Lesson 7 of 10
Module 1 · Understanding omics
RNA-seq is the most widely used omics assay in cancer research. It counts transcripts gene by gene, and with the right statistics it shows what changes between tumour and normal tissue.
From tissue to a count table
Bulk RNA-seq means that the RNA of a whole piece of tissue, millions of cells, is extracted and measured together. The steps are these:
- RNA is extracted, and abundant ribosomal RNA is removed or messenger RNA selected.
- It is copied into DNA, fragmented and sequenced (How sequencing works).
- Reads are mapped, and reads falling in each gene are counted.
The result is a count matrix: one row per gene, one column per sample. About 20,000 protein-coding genes means about 20,000 rows.
This is the count table promised in The central dogma, as data, and the library and sequencing steps are the ones from How sequencing works. Mapping RNA reads has one extra twist. A mature mRNA has had its introns cut out, so a single read can span the join between two exons. Aligners built for RNA-seq allow for these gaps. Some faster tools skip full alignment and instead match reads directly against a list of known transcripts, then estimate how many reads came from each.
Counting is not always clean. A read that matches several places equally well, for example in a family of near-identical genes, or a read that falls where two genes overlap, is often left uncounted by default. This is one reason a gene's count is an estimate of its activity, not an exact tally of molecules.
Why the first step matters
Most of the RNA in a cell is ribosomal RNA (rRNA), the RNA that forms part of the ribosome, the machine that builds proteins. It tells you little about which genes are in use, so sequencing it would waste most of the reads. Messenger RNA (mRNA), the copy of a gene that is translated into protein, is a small share of the total. Two strategies deal with this. Most mRNAs end in a long run of A letters, the poly(A) tail, so they can be fished out with beads carrying strings of T, which pair with A. The alternative is to remove the rRNA and keep everything else, which also keeps RNAs without a tail and copes better with damaged samples.
A matrix here means a table of numbers in rows and columns. Each cell of the table holds one whole number: how many reads from that sample were assigned to that gene. A study of 12 samples would give a matrix of about 20,000 rows by 12 columns. The same layout is used in almost every later step of the analysis.
On real data, the matrix is full of zeros and small numbers. Many genes are not active in a given tissue, so they collect no reads, while a few highly active genes collect hundreds of thousands. Genes with very low counts across all samples carry almost no information and are usually filtered out before testing, which also reduces the number of tests.
Why raw counts mislead
Samples are never sequenced to exactly the same depth. A sample with twice as many reads shows about twice the count for every gene, even if nothing biological changed. Counts must be normalised.
Here depth means the total number of reads in a sample, sometimes called the library size. Depth varies for practical reasons: how much RNA went into the library, how the samples were pooled, how a run performed. None of these has anything to do with the biology. Normalising means rescaling each sample so that their counts can be compared fairly.
One pitfall catches many beginners. Normalised values such as CPM and TPM are for plotting and for comparing samples by eye, but tools for differential expression, such as DESeq2 and edgeR, expect the raw counts as input. They estimate their own normalisation inside the model. Giving them CPM or TPM instead throws away the information about how many reads each number rests on, which the statistics need.
Worked example · counts per million
Sample A: 600 ÷ 30,000,000 × 10⁶ = 20 CPM
Sample B: 600 ÷ 15,000,000 × 10⁶ = 40 CPM
Equal raw counts, but the gene is twice as abundant in sample B. TPM also corrects for gene length; tools such as DESeq2 use more robust size factors.
Step by step. For sample A, divide the gene's count by the sample's total: 600 ÷ 30,000,000 = 0.00002. That is the gene's share of all reads. Multiplying by 1,000,000 turns the tiny share into a readable number: 0.00002 × 1,000,000 = 20. For sample B: 600 ÷ 15,000,000 = 0.00004, and 0.00004 × 1,000,000 = 40. The name says what the number is: out of every million reads in the sample, 20 (or 40) came from this gene.
What the answer means, and the two refinements. CPM fixes depth, but not everything. A long gene produces more fragments than a short one at the same activity, so it collects more reads. TPM (transcripts per million) first divides each count by the gene's length and then rescales, which makes genes within one sample comparable. CPM can also be pushed around by a few extremely active genes that take up a large share of a sample's reads. Size factors, as used by DESeq2, avoid this by comparing each sample with a typical sample, gene by gene, and taking the median ratio, so a few unusual genes have little effect. For comparing a gene between samples, which is what differential expression does, size factors are the usual choice.
The median-of-ratios size factors described here were introduced by Anders and Huber (2010, Genome Biology) and are used in DESeq2 (Love, Huber and Anders 2014, Genome Biology). The Benjamini–Hochberg adjustment in the next section comes from Benjamini and Hochberg (1995, Journal of the Royal Statistical Society, Series B).
Size factors rest on one assumption: most genes do not change between samples. If a treatment raises the activity of nearly every gene, normalisation will quietly hide that global shift. Experiments that expect such changes add known amounts of artificial RNA, called spike-ins, as a fixed yardstick. When citing, name the normalisation method as well as the tool.
Differential expression
Differential expression analysis asks, gene by gene, whether the level differs between two groups, for example tumour and normal. Each gene gets two numbers:
- Fold change: how much higher or lower a gene is, on a log2 scale. A log2 fold change of 2 means four times higher; −1 means half.
- Adjusted p-value: the evidence, corrected for testing thousands of genes.
Why use log2? On a plain scale, doubling is 2 and halving is 0.5, which look lopsided. On a log2 scale, doubling is +1 and halving is −1, so changes up and down are the same size. Each step of 1 is one more doubling: +3 means 2 × 2 × 2 = 8 times higher. In the worked example above, 40 CPM against 20 CPM is a ratio of 2, a log2 fold change of 1.
A p-value is the probability of seeing a difference at least this large if the gene did not really change. A small p-value means the difference would be surprising by chance alone. On its own it says nothing about how big or how important the change is.
Test 20,000 genes at p < 0.05 when none truly change, and about 1,000 still pass by chance. Methods such as Benjamini–Hochberg control the false discovery rate instead.
The arithmetic is 20,000 × 0.05 = 1,000: a threshold of 0.05 lets through 5% of the genes that did not change. The false discovery rate (FDR) is the expected share of false results among the genes you call significant. If 400 genes pass at an FDR of 0.05, you should expect about 400 × 0.05 = 20 of them to be false. The Benjamini–Hochberg method ranks the p-values from smallest to largest and raises each one according to its rank and the number of tests; the result is the adjusted p-value. Report and filter on the adjusted value, not the raw one.
Before any test, it is worth looking at how the samples relate to each other. A common first plot is a principal component analysis (PCA), which squeezes the thousands of genes into two or three summary axes and draws each sample as a dot. Replicates of the same group should sit near one another. A sample far from its group may be an outlier, and samples that split by processing date rather than by group point to a batch effect.
The output of a differential expression tool is a results table with one row per gene. In DESeq2, for example, the columns include baseMean (the average normalised count), log2FoldChange, pvalue and padj, the adjusted p-value. Fold changes for genes with few reads are noisy, so tools offer a shrinkage step that pulls unreliable fold changes towards zero. This makes ranking genes by the size of their change more trustworthy.
Reading a volcano plot: the horizontal axis is the log2 fold change, with genes higher in one group on the right and lower on the left. The vertical axis is −log10 of the adjusted p-value, so an adjusted p-value of 0.01 sits at 2 and 0.001 at 3. The genes worth a closer look are in the upper corners: large changes with strong evidence. A gene high up but near the centre has a small change measured very reliably, which may not matter biologically. A gene far out but low down has a large change with weak evidence, often from a gene with very few reads.
Go deeper: why replicates vary more than chance predicts
If reads were scattered purely at random, the spread of a gene's count would follow a Poisson distribution, in which the variance equals the mean. A gene averaging 100 reads would then vary by about ±10 (the square root of 100) between samples.
Between different patients, the spread is much larger, because people genuinely differ. Tools such as DESeq2 and edgeR therefore use the negative binomial distribution, which adds an extra term for this biological spread, called dispersion. With a dispersion of 0.1, the variance becomes 100 + 0.1 × 100² = 1,100, a standard deviation of about 33, not 10. Estimating dispersion needs replicates. With only three per group, one gene's spread is poorly known, so these tools borrow information from thousands of genes with similar counts. That sharing is what makes small RNA-seq studies workable at all.
Good design comes first
No statistics can rescue a weak design. Biological replicates (different patients or animals) are what let you generalise; technical replicates of one sample cannot. Process groups together: if all tumours are sequenced on Monday and all normals on Friday, the batch and the biology cannot be separated.
A technical replicate is the same sample measured twice. It shows how noisy the measurement is, but not how much patients differ from one another, and that difference is what a conclusion about "tumours" has to survive. Three biological replicates per group is a common minimum for RNA-seq, and more give much better power to detect modest changes.
A batch is any group of samples handled together: extracted on the same day, by the same person, with the same kit, or sequenced on the same run. Batches leave small systematic differences in the data. The remedy is to mix the groups across batches, for example half tumours and half normals on each run. Then the batch effect can be measured and corrected for. If every tumour is in one batch, there is no way to tell whether a difference is biology or handling.
Two further design choices make a big difference. When tumour and normal tissue come from the same patients, the design is paired, and including the patient in the statistical model removes much of the person-to-person variation. And every sample needs a record of how it was handled: date, kit, operator, sequencing run. Without that table, called the sample metadata, batch effects cannot be checked at all.
Bulk RNA-seq also has a built-in limit. Because it averages millions of cells, a gene can appear to rise simply because the tissue contains more of the cells that express it, not because any cell changed. A tumour sample with more immune cells will show more immune genes. The next lesson, Single-cell and spatial biology, shows how measuring cells one at a time separates these two explanations.
Key point
Before trusting a list of genes, ask: how many biological replicates, how was it normalised, and was the p-value adjusted?
Apply the questions to a second case. A study compares one tumour with one normal sample, each sequenced three times, and reports 2,000 genes with p < 0.05. It has one biological replicate per group, so any difference could be particular to those two people. With 20,000 genes tested, about 1,000 of the 2,000 could pass by chance even if nothing had changed. Until adjusted p-values and more patients are reported, the list is a starting point, not a result.
Further reading · Module 1Sources for this module and the rest of the course are gathered on one page. · All reading for this course
Check your understanding
1. 250 reads in a library of 25 million. What is the CPM?
2. Testing 10,000 genes at p < 0.05 with no real changes, about how many pass by chance?
3. All tumours were sequenced in one batch and all normals in another. What is the problem?
Up next
Lesson 8
Single-cell and spatial biology