subset.Seurat: Subset a Seurat object

Description Usage Arguments Value See Also Examples

View source: R/objects.R

Description

Subset a Seurat object

Usage

1
2
3
4
5
## S3 method for class 'Seurat'
x[i, j, ...]

## S3 method for class 'Seurat'
subset(x, subset, cells = NULL, features = NULL, idents = NULL, ...)

Arguments

x

Seurat object to be subsetted

i, features

A vector of features to keep

j, cells

A vector of cells to keep

...

Extra parameters passed to WhichCells, such as slot, invert, or downsample

subset

Logical expression indicating features/variables to keep

idents

A vector of identity classes to keep

Value

A subsetted Seurat object

See Also

subset WhichCells

Examples

1
2
3
4
5
6
7
8
pbmc_small[VariableFeatures(object = pbmc_small), ]
pbmc_small[, 1:10]

subset(x = pbmc_small, subset = MS4A1 > 4)
subset(x = pbmc_small, subset = `DLGAP1-AS1` > 2)
subset(x = pbmc_small, idents = '0', invert = TRUE)
subset(x = pbmc_small, subset = MS4A1 > 3, slot = 'counts')
subset(x = pbmc_small, features = VariableFeatures(object = pbmc_small))

lambdamoses/SeuratBasics documentation built on May 6, 2020, 9:32 a.m.