Learn R Programming

Seurat (version 2.3.4)

SubsetByPredicate: Return a subset of the Seurat object.

Description

Creates a Seurat object containing only a subset of the cells in the original object. Forms a dataframe by fetching the variables in vars.use, then subsets it using base::subset with predicate as the filter. Returns the corresponding subset of the Seurat object.

Usage

SubsetByPredicate(object, vars.use, predicate)

Arguments

object

Seurat object

vars.use

Variables to fetch for use in base::subset. Character vector.

predicate

String to be parsed into an R expression and evaluated as an input to base::subset.

Examples

Run this code
# NOT RUN {
pbmc1 <- SubsetByPredicate(object = pbmc_small,
                      vars.use = c("nUMI", "res.1"),
                      predicate = "nUMI < 200 & res.1=='3'")
pbmc1

# }

Run the code above in your browser using DataLab