Why the Median Can Recover a Relative Scale
Sequencing counts differ from sample to sample partly because samples have different effective sequencing exposures. A normalization factor is intended to account for that difference so that counts for genes with unchanged abundance can be compared on a common scale. The challenge is that the data used to estimate the factor also contain biological changes: a small number of genes may be strongly up- or down-regulated.
The DESeq median-ratio estimator uses each gene as one contributor to a sample’s scale estimate, then takes a median across genes. Thus, a few genes with very large counts or very large changes do not automatically dominate the estimate. The key condition is not that every gene is stable, but that more than half of the eligible genes provide ratios consistent with the same sample-scale difference.
A useful working model for understanding the estimator is \(E(K_{ij})=s_j q_{ij}\), where \(s_j\) is the sample-specific sequencing scale and \(q_{ij}\) is the gene’s abundance on the target scale. For a stable gene, \(q_{ij}=q_i\) across samples. This is a model for expected counts; observed counts fluctuate around their expectations. The scale factors and abundances cannot be separately identified in absolute units from the count matrix alone: multiplying all \(s_j\) by a constant and dividing all \(q_i\) by the same constant leaves the expected counts unchanged.
The geometric mean in the denominator gives each gene a reference built from the samples being normalized. Under the stable-gene model, the ideal count for gene \(i\) in sample \(j\) is proportional to \(s_jq_i\), while the gene’s geometric-mean reference is proportional to \(q_i\) times the geometric mean of the sample scales. Dividing cancels \(q_i\). The resulting ratio estimates the sample’s scale relative to the geometric mean scale across samples.
Consequently, the ideal ratio is the same for every unchanged gene in sample \(j\). If the estimated factors are rescaled to have geometric mean one, they represent the sample scales relative to their geometric mean, rather than an absolute number of reads or an absolute amount of RNA.
Why Sparse Changes Have Limited Influence
Consider a two-sample comparison and suppose the true sequencing scale in sample B is twice that in sample A. For an unchanged gene, the expected count ratio B-to-A is 2. Its geometric mean across the two samples is the square root of the product of its two counts, so its ratio to that reference is \(1/\sqrt{2}\) in A and \(\sqrt{2}\) in B. These are the scale signals the estimator is designed to recover.
For a gene that also changes biologically, its ratio can be far from the scale signal. But it still contributes only one value to the median, regardless of its count size. In the idealized case where unchanged-gene ratios all equal the target and more than half the eligible genes are unchanged, the median remains at that target even if the other ratios are arbitrarily large or small. With real count noise, stable-gene ratios are not identical; the same principle applies when a majority form a reasonably concentrated group.
Worked Example: Two Changed Genes Among Seven
Suppose the hypothetical counts for seven genes are as follows. Sample B has twice the sequencing scale of sample A. Genes 1–5 have unchanged abundance; gene 6 has an additional eightfold change in B, and gene 7 has an additional one-half change.
| Gene | Sample A count | Sample B count | Abundance status |
|---|---|---|---|
| 1 | 100 | 200 | Unchanged |
| 2 | 80 | 160 | Unchanged |
| 3 | 60 | 120 | Unchanged |
| 4 | 40 | 80 | Unchanged |
| 5 | 20 | 40 | Unchanged |
| 6 | 30 | 240 | Changed |
| 7 | 50 | 25 | Changed |
For each gene, the reference is the square root of its two counts. For an unchanged gene, the Sample B ratio is, for example, \(200/\sqrt{100\cdot200}=\sqrt{2}\approx1.414\). All five unchanged genes give this same ratio. Gene 6 gives \(240/\sqrt{30\cdot240}=\sqrt{8}\approx2.828\), and gene 7 gives \(25/\sqrt{50\cdot25}=\sqrt{0.5}\approx0.7071\).
The seven Sample B ratios, sorted, are approximately \(0.7071, 1.414, 1.414, 1.414, 1.414, 1.414, 2.828\). Their median is \(1.414=\sqrt{2}\). In Sample A the corresponding median is \(1/\sqrt{2}\approx0.7071\). The ratio of the two raw median estimates is \(1.414/0.7071=2.000\), recovering the sample-scale ratio despite two substantial gene-specific changes.
Rescaling these two estimates to geometric mean one gives factors \(0.7071\) for A and \(1.414\) for B. Their ratio remains 2. The changed genes did not overwhelm the estimate because each counts once and five of the seven genes support the scale signal.
The Majority Condition and Its Limits
The median’s protection is a statement about the number of gene-level ratios, not the total number of reads contributed by stable genes. In an ideal, noiseless setting, if more than half of the eligible genes have ratios equal to the target, the middle ordered ratio is among those unchanged-gene values. This remains true even if a minority of genes have extreme ratios. In actual data, the unchanged ratios vary because of sampling noise, and robustness is approximate rather than exact: it depends on stable genes providing a sufficiently clear central group.
The condition is evaluated among genes that can contribute ratios. If zeros remove many genes, the remaining set may be small or unrepresentative. Further, a majority of genes need not mean a majority of the total RNA abundance. Since this estimator takes a median of gene-level ratios, a low-count gene and a high-count gene each contribute one ratio. This is useful protection against a few extreme genes, but it also means that gene-level majority is the relevant assumption.
Worked Example: When Three of Five Genes Shift
Suppose there are five eligible genes, the sequencing scale in B is truly twice the scale in A, and genes 1 and 2 are unchanged. Genes 3–5 each have a fourfold increase in abundance in B, in addition to the twofold scale difference. The B-to-A count ratios are therefore 2 for the unchanged genes and \(2\cdot4=8\) for the three changed genes.
With two samples, a gene whose B-to-A count ratio is \(r\) contributes a Sample B ratio of \(\sqrt{r}\) and a Sample A ratio of \(1/\sqrt{r}\). The Sample B values are \(\sqrt{2},\sqrt{2},\sqrt{8},\sqrt{8},\sqrt{8}\). Their median is \(\sqrt{8}\approx2.828\); the Sample A median is \(1/\sqrt{8}\approx0.3536\). The estimated B-to-A scale ratio is \(2.828/0.3536=8\), not the true scale ratio 2.
Here three of five genes carry the same biological shift, so the median follows that shifted majority. The estimate is four times the true relative scale: \(8/2=4\). The example shows why the method does not, by itself, distinguish a widespread biological change from a sequencing-scale difference. The sparse-change assumption is substantive, not a consequence guaranteed by taking a median.
Multiple Samples, Zeros, and Calculation
For more than two samples, each gene’s reference is the geometric mean across all samples. The sample-specific ratios are then computed against that same reference. If the unchanged genes follow the multiplicative scale model, their ratios in each sample cluster around that sample’s scale divided by the geometric mean scale across samples. A gene that changes in just one sample can produce an extreme ratio there, but it remains one gene-level contribution to that sample’s median.
Worked Example: Three Samples and an All-Zero Gene
Consider six usable genes measured in three hypothetical samples. Five are unchanged, with base counts 10, 20, 30, 40, and 50 and sample scales 1, 2, and 4. The sixth has base count 10 but is four times higher than expected in Sample 3. A seventh gene has counts zero in all samples.
| Gene | Sample 1 | Sample 2 | Sample 3 |
|---|---|---|---|
| 1 | 10 | 20 | 40 |
| 2 | 20 | 40 | 80 |
| 3 | 30 | 60 | 120 |
| 4 | 40 | 80 | 160 |
| 5 | 50 | 100 | 200 |
| 6 | 10 | 20 | 160 |
| 7 | 0 | 0 | 0 |
The geometric mean of the true sample scales is \((1\cdot2\cdot4)^{1/3}=2\). For each of genes 1–5, the ratios in Samples 1, 2, and 3 are therefore \(0.5, 1,\) and \(2\). Gene 6 has geometric mean \((10\cdot20\cdot160)^{1/3}\approx31.75\), giving ratios \(10/31.75\approx0.3150\), \(20/31.75\approx0.6300\), and \(160/31.75\approx5.039\).
For Sample 1, the six eligible ratios are one value of 0.3150 and five values of 0.5, so the median is 0.5. For Sample 2 they are 0.6300 and five values of 1, giving median 1. For Sample 3 they are five values of 2 and one value of 5.039, giving median 2. The factors \(0.5,1,2\) already have geometric mean one and recover the relative scales. Gene 7 is excluded because its geometric mean is zero; it provides no defined ratio.
Assumptions, Diagnostics, and Alternatives
The estimator is most credible when the following conditions are reasonably satisfied:
- A majority of eligible genes are stable on the abundance scale being normalized, or their changes are balanced enough that the median ratio still reflects the sample-scale difference.
- There are enough informative genes. A median based on very few nonzero genes can be unstable, and omitting genes with zeros across samples can alter which genes define the majority.
- Counts are comparable measurements. Sample-specific technical effects should be adequately represented by a multiplicative scale factor rather than gene-specific distortions that systematically move many ratios.
- Sampling noise does not overwhelm the central pattern. Low counts and small numbers of usable genes can make ratios variable even when the model is otherwise reasonable.
Useful checks include recording how many genes contribute to each estimate, checking whether factors are driven by a small eligible set, and seeing whether the estimates change substantially when a few unusual genes are omitted. Known stable controls, when available and appropriate, can help assess whether the estimated relative scale is plausible. A large factor difference is not itself evidence of an error, but an estimate that changes sharply under modest changes to the contributing genes deserves investigation.
A central interpretive limitation concerns global shifts. If every gene’s abundance doubles in B while the sequencing scale stays fixed, the counts alone have the same pattern as a twofold increase in sequencing scale with unchanged abundances. The median-ratio estimator will generally attribute a common multiplicative shift to relative scale; without suitable external information or design assumptions, it cannot identify an absolute per-cell change. Its output is a relative normalization, not a measurement of total RNA per cell.
Total-library scaling, which uses each sample’s total count as its scale estimate, is simple but can be pulled by a small number of very abundant or strongly changed genes. The median-ratio estimator instead gives each eligible gene one vote, making it less sensitive to a minority of extreme changes. Trimmed ratio approaches, including TMM normalization, also estimate relative scales while limiting the influence of unusual genes, but use a different aggregation strategy. No approach can recover a biological absolute scale from counts alone when biology and sequencing exposure are indistinguishable.
Common Mistake
A common error is to say, “The median is robust, so the size factor is valid even if many genes change.” Robustness does not remove the estimator’s assumptions. The median protects against a minority of unusual ratios; if most eligible genes shift together, the median follows their ratios, as the five-gene example demonstrated. Another error is to interpret a normalized count as an absolute amount of RNA. The factor adjusts relative sequencing scale, and the count matrix alone cannot separate a global biological shift from a scale difference.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- In the two-sample setting, if an unchanged gene has a B-to-A count ratio of 3, what ratios does it contribute for Samples A and B relative to its geometric-mean reference?
- In a set of 15 eligible genes, 9 have the same ideal scale ratio and 6 have arbitrary extreme ratios. Where does the median lie in the noiseless case, and why?
- Why does a gene with counts zero in every sample not contribute to the standard median-ratio estimate?
- If every gene’s abundance doubles in one sample while sequencing exposure is unchanged, can the count data alone establish that this is a global biological change rather than a scale difference?
Solutions. (1) The ratios are \(1/\sqrt{3}\approx0.5774\) for A and \(\sqrt{3}\approx1.732\) for B, since each count is divided by the square root of the two counts’ product. (2) The median lies at the common ratio because 9 of 15 values support it, a strict majority; the other 6 cannot move the middle ordered value past that majority in the ideal case. (3) Its geometric mean is zero, so the ratios \(K_{ij}/G_i\) are undefined. (4) No. A global biological multiplier and a sequencing-scale multiplier produce the same multiplicative count pattern, so additional assumptions or external information are needed to distinguish them.