commot.tl.group_cell_communication

commot.tl.group_cell_communication(adata, keys=None, bin_method='gaussian_mixture', bin_append_zeros='full', bin_random_state=1, bin_cutoff=0, knn=2, dissimilarity_method='graphwave', kw_graphwave={}, leiden_k=5, leiden_resolution=1.0, leiden_random_seed=1, leiden_n_iterations=- 1)

Idenfitify groups of cell-cell communication with similar pattern.

Parameters
  • adata (AnnData) – The data matrix with the cell-cell communication info stored in adata.obsp.

  • keys – A list of keys for the analyzed communication connections as tuples (database_name, ligand, receptor).

  • bin_method (str) – Method for binarize communication connections. Choices: ‘gaussian_mixture’, ‘kmeans’.

  • bin_append_zeros (str) – Number of zeros to append to the non-zero entries when running the binarization. ‘full’ use the full flattened cell-by-cell communication matrix. ‘match’ append the same number of zeros to the vector of non-zero entries.

  • bin_random_state (int) – The random seed for binarization methods.

  • bin_cutoff (float) – Force all connections with a weight smaller than or equal to bin_cutoff to be zero , regardless of binarization result.

  • knn (int) – Number of neighbors for building the spatial knn graph.

  • dissimilarity_method (str) – The method for quantifying dissimilarity. ‘graphwave’, node structural embedding by GraphWave [Donnat2018] implemented in Karate Club.

  • kw_graphwave (dict) –

    Keywords for GraphWave. Defaults: {‘sample_number’:200, ‘step_size’:0.1, ‘heat_coefficient’: 1.0 ‘approximation’:100, ‘mechanism’:’approximation’, ‘switch’:1000, ‘seed’:42} See details at Karate Club.

  • leiden_k (int) – Number of neighbors for the knn-graph to be fed to leiden clustering algorithm.

  • leiden_resolution (float) – The resolution parameter for the leiden clustering algorithm.

  • leiden_random_seed (int) – The random seed for the leiden clustering algorithm.

  • leiden_n_iterations (int) – The maximum number of iterations for the leiden algorithm. The algorithm will run until convergence if set to -1.

Returns

  • keys (list) – The list of keys for the analyzed communication connections as tuples (pathway_name, ligand, receptor).

  • communication_clusterid (np.ndarray) – The group id of the cell-cell communications.

  • D (np.ndarray) – The dissimilarity matrix for the cell-cell communications.

References

Donnat2018

Donnat, C., Zitnik, M., Hallac, D., & Leskovec, J. (2018, July). Learning structural node embeddings via diffusion wavelets. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (pp. 1320-1329).