Why Multiple Batches Require a Strategy
Pairwise MNN correction describes how to align two batches using mutual nearest-neighbor pairs in a shared feature space. With three or more batches, that pairwise operation must be extended: one can align batches in sequence to a growing reference, or estimate corrections between pairs and combine them across a graph of batches. These procedures need not produce identical results. Each relies on which states are represented, which cells become matches, and which correction paths are used.
The central issue is not merely that there are more pairs to calculate. A correction estimated for one pair may become part of the coordinate system used to find matches for the next pair. If batches have unequal cell-state coverage, an early alignment can affect later matches and can alter the geometry available to the next step. Thus, the order of integration can influence the final embedding.
This direction convention matters: a correction vector is added to the cell being corrected. The cell in the reference batch is not moved by that pairwise operation. As established in the earlier material on averaging MNN correction vectors, local vectors can be combined to obtain a cell-specific estimate. Extending integration means deciding how such estimates are obtained and combined across several batches.
Sequential and Pairwise-Graph Strategies
In sequential integration, an initial batch or group of batches defines a reference coordinate system. A new batch is matched to the current reference, corrected, and added to the integrated data. The next batch is then matched against this growing reference. The reference therefore changes as integration proceeds, and the cells contributing to its local neighborhoods can affect subsequent MNN pairs.
In a pairwise-graph strategy, batches are represented as nodes and selected pairwise alignments as edges. An edge records an estimated correction from one batch toward another. The graph can include a chain, a star, or additional edges connecting batches directly. Corrections can then be propagated along paths, or assessed for consistency across multiple paths. A graph with redundant paths can reveal incompatible pairwise estimates, though it does not automatically determine which estimate is biologically appropriate.
Neither description specifies a unique algorithm. Implementations may differ in how they build the growing reference, select pairwise comparisons, smooth local correction fields, and treat cells without usable matches. The following calculations use simplified translations to make accumulation explicit. Real MNN corrections are usually local, so the same arithmetic applies exactly only when the relevant corrections are constant translations; otherwise, the correction fields must be composed cell by cell.
How Corrections Accumulate Along a Path
For constant translations, let \(\delta_{j\to i}\) be the vector added to batch \(j\) to align it to batch \(i\). If batch C is first aligned to B and the already aligned B is in turn aligned to A, then the correction carried by C along that path is the sum of the two translations. With cell-dependent corrections, the second field must instead be evaluated at the position produced by the first transformation.
The expression is a path calculation, not a claim that pairwise corrections are always transitive. A direct estimate \(\delta_{C\to A}\) may differ from the sum along C to B to A because the pairs, neighborhoods, or shared states used to estimate them differ. A useful check is to compare corrections obtained along alternative paths when the data support those comparisons.
Worked Example: Accumulating Translations Across Three Batches
Suppose three hypothetical batches contain the same two cell states, represented by one-dimensional positions. Their observed positions are A: 0 and 10, B: 2 and 12, and C: 5 and 15. Assume each state is matched correctly, and the pairwise differences are constant across states. Align B to A, then C to the corrected B.
For B to A, the correction for either state is reference position minus observed position: \(0-2=-2\) and \(10-12=-2\). Thus \(\delta_{B\to A}=-2\), and B becomes \(2+(-2)=0\) and \(12+(-2)=10\).
For C to corrected B, the two differences are \(0-5=-5\) and \(10-15=-5\). Hence \(\delta_{C\to B}=-5\), and C becomes \(5+(-5)=0\) and \(15+(-5)=10\). All three batches now have positions 0 and 10 for the two states.
Along this sequence, the net correction to C is \(-5\), not \(-5+(-2)\): the second estimate, \(-5\), was already calculated relative to B after B had been aligned. If instead the pairwise correction from C to the original, uncorrected B were \(-3\), the path calculation would be \((-3)+(-2)=-5\). Distinguishing the coordinate system in which an edge was estimated prevents double-counting.
Order Dependence Under Unequal State Coverage
If every batch contains the same states and pairwise corrections describe consistent technical shifts, sequential order may have little practical effect. But unequal coverage can change which state-specific matches are available. A batch containing only one state may anchor that state while providing no direct information about how another state should move. If the partially observed batch is used early, its limited coverage can shape the growing reference.
Worked Example: A Missing State Changes the Sequential Result
Consider hypothetical one-dimensional data with two biological states whose true positions are S at 0 and T at 10. Batch A contains both states at 0 and 10. Batch B contains both, shifted by \(+2\), at 2 and 12. Batch C contains only S, shifted by \(+5\), at 5. Assume MNNs match only cells in the same state, and cells without a shared-state match are left uncorrected.
Order A, then B, then C. Aligning B to A gives corrections \(0-2=-2\) for S and \(10-12=-2\) for T. The integrated reference has S at 0 and T at 10. C's S cell at 5 matches the shared S state, giving correction \(0-5=-5\); it moves to 0. The final state positions are S at 0 and T at 10.
Order C, then B, then A. C first defines a reference containing S at 5 but no T. When B is added, its S cell moves from 2 to 5, a correction of \(+3\). B's T cell at 12 has no match in C, so it remains at 12. The growing reference therefore has S at 5 and T at 12. When A is added, its S cell moves from 0 to 5, a correction of \(+5\), while its T cell moves from 10 to 12, a correction of \(+2\). The resulting positions are S at 5 and T at 12: the distance between states is \(12-5=7\), rather than the original distance of \(10-0=10\).
This result follows from the stated matching and no-extrapolation assumptions: the S correction to B is supported by a match, while B's T cell is not corrected at that step. Later, A is aligned to the altered positions in the growing reference. A method that propagates the S correction to T would need to justify that extrapolation; it is not supplied by a missing MNN match. The example shows why coverage and order must be considered together.
Checking Paths and Comparing Strategies
Order sensitivity is a property to investigate, not by itself proof that one ordering is correct. A practical assessment is to repeat the sequential integration using scientifically plausible orders, then compare the resulting cell positions, state relationships, and correction vectors. In a graph strategy, when a set of batches has multiple connecting paths, compare the corrections implied by those paths. For constant translations, a cycle should approximately sum to zero if its pairwise estimates are mutually consistent.
Worked Example: A Cycle Reveals Inconsistent Pairwise Estimates
Suppose hypothetical constant corrections are estimated as follows: aligning B to A gives \(\delta_{B\to A}=-2\); aligning C to B gives \(\delta_{C\to B}=-3\); and a direct alignment of C to A gives \(\delta_{C\to A}=-4\). Compare the two routes for C.
Along C to B to A, the accumulated correction is \((-3)+(-2)=-5\). The direct route gives \(-4\). Their discrepancy is \((-5)-(-4)=-1\) coordinate unit. Equivalently, the cycle discrepancy is \(\delta_{C\to B}+\delta_{B\to A}-\delta_{C\to A}=(-3)+(-2)-(-4)=-1\), not zero.
The estimates are not exactly transitive. That discrepancy could reflect noisy local matches, different state coverage, or a violation of the constant-translation simplification. It is a reason to inspect the pairs and coverage supporting each edge, not a basis for mechanically averaging the three numbers without a model for their reliability.
The main trade-offs can be summarized as follows.
| Strategy | Strength | Important risk |
|---|---|---|
| Sequential alignment to a growing reference | Simple to implement and adds batches one at a time. | Early batches and their coverage can shape later matches; changing order can change the result. |
| Pairwise graph of batch comparisons | Provides alternative paths and makes inconsistencies visible when the graph has cycles. | Requires choices about edges and how to combine them; inconsistent edges do not resolve themselves. |
| Direct alignment of each batch to one reference | Uses a common coordinate target for the comparisons. | A reference with limited coverage may not support corrections for states found elsewhere. |
Diagnostics, Limitations, and a Common Mistake
Several checks are especially relevant when extending MNN correction:
- Compare plausible sequential orders. Large changes in state positions or within-batch state geometry indicate that the result depends on the integration path.
- Record which batches and states support each pairwise alignment. Missing states cannot provide direct evidence for their own correction.
- For graphs with cycles, compare direct and path-based corrections. Large discrepancies point to incompatible estimates or differences in the local comparisons.
- Check whether correction changes relationships among states within a batch, not only whether batches overlap in a visualization. A compact merged embedding can conceal distortion.
These checks do not establish that batch effects are identifiable or that biological differences have been preserved. As emphasized in the earlier material on batch effects confounded with biological condition, alignment cannot recover a distinction that the observed design does not identify. MNN integration is also limited by the representation used to define neighbors, the availability of shared states, and the reliability of local matches. An absent state, a poorly supported edge, or a strongly varying correction field makes simple path accumulation less trustworthy.
Common mistake: “Each pairwise correction is valid, so sequentially applying all of them must give the same answer in any order.” This is not generally true. Later matches are selected in coordinates already affected by earlier corrections, and a missing state can leave part of a batch uncorrected while other states move. The correction is to distinguish pairwise estimates from their composition, track the coordinate system for each estimate, and assess plausible orders and paths rather than assuming transitivity.
Check Your Understanding
Answer each question, then compare with the solutions below.
- Batch D has observed position 8, and its matched reference position in batch E is 5. What correction vector is added to D's cell?
- For constant translations, the correction from F to G is \(+4\), and the correction from G to H is \(-7\). What is F's accumulated correction along the path F to G to H?
- Why can aligning a batch that lacks state T early in a sequential procedure affect the later position of T in another batch?
- A graph has two paths from one batch to another, with accumulated translations \(+2\) and \(+2.1\). What does their closeness suggest, and what does it not prove?
Solutions. 1. The correction is \(5-8=-3\), so the corrected position is \(8+(-3)=5\). 2. The accumulated correction is \(+4+(-7)=-3\). 3. The early batch cannot supply a direct MNN-based correction for T; the resulting growing reference may therefore retain a different T position, which can influence later matches and corrections. 4. The similar path estimates are consistent with one another at the scale of the \(0.1\)-unit discrepancy. They do not prove that the shared matches are biologically correct, that all states are covered, or that biological variation is preserved.