A fixed mitochondrial cutoff can delete a cell type
scRNA-seq
quality control
mitochondrial reads
scuttle
What percent.mt threshold for scRNA-seq QC? A simulation of fixed mitochondrial cutoffs against MAD outlier rules per sample and per cell type, with scuttle.
Author
Pseudocount
Published
25 November 2026
Setup: packages and helper functions
suppressPackageStartupMessages({library(scuttle) # attaches SingleCellExperiment as welllibrary(ggplot2)})stopifnot(packageVersion("scuttle") >="1.12.0",packageVersion("SingleCellExperiment") >="1.24.0",packageVersion("ggplot2") >="3.4.0")fmt_pct <-function(x, d =0) sprintf(paste0("%.", d, "f%%"), 100* x)fmt_int <-function(x) formatC(round(x), format ="d", big.mark =",")fmt_num <-function(x, d =1) sprintf(paste0("%.", d, "f"), x)fmt_mt <-function(x, d =1) sprintf(paste0("%.", d, "f%%"), x) # x already in percentfmt_prng <-function(v, d =1) paste(fmt_pct(min(v), d), "to", fmt_pct(max(v), d))fmt_mrng <-function(v, d =1) paste(fmt_mt(min(v), d), "to", fmt_mt(max(v), d))violet <-"#5a3fc0"; magenta <-"#d14fa6"; grey <-"#8a8799"theme_set(theme_minimal(base_size =12) +theme(panel.grid.minor =element_blank(),plot.background =element_rect(fill ="white", colour ="white"),strip.text =element_text(face ="bold")))
You open a single-cell RNA-seq data set, compute the percentage of each cell’s reads that come from mitochondrial genes (the Seurat tutorial stores it as percent.mt), and need a cutoff. Tutorials use 5%, forum answers suggest 10% or 20%, and so the question typed into a search box is: what percent.mt threshold should I use?
No single number is right, because healthy cell types differ in how much mitochondrial RNA they carry. In simulated liver-like data where healthy hepatocyte-like cells sit around 15% mitochondrial reads, a fixed 5% cutoff kept 0.2% of the healthy hepatocyte-like cells, and their estimated share of the sample fell from 20% to 0.1%. A threshold computed from the data within each cell type (three median absolute deviations above that type’s median), with the cell types known, kept at least 99.1% of healthy cells of every type and removed at least 97.4% of the damaged ones.
The setup
Why filter on mitochondrial reads at all? When a cell’s membrane breaks during dissociation, the cytoplasmic mRNA leaks out while the transcripts inside the mitochondria stay put, so a damaged cell shows a high mitochondrial share and a small library (Ilicic et al. 2016). A library here is the total number of UMIs of a cell; a UMI, or unique molecular identifier, is one captured mRNA molecule. The filter is meant to catch those cells. The trouble is that some healthy cells also have a high mitochondrial share, simply because they have many mitochondria: hepatocytes, cardiomyocytes and some metabolically active tumour cells are the usual examples.
The simulation below generates the quality-control (QC) metrics directly, one row per cell, without a full count matrix. It has three cell types, named after cell types of the liver only to fix ideas: T cell-like, macrophage-like and hepatocyte-like, making up 55%, 25% and 20% of the healthy cells, with healthy median mitochondrial shares of 3%, 5% and 15%. There are 4 samples of 1,500 cells, and each sample shifts all its mitochondrial shares up or down a little (a standard deviation of 0.25 on the log-odds scale), as real samples do. In every sample 10% of the cells of each type are damaged: their mitochondrial log-odds rise by 2.5 on average and their library shrinks to about 25% of a healthy one. Within a type, healthy cells vary around their baseline with a standard deviation of 0.35 on the log-odds scale for the mitochondrial share and 0.45 on the natural log scale for the library size, and the damage itself varies (standard deviations of 0.6 and 0.4 on the same scales). With these values damaged cells are well separated from healthy cells of their own type, so the per-type results below are a best case.
Two assumptions carry the results. The first is that damage is visible within a cell type: a damaged cell has more mitochondrial reads and fewer UMIs than healthy cells of its own type, which is the mechanism above. The second, for now, is that the cell type of every cell is known, as if a clustering had recovered the types perfectly; a later section drops it.
ggplot(d1, aes(mito, fill =ifelse(damaged, "damaged", "healthy"))) +geom_histogram(bins =60, position ="identity", alpha =0.85) +geom_vline(xintercept =c(5, 10, 20), linetype ="dashed", colour ="grey30") +facet_wrap(~ type, ncol =1, scales ="free_y") +scale_x_sqrt(breaks =c(1, 5, 10, 20, 40, 80)) +scale_y_sqrt(breaks =c(0, 10, 50, 200, 500)) +scale_fill_manual(values =c(healthy = grey, damaged = magenta), name =NULL) +labs(x ="mitochondrial UMIs (% of the cell's UMIs)", y ="cells") +theme(legend.position ="top")
Figure 1: Mitochondrial percentage per cell in one simulated data set, by cell type. Healthy cells in grey, damaged cells in magenta; the dashed lines are the three fixed cutoffs. Both axes are on a square-root scale, so that the few damaged cells stay visible.
In this first data set the healthy cells have median mitochondrial shares of 3.4%, 5.5% and 16.3%, and the damaged cells 29.5%, 40.7% and 69.7% (Figure 1). A damaged T cell-like cell is thus closer to a healthy hepatocyte-like cell than to a healthy T cell-like cell, which is the whole problem in one sentence.
The common way: one fixed cutoff
The Seurat PBMC 3k tutorial removes cells with more than 5% mitochondrial counts, with subset(pbmc, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 5). For blood mononuclear cells that can be reasonable. Copied to another tissue it becomes a rule about the tissue rather than about damage. Osorio and Cai (2021) surveyed public data sets and found that the 5% value, which early publications established and several software packages adopted as a default, failed to separate healthy from low-quality cells in 13 of the 44 human tissues they analysed.
Each rule below is a function that returns TRUE for a cell it removes. The first three are the fixed cutoffs; the others are introduced in the next section.
# TRUE = cell is removedfilters <-function(d, cluster = d$type) { mt_hi <-function(batch =NULL)as.logical(isOutlier(d$mito, nmads =3, type ="higher", log =FALSE, batch = batch)) lib_lo <-function(nmads) as.logical(isOutlier(d$sum, nmads = nmads, type ="lower",log =TRUE, batch = d$sample))list("Fixed 5%"= d$mito >5,"Fixed 10%"= d$mito >10,"Fixed 20%"= d$mito >20,"3 MADs, all cells"=mt_hi(),"3 MADs, per sample"=mt_hi(d$sample),"3 MADs, per cell type"=mt_hi(cluster),"3 MADs, per sample x type"=mt_hi(paste(d$sample, cluster)),"High mito AND low library"=mt_hi(d$sample) &lib_lo(3),"Same, library at 2 MADs"=mt_hi(d$sample) &lib_lo(2))}score <-function(d) { f <-filters(d) true_share <-prop.table(table(d$type[!d$damaged]))do.call(rbind, lapply(names(f), function(nm) { drop <- f[[nm]]data.frame(filter = nm, type = types,healthy_kept =as.numeric(tapply(!drop[!d$damaged], d$type[!d$damaged], mean)),damaged_removed =as.numeric(tapply(drop[d$damaged], d$type[d$damaged], mean)),share_true =as.numeric(true_share),share_est =as.numeric(prop.table(table(d$type[!drop])))) }))}
Unless a sentence says otherwise, the numbers below are averages over 100 simulated data sets (600,000 cells in all). A 5% cutoff kept 0.2% of healthy hepatocyte-like cells, and it also removed about half of the healthy macrophage-like cells (it kept 48%), whose baseline sits right at the cutoff. A 10% cutoff kept 13% of healthy hepatocyte-like cells. A 20% cutoff kept 78% of them, but by then it is too lenient for the other types: it removed only 72% of the damaged T cell-like cells. No fixed value does both jobs, because the healthy range of one type overlaps the damaged range of another.
The loss does not stay inside one cell type. Proportions must add up to one, so removing hepatocyte-like cells inflates everyone else’s share (the same closure that makes proportions correlate). After the 5% cutoff the T cell-like share was 80% against a true 55% (Table 1). Any comparison of cell type composition between conditions, and any pseudobulk built from the missing type, inherits this.
Outlier rules: better, until the cell types differ
The standard alternative is to let the data set the threshold. The scuttle package, which took over the non-plotting code of scater (McCarthy et al. 2017), has isOutlier() for this. It flags cells that lie more than nmads median absolute deviations (MADs) from the median. The MAD is the median distance of the values from their median, scaled by 1.4826 so that it matches the standard deviation for normally distributed data; it is a measure of spread that a minority of extreme cells cannot drag around. Three details of the function matter here, checked at the end of the post: the default is nmads = 3; the default type = "both" flags unusually low values too, so a mitochondrial filter needs type = "higher"; and log = FALSE by default, so the MAD is computed on the percentage itself. The batch argument computes a separate median and MAD, and so a separate threshold, for each level of a grouping factor.
Computed over all cells of the first data set, the threshold came out at 14.0%; per sample, from 12.4% to 15.3%. Both sit inside the healthy hepatocyte-like range, because the median and the MAD describe the majority, the low-mitochondrial types. Over all data sets the all-cells rule kept 39% of healthy hepatocyte-like cells and the per-sample rule 29%. Splitting by sample does not help, because every sample contains the same mixture of types.
long <-rbind(data.frame(agg[, c("filter", "type")], panel ="healthy cells kept", value = agg$healthy_kept),data.frame(agg[, c("filter", "type")], panel ="damaged cells removed", value = agg$damaged_removed))long$panel <-factor(long$panel, c("healthy cells kept", "damaged cells removed"))nf <-nlevels(agg$filter)long$y <- (nf +1-as.integer(long$filter)) +c(0.2, 0, -0.2)[as.integer(long$type)]ggplot(long, aes(100* value, y, colour = type)) +geom_point(size =2.6) +facet_wrap(~ panel) +scale_y_continuous(breaks = nf:1, labels =levels(agg$filter)) +scale_colour_manual(values =setNames(c(violet, grey, magenta), types), name =NULL) +labs(x ="% of cells", y =NULL) +theme(legend.position ="top", panel.grid.major.y =element_blank())
Figure 2: Average over the simulated data sets. Left: share of healthy cells each rule keeps. Right: share of damaged cells it removes. A good rule sits at the right edge of both panels for every cell type.
Grouping by cell type is what works. With one threshold per type, pooled over samples, the rule kept at least 99.1% of the healthy cells of every type and removed at least 97.4% of the damaged cells; with one threshold per sample and type, the figures were 99.3% and 98.8% (Figure 2). The estimated shares of the three types stayed within 0.1 percentage points of the truth.
Table 1: Estimated share of each cell type among the cells a rule keeps, averaged over the simulated data sets, against the true share among healthy cells.
Rule
T cell (%)
macrophage (%)
hepatocyte (%)
Truth (healthy cells only)
54.9
25.1
20.0
Fixed 5%
80.4
19.5
0.1
Fixed 10%
67.5
29.4
3.2
Fixed 20%
58.0
26.0
15.9
3 MADs, all cells
62.9
28.4
8.7
3 MADs, per sample
64.2
29.1
6.7
3 MADs, per cell type
54.8
25.1
20.1
3 MADs, per sample x type
54.8
25.1
20.0
High mito AND low library
54.5
25.3
20.2
Same, library at 2 MADs
54.5
25.2
20.2
The last two rules in the table are a frequent alternative: remove a cell only when its mitochondrial share is high and its library is also small. Both parts are per-sample outliers, the library on the log scale. With the library condition at 3 MADs, almost no healthy cell of any type was removed, but neither were most damaged cells: the rule removed 18% to 36% of them, depending on type. In this simulation the healthy library range is wide compared with the drop that damage causes (to about 25% of a healthy library), so a library 3 MADs below the median is rare. The catch rate depends on that choice: with the library condition at 2 MADs the same rule removed 49% to 68% of the damaged cells and still kept at least 99.9% of the healthy cells of every type. scuttle’s own combined filter, perCellQCFilters(), joins its flags with OR rather than AND (a cell is discarded if any flag is set), which avoids this but brings back the hepatocyte loss of the per-sample mitochondrial rule if you pass it the sample as batch.
Figure 3: Mitochondrial percentage against UMIs per cell in the first simulated data set, one panel per cell type, with the MAD threshold computed within each type (solid line). Damaged cells combine a high mitochondrial share with a small library.
Figure 3 shows why the per-type rule works: within a type, damaged cells stand apart on both axes, and the per-type thresholds in the first data set (7.6%, 12.8% and 34.7%) each sit just above that type’s own healthy cloud.
The per-type grouping also protects the low-mitochondrial types when a high-mitochondrial type is the majority. With hepatocyte-like cells making up 60% of the healthy cells, the all-cells threshold sat high and removed only 19% of the damaged T cell-like cells and 45% of the damaged macrophage-like cells, against at least 98% for the per-type rule (50 data sets).
Where per-group MAD rules fail too
A MAD threshold describes the majority of its group. When the majority of a group is damaged, the threshold moves with it. Two versions of that turn up in real data.
The first is a sample that went badly: a long dissociation, a clog in the chip. Below, sample S4 has 50% damaged cells and the others 10%.
set.seed(3)n_rep2 <-50bad <-c(0.10, 0.10, 0.10, 0.50) # sample S4: half of its cells damagedres_s <-sapply(seq_len(n_rep2), function(i) { d <-sim_qc(p_dam = bad) f <-filters(d)[c("3 MADs, per sample", "3 MADs, per cell type", "3 MADs, per sample x type")] s4 <- d$sample =="S4" thr <-attr(isOutlier(d$mito, type ="higher", batch = d$sample), "thresholds")["higher", ]c(sapply(f, function(x) mean(x[s4 & d$damaged])),sapply(f, function(x) mean(!x[s4 &!d$damaged])),thr_good =max(thr[c("S1", "S2", "S3")]), thr_bad =unname(thr["S4"]))})dam_s4 <-rowMeans(res_s)[1:3]; kept_s4 <-rowMeans(res_s)[4:6]thr_good <-mean(res_s["thr_good", ]); thr_bad <-mean(res_s["thr_bad", ])names(dam_s4) <-names(kept_s4) <-c("sample", "type", "sample_type")
Over 50 such data sets, the per-sample threshold for S4 averaged 74.3%, while the highest threshold among the other three samples averaged 15.0%, and the per-sample rule removed only 9% of the damaged cells in S4. Thresholds per sample and cell type removed 34% of them. Thresholds per cell type pooled over samples removed 97% while keeping 99.5% of S4’s healthy cells, because the three good samples hold the median of each type in place. The thresholds themselves are the warning: a sample whose threshold is several times the others is a finding to report, not a setting to accept.
The second is subtler. Damaged cells share a profile (many mitochondrial reads, few cytoplasmic ones), so they can cluster together, and then a clustering produces a “damaged cluster” instead of assigning them to their true type. Within that cluster the damaged cells are the majority, and a per-cluster threshold keeps them.
set.seed(4)split_share <-c(all =1, half =0.5) # share of damaged cells that leave their type's clusterres_c <-sapply(seq_len(n_rep2), function(i) { d <-sim_qc()sapply(split_share, function(q) { moved <- d$damaged &runif(nrow(d)) < q cl <-ifelse(moved, "damaged", as.character(d$type)) x <-as.logical(isOutlier(d$mito, type ="higher", batch = cl))mean(x[d$damaged]) })})dam_cl <-rowMeans(res_c) # damaged cells removed, per scenariocl1 <-factor(ifelse(d1$damaged, "damaged", as.character(d1$type)), c(types, "damaged"))cluster_table <-data.frame(cluster =levels(cl1),cells =as.numeric(table(cl1)),median_mito =as.numeric(tapply(d1$mito, cl1, median)),median_umis =as.numeric(tapply(d1$sum, cl1, median)))
In this extreme version, where every damaged cell lands in one cluster, the per-cluster rule removed 0.1% of the damaged cells. If only 50% of the damaged cells split off, it removed 49%: it misses roughly the share that left. The cure is to look at the clusters, not only at the cells. A table of per-cluster medians makes the damaged cluster obvious:
Table 2: Per-cluster medians in the first simulated data set when the damaged cells form a cluster of their own.
Cluster
Cells
Median mito (%)
Median UMIs
T cell
2,972
3.4
4,020
macrophage
1,324
5.5
4,975
hepatocyte
1,060
16.3
6,020
damaged
644
38.5
1,159
Both high-mitochondrial clusters stand out on the median mitochondrial share, but only the damaged one also has a median library of 1,159 UMIs against 4,020 or more for the others (Table 2). A cluster with a high mitochondrial share, a small library and no marker genes of its own is damage. A cluster with a high mitochondrial share, a normal library and clear markers (albumin in a hepatocyte cluster, for example) is biology.
What to do in practice
Compute the threshold per cell type or cluster, check it against the library size, and look at what you are about to remove before you remove it. In code, with scuttle:
# In your data (human gene names; mouse uses "^mt-"):# qc <- perCellQCMetrics(sce, subsets = list(Mito = grepl("^MT-", rownames(sce))))# mito <- qc$subsets_Mito_percent; umis <- qc$sum# with cluster labels from a first, lenient pass. Here the simulated d1 stands in.mito <- d1$mito; umis <- d1$sum; cluster <- d1$type; sample_id <- d1$samplehigh_mt <-isOutlier(mito, nmads =3, type ="higher", batch = cluster)round(attr(high_mt, "thresholds")["higher", ], 1) # one threshold per cluster
hepatocyte macrophage T cell
34.7 12.8 7.6
# per-sample thresholds as a check: one far above the others marks a damaged sampleround(attr(isOutlier(mito, type ="higher", batch = sample_id), "thresholds")["higher", ], 1)
S1 S2 S3 S4
15.3 14.1 12.4 14.0
# per-cluster medians: high mito AND few UMIs marks a damaged clusterround(sapply(list(mito = mito, umis = umis), function(v) tapply(v, cluster, median)), 1)
Clustering before the mitochondrial filter sounds circular, but only a lenient first pass is needed (removing near-empty barcodes by library size), and damaged cells that form their own cluster are then easy to spot with the table above. If you prefer a fixed number, choose it per cell type from the plot of mitochondrial share against library size, and write down why.
A threshold copied from a tutorial made on a different tissue is the mistake this post is about. Two smaller traps are in the API. isOutlier() on the mitochondrial percentage needs type = "higher". And quickPerCellQC() and perCellQCFilters() only filter on mitochondrial reads when you name the column (or pass sub.fields = TRUE, which picks up every subsets_*_percent and altexps_*_percent column): with the default sub.fields = NULL they use library size and detected genes alone, as the check below shows for perCellQCFilters(), which quickPerCellQC() calls.
f <-formals(isOutlier)c(nmads = f$nmads, log = f$log, type_default =eval(f$type)[1])
nmads log type_default
"3" "FALSE" "both"
formals(mad)$constant # the scaling isOutlier() gets from mad()
[1] 1.4826
set.seed(5)qc_mock <-perCellQCMetrics(mockSCE(), subsets =list(Mito =1:10))grep("Mito", colnames(qc_mock), value =TRUE)
The simulation is simple on purpose. Real damage is a continuum rather than two groups, real clusters mix types, and real cell types differ far more in library size than here. The direction of the result does not depend on those details: a single threshold fails whenever the healthy range of one type overlaps the damaged range of another, and that overlap is a property of the tissue, not of the software.
The R file runs the post top to bottom in a fresh session. Spotted an error, a broken number or code that no longer runs? The report link opens an email to contact@pseudocount.com.