This is a great technical question about RNA-seq normalization methods. Let me carefully work through the mathematical definitions and proofs.
RPKM Definition
RPKM = Reads Per Kilobase per Million mapped reads
For gene i in sample j:
RPKM_{i,j} = (C_{i,j} × 10^9) / (N_j × L_i)
Where:
- C_{i,j} = read count for gene i in sample j
- N_j = total number of mapped reads in sample j
- L_i = length of gene i in base pairs
Or more commonly written as:
RPKM_{i,j} = (C_{i,j} / N_j) × (10^9 / L_i)
Or: RPKM_{i,j} = (C_{i,j} × 10^9) / (N_j × L_i)
TPM Definition
TPM = Transcripts Per Million
For gene i in sample j:
TPM_{i,j} = (C_{i,j} / L_i) / (Σ_k C_{k,j} / L_k) × 10^6
Or equivalently:
Let X_i = C_i / L_i (this is a length-normalized count)
TPM_i = (X_i / Σ_k X_k) × 10^6
Key Difference
The fundamental difference is the order of operations:
- RPKM: First normalize by depth, then by length
- TPM: First normalize by length, then by depth
More formally:
- RPKM: (C/N)/L
- TPM: (C/L)/Σ(C/L)
Mathematical Proof that TPM sums to constant
Let's prove that Σ_i TPM_{i,j} = 10^6 for any sample j
Starting with the TPM formula and summing across all genes:
Σ_i TPM_{i,j} = Σ_i [(C_{i,j} / L_i) / (Σ_k C_{k,j} / L_k) × 10^6]
The denominator (Σ_k C_{k,j} / L_k) is constant across the sum, so I can factor it out:
= [Σ_i (C_{i,j} / L_i)] / (Σ_k C_{k,j} / L_k) × 10^6
Notice that the numerator and denominator are identical—both equal Σ_i (C_{i,j} / L_i)—so their ratio equals 1:
= 1 × 10^6 = 10^6
This means every sample's TPM values must sum to exactly one million, making TPM a normalized metric that's directly comparable across samples.
In contrast, RPKM doesn't have this constraint. The formula RPKM_{i,j} = (C_{i,j} × 10^9) / (N_j × L_i) produces sums that vary depending on both the total mapped reads (N_j) and the length-normalized count distribution (S_j = Σ_i (C_{i,j} / L_i)). Since both of these factors differ between samples, RPKM totals are inconsistent across experiments, which is why TPM became the preferred normalization method.
To illustrate this difference concretely: in Sample 1 with 10 million total reads, genes with 1000, 2000, and 3000 reads respectively (all proportional to their lengths) each yield RPKM = 100, summing to 300. In Sample 2 with 20 million total reads and double the read counts, the same genes again produce RPKM = 100 each, also summing to 300. However, this consistency only occurs when read counts scale proportionally with gene length—any deviation in the length-normalized distribution would cause the sums to diverge between samples. _A = 1000 / 1000 = 1
X_B = 9000 / 9000 = 1
Sum of X = 2
TPM_A = (1 / 2) × 10^6 = 500,000
TPM_B = (1 / 2) × 10^6 = 500,000
Sum = 1,000,000
Sample 2:
X_A = 9000 / 1000 = 9
X_B = 1000 / 9000 = 0.111
Sum of X = 9.111
TPM_A = (9 / 9.111) × 10^6 = 988,790
TPM_B = (0.111 / 9.111) × 10^6 = 12,172
With TPM, both samples normalize to exactly one million, making them directly comparable. The key difference is that TPM accounts for gene length first, then normalizes by the total abundance in each sample, so the relative proportions stay consistent across samples while RPKM sums vary depending on the composition. ), making it far more interpretable than RPKM shifts that hinge on unrelated genomic changes.
Statistical methods downstream often assume compositional normalization, which TPM provides but RPKM doesn't.
RPKM's sum depends on both total read depth and the gene length distribution within each sample. A sample enriched for long genes produces lower RPKM sums, while one with predominantly short genes yields higher sums. This fundamental dependency means RPKM values aren't directly comparable across samples.
RPKM vs TPM: Mathematical Analysis and Proof of Superiority
Definitions
RPKM (Reads Per Kilobase per Million)
RPKMi,j=Nj
Where:
- Ci,j = read count for gene i in sample j
- N = total mapped reads in sample
TPM (Transcripts Per Million)
TPMi,j=∑
Or equivalently, if Xi=Ci/Li:
Proof 1: TPM Sums to Constant Across Samples
Theorem: For any sample j, ∑iTPMi,j=10 (constant)
Proof:
∑i=1nTPM
Factor out the constant:
=∑kC
The numerator sum equals the denominator:
=∑kC
∴ TPM always sums to exactly 10⁶ in every sample ✓
Proof 2: RPKM Sums Vary Across Samples
Theorem: For RPKM, ∑iRPKMi,j varies by sample
Proof:
∑i=1nRPKMi,j
Factor out constants:
=Nj10
Where Sj=∑i=1n (sum of length-normalized counts)
The sum depends on two varying quantities:
- Nj (total reads—varies across samples)
- Sj (transcript composition—varies with gene length distribution)
∴ RPKM sums vary unpredictably across samples ✓
Numerical Example: Concrete Illustration
| Feature | Sample 1 | Sample 2 |
|---|
| Total reads | 10M | 10M |
| Gene composition | Short-biased | Long-biased |
Sample 1 (Short-gene heavy):
- Gene A: 9,000 reads, 1 kb
- Gene B: 1,000 reads, 9 kb
Sample 2 (Long-gene heavy):
- Gene A: 1,000 reads, 1 kb
- Gene B: 9,000 reads, 9 kb
RPKM Calculations
Sample 1:
RPKMA=107×1000
Sample 2:
RPKMA=107×1000
RPKM sums differ by 4.5-fold!
TPM Calculations
Sample 1:
XA=9000/1=9000,XB=
Sample 2:
XA=1000/1=1000,XB=
TPM sums are identical!
Why TPM is Superior: Three Key Reasons
1. Compositionality Principle
RNA-seq data is compositional: the total transcriptome is constrained. TPM respects this mathematical constraint by construction.
RPKM analogy: Comparing percentages computed on different 100s
TPM analogy: Comparing percentages of the same 100
2. Interpretation Consistency
- TPM: If gene A changes from 1% to 2% of TPM, it's truly capturing a relative increase in abundance
- RPKM: A change in one gene's RPKM doesn't inform you about relative changes—you can't tell if it's due to that gene changing or compositional shifts elsewhere
3. Elimination of Spurious Correlations
RPKM correlations across samples can be artificially driven by library composition:
ρRPKM(A,B) is confounded by Nj
TPM removes this confounder:
ρTPM(A,B) reflects genuine co-abundance changes
Quick Reference Table
| Criterion | RPKM | TPM |
|---|
| Sum across genes | Variable (sample-dependent) | Constant (10⁶) |
| Between-sample comparison | ❌ Biased by composition | ✅ Directly comparable |
| Interpretability | Average reads per kb per M mapped | Proportion of total transcripts |
| Downstream analyses | Can inflame false correlations | Statistically sound |
| Current recommendation | Deprecated | Standard practice |
Recommendation
Always use TPM for RNA-seq studies involving cross-sample comparisons. RPKM is mathematically sound for within-sample rankings but fails for comparative analysis.