cellQC: Quality control on cells

View source: R/QC.R

cellQCR Documentation

Quality control on cells

Description

Quality control on cells

Usage

cellQC(
  sce,
  spike,
  threshold = 0,
  mad_sum = 5,
  mad_detected = 3,
  mad_spikegenes = 5
)

Arguments

sce

SingleCellExperiment with counts and ratio

spike

the character name of spike genes. If missing, spikePercent will all be zero and filter_spike will be false.

threshold

A numeric scalar specifying the threshold above which a gene is considered to be detected.

mad_sum

A numeric scalar specifying exceed how many median absolute deviations from the median log10-counts a cell is considered to be filtered out. Default is 5.

mad_detected

A numeric scalar specifying exceed how many median absolute deviations from the median detected features a cell is considered to be filtered out. Default is 5.

mad_spikegenes

A numeric scalar specifying exceed how many median absolute deviations from the median spike genes expression percentage a cell is considered to be filtered out. Default is 5.

Value

A DataFrame of QC statistics includes

  • sum the sum of counts of each cell

  • detected the number of features above threshold

  • spikePercent the percentage of counts assignes to spike genes

  • filter_sum indicate whether log10-counts within mad_sum median absolute deviations from the median log10-counts for the dataset

  • filter_detected indicate whether features detected by this cell within mad_detected median absolute deviations from the median detected features for the dataset

  • filter_spike indicate whether percentage expressed by spike genes within mad_spikegenes median absolute deviations from the median spike genes expression percentage for the dataset

Examples

sce <- makeSimulatedData()
sce <- preprocess(sce)
cellQCmetrics <- cellQC(sce)
keep_cell <- (
  cellQCmetrics$filter_sum | # sufficient features (genes)
    # sufficient molecules counted
    cellQCmetrics$filter_detected |
    # sufficient features expressed compared to spike genes
    cellQCmetrics$filter_spike
)
sce <- sce[, keep_cell]

# or manually setting threshold
cellQCmetrics <- cellQC(sce,
  spike = "Ercc",
  mad_detected = 4, mad_spikegenes = 4
)
keep_cell <- (
  cellQCmetrics$sum > 2.4 |
    cellQCmetrics$detected > 110
)

Wancen/airpart documentation built on March 12, 2023, 11:53 a.m.