Allows for re-filtering of Seurat object based on new parameters for min.cells
and
min.features
(see CreateSeuratObject
for more details)
ReFilter_SeuratObject(
seurat_object,
min.cells = NULL,
min.features = NULL,
override = FALSE,
verbose = TRUE
)
Seurat object to filter
Include features detected in at least this many cells. Will recalculate nCount and nFeature meta.data values as well.
Include cells where at least this many features are detected.
logical, override the Yes/No interactive check (see details). Default is FALSE; don't override.
logical, whether to print information on filtering parameters and number of cells/features removed, Default is TRUE.
Seurat object
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.
if (FALSE) {
# 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)
}