Union[mudata._core.mudata.MuData, anndata._core.anndata.AnnData], resolution: Optional[Union[float, Sequence[float], Mapping[str, float]]] = None, mod_weights: Optional[Union[Sequence[float], Mapping[str, float]]] = None, random_state: int = 0, key_added: str = 'louvain', neighbors_key: Optional[str] = None, directed: bool = True, partition_type: Optional[Type[louvain.VertexPartition.LouvainMutableVertexPartition]] = None, partition_kwargs: Mapping[str, Any] = mappingproxy({}), **kwargs)#

Cluster cells using the Louvain algorithm.

This runs only the multiplex Louvain algorithm on the MuData object using connectivities of individual modalities (see documentation for more details). For that, scanpy.pp.neighbors() should be run first for each modality.

For taking use of mdata.obsp['connectivities'], it’s that should be used. See for details.

  • datamuon.MuData object.

  • resolution – Resolution parameter controlling coarseness of the clustering (higher values -> more clusters). To use different resolution per modality, dictionary {mod: value} or list/tuple [value_mod1, value_mod2, ...]. Single value to use the same resolution for all modalities.

  • mod_weights – Weight each modality controlling its contribution (higher values -> more important). To use different weight per modality, dictionary {mod: value} or list/tuple [value_mod1, value_mod2, ...]. Single value to use the same weight for all modalities.

  • random_state – Random seed for the optimization.

  • key_addedmdata.obs key where cluster labels to be added.

  • neighbors_key – Use neighbors connectivities as adjacency. If not specified, look for .obsp['connectivities'] in each modality. If specified, look for .obsp[.uns[neighbors_key]['connectivities_key']] in each modality for connectivities.

  • directed – Treat the graph as directed or undirected.

  • partition_type – Type of partition to use, RBConfigurationVertexPartition by default. See find_partition() for more details.

  • partition_kwargs – Arguments to be passed to the partition_type.

  • **kwargs – Arguments to be passed to optimizer.optimise_partition_multiplex().