dynamo.tl.leiden

dynamo.tl.leiden(adata, use_weight=True, weight=None, initial_membership=None, adj_matrix=None, adj_matrix_key=None, result_key=None, layer=None, obsm_key=None, selected_cluster_subset=None, selected_cell_subset=None, directed=False, copy=False, **kwargs)[source]

Apply leiden clustering to adata. For other community detection general parameters, please refer to dynamo's cluster_community() function. “The Leiden algorithm is an improvement of the Louvain algorithm. The Leiden algorithm consists of three phases: (1) local moving of nodes, (2) refinement of the partition (3) aggregation of the network based on the refined partition, using the non-refined partition to create an initial partition for the aggregate network.” - cdlib

Parameters
  • weight – weights of edges. Can be either an iterable or an edge attribute. Default None

  • initial_membership (optional) – list of int Initial membership for the partition. If None then defaults to a singleton partition. Default None, by default None

Return type

AnnData