What a Corrected Embedding Shows
A corrected embedding can be useful: it gives a compact view of cell relationships after a method has transformed the data to reduce variation associated with batch. Coloring the same points by batch and by biological condition can reveal patterns that deserve investigation. But the plot shows the geometry of a chosen representation, not whether the gene-level condition effect has been separated from batch. Visual mixing is evidence about the embedding; it is not proof of unbiased gene-level comparisons.
This distinction matters especially when batch and condition are associated. A correction method may make batches appear well mixed while retaining, attenuating, or altering condition-associated structure. Conversely, a visible batch pattern may remain even when a gene-level analysis has valid within-batch contrasts. Interpretation must therefore connect the plot to the study design and to the specific gene-level estimand.
A two-dimensional plot is a projection or summary of a much larger feature space. It can hide differences in dimensions that are not displayed, and its appearance can depend on the features, transformation, method, and plotting choices. Even perfect overlap in the displayed coordinates only establishes overlap there. It does not establish that every gene has been corrected appropriately, that biological signal was preserved, or that the design contains the comparisons needed to estimate a condition effect.
Separate the Visual Question From the Estimand
For a gene \(g\), a simple additive model for a cell-level expression measurement \(Y_{ig}\) is
where \(C_i\) indicates condition, \(B_i\) indicates batch, \(\beta_{Cg}\) is the condition coefficient, and \(\beta_{Bg}\) is the batch coefficient. This model is illustrative; actual single-cell analyses must also address the expression distribution, library size, dependence among cells from the same sample, and the chosen unit of inference. To interpret \(\beta_{Cg}\) as an adjusted condition contrast, the design must contain adequate condition comparisons across batches, and the model's additive form and other assumptions must be appropriate.
If every control cell is in batch 1 and every treated cell is in batch 2, then \(C_i=B_i\) for all observed cells. The two columns of the design matrix are identical. The data can estimate their combined contribution, but cannot determine how much is condition and how much is batch. Earlier material on null spaces and equivalent model coefficients describes this non-identifiability; the key point here is that changing the coordinates used for a plot does not add the missing comparison.
Worked Example: Identical Fitted Differences, Different Attributions
Suppose a hypothetical gene has observed mean expression 2 units in control cells from batch 1 and 8 units in treated cells from batch 2. There are no control cells in batch 2 and no treated cells in batch 1. Use the additive model \(Y=\mu+\beta_C C+\beta_B B+\varepsilon\), with control and batch 1 coded as 0, and treatment and batch 2 coded as 1.
The observed difference between the two groups is \(8-2=6\) expression units. This sample difference estimates \(\beta_C+\beta_B\); because the errors are not generally zero, it need not equal the population parameter exactly. Under least squares for this two-group design, the estimate of the coefficient sum is 6. The baseline estimate is \(\hat{\mu}=2\).
For example, the coefficient pairs \((\hat{\beta}_C,\hat{\beta}_B)=(6,0)\), \((0,6)\), and \((2,4)\) all give the same fitted group means: control in batch 1 has fitted mean \(2\), while treatment in batch 2 has fitted mean \(2+\hat{\beta}_C+\hat{\beta}_B=8\). They therefore fit the observed group difference equally well, while assigning it differently to condition and batch. The data do not choose among those attributions.
A corrected embedding might nevertheless place the two groups together if the correction removes the direction distinguishing their observed profiles. That visual outcome does not tell us which coefficient pair is biologically correct. The missing within-batch comparison remains missing, so the condition effect is not identified by this design.
Read Both Colorings, Then Return to the Design
Coloring a corrected embedding by batch asks whether batch labels remain spatially structured in that representation. Coloring it by condition asks whether condition labels remain spatially structured there. These are useful descriptive checks, but neither has a universal target appearance. If condition is genuinely associated with broad expression patterns, strong condition separation may be expected. If a biological state occurs across batches, its cells may overlap spatially while still differing in particular genes. A single color pattern is not a general score of correction quality.
Interpret the plots together with the condition-by-batch cross-tabulation. Ask which combinations are observed, how many independent samples support each combination, and whether the gene-level contrast can be formed within batches or across connected batches. Cell counts alone can be misleading: many cells from one sample do not create independent biological replication. A plot cannot substitute for these design checks.
Also distinguish an absence of visible batch clustering from an absence of batch-associated effects. A batch effect may be gene-specific, subtle, or expressed in a direction not retained in the displayed dimensions. Alternatively, a correction can suppress a real biological difference that happens to align with batch. The corrected coordinates do not reveal whether a removed direction was technical, biological, or a mixture of both without additional assumptions or design information.
Worked Example: Good Visual Mixing With a Remaining Gene-Level Question
Consider a hypothetical study with two batches, each containing control and treated samples. A corrected embedding shows the two batch colors intermingled, while condition-colored cells show some separation. For one gene, suppose the estimated mean expressions in batch 1 are 4 units for control and 5 for treatment; in batch 2 they are 7 units for control and 8 for treatment.
The within-batch contrasts are \(5-4=1\) unit and \(8-7=1\) unit. With equal weighting of these two batch contrasts, the combined contrast is \((1+1)/2=1\) expression unit. This agreement is compatible with an additive condition effect for this gene, assuming the sample-level design supports the estimates and there are no important condition-by-batch interactions.
The plot's batch mixing is not what identifies this one-unit contrast. The relevant evidence is that both conditions are represented in each batch and that the within-batch comparisons agree under the stated assumptions. If a gene-level model finds a different result, visual overlap does not invalidate it; if the batch colors overlap but the condition and batch columns are aliased for another gene's relevant samples, the plot does not rescue that non-identifiability.
Why Projection and Correction Can Mislead
A corrected embedding is usually built from selected features and then reduced to a small number of dimensions. This creates several limits on interpretation:
- Information is omitted. Gene-level differences can lie outside the displayed dimensions or be too small to shape the plot.
- Correction is a transformation, not new data. It can suppress technical variation, biological variation correlated with batch, or both.
- Overlap is representation-dependent. Different choices of features, dimensions, and correction can produce different apparent mixing.
- Cells are not independent samples. A dense cloud of cells does not by itself establish precise condition comparisons when biological replication is limited.
A useful diagnostic is to compare uncorrected and corrected representations, with separate panels colored by batch and condition, while keeping the design table visible. Look for gross patterns, unexpected losses of condition structure, and residual batch structure. Treat these as flags for follow-up rather than pass/fail tests. A metric that summarizes mixing has the same limitation: it quantifies a property of the representation, not the validity of a gene-level estimand.
Worked Example: A Projection Hides a Gene Difference
Suppose a hypothetical corrected feature space has three coordinates. For two groups of cells, their displayed first two coordinates have the same group means: \((2,1)\) for control and \((2,1)\) for treatment. The third coordinate, not shown in the plot, has means 0 for control and 3 units for treatment.
On the two-dimensional plot, the group centers coincide because both use only the first two coordinates. The displayed mean difference is \((2,1)-(2,1)=(0,0)\). In the full three-coordinate space, however, the mean difference is \((0,0,3)\), so the groups differ by 3 units along the omitted coordinate.
This calculation does not imply that the third-coordinate difference is biological or that it identifies a particular gene effect. It demonstrates only that two-dimensional overlap cannot establish equality in the full representation, much less unbiasedness for every gene. The source of the difference and the study design still need to be assessed.
A Short Justification: Why Aliasing Survives Any Plot
In the perfectly confounded design above, \(C_i=B_i\). Thus the model's fitted value is
Only the sum appears in the fitted values. For any number \(a\), replacing \(\beta_{Cg}\) with \(\beta_{Cg}+a\) and \(\beta_{Bg}\) with \(\beta_{Bg}-a\) leaves that sum unchanged:
Therefore every such coefficient pair produces the same fitted values for the observed cells. An embedding is calculated from the observed data (possibly after a correction transformation); it does not supply observations for the absent condition-batch combinations. No arrangement of those observed cells can, on its own, distinguish the equivalent coefficient attributions.
Comparison, Failure Modes, and Practical Interpretation
| Approach | What it can show | What it cannot establish alone |
|---|---|---|
| Corrected embedding colored by batch | Whether batch labels appear spatially structured in the selected coordinates | That batch has no gene-level effects or that adjustment is unbiased |
| Corrected embedding colored by condition | Whether condition labels show structure in those coordinates | That condition signal was fully preserved or its effect is identified |
| Cross-tabulation and design checks | Which condition-batch comparisons and sample-level replication exist | That model assumptions hold for every gene |
| Gene-level model using observed comparisons | Condition estimates and uncertainty under its model and design assumptions | Protection from non-identifiability or misspecification without adequate design support |
A common mistake is: “The corrected plot mixes batches, so the batch effect has been removed and the condition comparison is unbiased.” The correction is that mixing reports overlap in a chosen low-dimensional representation. Unbiased gene-level comparison additionally depends on identifiable contrasts, an appropriate model, and preservation of relevant biological signal. When condition and batch are perfectly aliased, no corrected visualization resolves the attribution.
A second mistake is to treat visible condition separation as proof that condition effects are preserved correctly. Separation can reflect biology, residual batch structure, or a mixture. Likewise, no separation does not prove that no gene-level condition effects exist. Embeddings are exploratory summaries, not replacements for design-based reasoning and gene-level analysis.
The practical conclusion should therefore be proportionate: describe what the embedding shows, state which design comparisons support the gene-level analysis, and avoid claiming that correction has “resolved confounding” based on visual mixing alone. If design support is absent, the honest conclusion is that the condition effect cannot be separated from batch without additional assumptions or information.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A corrected embedding shows complete batch mixing. Does this establish that every gene's batch effect has been removed?
- In a design where all controls are in batch 1 and all treated cells are in batch 2, what combination of coefficients is estimable under an additive model?
- A two-dimensional embedding shows identical condition group centers, but the groups differ on an omitted coordinate by 2 units. What can be concluded from the plot?
- Why can many cells in a batch not substitute for condition overlap across independent samples?
Solutions. (1) No. It establishes overlap only in the displayed representation; gene-specific residual effects and biological signal removed by correction remain possible. (2) The coefficient sum \(\beta_C+\beta_B\) is estimable from the observed group difference, but the separate condition and batch coefficients are not identified. (3) The plotted coordinates show coincident centers, but this does not establish equality in the full space or identify the source of the omitted-coordinate difference. (4) Cells from the same sample are not independent biological replicates; additional cells can improve measurement of that sample but cannot create the missing between-condition comparisons or independent replication.