Learn R Programming

Seurat (version 3.1.4)

WhichCells: Identify cells matching certain criteria

Description

Returns a list of cells that match a particular set of criteria such as identity class, high/low values for particular PCs, ect..

Usage

WhichCells(object, ...)

# S3 method for Assay WhichCells(object, cells = NULL, expression, invert = FALSE, ...)

# S3 method for Seurat WhichCells( object, cells = NULL, idents = NULL, expression, slot = "data", invert = FALSE, downsample = Inf, seed = 1, ... )

Arguments

object

An object

...

Arguments passed to other methods

cells

Subset of cell names

expression

A predicate expression for feature/variable expression, can evalue anything that can be pulled by FetchData; please note, you may need to wrap feature names in backticks (``) if dashes between numbers are present in the feature name

invert

Invert the selection of cells

idents

A vector of identity classes to keep

slot

Slot to pull feature data for

downsample

Maximum number of cells per identity class, default is Inf; downsampling will happen after all other operations, including inverting the cell selection

seed

Random seed for downsampling. If NULL, does not set a seed

Value

A vector of cell names

See Also

FetchData

Examples

Run this code
# NOT RUN {
WhichCells(object = pbmc_small, idents = 2)
WhichCells(object = pbmc_small, expression = MS4A1 > 3)
levels(x = pbmc_small)
WhichCells(object = pbmc_small, idents = c(1, 2), invert = TRUE)

# }

Run the code above in your browser using DataLab