removeResidualSmallClusters: Remove Residual Small Clusters from a Seurat Object

View source: R/Seurat.Utils.R

removeResidualSmallClustersR Documentation

Remove Residual Small Clusters from a Seurat Object

Description

Removes clusters containing fewer cells than specified by max.cells from a Seurat object. This function is particularly useful after subsetting a dataset, where small, possibly unrepresentative clusters may remain.

Usage

removeResidualSmallClusters(
  obj = combined.obj,
  identitites = GetClusteringRuns(obj, pat = "*snn_res.[0-9].[0-9]$")[1:5],
  max.cells = max(round((ncol(obj))/2000), 5),
  plot.removed = TRUE
)

Arguments

obj

Seurat object from which small clusters will be removed. Default: combined.obj.

identitites

Vector of clustering identities to examine for small clusters; Default: GetClusteringRuns(obj).

max.cells

Maximum number of cells a cluster can contain to still be considered for removal. Default: The lesser of 0.5% of the dataset or 10 cells.

plot.removed

Logical indicating if a umap of the cells removed should be plotted.

Examples

## Not run: 
if (interactive()) {
  combined.obj <- removeResidualSmallClusters(obj = combined.obj)
}

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.