filterCells: Filter cells

filterCellsR Documentation

Filter cells

Description

Filter cells

Usage

filterCells(object, ...)

## S4 method for signature 'SingleCellExperiment'
filterCells(
  object,
  assay = 1L,
  minCounts = 1L,
  maxCounts = Inf,
  minFeatures = 1L,
  maxFeatures = Inf,
  minNovelty = 0L,
  maxMitoRatio = 1L,
  minCellsPerFeature = 1L,
  nCells = Inf,
  countsCol = "nCount",
  featuresCol = "nFeature",
  noveltyCol = "log10FeaturesPerCount",
  mitoRatioCol = "mitoRatio"
)

Arguments

object

Object.

assay

vector(1). Assay name or index position.

minCounts, maxCounts

integer(1). Minimum/maximum number of counts per cell. Applies to UMI disambiguated counts for droplet scRNA-seq. Matches nUMI then nCount column in colData() internally. Previously named minUMIs/maxUMIs in bcbioSingleCell.

minFeatures, maxFeatures

integer(1). Minimum/maximum number of features (i.e. genes) detected. Matches nFeaturein colData() internally. Previously named minGenes/maxGenes in bcbioSingleCell.

minNovelty

integer(1) (0-1). Minimum novelty score (log10 features per UMI). Matches log10FeaturesPerCount then log10FeaturesPerUMI (legacy) colData() internally.

maxMitoRatio

integer(1) (0-1). Maximum relative mitochondrial abundance.

minCellsPerFeature

integer(1). Include genes with non-zero expression in at least this many cells. Previously named minCellsPerGene in bcbioSingleCell.

nCells

integer(1). Expected number of cells per sample. Don't set this by default, unless you're confident of your capture.

countsCol, featuresCol, noveltyCol, mitoRatioCol

character(1). Column mapping name.

...

Additional arguments.

Details

Apply feature (i.e. gene/transcript) detection, novelty score, and mitochondrial abundance cutoffs to cellular barcodes. By default we recommend applying the same filtering cutoff to all samples. The filtering parameters now support per-sample cutoffs, defined using a named numeric vector. When matching per sample, be sure to use the sampleNames() return values (i.e. the sampleName column in sampleData().

Filtering information gets slotted into metadata() as filterCells metadata.

Value

SingleCellExperiment.

Note

Updated 2022-10-24.

Examples

data(SingleCellExperiment_splatter, package = "AcidTest")

## SingleCellExperiment ====
object <- SingleCellExperiment_splatter
x <- filterCells(object)
print(x)

## Per sample cutoffs.
x <- filterCells(
    object = object,
    minCounts = c("sample1" = 100L)
)
print(x)

acidgenomics/r-acidsinglecell documentation built on March 30, 2024, 5:39 a.m.