Tutorials › High-Dimensional Genomic Data Analysis › TPM, FPKM, and RPKM Compared

Normalization and Batch Effects · Tutorial 83 of 795

TPM, FPKM, and RPKM Compared

You will calculate and compare RPKM, FPKM, and TPM, including how feature lengths and library denominators determine what their values can mean.

Intermediate 12 min read

What You'll Learn

  • Distinguish RPKM for single-end reads from FPKM for paired-end fragments.
  • Calculate length-adjusted rates and normalize them to TPM within a specified feature set.
  • Derive the relationship between TPM and RPKM or FPKM when denominators are consistent.
  • Interpret normalized values as relative, rather than absolute, abundance measures.
  • Identify why these measures do not by themselves establish differential expression across samples.
  • Check whether feature lengths, library denominators, and included features are defined consistently.

Why These Measures Differ

Sequencing counts depend on more than how abundant a transcript is. A longer transcript can generate more reads or fragments than a shorter transcript at the same abundance, and a deeper library can generate more counts overall. RPKM, FPKM, and TPM address these two influences using feature length and a sequencing-depth denominator. Their formulas are related, but the order of normalization matters: TPM first adjusts counts for length and then scales those adjusted values to a fixed total.

The measures are useful for describing relative expression within a sample, but their values do not turn sequencing counts into absolute numbers of RNA molecules per cell. They also do not, on their own, provide a sound test of differential expression. The interpretation depends on the measured feature set, how reads or fragments were assigned, and which library denominator was used.

Definition: For feature \(i\) in sample \(j\), let \(C_{ij}\) be its assigned read count for single-end sequencing or fragment count for paired-end sequencing, and let \(L_i\) be its length in kilobases. Let \(N_j\) be the corresponding library size expressed in millions: mapped reads for a single-end RPKM calculation, or mapped fragments for a paired-end FPKM calculation. RPKM is reads per kilobase per million mapped reads; FPKM is fragments per kilobase per million mapped fragments. TPM is transcripts per million, calculated by first dividing counts by feature length and then scaling those length-adjusted values so their sum over the specified feature set is one million.

Formulas and Their Denominators

For a single-end library, RPKM divides the count by feature length in kilobases and by the library size in millions. For a paired-end library, FPKM uses fragments in both the count and the library denominator. A paired-end fragment represents the sequenced DNA fragment, not two independent fragments just because it produced two reads.

$$ \mathrm{RPKM}_{ij}=\frac{C_{ij}}{L_iN_j} \qquad \mathrm{FPKM}_{ij}=\frac{C_{ij}}{L_iN_j} $$

The algebraic forms match, but \(C_{ij}\) and \(N_j\) must refer to the same type of unit. In RPKM, both are reads; in FPKM, both are fragments. Because \(N_j\) is already expressed in millions, there is no additional factor of one million in these formulas. If instead the denominator were written as a raw number of mapped reads or fragments, the formula would include a factor of \(10^6\).

For TPM, define the length-adjusted rate \(r_{ij}=C_{ij}/L_i\). Then sum these rates over the included features in sample \(j\), and divide each rate by that sum before multiplying by one million.

$$ \mathrm{TPM}_{ij} = 10^6\frac{C_{ij}/L_i}{\sum_{k\in S}C_{kj}/L_k} = 10^6\frac{r_{ij}}{\sum_{k\in S}r_{kj}} $$

Here \(S\) is the feature set used in the TPM calculation. It might contain quantified transcripts or genes, depending on the analysis. The chosen features and the lengths used must be specified: changing the set changes the denominator, and therefore can change the TPM values even when the count and length of a particular feature stay the same. For transcript-level quantification, an effective length may be used to account for the fact that not every possible fragment can be observed from every transcript. The important requirement is to use the length definition appropriate to the quantification method, consistently.

Worked Calculations

Worked Example: Calculating RPKM and TPM

Suppose a hypothetical single-end sample has 10 million mapped reads. Three included genes have counts and lengths as shown: gene A has 400 reads and is 2 kb long; gene B has 300 reads and is 1 kb long; gene C has 200 reads and is 4 kb long. The lengths are assumed to be the appropriate lengths for this gene-level calculation, and the three genes are the complete feature set for the TPM calculation.

The RPKM values use mapped reads in millions, so \(N_j=10\). For gene A, \(400/(2\times10)=20\) RPKM. For gene B, \(300/(1\times10)=30\) RPKM. For gene C, \(200/(4\times10)=5\) RPKM.

