Batch integration: Harmony, scVI, CCA and the failure nobody plots

How to choose an integration method, how to tell over-correction from correction, and the checks that show your biology survived.

Updated 2026-07-31

Do this on your own data: over-correction is only visible when you compare the same data before and after integration. A worked integration with the before/after check side by side: omics.hstgenomics.com/sample-integration.

Want it done rather than explained? We do analysis only — send a count matrix, an h5ad or Seurat object, Cell Ranger output or a public accession and get publication-ready results with the code that produced them, at a fixed price agreed before any work starts: omics.hstgenomics.com/quote.

Integration methods are judged in papers by how well batches mix. That is half a metric. Perfect mixing is trivially achieved by destroying the biological signal, and the plots look better as that happens.

What each method actually does

Harmony iteratively adjusts cell positions in PCA space so that clusters contain balanced proportions from each batch. Fast, works on large datasets, keeps the original expression untouched. Reasonable default for samples of the same tissue processed differently.

Seurat CCA / RPCA anchors finds mutual nearest neighbours between datasets and uses them to transform one onto another. RPCA is the more conservative variant and is the right choice when the datasets share only some cell types — CCA tends to force alignment of populations that do not correspond.

scVI and related deep generative models learn a latent space with the batch as a modelled covariate. Strong when you have many batches and enough cells, and it gives you a probabilistic model to build on. The cost is compute time and less interpretability when something goes wrong.

Doing nothing is an underrated option. If your batches are biological conditions rather than technical artefacts, integration removes exactly what you set out to measure.

The question to ask before running any of them

Is the variable you are correcting technical or biological? Chemistry version, processing day, sequencing run, and hospital of origin are technical. Treatment, genotype, timepoint and tissue site are biological. Correcting for the second kind is not integration, it is deleting your result — and it happens most often when "sample" is used as the batch key and each sample happens to be one condition.

Three checks that catch over-correction

  1. The known-difference test. Pick a population you are confident differs between conditions — proliferating cells in a treated sample, an infiltrating immune population. After integration, is it still separable? If it dissolved, the correction is too strong.
  2. Marker coherence. Cluster markers after integration should still be recognisable. When a cluster's top genes become a bland mixture, the latent space has been smoothed past usefulness.
  3. Batch prediction. Train a simple classifier to predict batch from the corrected embedding. Near-random accuracy plus preserved biology is success; near-random accuracy with dissolved biology is over-correction; high accuracy means the correction did not work at all.

A practical route

Start without integration and look. If cells separate primarily by batch, integrate with Harmony and re-check. If cell types are only partially shared across datasets, prefer RPCA-style anchoring or scVI. Do the differential expression on the uncorrected counts with the batch as a covariate in the model — integrated embeddings are for visualisation and clustering, not for statistics. That last point is where a surprising number of published analyses go wrong.

Need this done rather than explained?

We do analysis only — send a count matrix, an h5ad/Seurat object or a public accession and get publication-ready results with the code that produced them. Fixed price agreed before work starts.

→ Get a fixed quote  ·  See a full sample deliverable

More guides