stereo.core.StPipeline.louvain#

StPipeline.louvain(neighbors_res_key='neighbors', res_key='louvain', resolution=None, random_state=0, flavor='vtraag', directed=True, use_weights=False)[source]#

Cluster cells into subgroups by Louvain algorithm [Blondel08].

Parameters:
  • neighbors_res_key (str) – the key of neighbors to get corresponding result from self.result.

  • res_key (str) – the key for storing result of Louvain clustering.

  • resolution (Optional[float]) – a parameter value to control the coarseness of clustering where higher value leads to more clusters.

  • random_state (int) – change the initialization of the optimization.

  • flavor (Literal['vtraag', 'igraph', 'rapids']) – choose among of packages for computing the clustering. 'vtraag' is much more powerful, and the default. Set to None if overriding partition_type to one that doesn’t accept a resolution_parameter.

  • directed (bool) – if True, treat the graph as directed. If False, undirected.

  • use_weights (bool) – use weights from knn graph.

Returns:

Clustering result of Louvain is stored in self.result where the key is 'louvain'.