sccloud.leiden¶
-
sccloud.leiden(data, rep='pca', resolution=1.3, n_iter=-1, random_state=0, class_label='leiden_labels')[source]¶ Cluster the data using Leiden algorithm.
- Parameters
data (
anndata.AnnData) – Annotated data matrix with rows for cells and columns for genes.rep (
str, optional, default:"pca") – The embedding representation used for clustering. Keyword'X_' + repmust exist indata.obsm. By default, use PCA coordinates.resolution (
int, optional, default:1.3) – Resolution factor. Higher resolution tends to find more clusters.n_iter (
int, optional, default:-1) – Number of iterations that Leiden algorithm runs. If-1, run the algorithm until reaching its optimal clustering.random_state (
int, optional, default:0) – Random seed for reproducing results.class_label (
str, optional, default:"leiden_labels") – Key name for storing cluster labels indata.obs.
- Return type
None- Returns
NoneUpdate
data.obs–data.obs[class_label]: Cluster labels of cells as categorical data.
Examples
>>> scc.leiden(adata)