OmVitalis Academy ▶  Watch Episode 6All guidesCourseEnroll free
PCA Reference Guide
Omics Stats Decoded · Episode 6 · OmVitalis Systems

PCA Reference Guide

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.

What PCA does

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.

Rows

One sample, one dot

Samples must be rows. Each dot is the whole profile of one sample squeezed into a few coordinates.

Scores

Where samples sit

Scores are the dot positions. Use them to see groups, batches, QC samples and outliers.

Loadings

Which features pull

Loadings are the weights of each feature on an axis. Use them to name what an axis is made of.

Unsupervised

It never sees your groups

PCA does not use group labels. If groups separate, that structure was already in the data.

Preprocessing decides the picture

Run PCA on a complete, transformed, scaled table. This order comes from Episode 5.

  1. Filter
  2. log2
  3. Normalize
  4. Impute
  5. Scale
  6. PCA
ScalingWhat it doesUse whenWatch for
None (raw)Keeps the original unitsRarelyA few abundant features own PC1. In our simulation the top 10% of features held 96% of PC1.
log2 onlyCompresses the rangeIntensity or count dataFeatures with large spread still dominate.
log2 + ParetoDivides by the square root of the standard deviationA common compromise for metabolomicsStill lets high-variance features lead.
log2 + autoscaleEvery feature gets unit varianceWhen all features should count equallyNoise 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.

Reading a scores plot

Go through these six steps in order every time.

StepLook atWhat it tells you
1 Axis labelsThe percent on PC1 and PC2How much of the total variance the picture holds. Two axes at 17% and 15% hold about a third.
2 QC samplesPooled QC injectionsThey should sit in a tight cluster near the centre. If they scatter, the run drifted.
3 GroupsColour by biological groupSeparation along an axis suggests group structure. Overlap does not prove no difference.
4 BatchShape by batch, run order, sample typeIf a technical factor lines up with an axis, it is a technical effect to fix before testing.
5 OutliersHotelling T² ellipseA sample outside the limit gets checked first. The 95% limit is 2(n-1)/(n-2) × F(0.95, 2, n-2).
6 LoadingsThe largest weights on the axisThe features that drive the separation. Their sign shows the direction.

How many components?

The scree elbow is a hint. Parallel analysis gives a rule you can defend.

Scree plot

Look for the elbow

Plot variance explained per component. Components after the bend add little.

Parallel analysis

Beat chance

Shuffle each feature across samples, run PCA, repeat 200 times and take the 95th percentile per component. Keep components that exceed it.

Our simulation

4 components pass

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.

Six traps

Each one produces a confident wrong sentence in a paper.

Trap 1

No separation is not no difference

PCA is unsupervised. A small effect can sit in a later component.

Trap 2

Separation is not proof

Confirm with a test, such as the differential analysis from Episode 5.

Trap 3

Variance is not importance

The largest source of variation may be batch, not biology.

Trap 4

The sign is arbitrary

Flip an axis and the picture means the same thing.

Trap 5

Counts need a transform first

Variance stabilizing for sequencing counts. Log-ratio for compositions.

Trap 6

Few samples, many features

At most n minus 1 components exist. Do not read the rest.

Checklist

Tick as you go. Your ticks stay in this browser.

0 of 0

Before

During

After

Shape the next lesson

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.

References

Open each one through its DOI. Check the details against the publisher page before you cite.

  1. Two page intuitionRingnér M. What is principal component analysis? Nat Biotechnol 2008;26:303-304.doi:10.1038/nbt0308-303
  2. Short and visualLever J, Krzywinski M, Altman N. Points of Significance: Principal component analysis. Nat Methods 2017;14:641-642.doi:10.1038/nmeth.4346
  3. Practical tutorialBro R, Smilde AK. Principal component analysis. Anal Methods 2014;6:2812-2831.doi:10.1039/C3AY41907J
  4. The rigorous reviewJolliffe IT, Cadima J. Principal component analysis: a review and recent developments. Phil Trans R Soc A 2016;374:20150202.doi:10.1098/rsta.2015.0202
  5. Modern overviewGreenacre M, et al. Principal component analysis. Nat Rev Methods Primers 2022;2:100.doi:10.1038/s43586-022-00184-w
  6. Scaling choicesvan den Berg RA, et al. Centering, scaling, and transformations: improving the biological information content of metabolomics data. BMC Genomics 2006;7:142.doi:10.1186/1471-2164-7-142
  7. Parallel analysisHorn JL. A rationale and test for the number of factors in factor analysis. Psychometrika 1965;30:179-185.doi:10.1007/BF02289447
  8. Imputation, Ep3 and Ep5Wei R, et al. Missing value imputation approach for mass spectrometry-based metabolomics data. Sci Rep 2018;8:663.doi:10.1038/s41598-017-19120-0