Skip to contents

This function calculates the percentage of counts coming from features matching specified patterns (e.g., mitochondrial genes, ribosomal genes) and adds them as metadata columns to the Seurat object.

Usage

QCPatternDetect(
  obj,
  pattern = c("^MT-", "^mt-", "^RP[SL]", "^MT-|^RP[SL]"),
  verbose = TRUE,
  ...
)

Arguments

obj

A seurat object.

pattern

A character vector or list containing regex patterns to identify mitochondrial genes, ribosomal protein genes, or other unwanted genes, as well as combinations of these genes. Customized patterns are supported.

verbose

logical, whether to print progress messages

...

Additional arguments passed to PercentageFeatureSet

Details

The function automatically generates friendly column names based on the patterns:

  • "mt" for mitochondrial patterns

  • "rp" for ribosomal patterns

  • "rrna" for ribosomal RNA patterns

  • For combined patterns (using |), creates names like "mt_rp"

  • For other patterns, creates cleaned lowercase names