stereo.algorithm.dendrogram.Dendrogram.main#

Dendrogram.main(cluster_res_key, pca_res_key='pca', use_raw=False, cor_method='pearson', linkage_method='complete', optimal_ordering=False, res_key='dendrogram')[source]#

Computes a hierarchical clustering for the given cluster_res_key categories.

Note

The computation of the hierarchical clustering is based on predefined groups and not per cell. The correlation matrix is computed using by default pearson but other methods are available.

Parameters:
  • cluster_res_key (str) – a key or a list of keys which specify the cluster result in data.tl.result.

  • pca_res_key (Optional[str]) – a key which specify the pca result in data.tl.result, if None, using exp_matrix instead.

  • use_raw (Optional[bool]) – whether to use raw exp_matrix, defaults to False.

  • cor_method (str) – correlation method to use, options are ‘pearson’, ‘kendall’, and ‘spearman’.

  • linkage_method (str) – linkage method to use. See scipy.cluster.hierarchy.linkage() for more information.

  • optimal_ordering (bool) – Same as the optimal_ordering argument of scipy.cluster.hierarchy.linkage() which reorders the linkage matrix so that the distance between successive leaves is minimal.

  • res_key (str) – a key to store dendrogram result in data.tl.result.