Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Per-Cell Counts, Detected Genes, and Mitochondrial Fraction

Quality Control, Doublets and Ambient RNA · Tutorial 22 of 700

Per-Cell Counts, Detected Genes, and Mitochondrial Fraction

Learn to calculate three basic per-barcode quality metrics and interpret their joint patterns while accounting for sequencing depth, feature annotation, and denominator choices.

Intermediate 10 min read

What You'll Learn

  • Define total UMI count, detected-gene count, and mitochondrial UMI fraction from a gene-by-barcode matrix.
  • Calculate each metric, including how to handle barcodes with zero total counts.
  • Explain why detected-gene counts tend to increase with total counts under a simple sampling model.
  • Read joint plots as descriptive diagnostics rather than automatic cell-quality verdicts.
  • Identify how annotation and feature-universe choices affect mitochondrial fractions.
  • Recognize common calculation and interpretation errors.

Three summaries of each barcode

Once cell-associated barcodes have been identified, their count profiles can be summarized in several complementary ways. A barcode with many observed molecules may represent a cell with abundant captured RNA, greater sequencing depth, or both. The number of genes with any observed counts gives a different view of that profile, while the share of counts assigned to mitochondrial genes describes its composition. None of these summaries, by itself, establishes whether a barcode is a valid cell or whether a cell is healthy.

Let \(x_{gi}\) be the nonnegative integer UMI count for gene \(g\) in barcode \(i\), with \(g=1,\ldots,G\). Let \(M\) be the set of features annotated as mitochondrial genes, using a consistent annotation for the organism and reference. The metrics below are calculated from the same gene-by-barcode count matrix.

Definition: For barcode \(i\), the total UMI count is \(T_i=\sum_{g=1}^{G}x_{gi}\). The detected-gene count is \(D_i=\sum_{g=1}^{G}I(x_{gi}>0)\), where \(I(\cdot)\) equals 1 when its condition is true and 0 otherwise. The mitochondrial UMI fraction is \(F_i=\left(\sum_{g\in M}x_{gi}\right)/T_i\), defined when \(T_i>0\). It is often reported as \(100F_i\%\).

These definitions distinguish a molecule count from a gene count. If one gene has 40 UMIs in a barcode, it contributes 40 to \(T_i\), but only 1 to \(D_i\). A gene detected once and a gene detected hundreds of times contribute equally to the detected-gene count. The mitochondrial fraction is a ratio of counts, not the proportion of genes that are mitochondrial.

For a barcode with \(T_i=0\), no genes are detected and the mitochondrial fraction is undefined because its denominator is zero. Record that fraction as missing or undefined, not as zero: zero would imply that the fraction was measured and that no UMIs were mitochondrial. A barcode with no counts may be an empty or otherwise unusable barcode, but deciding its status requires the wider context of cell calling and quality control.

Worked calculations

Worked Example: Calculating All Three Metrics

Consider a hypothetical matrix with eight features: two mitochondrial genes, MT-ND1 and MT-CO1, and six other genes. For barcode A, the counts in that order are \(12, 8, 20, 10, 0, 0, 5, 15\).

The total UMI count is the sum of all eight entries: \(T_A=12+8+20+10+0+0+5+15=70\) UMIs.

Six entries are greater than zero, so \(D_A=6\) detected genes. The mitochondrial numerator is \(12+8=20\) UMIs, giving \(F_A=20/70=0.2857\), or \(28.57\%\).

For barcode B, suppose the counts are \(3, 2, 5, 4, 6, 1, 2, 7\). Then \(T_B=30\) UMIs, \(D_B=8\) genes, and \(F_B=(3+2)/30=0.1667\), or \(16.67\%\). Barcode B has fewer total UMIs than A but more detected genes in this small example. These calculations describe the observed matrix; the metrics alone do not explain why the profiles differ.

A third barcode with eight zero counts has \(T=0\) and \(D=0\), while its mitochondrial fraction is undefined. Reporting a fraction of \(0\%\) for this barcode would incorrectly conflate no observed molecules with observed molecules that are all non-mitochondrial.

Why total counts and detected genes move together