For TPM, first calculate the length-adjusted rates: \(400/2=200\), \(300/1=300\), and \(200/4=50\). Their sum is \(200+300+50=550\). The TPM values are therefore \(10^6(200/550)=363{,}636\) for A, \(10^6(300/550)=545{,}455\) for B, and \(10^6(50/550)=90{,}909\) for C, to the nearest whole TPM.

The RPKM values sum to \(20+30+5=55\), not to a fixed total. The TPM values sum to approximately one million (the displayed rounded values sum to one million). Within this specified feature set, gene B has the largest length-adjusted share. Neither measure says how many molecules of that gene were present per cell.

Worked Example: Using FPKM for Paired-End Data

In a hypothetical paired-end sample, a transcript has 1,200 assigned fragments, an appropriate length of 3 kb, and a library containing 8 million mapped fragments. Assume the fragment assignment and transcript length are valid for the calculation.

Here \(C_{ij}=1{,}200\), \(L_i=3\), and \(N_j=8\). Thus \(\mathrm{FPKM}=1{,}200/(3\times8)=1{,}200/24=50\) FPKM.

The numerator is fragments and the denominator is millions of fragments, so the units agree. If one incorrectly used 16 million reads as the denominator while keeping 1,200 fragments in the numerator, the result would be \(1{,}200/(3\times16)=25\). That calculation mixes units and is not the stated FPKM calculation. If the numerator were instead a count of reads, the corresponding depth denominator would need to be mapped reads.

How TPM Relates to RPKM and FPKM

For a fixed sample and feature set, the relationship between TPM and a depth-normalized length measure follows directly by cancellation. For single-end data, write \(r_{ij}=C_{ij}/L_i\) and let \(N_j\) be the library size in millions. Then \(\mathrm{RPKM}_{ij}=r_{ij}/N_j\). Summing over the same features gives \(\sum_{k\in S}\mathrm{RPKM}_{kj}=(\sum_{k\in S}r_{kj})/N_j\). Therefore:

$$ 10^6 \frac{\mathrm{RPKM}_{ij}} {\sum_{k\in S}\mathrm{RPKM}_{kj}} = 10^6 \frac{r_{ij}/N_j}{(\sum_{k\in S}r_{kj})/N_j} = 10^6\frac{r_{ij}}{\sum_{k\in S}r_{kj}} = \mathrm{TPM}_{ij} $$

The same derivation applies to FPKM when counts and depth are both measured in fragments. Consequently, for a fixed sample and the same features, TPM is proportional to the length-adjusted count and has the same ranking as RPKM or FPKM. Its distinctive property is that its values sum to one million over the specified features, not that it removes all differences between samples.

This derivation also explains the limitation of interpreting the sum of RPKM or FPKM values: the sum depends on the sample's depth denominator and the length-adjusted counts. TPM rescales those values by their sum, making the within-sample total fixed. That fixed total is a relative scale, not a measure of total RNA output.

Within-Sample and Cross-Sample Interpretation

Within a sample, TPM describes each feature's share of the total length-adjusted expression assigned to the included features. For example, a TPM of 100,000 means that the feature accounts for one tenth of the sum of length-adjusted rates in that feature set. It does not mean that one tenth of all RNA molecules in each cell come from that feature: extraction, library preparation, sequencing, and the selected feature set all affect what is represented.

RPKM and FPKM adjust each feature for length and library depth, but their total is not fixed across samples. TPM fixes that total within each sample. Thus, TPM values can be convenient for describing relative abundance and comparing the composition of samples, provided the same feature definitions and quantification conventions are used. Still, all three measures are compositional: an increase in the relative contribution of one set of transcripts can reduce the reported relative values of others, even if their absolute amounts have not changed.

Worked Example: A Relative Change Is Not an Absolute Change

Consider two hypothetical samples and a TPM calculation over the same two included transcripts, A and B, each 1 kb long. In sample 1, their counts are 100 and 100; in sample 2, their counts are 100 and 300. Suppose both samples have 1 million mapped reads. For this illustration, assume counts are assigned consistently and the two listed features define the TPM set.

