Skip to contents

Converts input to SingleCellExperiment when needed and applies common QC filters: UMI thresholds, removal of all-zero genes, optional mitochondrial gene removal, and duplicate-gene handling. Also emits a warning if Ensembl identifiers are detected.

Usage

preprocess(
  object,
  min_umi = 500,
  max_umi = NULL,
  assay = "counts",
  remove_mito = FALSE
)

Arguments

object

Input object (SingleCellExperiment, SpatialExperiment, AnnData, or Seurat). AnnData/Seurat are converted to SingleCellExperiment.

min_umi

Minimum UMI count per cell/spot to keep.

max_umi

Maximum UMI count per cell/spot to keep (optional).

assay

Assay to use for filtering (default: "counts").

remove_mito

Logical; drop genes with MT- prefix.