Detected-gene counts tend to rise with total counts because observing more molecules creates more opportunities to observe genes that previously had zero counts. This relationship is useful for understanding a scatterplot of \(D_i\) against \(T_i\), but it also means the two metrics are not independent pieces of evidence.

A simple derivation makes the relationship explicit. Suppose, as a deliberately simplified sampling model, that a barcode has a fixed gene composition: each of \(N\) sampled molecules independently comes from gene \(g\) with probability \(q_g\), where \(\sum_g q_g=1\). Let \(I_g\) equal 1 if gene \(g\) appears at least once among the \(N\) molecules and 0 otherwise. The detected-gene count is \(D=\sum_g I_g\). The probability that gene \(g\) is not observed is \((1-q_g)^N\), so \(E[I_g]=1-(1-q_g)^N\). By adding these expectations,

$$ E[D\mid N]=\sum_{g=1}^{G}\left[1-(1-q_g)^N\right]. $$

For each gene, the increase in its detection probability from \(N\) to \(N+1\) molecules is \(q_g(1-q_g)^N\), which is nonnegative. Therefore,

$$ E[D\mid N+1]-E[D\mid N] =\sum_{g=1}^{G}q_g(1-q_g)^N\geq 0. $$

Under this model, expected detected-gene count cannot decrease as sampling depth increases, although it may approach a plateau as more genes are already detected. The model assumes a fixed composition and independent molecule draws. Real data can depart from those assumptions because cells differ in their RNA composition and biological expression, and because capture and sequencing are not perfectly represented by this simple sampling scheme. The result explains a general tendency, not a rule that every pair of barcodes must follow.

Worked Example: Reading Total Counts and Detected Genes Together

Suppose four hypothetical called barcodes have the following summaries:

BarcodeTotal UMIsDetected genesMitochondrial fraction
A12,0002,5006%
B2,5006005%
C14,0002,60042%
D9,0001,8007%

A and B differ by a factor of \(12{,}000/2{,}500=4.8\) in total UMIs and by \(2{,}500/600=4.167\) in detected genes. Their summaries are consistent with a broad depth-related pattern: the barcode with more UMIs also has more detected genes. This comparison does not show that depth is the only cause, nor does it establish a universal expected ratio between the metrics.

C has the largest total count and detected-gene count in this set, as well as a larger mitochondrial fraction than the other listed barcodes. These are three distinct observations. In particular, the large total does not cancel or invalidate the fraction, and the fraction alone does not establish a quality diagnosis. The appropriate next step is to examine the distribution in its experimental context and consider other evidence, rather than apply an unexamined universal cutoff.

Interpreting the joint distributions

A useful first pass is to inspect the empirical distributions of total UMIs, detected genes, and mitochondrial fractions, then examine scatterplots of detected genes versus total UMIs and mitochondrial fraction versus total UMIs. A histogram or density plot shows the range and shape of a metric; a scatterplot shows whether unusual values occur together. When totals span orders of magnitude, plotting total UMIs on a logarithmic axis can make the lower-count region easier to inspect. The plotted scale should be stated clearly.

The joint view helps distinguish patterns that a single summary can hide. A low total count paired with a low detected-gene count is consistent with a barcode having little captured signal, but it is not proof of a particular cause. A high total count paired with many detected genes may reflect greater depth, a more complex profile, or both. A high mitochondrial fraction can occur at different total-count levels; it is a compositional summary and should be read alongside the other metrics, not as a substitute for them.

These plots are descriptive diagnostics. They can reveal a long tail, a secondary concentration of barcodes, an unexpected gap, or a group separated from the main cloud. Such features are prompts to investigate matrix construction, sample identity, processing, and biological context. They do not by themselves identify a mechanism or dictate which barcodes to retain. In particular, avoid treating a visually unusual point as an automatic exclusion.

Comparisons are most interpretable when they use consistent counting and annotation conventions. Check that the matrix contains the intended count units, that the same feature universe is used for the denominator, and that mitochondrial genes are annotated appropriately for the organism and reference. If metrics are summarized across samples or batches, display the groups rather than relying only on a pooled distribution: a pooled plot can conceal a sample-specific shift. Do not compare raw totals as though they were pure measures of cell size or RNA content; sequencing depth and capture also affect them.

