Seurat (version 2.3.4)

FindClusters: Cluster Determination

Description

Identify clusters of cells by a shared nearest neighbor (SNN) modularity optimization based clustering algorithm. First calculate k-nearest neighbors and construct the SNN graph. Then optimize the modularity function to determine clusters. For a full description of the algorithms, see Waltman and van Eck (2013) The European Physical Journal B. Thanks to Nigel Delaney (evolvedmicrobe@github) for the rewrite of the Java modularity optimizer code in Rcpp!

Usage

FindClusters(object, genes.use = NULL, reduction.type = "pca",
  dims.use = NULL, k.param = 30, plot.SNN = FALSE, prune.SNN = 1/15,
  print.output = TRUE, distance.matrix = NULL, save.SNN = FALSE,
  reuse.SNN = FALSE, force.recalc = FALSE, nn.eps = 0,
  modularity.fxn = 1, resolution = 0.8, algorithm = 1, n.start = 100,
  n.iter = 10, random.seed = 0, temp.file.location = NULL,
  edge.file.name = NULL)

Arguments

object

Seurat object

genes.use

A vector of gene names to use in construction of SNN graph if building directly based on expression data rather than a dimensionally reduced representation (i.e. PCs).

reduction.type

Name of dimensional reduction technique to use in construction of SNN graph. (e.g. "pca", "ica")

dims.use

A vector of the dimensions to use in construction of the SNN graph (e.g. To use the first 10 PCs, pass 1:10)

k.param

Defines k for the k-nearest neighbor algorithm

plot.SNN

Plot the SNN graph

prune.SNN

Sets the cutoff for acceptable Jaccard index when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the strigency of pruning (0 --- no pruning, 1 --- prune everything).

print.output

Whether or not to print output to the console

distance.matrix

Build SNN from distance matrix (experimental)

save.SNN

Saves the SNN matrix associated with the calculation in object@snn

reuse.SNN

Force utilization of stored SNN. If none store, this will throw an error.

force.recalc

Force recalculation of SNN.

nn.eps

Error bound when performing nearest neighbor seach using RANN; default of 0.0 implies exact nearest neighbor search

modularity.fxn

Modularity function (1 = standard; 2 = alternative).

resolution

Value of the resolution parameter, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.

algorithm

Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm).

n.start

Number of random starts.

n.iter

Maximal number of iterations per random start.

random.seed

Seed of the random number generator.

temp.file.location

Directory where intermediate files will be written. Specify the ABSOLUTE path.

edge.file.name

Edge file to use as input for modularity optimizer jar.

Value

Returns a Seurat object and optionally the SNN matrix, object@ident has been updated with new cluster info

Examples

Run this code
# NOT RUN {
pbmc_small
pmbc_small <- FindClusters(
  object = pbmc_small,
  reduction.type = "pca",
  dims.use = 1:10,
  save.SNN = TRUE
)
# To explore a range of clustering options, pass a vector of values to the resolution parameter
pbmc_small <- FindClusters(
  object = pbmc_small,
  reduction.type = "pca",
  resolution = c(0.4, 0.8, 1.2),
  dims.use = 1:10,
  save.SNN = TRUE
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace