sccloud.spectral_louvain¶
-
sccloud.spectral_louvain(data, rep='pca', resolution=1.3, rep_kmeans='diffmap', n_clusters=30, n_init=20, n_jobs=-1, random_state=0, temp_folder=None, class_label='spectral_louvain_labels')[source]¶ Cluster the data using Spectral Louvain 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 with smaller sizes.rep_kmeans (
str, optional, default:"diffmap") – The embedding representation on which the KMeans runs. Keyword must exist indata.obsm. By default, use Diffusion Map coordinates. If diffmap is not calculated, use PCA coordinates instead.n_clusters (
int, optional, default:30) – The number of clusters set for the KMeans.n_init (
int, optional, default:20) – Size of random seeds at initialization.n_jobs (
int, optional, default:-1) – Number of threads to use. If-1, use all available threads.random_state (
int, optional, default:0) – Random seed for reproducing results.temp_folder (
str, optional, default:None) – Temporary folder name for joblib to use during the computation.class_label (
str, optional, default:"spectral_louvain_labels") – Key name for storing cluster labels indata.obs.
- Return type
None- Returns
NoneUpdate
data.obs–data.obs[class_label]: Cluster labels for cells as categorical data.
Examples
>>> scc.spectral_louvain(adata)