View source: R/analysis_functions.R
multiCluster | R Documentation |
Cluster seurat object at several resolutions. Wrapper for Seurat::FindClusters(...).
multiCluster(
object,
resolutions,
assay = NULL,
nworkers = 1,
pca_var = 0.9,
group_singletons = F,
algorithm = 1,
return_object = T,
verbose = T
)
object |
Seurat object |
resolutions |
Numeric vector of resolutions to cluster object at. |
assay |
Seurat assay to use. If not specified, default assay is used. |
nworkers |
Number of workers for parallel implementation. Default is 1. |
pca_var |
If nearest neighbor graph is absent in object, FindNeighbors(...) is run using the numebr of principal components that explains 'pca_var' fraction of variance. |
group_singletons |
Group singletons into nearest cluster. If FALSE, assign all singletons to a "singleton" group |
algorithm |
Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm; 4 = Leiden algorithm). Leiden requires the leidenalg python. |
return_object |
Return seurat object with multi-resolution clusters in meta data if TRUE, otherwise return list containing additional results. Default is T. |
verbose |
Print progress. Default is TRUE. |
Seurat object
Nicholas Mikolajewicz
FindClusters
# clustering data
mc.list <- multiCluster(object = so.query,
resolutions = c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.75, 1) ,
assay = NULL, nworkers = 10,
pca_var = 0.9,
group_singletons = F,
algorithm = 1,
return_object = F)
plt.umap_by_cluster <- mc.list$plots
so.query <- mc.list$object
cr_names <- mc.list$resolution_names
cluster.name <- mc.list$cluster_names
assay.pattern <- mc.list$assay_pattern
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.