For transcript A, RPKM is \(100/(1\times1)=100\) in both samples. For TPM, the length-adjusted rates in sample 1 are 100 and 100, so A has \(10^6(100/200)=500{,}000\) TPM. In sample 2, the rates are 100 and 300, so A has \(10^6(100/400)=250{,}000\) TPM; B has \(750{,}000\) TPM.

A's count and RPKM are unchanged in this constructed example, while its TPM falls because B contributes a larger share of the included length-adjusted total. This is a change in relative composition, not evidence that the absolute number of A molecules fell. In real data, counts themselves are also affected by sampling and library composition, so absolute abundance claims require suitable measurements and design, not just one of these normalized measures.

Assumptions, Diagnostics, and Common Pitfalls

These calculations are meaningful only if the quantities being combined match. Counts should correspond to the defined features; the length should represent the same feature definition and use the appropriate unit; and the library denominator should count the same unit as the numerator. For TPM, the same feature set and compatible length convention should be used across samples if the goal is to compare the resulting relative profiles.

Before interpreting values, check the following:

  • Read or fragment consistency: confirm whether the counts are reads or paired-end fragments, and use the corresponding mapped-read or mapped-fragment library size.
  • Length and annotation: confirm whether lengths are gene lengths, transcript lengths, or effective lengths. In gene-level analyses, isoforms and overlapping features can make a single gene length definition nontrivial.
  • Feature inclusion: check which features contribute to the TPM denominator. Excluding features, or using different feature sets across samples, changes the relative scale.
  • Count assignment: ambiguous, multi-mapping, or estimated counts can affect both the numerator and TPM denominator. Do not assume that every assigned count is an exact independent observation.
  • Numerical checks: TPM values should sum to approximately one million across the included features, allowing for rounding. RPKM and FPKM have no corresponding fixed-sum check.

A common mistake is to treat TPM as an absolute, cross-sample measure because its values sum to one million in every sample. The wrong reasoning is: “The total is fixed, so a feature's TPM directly measures how much RNA was produced.” The correction is that TPM gives a feature's share of a length-adjusted total within a sample. A change in other features can change that share; TPM does not measure total RNA per cell.

A second pitfall is using TPM, RPKM, or FPKM as if they were raw counts for a differential-expression test. Their length and depth adjustments are useful for expression summaries, but these values do not by themselves model count variability or provide a suitable test of a between-condition change. For differential expression, use an appropriate count-based model with a justified normalization strategy, as in the earlier material on library size factors and count scaling. Also avoid interpreting a difference in normalized values as causal: the measures are descriptive and depend on the data and normalization assumptions.

Choosing and Reporting a Measure

MeasureAdjustment and usual contextKey interpretation limit
RPKMLength-adjusted counts per million mapped single-end readsSum varies across samples; not an absolute abundance scale
FPKMLength-adjusted counts per million mapped paired-end fragmentsMust use fragments consistently; sum varies across samples
TPMLength-adjusted values rescaled to sum to one million over a feature setRelative composition depends on that set; fixed total does not imply fixed absolute RNA

For a reproducible report, state whether the values are gene- or transcript-level, what length definition was used, whether the library units are reads or fragments, and which features formed the TPM denominator. Report the normalization measure as a descriptive scale, not as proof of equal total expression across samples or as a substitute for an inferential model.

Key takeaway: RPKM and FPKM divide counts by feature length and sequencing depth, using reads or fragments consistently. TPM divides by feature length first, then rescales across a stated feature set to sum to one million. These measures describe relative expression; none alone establishes absolute abundance or differential expression.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A single-end sample has 6 million mapped reads. A 2 kb feature has 240 assigned reads. Calculate its RPKM.
  2. In a TPM calculation, a feature has a length-adjusted rate of 80 and the rates across the included set sum to 400. Calculate its TPM and interpret it within that set.
  3. Why is it inconsistent to divide a paired-end fragment count by a library size measured in reads when calculating FPKM?
  4. For a fixed sample and feature set, what is the sum of TPM values, and what does that fixed total not establish?

Solutions. (1) \(240/(2\times6)=20\) RPKM. (2) \(10^6(80/400)=200{,}000\) TPM; the feature contributes one fifth of the included length-adjusted total. (3) The numerator counts fragments while the denominator counts reads, so the units do not match; FPKM uses mapped fragments in both. (4) The TPM values sum to one million, subject to rounding. This establishes a normalized relative total over the chosen features, not an absolute total of RNA molecules per cell or equal total RNA output across samples.

Clinical Biostats