Identify clusters of cells by a shared nearest neighbor (SNN) modularityoptimization based clustering algorithm. First calculate k-nearest neighborsand construct the SNN graph. Then optimize the modularity function todetermine clusters. For a full description of the algorithms, see Waltman andvan Eck (2013)The European Physical Journal B. Thanks to NigelDelaney (evolvedmicrobe@github) for the rewrite of the Java modularityoptimizer code in Rcpp!
FindClusters(object, ...)# S3 method for defaultFindClusters( object, modularity.fxn = 1, initial.membership = NULL, node.sizes = NULL, resolution = 0.8, method = "matrix", algorithm = 1, n.start = 10, n.iter = 10, random.seed = 0, group.singletons = TRUE, temp.file.location = NULL, edge.file.name = NULL, verbose = TRUE, ...)
# S3 method for SeuratFindClusters( object, graph.name = NULL, modularity.fxn = 1, initial.membership = NULL, node.sizes = NULL, resolution = 0.8, method = "matrix", algorithm = 1, n.start = 10, n.iter = 10, random.seed = 0, group.singletons = TRUE, temp.file.location = NULL, edge.file.name = NULL, verbose = TRUE, ...)
An object
Arguments passed to other methods
Modularity function (1 = standard; 2 = alternative).
Parameters to pass to the Python leidenalg function.
Value of the resolution parameter, use a value above(below) 1.0 if you want to obtain a larger (smaller) number of communities.
Method for running leiden (defaults to matrix which is fast for small datasets).Enable method = "igraph" to avoid casting large data to a dense matrix.
Algorithm for modularity optimization (1 = original Louvainalgorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLMalgorithm; 4 = Leiden algorithm). Leiden requires the leidenalg python.
Number of random starts.
Maximal number of iterations per random start.
Seed of the random number generator.
Group singletons into nearest cluster. If FALSE, assign all singletons toa "singleton" group
Directory where intermediate files will be written.Specify the ABSOLUTE path.
Edge file to use as input for modularity optimizer jar.
Print output
Name of graph to use for the clustering algorithm
Returns a Seurat object where the idents have been updated with new cluster info;latest clustering results will be stored in object metadata under 'seurat_clusters'.Note that 'seurat_clusters' will be overwritten everytime FindClusters is run
To run Leiden algorithm, you must first install the leidenalg pythonpackage (e.g. via pip install leidenalg), see Traag et al (2018).