thebench.bio #1 Ecosystem for the Bio-Tech Industry
All RNA-seq questions

Question 13 of 20 Intermediate Practical

How would you use a PCA plot to check RNA-seq samples before differential expression testing?

Short answer

Transform counts with a variance-stabilizing transformation, plot the first principal components and color the samples by every recorded variable, not only treatment. Look for outliers, swapped labels and batch structure, then decide whether the design needs another term.

Why

Principal component analysis projects samples onto the few directions that explain most of the variation between them. On raw counts, a handful of very highly expressed genes would dominate those directions, so DESeq2 recommends the variance-stabilizing transformation (vst) or rlog first. Both put data on a roughly log2 scale while damping the noise of low counts.

With blind=TRUE the transformation ignores the design, which suits a first, unbiased look. The Bioconductor RNA-seq workflow uses plotPCA on vst data and colors samples by treatment and by cell line. The airway data it uses has four cell lines, each treated and untreated with dexamethasone, and the plot shows both effects.

That is the signal to model cell line in the design. The DESeq2 documentation also notes that vst does not remove batch effects. If samples cluster by batch on the plot, the batch belongs in the design formula, and limma's removeBatchEffect is for making cleaner pictures, not for producing input to the test.

How to work it through

  1. Build the DESeqDataSet from raw counts and run vst with blind set to TRUE.
  2. Plot the first two principal components colored by treatment.
  3. Repeat the plot colored by donor, batch, extraction date and RNA quality.
  4. Note the percent of variance on each axis, since a small PC1 means no dominant structure.
  5. Investigate any sample far from its replicates by checking its library size, mapping rate and labels.
  6. Add any covariate that clearly structures the samples to the design before testing.

An example

Take eight samples from four donors, each treated and untreated. On the vst PCA, PC1 explains 41 percent of variance and splits treated from untreated, and PC2 explains 23 percent and separates donors. One treated sample sits among the untreated ones.

Its library size and mapping rate are normal, but the lab sheet shows two tubes from the same donor were relabeled on the day. The swap is corrected, and the design becomes ~ donor + treatment.

Where the answer stops holding

PCA shows only the largest sources of variance. A real treatment effect confined to a few genes may not appear on the first components and can still be strongly significant. A sample that looks like an outlier can be biologically genuine, so removal needs a documented technical reason.

Coloring by a covariate shows association, not cause.

A strong answer covers

  • Use vst or rlog rather than raw counts
  • Color by every recorded covariate, not only treatment
  • Check outliers against technical metrics and sample records
  • Structure seen on the plot goes into the design formula
  • Batch removal on transformed data is for visualization only

Common mistakes

  • Running PCA on raw counts so that a few abundant genes drive the plot
  • Dropping an outlier sample without a technical reason
  • Passing batch-corrected transformed values into DESeq2 as input