commot.tl.group_cluster_communication

commot.tl.group_cluster_communication(adata, clustering=None, cluster_permutation_type='label', keys=None, p_value_cutoff=0.05, quantile_cutoff=0.99, dissimilarity_method=None, leiden_k=5, leiden_resolution=1.0, leiden_random_seed=1, leiden_n_iterations=- 1, d_global_structure_weights=(0.45, 0.45, 0.1))

Idenfitify groups of cluster-cluster communication with similar pattern.

The CCC inference should have been summarized to cluster level using either commot.tl.cluster_communication() function or commot.tl.cluster_communication_spatial_permutation() function. The dissimilarities among different ligand-receptor pairs or signaling pathways are first quantified which will be used with the leiden clustering algorithm [Traag2019] to cluster these CCC networks.

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

  • clustering (Optional[str]) – Name of clustering with the labels stored in .obs[clustering].

  • cluster_permutation_type (str) – 'label' if the function commot.tl.cluster_communication() was used and 'spatial' if commot.tl.cluster_communication_spatial_permutation() was used.

  • keys – A list of keys for the analyzed communication connections as strings. For example, the string 'databaseX-pathwayX' represents the cluster-level CCC of signaling pathway “pathwayX” computed with the LR database “databaseX”. For another example, the string 'databaseX-ligA-recA' represents the cluster-level CCC of the LR pair “ligA-recA” computed with the LR database “databaseX”.

  • p_value_cutoff (float) – The cutoff of p-value for including an edge.

  • quantile_cutoff (float) – The quantile cutoff for including an edge. Set to 1 to disable this criterion. The quantile_cutoff and p_value_cutoff works in the “or” logic to avoid missing significant signaling connections. An edge will be ignored only if it has a p-value greater than the p_value_cutoff and a score smaller than the score quantile cutoff.

  • dissimilarity_method (Optional[str]) – The dissimilarity measurement between graphs to use. ‘jaccard’ for Jaccard distance. ‘jaccard_weighted’ for weighted Jaccard distance. ‘global_structure’ for a metric focusing on global structure [Schieber2017].

  • leiden_k (int) – Number of neighbors for the knn-graph for using 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.

  • d_global_structure_weights (tuple) – The weights for the three terms in the global structural dissimilarity. See [Schieber2017] for more information.

Returns

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

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

References

Schieber2017(1,2)

Schieber, T. A., Carpi, L., Díaz-Guilera, A., Pardalos, P. M., Masoller, C., & Ravetti, M. G. (2017). Quantification of network structural dissimilarities. Nature communications, 8(1), 1-10.

Traag2019

Traag, V. A., Waltman, L., & Van Eck, N. J. (2019). From Louvain to Leiden: guaranteeing well-connected communities. Scientific reports, 9(1), 1-12.