ReFilter_SeuratObject: Re-filter Seurat object

View source: R/Utilities_Objects.R

ReFilter_SeuratObjectR Documentation

Re-filter Seurat object

Description

Allows for re-filtering of Seurat object based on new parameters for min.cells and min.features (see CreateSeuratObject for more details)

Usage

ReFilter_SeuratObject(
  seurat_object,
  min.cells = NULL,
  min.features = NULL,
  override = FALSE,
  verbose = TRUE
)

Arguments

seurat_object

Seurat object to filter

min.cells

Include features detected in at least this many cells. Will recalculate nCount and nFeature meta.data values as well.

min.features

Include cells where at least this many features are detected.

override

logical, override the Yes/No interactive check (see details). Default is FALSE; don't override.

verbose

logical, whether to print information on filtering parameters and number of cells/features removed, Default is TRUE.

Details

When running this function any existing reductions, graphs, and all layers except "counts" in the RNA assay. None of these aspects will be valid once cells/features are removed. To ensure users understand this default behavior of function will provide interactive prompt that users must select "Yes" in order to continue. To avoid this behavior users can set override = TRUE and function will skip the interactive prompt.

Value

Seurat object

Examples

## Not run: 
# Remove features expressed in fewer than 10 cells
obj_fil <- ReFilter_SeuratObject(seurat_object = obj, min.cells = 10)

# Remove cells with fewer than 1000 features
obj_fil <- ReFilter_SeuratObject(seurat_object = obj, min.features = 1000)

# Filter on both parameters
obj_fil <- ReFilter_SeuratObject(seurat_object = obj, min.features = 1000, min.cells = 10)

## End(Not run)

scCustomize documentation built on Dec. 11, 2025, 5:08 p.m.