nichepca.clustering.leiden_multires

nichepca.clustering.leiden_multires#

nichepca.clustering.leiden_multires(adata, resolutions, parallel=True, n_jobs=-1, prefix='leiden_', return_leiden=True, **kwargs)#

Perform Leiden clustering at multiple resolutions in parallel.

Parameters:
  • adata (AnnData) – Anndata object with the graph information.

  • resolutions (list[float]) – List of resolution parameters for the Leiden algorithm.

  • parallel (bool, optional) – Whether to perform the clustering in parallel, by default True.

  • n_jobs (int, optional) – Number of jobs to run in parallel, by default -1.

  • prefix (str, optional) – Prefix to be added to the column names, by default "leiden_".

  • return_leiden (bool, optional) – Whether to return the cluster assignments as a DataFrame, by default True.

Returns:

pd.DataFrame | None Pandas DataFrame with the cluster assignments for each cell. If return_leiden is False, the cluster assignments are added to the adata object.