Worked Example: Checking the Mitochondrial Fraction Denominator

In a hypothetical barcode, a full count matrix contains 100 mitochondrial UMIs and 900 non-mitochondrial UMIs. The total is \(100+900=1{,}000\) UMIs, so the mitochondrial fraction is \(100/1{,}000=0.1000\), or \(10.00\%\).

Suppose an analyst first removes 200 non-mitochondrial UMIs by restricting the matrix to a smaller feature set, then recomputes both numerator and denominator from that restricted matrix. The mitochondrial count remains 100, but the new total is \(1{,}000-200=800\), producing \(100/800=0.1250\), or \(12.50\%\). The fraction changed because the denominator changed, not because the original barcode acquired mitochondrial UMIs.

For a defined QC metric, use the intended full feature set and mitochondrial annotation consistently across barcodes. If a different feature universe is deliberately used, state it and do not compare its fractions directly with values computed using another denominator.

Assumptions, alternatives, and failure modes

The calculations require a count matrix whose entries represent the count units intended for this assay. For UMI-based data, \(x_{gi}\) is a UMI count, not a raw read count: duplicate reads from the same molecule should not be mistaken for distinct molecules. The feature rows and barcode columns must be identified correctly, counts must be nonnegative, and the mitochondrial feature set must be defined using a suitable annotation. These summaries are also computed per barcode; they do not correct for differences in sequencing depth or establish cell identity.

The three metrics answer different questions. Total UMI count measures the number of counted molecules assigned to a barcode. Detected-gene count measures how many features have nonzero counts, and is sensitive to both sampling depth and the underlying profile. Mitochondrial fraction measures what share of the barcode's counted molecules belongs to the annotated mitochondrial set. A normalized expression value may be useful for other analyses, but it is not interchangeable with the raw count sum used to define these QC summaries.

Common warning signs include negative entries, a detected-gene count greater than the number of features, a mitochondrial numerator greater than the total, fractions outside the interval from 0 to 1, or a defined fraction for a zero-total barcode. Each indicates a likely coding, indexing, annotation, or denominator error. Also inspect whether mitochondrial features were accidentally omitted, duplicated, or inconsistently named. A technically valid calculation can still be misleading if its inputs or feature universe are inappropriate.

A frequent mistake is to reason that a barcode with many UMIs and many detected genes must be a good-quality cell, or that one with a high mitochondrial fraction must be discarded. The correction is that these metrics are screening summaries, not definitive classifications. Their joint distributions can identify barcodes worth investigating, but biological differences, technical depth, and processing choices can all shape the patterns. A fixed cutoff is not justified merely by plotting the metrics; threshold choice and more formal joint outlier procedures require additional considerations.

Key takeaway: Calculate total UMIs, detected genes, and mitochondrial UMI fraction from a clearly specified count matrix and feature set. Interpret their marginal and joint distributions as context-dependent diagnostics, not as stand-alone evidence that a barcode is valid, invalid, or biologically abnormal.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A barcode has counts \(4, 0, 3, 0, 5\), and the first and fifth features are mitochondrial. Find its total UMI count, detected-gene count, and mitochondrial fraction.
  2. Why can a barcode with more total UMIs have more detected genes even if its underlying gene composition is unchanged?
  3. A barcode has zero total UMIs. What are its detected-gene count and mitochondrial fraction?
  4. What happens to a mitochondrial fraction if non-mitochondrial features are removed from its denominator while its mitochondrial count is unchanged?

Solutions. (1) The total is \(4+0+3+0+5=12\) UMIs; three features have positive counts; mitochondrial UMIs are \(4+5=9\), so the fraction is \(9/12=0.7500\), or \(75.00\%\). (2) More sampled molecules provide more opportunities to observe genes that would otherwise have zero counts; under the fixed-composition sampling model, expected detected-gene count is nondecreasing with depth. (3) The detected-gene count is 0, while the fraction is undefined because it would require division by zero. (4) The denominator becomes smaller, so the fraction increases if the numerator stays fixed and the new denominator remains positive; the resulting value is not directly comparable to one calculated from the full feature set.

Clinical Biostats