Skip to contents

Clusters cells using graph clustering methods. A prerequisite is a nearest neighbor network (NN) object having been computed on the data, often by runUMAP.

Usage

clusterCells(
  object,
  method = "leiden",
  nn.name = "umap",
  col.name = ".clusters",
  cluster.resolution = NULL,
  ...,
  analyze = NULL,
  cores = NULL,
  parallel = NULL
)

Arguments

object

A SpatialMap object

method

What method should be used to cluster? (Right now, lovain and leiden clustering are supported. DBscan easy to add)

nn.name

The name of the NN object in nearestNeighborNetworks to use. Defaults to UMAP, since UMAP is a common workflow. Any graph can be used though.

col.name

The name of the column containing cluster assignments to add to Regions' cellMetadata

cluster.resolution

Enter a cluster resolution parameter. Defaults to 1.0 for leiden, 50 for louvain.

...

Additional arguments passed to the clustering functions

analyze

What to analyze (and how). The options are "regions", NULL (activeAnalysis), the name of a currently existing formal analysis, or the name of a column in object's projectMetadata (an "informal" analysis).

cores

Parallelization options

parallel

Parallelization options

Value

A SpatialMap object with new cell cluster memberships added to the cellMetadata slot as a factor. The new column in cellMetadata will be named according to the value passed to col.name.

Details

See vignette("AnalysisGuide3_Unsupervised_clustering") & vignette("AnalysisGuide4_Subsetting_and_subclustering") for a representative workflow that uses this function.

Scroll to top