Batch Effect — Batch Structure Before and After Correction¶
In the app: QC & samples › Batch Effect
Available on RNA projects whose sample annotation has a usable batch column: a Batch column (or another column such as lane or collection date) with at least two levels, a value for every sample, and not coinciding with the groups. Needs at least three samples.
Samples processed on different days, lanes or kits can differ for technical reasons alone — a batch effect. This report asks how much of the sample-to-sample variation follows the batch rather than the experimental groups, and what the samples look like once the batch is removed.

Example output from a demonstration project with synthetic data.
Findings¶
The Findings box always starts with a disclaimer: Computed in the app, for visualisation only. The after panel is limma::removeBatchEffect reproduced in Python — per gene, batch is fitted together with the condition groups by least squares and only the batch part is subtracted, so group differences are kept. Differential expression does not use this matrix: batch belongs in the DESeq2 design as a blocking term (~ batch + condition), never as pre-corrected values.
A note then says which matrix was read (all.vst.tsv), that the PCA uses the top 500 most variable genes, centred (as DESeq2's plotPCA does), computed separately before and after, and — when the pipeline recorded it — the DESeq2 design it used.
Finally the verdict, based on how much of the variance captured by PC1–PC2 the batch explains:
- 50% or more — ⚠️ the batch is a major source of variation: the DESeq2 design must include it as a blocking term.
- 20% to 50% — a moderate batch effect.
- Under 20% — little visible batch effect on the leading components.
It adds how much the groups explain before and after, and warns if group separation fell after correction, which suggests the batch is partly aligned with the groups.
If some annotation columns were not offered because they coincide with the groups, a note names them.
Filters¶
Batch column¶
Which annotation column to treat as the batch. The wizard's Batch column is offered first; any other annotation column with two or more levels and a value for every sample can be chosen instead.
Corrected matrix¶
Shown only when the pipeline delivered its own batch-corrected matrix (all.vst.batchcorrected.tsv). Pipeline-delivered uses the pipeline's correction and batch variable; In-app (this batch column) uses the column chosen above.
Before and after PCA¶
Two PCA plots side by side, PC1 against PC2 with the variance each explains in the axis titles:
- Before — all.vst.tsv — the samples as they are.
- After removing Batch (in-app) — or After pipeline correction (all.vst.batchcorrected.tsv) — the samples with the batch part removed.
Colour shows the group and marker shape shows the batch, so the legend reads Group, Batch (for example ctrl, b1).
Raw data¶
Raw data — Share of PC variance explained (η²)¶
How much of each component's variance each factor explains (η², from 0 to 1), before and after correction.
| Column | Meaning |
|---|---|
| Factor | Batch or Group |
| PC | PC1, PC2, or PC1+PC2 (weighted) — the two combined, each weighted by its share of variance so a minor component cannot overstate a batch effect |
| Before | η² before correction |
| After | η² after correction |
Raw data — Batch-corrected matrix (display only)¶
Download corrected matrix (TSV) saves the corrected values. Do not use these values for differential expression.
Report settings that apply¶
None of the filter settings in the Report settings panel change this report. Appearance sets the plot styling (see Report Settings).
Reading it¶
- Ideally the Before plot separates samples by colour (group), not by shape (batch). If the shapes split the samples, the batch is driving the leading variation.
- After correction, the batch shapes should mix within each group while the groups stay apart.
- A batch effect does not invalidate the results when the batch is in the DESeq2 design: the design accounts for it during testing. Project Summary shows the design the pipeline recorded.
- A batch that coincides with the groups cannot be separated from the treatment by any correction; such columns are not offered.
- To see the pipeline's own corrected matrix on the main PCA, use Batch-corrected VST (display only) in PCA.