Introduction

This report details the quality control (QC) process applied to a SingleCellExperiment object derived from single-cell RNA-seq data (zebrafish sample, Ensembl gene IDs). The goal is to identify and remove potentially low-quality cells based on library size, number of detected genes, and mitochondrial gene content percentage. We use adaptive thresholds based on median absolute deviations (MADs) from the median.

1. Load Data

First, we load the pre-existing SingleCellExperiment object. Ensure the object named sce is available in your R environment or load it from a saved file.

The object has 32057 genes and 570 cells, with assays for counts. Row data includes gene_id and symbol, while column data currently only contains CellID.

2. Identify Mitochondrial Genes

To calculate the percentage of counts coming from mitochondrial genes, we first identify which genes are mitochondrial using the org.Dr.eg.db annotation package.

Using the annotations, 13 mitochondrial genes were identified.

3. Calculate Per-Cell QC Metrics

We use scater::addPerCellQC to calculate standard QC metrics (sum, detected, subsets_mt_percent).

This step adds columns like sum (total counts), detected (number of expressed genes), and subsets_mt_percent (percentage of counts from mitochondrial genes) to the colData of the sce object.

4. Determine Outliers Using Adaptive Thresholds

We identify outliers based on 3 MADs from the median for library size (sum), detected features (detected), and mitochondrial percentage (subsets_mt_percent).

Based on the MAD thresholds:

  • 0 cells were flagged for low library size.

  • 4 cells were flagged for low detected features.

  • 25 cells were flagged for high mitochondrial content percentage.

In total, 28 unique cells are marked for removal.

5. Visualize QC Metrics and Outliers

Visualizing the distributions helps to confirm if the adaptive thresholds are reasonable. We use the revised color scheme.

Cells marked for removal are highlighted. Dashed red lines indicate the approximate MAD-based thresholds used for filtering. Violin/dot plots show individual cell values, while histograms show the overall distributions. The scatter plot illustrates the relationship between library size and mitochondrial content, often revealing damaged cells with high mitochondrial percentage despite low library size.

6. Filter the SingleCellExperiment Object

Finally, we subset the sce object to remove the cells flagged by the discard column.