Introduction
A multi-batch single-cell RNA-seq dataset mixes two kinds of variation. Cells differ because they are in different biological states, and they differ because they were captured by different protocols, at different depths, from different donors. An integration method must return one representation in which comparable cells from different batches are neighbours while distinct cell states stay apart, and here it must do so with no cell-type labels at all, neither for training nor for choosing a model.
The difficulty is that the two kinds of variation are confounded in exactly the places that matter. If two batches contain the same populations in different proportions, subtracting each batch's mean moves cells away from their true counterparts. If a population exists in only one batch, any method that forces the batches to overlap will fold it onto something else. And if a technical effect follows a genuine biological direction, a method that protects biological directions will leave it in place. The field's answers trade these risks in different ways: linear models of batch effects with empirical Bayes shrinkage [1], matching mutual nearest neighbours [2, 3], anchors between batches [4, 5], iterative soft clustering with per-cluster corrections [6], deep generative models [7], and further methods for substantial batch effects, anchor-free integration and a shared cell-state landscape [8, 9, 10]. Pretrained single-cell transformers offer a third route, a representation learned elsewhere [11, 12], and the starter of this task returns the released Geneformer model's own mean-pooled embedding without any adaptation.
Our view is that without labels, the only reliable arbiter between technical and biological variation is a second, independent measurement of the same cells. A count matrix contains several: disjoint panels of genes, and the two halves one obtains by splitting each cell's molecules at random. We build every decision of the method, how to scale counts, which directions to keep, how far to move cells, out of agreement between such measurements.
Method
The method works directly on raw counts and returns at most 128 coordinates per cell. It never calls Geneformer or scGPT. Its stages are a depth-invariant count transform, a latent space of reproducible within-batch directions, a local registration of batches, an evidence test that gates how much of that registration is applied, and two refinements of the metric driven by independent measurements.
A count transform whose expectation does not depend on depth
The usual of a count in a cell of library size still depends on : a cell sequenced more deeply has a different expected value at the same expression rate. We instead ask what a count would have looked like had the cell been sequenced to a common depth , and report the expected harmonic number under that binomial thinning. For a count and ,
Because a Poisson count with mean thinned by is a Poisson count with mean , the expectation of is a function of alone. It behaves like a logarithm at high counts, and for (and ) we use the asymptotic form . The target is the lower quartile of library sizes, capped at 12000; a ratio above 1.5 (a cell shallower than the target) is handled with an explicit correction rather than extrapolated. The same construction gives each entry's shot-noise variance through the Poisson Poincaré bound, estimated without bias by .
def _harmonic_values(n, ratio):
"""Expected harmonic count under thinning to a common effective exposure.
For a Poisson count with mean L*lambda, thinning by T/L makes the
expectation a function of T*lambda alone. Integrating over the
thinning probability gives a smooth, logarithmic response at high rates.
"""
from scipy.special import digamma
p = np.minimum(ratio, 1.5).astype(np.float32, copy=False)
v = np.empty_like(p)
one = n == 1
two = n == 2
v[one] = p[one]
v[two] = p[two] * (2 - 0.5 * p[two])
high = (n * p >= 9) & ~one & ~two
v[high] = digamma(n[high] + 1) + np.float32(np.euler_gamma) + np.log(p[high])
low = ~(one | two | high)
interp = low & (p <= 1)
if interp.any():
nn = n[interp]
pp = p[interp]
vals = np.zeros_like(pp)
# Gauss-Legendre quadrature on [0,p] for (1-(1-s)^n)/s.
for u, w in zip(
(0.03376524, 0.16939531, 0.38069041, 0.61930959, 0.83060469, 0.96623476),
(0.08566225, 0.18038079, 0.23395697, 0.23395697, 0.18038079, 0.08566225),Before the transform, counts that are read counts rather than molecule counts are brought back to molecules: for each batch, the number of reads per molecule is estimated from sparsely detected genes, refined cell by cell from two independent gene panels, and divided out.
Directions that recur across batches
Genes are ranked within each batch by their variance in excess of the estimated shot noise, and the 3200 highest-ranked genes form the panel. The shot-noise variances of cells and genes are then equilibrated by alternating scaling (nine rounds, with cell precisions clipped to ), so that no gene or cell dominates the subspace through counting noise alone. The subspace is learned from within-batch variation: every batch is centred before a randomised SVD, so a pure batch offset cannot create a direction.
Not every within-batch direction is shared. For each batch with within-batch covariance , we let each eigen-direction vote in proportion to how far it rises above a noise threshold ,
and keep the leading directions of the pooled covariance after shrinking it towards the directions with many votes. A direction that appears in only one batch is down-weighted before it can shape the space.
Local registration of batches
In this space we register batches locally. Cells are softly assigned to up to 160 states. Within each state we estimate the conditional mean of every batch and a local precision from the pooled within-state scatter, shrunk towards a multiple of the identity (an oracle-approximating shrinkage) and capped so that high-variance directions, which within a state are most likely biological, receive less precision. The batch intercepts then solve a generalised least-squares problem across all states at once,
which we solve by preconditioned conjugate gradients. Several states with differently oriented biological variation can identify a translation that any single state leaves ambiguous. What remains of each batch's local deviation is kept only to the extent that its energy exceeds the sampling noise of the two conditional means, smoothed across neighbouring states, and subtracted from the cells; the whole procedure is repeated seven times.
for it in range(7):
dist = _dist(z @ a, c)
local = dist.topk(min(4, k), largest=False).values
temp = ((local[:, -1] - local[:, 0]) / 3).median().clamp_min(1e-6)
r = torch.softmax(-dist / temp, dim=1)
mass = torch.stack([r[ii].sum(0) for ii in rows])
means = torch.stack([r[ii].T @ xx for ii, xx in zip(rows, blocks)]) / mass[:, :, None].clamp_min(
1e-6
)
met, noise = _local_precision(u, r, mass, means)
cap = max(8.0, len(u) / (k * len(b)))
weight = mass / (1 + mass / cap)
shift = _gls_offset(means, weight, met)
base = ((means - shift[:, None]) * weight[:, :, None]).sum(0) / weight.sum(0)[:, None].clamp_min(
1e-7
)
err = means - shift[:, None] - base
normal = torch.einsum("bkd,kde->bke", err, met)
other = (mass.sum(0)[None, :] - mass).clamp_min(0)
support = mass * other / (mass + other).clamp_min(1e-7)
# Shrink deviations whose transverse energy is explained by
# uncertainty in the source and target conditional means.
energy = normal.square().sum(2) * support
reliable = (1 - noise[None, :] / energy.clamp_min(1e-7)).clamp(0, 1)
ds = _dist(base @ a, base @ a)
bw = ds.topk(min(4, k), largest=False).values[:, -1].clamp_min(1e-5)
smooth = torch.exp(-2 * ds / torch.sqrt(bw[:, None] * bw[None, :]))
precision = support * reliable
interaction = (smooth[None] @ (precision[:, :, None] * normal)) / (
(support @ smooth.T)[:, :, None] + 3.0
)
field = shift[:, None] + interaction
for j, ii in enumerate(rows):
z[ii] = blocks[j] - r[ii] @ field[j]
c = (r.T @ (z @ a)) / r.sum(0)[:, None].clamp_min(1e-7)A second path additionally models a multiplicative capture factor per gene and batch, maps the expected expression change it causes through the same harmonic transform into the latent space, and registers again. The two paths are blended with a strength chosen by held-out genes: we build the space without up to 1400 randomly held-out genes, and for each candidate strength measure how well a cell's held-out genes are predicted from its 24 nearest neighbours in every other batch. The strength with the largest gain over no blending is used.
d = min(64, guide.shape[1], len(rows))
basis = _CountSpace().fit(guide, bb, d, seed, device)
a, b = _field_path(guide, bb, basis, seed, device)
y = xx[:, test]
grid = np.array([0, 0.25, 0.5, 0.75, 1.0, 1.25])
curve = np.stack([_contrast_information(a + float(t) * (b - a), y, bb, device) for t in grid])
_, nn = np.unique(bb, return_counts=True)
valid = np.all(np.isfinite(curve), axis=0)
if not valid.any():
return np.zeros(len(labels), dtype=np.float32)
curve = curve - curve[:1]
weights = np.sqrt(nn[valid])
weights /= weights.sum()
mean = curve[:, valid] @ weights
return np.full(len(labels), grid[np.argmax(mean)], dtype=np.float32)An evidence test that gates the correction
Registration is applied only as far as there is evidence that batches measure expression differently. To get that evidence we form metacells in each batch of at least 80 cells (up to twelve such batches) from two random halves of its cells, split the genes into two folds, and predict each metacell's expression on one fold by a local affine combination of metacells from other batches, located with the other fold. Agreement between the residuals of the two halves measures a reproducible difference in measurement law. A null for the same statistic comes from nine splits of the batch against itself, at random and along random axes, matched for how far the prediction had to extrapolate; the excess over the null is graded through an error function into a degree in . The median over the tested batches is the global evidence ; when fewer than two batches can be tested, and the full registration is applied. When at least three batches are tested, the same test is also run for every pair of them, so that a difference confined to a few batches is not averaged away; the pairwise discrepancies couple the batches' displacement fields through a graph Laplacian, and a per-state estimate revises the magnitude of each cell's displacement. Without pairwise evidence the corrected position, before that per-state revision, is
if evidence < 0.999 or pair is not None:
basis = _restore_population_variance(basis, counts, batch, evidence, seed, device, pair)
raw = basis.transform(counts)
if evidence > 0 or pair is not None or (state is not None and np.any(state[:, 0] > 0)):
strength = _learn_strength(counts, batch, seed, device)
a, b = _field_path(counts, batch, basis, seed, device)
_, inv = np.unique(batch, return_inverse=True)
aligned = a + strength[inv, None] * (b - a)
if pair is None:
z = raw + np.float32(evidence) * (aligned - raw)
else:
z = _relative_field(raw, aligned, batch, pair, seed, device)When the evidence is incomplete, between-batch mean differences that the within-batch subspace cannot see are added back to the subspace in proportion to (or, with pairwise evidence, to the pairwise agreement), so that a population present mostly in one batch is not lost from the representation.
Refining the metric with independent measurements
After a local posterior-mean denoising step, whose shrinkage is computed from each cell's estimated shot noise and a debiased spiked-covariance model per local chart, two further steps adjust the metric of the space.
First, we use the frozen SCimilarity encoder [13] as an expression prior, but only through what two independent measurements of the same cell agree on. We split every molecule of a cell between two halves with probability 0.5, which for Poisson counts gives two independent measurements of the same cell, encode both halves, and keep the directions of the encoder's output whose within-batch cross-covariance between the halves is largest. A linear metric on our coordinates and a coupling to these prior features are then learned (120 Adam steps, learning rate 0.005) so that a cell's neighbours, searched only among cells of other batches, predict the other half's native coordinates; the metric is selected on up to 900 held-out cells. Where the encoder cannot be used, the same objective is run with two disjoint gene panels instead.
rng = np.random.default_rng(seed + 888)
take = _sample_batch(batch, 6400, rng)
x = counts[take].tocsr()
one = x.astype(np.float32, copy=True)
one.data = rng.binomial(one.data.astype(np.int64), 0.5).astype(np.float32)
one.eliminate_zeros()
two = (x - one).tocsr()
part = [one, two]
native = [torch.as_tensor(basis.transform(v), device=device) for v in part]
pp = [_prior_features(v, prior, device) for v in part]
keys, inv = np.unique(batch, return_inverse=True)
sub = inv[take]
local = [v.clone() for v in pp]
size = np.bincount(sub, minlength=len(keys))
weights = torch.as_tensor((1 / np.sqrt(size[sub])).astype(np.float32), device=device)
for j in np.flatnonzero(size):
ii = np.flatnonzero(sub == j)
for v in local:
v[ii] -= v[ii].mean(0)
cross = local[0].T @ (weights[:, None] * local[1]) / weights.sum()
e, rot = torch.linalg.eigh(0.5 * (cross + cross.T))
rot = rot[:, -min(d, rot.shape[1]) :]
if float(e[-1]) <= 1e-9:
return _predict_from_other_genes(z, counts, batch, basis, seed, device)
reports = [v @ rot for v in pp]
zz = torch.as_tensor(z, device=device)
full = _prior_features(counts, prior, device) @ rot
full = _conditional_prior(zz, full, take, inv, seed)
with torch.enable_grad():
a, c = _multiview_metric(zz[take], full[take], native, reports, sub, seed)
return (zz @ a + full @ c).cpu().numpy()Second, up to 64 further coordinates encode nonlinear expression responses along the manifold: held-out gene panels are regressed on soft state memberships separately in two disjoint halves of the batches (of the cells, when there are fewer than four batches), and only the cross-product of the two fits, the part of the response that replicates, enters the metric.
When batches are too small
A -dimensional within-batch covariance needs more than cells. When at least four batches are present, the average reliability is below and the dataset is not tiny, the method switches to a hierarchical variant: small batches pool their covariance estimates, batches are grouped into recurring protocol families by Ward clustering whose number of clusters is chosen by cross-validation on held-out genes and cell halves, the registration, gated by the global evidence test, runs between families, and each batch's private offset is estimated from its other cells only, so a batch of one cell receives no offset.
def _integrate_counts(counts, batch, max_dim, seed, device, prior):
if min(counts.shape) == 0:
return np.zeros((counts.shape[0], 1), dtype=np.float32)
d = min(max_dim, 64)
_, size = np.unique(batch, return_counts=True)
# A covariance in d coordinates needs more than d independent measurements.
# Pool across reproducibly similar protocols when most donor covariances
# lack this information.
if (
len(size) >= 4
and np.mean(size / (size + d)) < 1 / 3
and len(batch) >= 80
and counts.shape[1] >= 12
):
return _scarce_integration(counts, batch, d, max_dim, seed, device, prior)
basis = _CountSpace().fit(counts, batch, d, seed, device)
return _transfer_integrate(counts, batch, basis, seed, device, prior, max_dim)When the cells to embed are not the cells seen at fit time, they are integrated jointly with a sample of retained fit cells and only their rows are returned. The configuration has no per-setting constants.
Results
| Method | ① | ② | ③ | ④ | ⑤ | ⑥ | ⑦ | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | Bio-conservation ↑ | Batch-integration score ↑ | |
| GPT-6.2 Astra | 0.793 | 0.540 | 0.734 | 0.489 | 0.701 | 0.409 | 0.788 | 0.686 | 0.715 | 0.458 | 0.651 | 0.528 | 0.733 | 0.573 |
| Frozen Geneformer | 0.548 | 0.315 | 0.641 | 0.417 | 0.639 | 0.365 | 0.525 | 0.504 | 0.674 | 0.461 | 0.612 | 0.426 | 0.640 | 0.408 |
| Constant embedding | 0.350 | 0.440 | 0.357 | 0.447 | 0.342 | 0.443 | 0.349 | 0.439 | 0.369 | 0.424 | 0.375 | 0.425 | 0.360 | 0.427 |
| Random-target MLM | 0.389 | 0.252 | 0.335 | 0.303 | 0.332 | 0.342 | 0.349 | 0.325 | 0.303 | 0.326 | 0.306 | 0.311 | 0.317 | 0.366 |
| HVG + PCA | 0.723 | 0.425 | 0.698 | 0.476 | 0.684 | 0.290 | 0.706 | 0.543 | 0.720 | 0.451 | 0.660 | 0.476 | 0.691 | 0.414 |
| Harmony | 0.894 | 0.757 | 0.760 | 0.694 | 0.708 | 0.501 | 0.750 | 0.738 | 0.707 | 0.537 | 0.628 | 0.542 | 0.743 | 0.583 |
| Scanorama | 0.822 | 0.686 | 0.766 | 0.678 | 0.677 | 0.381 | 0.779 | 0.654 | 0.722 | 0.494 | 0.641 | 0.429 | 0.692 | 0.578 |
| scVI | 0.847 | 0.756 | 0.747 | 0.720 | 0.677 | 0.521 | 0.791 | 0.751 | 0.732 | 0.573 | 0.649 | 0.580 | 0.772 | 0.676 |
| Geneformer, continued MLM | 0.545 | 0.342 | 0.624 | 0.374 | 0.630 | 0.325 | 0.623 | 0.451 | 0.702 | 0.432 | 0.617 | 0.416 | 0.626 | 0.346 |
| scGPT, ECS + DAB | 0.726 | 0.545 | 0.742 | 0.639 | 0.725 | 0.469 | 0.766 | 0.676 | 0.705 | 0.490 | 0.639 | 0.547 | 0.742 | 0.607 |
| CLEAR | 0.561 | 0.340 | 0.642 | 0.398 | 0.679 | 0.333 | 0.628 | 0.505 | 0.699 | 0.410 | 0.628 | 0.442 | 0.648 | 0.366 |
| CONCORD | 0.803 | 0.685 | 0.697 | 0.642 | 0.656 | 0.532 | 0.750 | 0.647 | 0.683 | 0.554 | 0.626 | 0.565 | 0.789 | 0.696 |
| sysVI | 0.858 | 0.691 | 0.710 | 0.663 | 0.714 | 0.488 | 0.757 | 0.651 | 0.707 | 0.494 | 0.648 | 0.539 | 0.748 | 0.585 |
| scCRAFT | 0.826 | 0.822 | 0.753 | 0.720 | 0.700 | 0.574 | 0.784 | 0.792 | 0.709 | 0.584 | 0.621 | 0.602 | 0.667 | 0.632 |
| scCobra | 0.806 | 0.720 | 0.744 | 0.675 | 0.682 | 0.479 | 0.776 | 0.681 | 0.693 | 0.522 | 0.640 | 0.528 | 0.708 | 0.613 |
| DRVI | 0.827 | 0.721 | 0.735 | 0.683 | 0.645 | 0.477 | 0.789 | 0.743 | 0.734 | 0.526 | 0.647 | 0.543 | 0.771 | 0.683 |
| VICReg | 0.631 | 0.577 | 0.702 | 0.617 | 0.424 | 0.462 | 0.788 | 0.727 | 0.660 | 0.560 | 0.602 | 0.573 | 0.728 | 0.635 |
| ComBat | 0.838 | 0.712 | 0.713 | 0.572 | 0.665 | 0.481 | 0.777 | 0.655 | 0.698 | 0.492 | 0.641 | 0.531 | 0.677 | 0.665 |
| SCA | 0.721 | 0.498 | 0.659 | 0.408 | 0.677 | 0.327 | 0.744 | 0.574 | 0.718 | 0.434 | 0.651 | 0.474 | 0.674 | 0.508 |
| SCALEX | 0.641 | 0.546 | 0.568 | 0.541 | 0.563 | 0.499 | 0.664 | 0.615 | 0.529 | 0.466 | 0.502 | 0.450 | 0.518 | 0.485 |
| LIGER | 0.720 | 0.669 | 0.658 | 0.620 | 0.585 | 0.482 | 0.737 | 0.738 | 0.614 | 0.513 | 0.553 | 0.532 | 0.619 | 0.567 |
| Density-Adaptive BBSG | 0.798 | 0.691 | 0.721 | 0.673 | 0.646 | 0.494 | 0.759 | 0.678 | 0.513 | 0.566 | 0.458 | 0.549 | 0.659 | 0.629 |
| Zero-shot scGPT | 0.687 | 0.493 | 0.691 | 0.523 | 0.692 | 0.431 | 0.746 | 0.567 | 0.690 | 0.491 | 0.637 | 0.535 | 0.664 | 0.517 |
| Zero-shot SCimilarity | 0.710 | 0.460 | 0.732 | 0.495 | 0.691 | 0.365 | 0.753 | 0.546 | 0.735 | 0.420 | 0.667 | 0.453 | 0.747 | 0.504 |
| fastMNN | 0.841 | 0.718 | 0.771 | 0.704 | 0.694 | 0.456 | 0.807 | 0.734 | 0.692 | 0.480 | 0.635 | 0.531 | 0.723 | 0.621 |
| mnnCorrect | 0.802 | 0.693 | 0.765 | 0.647 | 0.685 | 0.381 | 0.789 | 0.685 | ||||||
| limma removeBatchEffect | 0.727 | 0.600 | 0.696 | 0.497 | 0.677 | 0.459 | 0.784 | 0.697 | 0.686 | 0.444 | 0.649 | 0.490 | 0.677 | 0.612 |
| Harmony, R package | 0.828 | 0.723 | 0.756 | 0.667 | 0.716 | 0.499 | 0.789 | 0.702 | 0.694 | 0.530 | 0.623 | 0.562 | 0.715 | 0.675 |
| LIGER, R package | 0.681 | 0.683 | 0.665 | 0.632 | 0.590 | 0.478 | 0.761 | 0.766 | 0.619 | 0.523 | 0.542 | 0.512 | 0.645 | 0.589 |
| scMerge2 | 0.834 | 0.726 | 0.728 | 0.675 | 0.604 | 0.507 | 0.755 | 0.704 | 0.593 | 0.509 | 0.643 | 0.536 | 0.642 | 0.630 |
| Seurat CCA | 0.861 | 0.744 | 0.710 | 0.621 | 0.559 | 0.490 | 0.766 | 0.721 | 0.633 | 0.502 | 0.574 | 0.518 | 0.749 | 0.634 |
| Seurat RPCA | 0.876 | 0.758 | 0.756 | 0.680 | 0.656 | 0.522 | 0.784 | 0.750 | 0.649 | 0.493 | 0.585 | 0.525 | 0.773 | 0.624 |
| STACAS | 0.835 | 0.713 | 0.743 | 0.653 | 0.689 | 0.446 | 0.785 | 0.727 | 0.687 | 0.485 | 0.604 | 0.501 | 0.785 | 0.588 |
| BBKNN | 0.969 | 0.462 | 0.822 | 0.430 | 0.665 | 0.301 | 0.845 | 0.410 | 0.641 | 0.290 | 0.583 | 0.326 | 0.673 | 0.358 |
| Zero-shot UCE | 0.664 | 0.532 | 0.717 | 0.610 | 0.677 | 0.448 | 0.702 | 0.530 | 0.723 | 0.497 | 0.650 | 0.542 | 0.679 | 0.570 |
| Zero-shot CellPLM | 0.697 | 0.515 | 0.708 | 0.483 | 0.684 | 0.364 | 0.710 | 0.555 | 0.709 | 0.471 | 0.644 | 0.472 | 0.700 | 0.521 |
| Zero-shot scPRINT | 0.590 | 0.424 | 0.658 | 0.558 | 0.648 | 0.446 | 0.567 | 0.537 | 0.614 | 0.505 | 0.591 | 0.454 | 0.584 | 0.546 |
| scGPT fine-tuned, OpenProblems | 0.686 | 0.466 | 0.728 | 0.515 | 0.671 | 0.432 | 0.730 | 0.557 | 0.709 | 0.486 | 0.638 | 0.504 | 0.697 | 0.540 |
- ① human pancreas, technology batches
- ② human immune, donor/study batches
- ③ human lung atlas, donor batches
- ④ human kidney (diabetic kidney disease), donor batches, single-nucleus
- ⑤ human cross-tissue atlas (GTEx), donor batches, single-nucleus
- ⑥ human multi-organ atlas (Tabula Sapiens), donor-by-assay batches
- ⑦ human cross-tissue immune atlas (Immune Cell Atlas), donor batches
The method preserves biological structure well. Its biology conservation is above the frozen Geneformer embedding the task starts from on every setting, and it is among the strongest entries on two of them: 0.651 on TabulaSap, behind only Zero-shot SCimilarity [13] (0.667) and HVG + PCA (0.660), and 0.701 on Lung against 0.725 for scGPT-style ECS + DAB [12].
The batch-integration score is where it falls short. Its batch-integration score is above HVG + PCA on every setting, and above the starter's frozen embedding on every setting except GTEx (0.458 against 0.461), but it is below Harmony and below scVI on every setting. The gap to the strongest baseline is smallest on TabulaSap, 0.528 against 0.602 for scCRAFT [9], and next on Kidney-DKD, 0.686 against 0.792. It is largest on Pancreas, 0.540 against 0.822. On Lung our score, 0.409, is below even the constant embedding's 0.443.
This pattern is consistent with the design. Wherever the evidence test can be run, registration moves cells only as far as an independent measurement shows a technical difference, and differences it cannot attribute to measurement, for example a shift in composition between batches, are deliberately left in place. The method therefore keeps biological structure, and its batch-integration score stays below that of methods that align batches by construction.
How we got here
We started from the literature rather than from a model. We read the methods papers for mutual nearest neighbours, Harmony, Scanorama, Seurat, STACAS, sysVI, scCRAFT and CONCORD, and the scIB benchmark [2, 6, 3, 4, 31, 8, 9, 10, 15]. From them we took one failure mode as the problem to solve: when batches contain the same populations in different proportions, a correction based on batch means moves cells away from their counterparts. Because we had no labels, we built our own development material: public count matrices from several species with simulated capture and composition shifts, molecule-level data with known read multiplicities, and datasets in which RNA was measured together with chromatin, protein or a second sequencing protocol, so that an RNA-only representation could be checked against an independent assay. Our main development measure was how well neighbourhoods across batches recovered such independent measurements, not a batch-mixing score. The method went through about seventy versions; the steps below are the ones that shaped the final design.
- Accounting for the direction of local variation reduced overcorrection. Weighting each state's correction by its local precision reduced overcorrection: on our simulated composition-only control, the ratio of ideal to observed cross-batch neighbour distance rose from 0.57 to 0.83 in our development runs (1 is ideal), and on a real-count composition test from 0.71 to 0.74.
- The depth transform was checked directly. At a fixed simulated expression rate, moving library depth from 800 to 12,000 moved the mean conventional log-normalised value from 0.77 to 0.87 in our development runs, while the harmonic transform stayed between 1.030 and 1.032.
- A single amplification factor per batch was not enough. It worked on controlled amplification tests but lost accuracy when amplification varied from cell to cell, which is why the read scale is refined per cell from two independent gene panels.
- Held-out genes set the strength of correction. When the technical shift followed a biological direction, choosing the strength this way raised cross-batch recovery from 0.057 to 0.157 and from 0.221 to 0.441 on two of our semi-synthetic tests, while keeping 0.761 on a partial-overlap control.
- Correcting protocol-specific variance erased real structure. It improved our paired-protocol test but erased part of a simulated biological continuum, so we looked instead for evidence that could tell the two cases apart.
- A learned metric from one gene panel predicting another improved the mean cross-batch neighbourhood score by 0.012 across 26 held-out development conditions and lost 0.024 on one paired test, which we kept as a check on later changes.
- Balancing the neighbour graph by density was not adopted. It helped mixing but lost geometry measured by the independent assays.
- The disjoint-gene test exposed a confound. A population present in only one batch could look like a change in that protocol's gene response. Adding the within-batch null to the evidence test separated the two: on a test with little population overlap and no added technical effect, cross-batch neighbourhood fidelity rose from 0.493 to 0.593, and with an added assay effect it stayed at 0.459. Restoring between-batch variation that the within-batch subspace missed then added 0.014 on average across ten composition-shift controls.
- Degenerate designs needed their own branch. When every batch held a single cell, centring within batches erased the signal entirely; the fix treats that design as having no estimable batch contrast. The hierarchical small-batch variant raised cross-batch recovery from 0.492 to 0.544 on a separate control with many small batches.
- An ambient-RNA decontamination step was not installed: on a condition with physically added ambient RNA it estimated almost none of it.
- Pairwise evidence came last, for the case where only a minority of batches has a different measurement process; it improved recovery in 18 matched development comparisons, with the largest gains in that case. A final change made the output independent of the order of the input rows.
On one paired short- and long-read dataset our development measure reached 0.796, against 0.771 for ComBat and 0.653 for Harmony; on tests against neuronal morphology the references were slightly ahead. All figures in this section are our development diagnostics, recorded in the trace.
Limitations
- The batch-integration score trails the leading baselines. It is below Harmony and scVI on every setting, below the frozen starter embedding on GTEx, and below a constant embedding on Lung. The evidence gate, which protects biology, also leaves residual batch structure in place whenever the test cannot attribute it to measurement.
- Our development measure is not the task's. We selected every change by how well neighbourhoods recovered independent assays, which rewards preserving structure and does not penalise unmixed batches. The measured results follow that choice.
- No component learns from the pretrained transformers. The method uses no Geneformer or scGPT forward passes; its only pretrained component is the frozen SCimilarity encoder, used as a prior. Whether a transformer adapted with the same independent-measurement objectives would do better is untested.
- The machinery is large and hand-built. The file defines dozens of estimators with fixed constants (shrinkage strengths, kernel widths, iteration counts) set during development rather than derived, and the interaction of the evidence test, the pairwise coupling and the per-state revision is hard to analyse as a whole.
References
- W. Evan Johnson, Cheng Li, Ariel Rabinovic (2007). Adjusting batch effects in microarray expression data using empirical Bayes methods. Biostatistics.
- Laleh Haghverdi, Aaron T L Lun, Michael D Morgan et al. (2018). Batch effects in single-cell RNA-sequencing data are corrected by matching mutual nearest neighbors. Nature Biotechnology.
- Brian Hie, Bryan Bryson, Bonnie Berger (2019). Efficient integration of heterogeneous single-cell transcriptomes using Scanorama. Nature Biotechnology.
- Tim Stuart, Andrew Butler, Paul Hoffman et al. (2019). Comprehensive Integration of Single-Cell Data. Cell.
- Massimo Andreatta, Santiago J Carmona (2021). STACAS: Sub-Type Anchor Correction for Alignment in Seurat to integrate single-cell RNA-seq data. Bioinformatics.
- Ilya Korsunsky, Nghia Millard, Jean Fan et al. (2019). Fast, sensitive and accurate integration of single-cell data with Harmony. Nature Methods.
- Romain Lopez, Jeffrey Regier, Michael B. Cole et al. (2018). Deep generative modeling for single-cell transcriptomics. Nature Methods.
- Karin Hrovatin, Amir Ali Moinfar, Luke Zappia et al. (2025). Integrating single-cell RNA-seq datasets with substantial batch effects. BMC Genomics.
- Chuan He, Paraskevas Filippidis, Steven H. Kleinstein et al. (2025). Partially characterized topology guides reliable anchor-free scRNA-integration. Communications Biology.
- Qin Zhu, Zuzhi Jiang, Binyamin Zuckerman et al. (2026). Revealing a coherent cell-state landscape across single-cell datasets with CONCORD. Nature Biotechnology.
- Christina V. Theodoris, Ling Xiao, Anant Chopra et al. (2023). Transfer learning enables predictions in network biology. Nature.
- Haotian Cui, Chloe Wang, Hassaan Maan et al. (2024). scGPT: toward building a foundation model for single-cell multi-omics using generative AI. Nature Methods.
- Graham Heimberg, Tony Kuo, Daryle J. DePianto et al. (2025). A cell atlas foundation model for scalable search of similar human cells. Nature.
- Rebecca Boiarsky, Nalini Singh, Alejandro Buendia et al. (2023). A Deep Dive into Single-Cell RNA Sequencing Foundation Models. bioRxiv.
- Malte D. Luecken, M. Büttner, K. Chaichoompu et al. (2022). Benchmarking atlas-level data integration in single-cell genomics. Nature Methods.
- Wenkai Han, Yuqi Cheng, Jiayang Chen et al. (2022). Self-supervised contrastive learning for integrative single cell RNA-seq data analysis. Briefings in Bioinformatics.
- Bowen Zhao, Kailu Song, Dong-Qing Wei et al. (2025). scCobra allows contrastive cell embedding learning with domain adaptation for single cell data integration and harmonization. Communications Biology.
- Amir Ali Moinfar, Fabian J. Theis (2024). Disentangling cellular heterogeneity into interpretable biological factors through structured latent representations. bioRxiv.
- Adrien Bardes, Jean Ponce, Yann LeCun (2022). VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning. ICLR.
- Benjamin DeMeo, Bonnie Berger (2023). SCA: recovering single-cell heterogeneity through information-based dimensionality reduction. Genome Biology.
- Lei Xiong, Kang Tian, Yuzhe Li et al. (2022). Online single-cell data integration through projecting heterogeneous datasets into a common cell-embedding space. Nature Communications.
- Joshua D. Welch, Velina Kozareva, Ashley Ferreira et al. (2019). Single-Cell Multi-omic Integration Compares and Contrasts Features of Brain Cell Identity. Cell.
- Stephen Chung, Wenyu Du (2025). The Station: An Open-World Environment for AI-Driven Discovery.
- Matthew E. Ritchie, Belinda Phipson, Di Wu et al. (2015). limma powers differential expression analyses for RNA-sequencing and microarray studies. Nucleic Acids Research.
- Yingxin Lin, Shila Ghazanfar, Kevin Y. X. Wang et al. (2019). scMerge leverages factor analysis, stable expression, and pseudoreplication to merge multiple single-cell RNA-seq datasets. Proceedings of the National Academy of Sciences.
- Yuhan Hao, Tim Stuart, Madeline H. Kowalski et al. (2024). Dictionary learning for integrative, multimodal and scalable single-cell analysis. Nature Biotechnology.
- Krzysztof Polański, Matthew D Young, Zhichao Miao et al. (2020). BBKNN: fast batch alignment of single cell transcriptomes. Bioinformatics.
- Yanay Rosen, Yusuf Roohani, Ayush Agrawal et al. (2023). Universal Cell Embeddings: A Foundation Model for Cell Biology. bioRxiv.
- Hongzhi Wen, Wenzhuo Tang, Xinnan Dai et al. (2024). CellPLM: Pre-training of Cell Language Model Beyond Single Cells. ICLR.
- Jérémie Kalfon, Jules Samaran, Gabriel Peyré et al. (2025). scPRINT: pre-training on 50 million cells allows robust gene network predictions. Nature Communications.
- Massimo Andreatta, Léonard Hérault, Paul Gueguen et al. (2024). Semi-supervised integration of single-cell transcriptomics data. Nature Communications.