Why Use Gene-Wise References?
A cell’s total number of recorded counts can be influenced by both its overall capture depth and the relative abundance of the genes it expresses. As the earlier material on compositional bias explains, scaling every cell by its total count can therefore distort comparisons when a small number of genes account for a large share of counts. Median-ratio normalization offers a different reference: for each gene, it compares each cell’s count with that gene’s geometric mean across cells, then summarizes those ratios across genes.
The method is most directly defined for a set of genes with positive counts in every cell being compared. This tutorial uses such shared expressed genes so that each geometric mean and ratio is defined. Counts are hypothetical, and the method does not require the example counts to be real measurements.
Model and Derivation
The method is motivated by a multiplicative exposure model. Write \(s_j\) for the relative sampling or library-size factor of cell \(j\), and \(q_g\) for the underlying abundance of gene \(g\) on the scale being compared. In an idealized noiseless version of the model, the expected count has the form \(s_jq_g\). Counts in real data fluctuate around this pattern; the equation below isolates the structure that the estimator is intended to recover.
If the approximation were exact for a stable gene, its geometric mean across the \(m\) cells would be \(q_g\) times the geometric mean of the cell factors. Dividing the count in a cell by that reference removes the gene-specific abundance and leaves a quantity proportional to that cell’s factor:
The unknown \(q_g\) cancels. Under this exact model, every stable gene gives the same ratio for a given cell. With sampling variation and genes that depart from the model, the ratios differ; their median estimates the common cell-specific ratio without allowing a few very large ratios to dominate. In practice, the estimate is meaningful when the typical gene in the reference set is sufficiently stable across the cells, so that the distribution of log-ratios is centered on the common factor. If most genes shift systematically in the same direction, the median can shift too.
The factors are relative, not absolute. Multiplying every \(s_j\) by the same positive constant changes no cell-to-cell comparison. Centering by the geometric mean selects a convenient scale: the product of the centered factors is one. Consequently, normalized counts remain on a relative scale, and their absolute level depends on the chosen centering convention.
Worked Example: Exact Factors From Shared Expressed Genes
Suppose five shared genes have the following hypothetical counts in three cells. Every gene has positive counts, and each row follows the same cell multiplier pattern.
| Gene | Cell 1 | Cell 2 | Cell 3 |
|---|---|---|---|
| A | 10 | 20 | 60 |
| B | 20 | 40 | 120 |
| C | 6 | 12 | 36 |
| D | 15 | 30 | 90 |
| E | 4 | 8 | 24 |
For gene A, the geometric mean reference is
Its three ratios are \(10/22.8943\approx0.4368\), \(20/22.8943\approx0.8736\), and \(60/22.8943\approx2.6207\). Every other gene has the same ratios, because its counts are a constant multiple of gene A’s counts. The cell-wise medians, and therefore the raw factors, are approximately \(0.4368,\ 0.8736,\ 2.6207\).
Check the centering rather than assuming the factors need an additional adjustment. Their geometric mean is
Thus the centered factors are still approximately \(0.4368,\ 0.8736,\ 2.6207\). For gene A, the size-adjusted counts are \(10/0.4368\approx22.894\), \(20/0.8736\approx22.894\), and \(60/2.6207\approx22.894\). Their agreement is expected here because the constructed counts follow the multiplicative model exactly. Real data will not generally produce identical adjusted counts across cells.
Why the Median Helps
A geometric-mean reference is calculated separately for each gene, but the cell factor is summarized across genes. The median is resistant to a minority of unusually large or small ratios. In the usual one-dimensional sense, fewer than half the observations can be arbitrarily extreme without forcing the median arbitrarily far in the same direction. This is a robustness property, not a guarantee that the resulting factor is unbiased: if many genes shift together, or if the reference genes are unrepresentative, the median may be misleading.
Worked Example: One Extreme Gene Ratio
Consider two hypothetical cells and five shared genes. Counts are positive throughout.
| Gene | Cell 1 | Cell 2 | Geometric mean | Cell 1 ratio | Cell 2 ratio |
|---|---|---|---|---|---|
| A | 100 | 144 | 120 | 0.8333 | 1.200 |
| B | 100 | 121 | 110 | 0.9091 | 1.100 |
| C | 100 | 81 | 90 | 1.111 | 0.9000 |
| D | 100 | 100 | 100 | 1.000 | 1.000 |
| E | 100 | 1600 | 400 | 0.2500 | 4.000 |
For example, gene E has reference \((100\cdot1600)^{1/2}=400\), so its ratios are \(100/400=0.25\) and \(1600/400=4\). Sorting each cell’s five ratios, the median for Cell 1 is \(0.9091\), and the median for Cell 2 is \(1.100\). The extreme ratio of 4 does not set Cell 2’s factor because it is only one of five ratios. The raw factors have geometric mean
so centering leaves them approximately unchanged. This example illustrates resistance to one extreme gene, not proof that the two factors recover a biological truth. The other ratios also vary, and the estimate depends on the assumption that their typical value reflects the cell-level sampling difference.
A Calculation With a Minority of Changed Genes
A more interpretable diagnostic example separates the genes that follow a shared cell multiplier pattern from one gene that does not. With four stable genes, the median can still track the pattern even if the remaining gene has a large departure. The factor estimate is relative to the collection of cells, so it should not be read as a direct measurement of RNA molecules per cell.
Worked Example: Stable Majority and One Departing Gene
Suppose four stable genes each have counts \(10,20,30\) across three cells, while gene E has counts \(10,20,300\). The totals are \(50,100,420\). For any of the four stable genes, the geometric mean and ratios are
For gene E, \(G_E=(10\cdot20\cdot300)^{1/3}\approx39.1487\), giving ratios approximately \((0.2554,\ 0.5109,\ 7.663)\). In Cell 1 the five ratios consist of four values near \(0.5503\) and one value \(0.2554\), so their median is \(0.5503\). In Cell 2, four values are near \(1.101\) and one is \(0.5109\), so the median is \(1.101\). In Cell 3, four values are near \(1.651\) and one is \(7.663\), so the median is \(1.651\). The raw factors are therefore approximately \((0.5503,1.101,1.651)\).
Their geometric mean is approximately one because they are \((1,2,3)/\sqrt[3]{6}\); thus they are already centered. The total counts, by contrast, are \(50,100,420\): their relative pattern is \(1:2:8.4\), rather than the \(1:2:3\) pattern shared by the stable genes. This contrast shows why a large count contribution from one gene can affect total-count scaling while leaving the median-ratio estimate anchored by the typical gene in this constructed example.
Assumptions, Diagnostics, and Alternatives
The calculation itself is simple; its interpretation depends on the reference genes and the comparison being made. Before treating the factors as exposure corrections, check that the selected cells are a scientifically meaningful group to compare, and that enough genes have positive counts in all of them. The method also relies on a location assumption: across the genes used, the typical gene’s relative expression should not have shifted systematically in one direction between cells. It does not require every gene to be unchanged, but it can fail when a large fraction of genes changes together or when a few highly abundant genes dominate the biology being compared.
Useful checks include inspecting the number and identity of genes contributing ratios, looking at the distribution of log-ratios by cell, and checking whether a small set of genes or a particular cell group drives the estimated factors. Large differences between median-ratio factors and total-count factors can be a warning of compositional effects or broad expression changes; the difference alone does not establish which estimate is correct. Recompute factors on a defensible stable gene set as a sensitivity check when such a set can be justified. If many counts are zero, the geometric means and ratios are not defined in the simple form used here; do not silently replace zero with a positive value. The treatment of zeros requires a separate, explicit convention.
The main alternatives answer related but not identical questions. Total-count scaling uses the sum of counts in each cell and is straightforward, but can be sensitive to composition. External spike-ins can provide a reference not derived from endogenous genes, provided their addition and capture are suitable for the target of inference. Other endogenous robust-ratio methods use different rules for selecting and weighting gene-level comparisons. No normalization factor can, by itself, distinguish a technical sampling shift from a genuine global biological change in RNA abundance; that distinction requires assumptions or external information.
| Approach | Reference used | Key caution |
|---|---|---|
| Median-ratio factors | Gene-wise geometric means and the median of cell-to-reference ratios | Needs a suitable typical-gene reference and positive counts for the simple calculation |
| Total-count scaling | Each cell’s summed counts | A few abundant or changing genes can strongly affect the sum |
| External spike-ins | Added reference molecules | Interpretation depends on spike-in addition and capture representing the intended comparison |
Common Pitfalls
- Using an arithmetic mean instead of the geometric mean. The reference is the \(m\)th root of the product of the counts, not their arithmetic average. It is defined on the multiplicative scale used by the ratio model.
- Centering by the wrong quantity. To center raw factors \(r_j\), divide each by \((\prod_j r_j)^{1/m}\). Check the product or geometric mean afterward; do not assume a correction is needed if it is already one.
- Calling a factor an absolute RNA amount. It estimates a relative cell multiplier under the reference assumptions. The normalization scale is arbitrary up to a common constant.
- Assuming the median protects against any biological shift. It protects against a minority of extreme ratios, not a systematic shift affecting most genes or a biased reference set.
- Applying the positive-count formula to zeros without a stated rule. A geometric mean involving zero is zero, so the ratio is not defined by the simple positive-count calculation. Zeros need deliberate handling.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For counts \(4,16\) of one gene in two cells, calculate the gene-wise geometric mean and both cell ratios.
- Three raw factors are \(0.5,1,2\). What is their geometric mean, and what are the centered factors?
- Why can one very large gene ratio fail to move a cell’s median-ratio factor much?
- State one assumption that makes median-ratio factors interpretable as relative exposure corrections.
- Why is a zero count not handled by simply calculating the usual positive-count ratio for that gene?
Solutions. (1) \(G=(4\cdot16)^{1/2}=8\); the ratios are \(4/8=0.5\) and \(16/8=2\). (2) The geometric mean is \((0.5\cdot1\cdot2)^{1/3}=1\), so the centered factors remain \(0.5,1,2\). (3) The median depends on the middle ordered ratio, so one extreme value among many contributing genes does not determine it. (4) For example, the typical reference gene must not undergo a systematic expression shift across the cells being compared. (5) A zero can make the geometric-mean reference zero, leaving division by zero undefined; a specific zero-handling rule is needed.