Principal component analysis for single and multi-omics tables. Keep it open next to your data: the order of steps, how to read a scores plot, how many components to keep, six traps and a checklist that remembers what you ticked.
Your table has samples and features. PCA finds new axes, each a weighted blend of all features, so that the first axis carries the most variance, the second the most that is left at right angles, and so on.
Samples must be rows. Each dot is the whole profile of one sample squeezed into a few coordinates.
Scores are the dot positions. Use them to see groups, batches, QC samples and outliers.
Loadings are the weights of each feature on an axis. Use them to name what an axis is made of.
PCA does not use group labels. If groups separate, that structure was already in the data.
Run PCA on a complete, transformed, scaled table. This order comes from Episode 5.
| Scaling | What it does | Use when | Watch for |
|---|---|---|---|
| None (raw) | Keeps the original units | Rarely | A few abundant features own PC1. In our simulation the top 10% of features held 96% of PC1. |
| log2 only | Compresses the range | Intensity or count data | Features with large spread still dominate. |
| log2 + Pareto | Divides by the square root of the standard deviation | A common compromise for metabolomics | Still lets high-variance features lead. |
| log2 + autoscale | Every feature gets unit variance | When all features should count equally | Noise features speak as loudly as real ones. |
Scaling changes the question. Choose it before you look at the plot, name it in your methods, and compare at least two. PCA needs a complete table: filter, then impute, first. Counts need a variance stabilizing transform, and compositions need a log-ratio transform.
Go through these six steps in order every time.
| Step | Look at | What it tells you |
|---|---|---|
| 1 Axis labels | The percent on PC1 and PC2 | How much of the total variance the picture holds. Two axes at 17% and 15% hold about a third. |
| 2 QC samples | Pooled QC injections | They should sit in a tight cluster near the centre. If they scatter, the run drifted. |
| 3 Groups | Colour by biological group | Separation along an axis suggests group structure. Overlap does not prove no difference. |
| 4 Batch | Shape by batch, run order, sample type | If a technical factor lines up with an axis, it is a technical effect to fix before testing. |
| 5 Outliers | Hotelling T² ellipse | A sample outside the limit gets checked first. The 95% limit is 2(n-1)/(n-2) × F(0.95, 2, n-2). |
| 6 Loadings | The largest weights on the axis | The features that drive the separation. Their sign shows the direction. |
The scree elbow is a hint. Parallel analysis gives a rule you can defend.
Plot variance explained per component. Components after the bend add little.
Shuffle each feature across samples, run PCA, repeat 200 times and take the 95th percentile per component. Keep components that exceed it.
The first four held 53% of the total variance. The rest were mostly noise.
With n samples you can have at most n minus 1 components. When features far outnumber samples, do not read the late components at all.
Each one produces a confident wrong sentence in a paper.
PCA is unsupervised. A small effect can sit in a later component.
Confirm with a test, such as the differential analysis from Episode 5.
The largest source of variation may be batch, not biology.
Flip an axis and the picture means the same thing.
Variance stabilizing for sequencing counts. Log-ratio for compositions.
At most n minus 1 components exist. Do not read the rest.
Tick as you go. Your ticks stay in this browser.
This series is built from the questions researchers actually ask. Tell us where you got stuck and what you want next. It takes under a minute.
Turn on JavaScript to send your questions, or write to wael@omvitalis.com.
Open each one through its DOI. Check the details against the publisher page before you cite.