What Does Color Add to an Embedding?
A PCA, t-SNE, or UMAP plot places each cell at a location determined by an embedding procedure. Coloring those locations by batch or biological condition adds a visual layer: it shows where cells with particular metadata labels appear in the displayed coordinates. The color does not, by itself, identify why cells occupy those locations. A separation by color is an observed pattern in the plot, not proof that the colored variable caused the separation.
This distinction matters in single-cell RNA sequencing because technical processing and biology can both be associated with expression patterns. A batch may represent a sequencing run, library preparation, or processing date. A condition may represent a treatment or disease group. If particular conditions occur mainly in particular batches, a plot colored by either label can display a similar pattern. The embedding alone cannot untangle those explanations.
A useful reading begins with a narrow description: which labels appear where, and how much they overlap? It then asks whether the design can distinguish technical from biological explanations. That second question depends on which samples were processed in which batches, not just on how many cells appear in each color.
Read the Display Before Interpreting It
First confirm what each point represents and what the colors encode. Check the legend, the number of batches or conditions shown, and whether the same cells are included in the panels being compared. If a cell's label was joined to the wrong cell identifier, a convincing-looking overlay can be meaningless. A missing label may also be silently omitted from the plotted points.
Next describe the pattern in the coordinates shown, without translating it immediately into a cause. For example, “cells from batch A are concentrated on the left, while cells from batch B are concentrated on the right” is a plot description. “Batch A caused the cells to move left” is not justified by the display. The same caution applies to a condition-colored plot.
The displayed pattern can depend on which cells and genes were included, preprocessing, the embedding method and settings, and, for methods with stochastic optimization, the random seed. Earlier material on local and global geometry and embedding variability is relevant here: the two-dimensional layout is a representation, not a direct measurement of every relationship in the original expression data. Interpret color patterns as features of this particular display, and check whether they are consistent with the study design and other evidence.
Color mixing is not automatically a goal. If a biological condition is associated with genuine expression differences, condition-colored cells may be separated in some regions. Conversely, batch labels may be mixed in a region because that region contains several cell types or samples; this does not establish that all technical effects are absent. The meaning of apparent mixing depends on which cells are being compared and how condition and batch are represented in the experiment.
Worked Example: Batch and Condition Are Entangled
Hypothetical data. A study plots 80 cells, with two conditions and two batches. The table gives the number of cells in each batch-condition combination.
| Batch | Control | Treated | Total |
|---|---|---|---|
| Batch A | 36 | 4 | 40 |
| Batch B | 4 | 36 | 40 |
| Total | 40 | 40 | 80 |
Suppose the batch-colored plot shows batch A mostly on the left and batch B mostly on the right. The condition-colored plot shows a similar left-right pattern. Within batch A, the treated fraction is \(4/40=0.10\), or 10%. Within batch B, it is \(36/40=0.90\), or 90%. Thus batch and condition are strongly associated in the observed cells.
The plots support the descriptive statement that location in this embedding is associated with both labels. They do not identify whether the pattern reflects treatment, batch, or both. There are some cells in all four combinations, so this design is not perfectly confounded; however, the imbalance means the visual association of either label with location cannot be interpreted as an isolated effect. A conclusion about cause would require more than comparing colors.
Design Determines What Can Be Distinguished
A design is crossed when each condition is represented in each batch, with enough observations to make the comparisons meaningful. Crossing does not guarantee that all confounding is absent, but it permits within-batch condition comparisons and between-batch comparisons at a given condition. When some combinations are missing or very sparse, those comparisons become limited or impossible.
The identifiability issue can be seen with a simple model for an expression outcome \(Y\) for a cell, used here to reason about a single gene or a numerical summary. Let \(C\) be an indicator for condition and \(B\) an indicator for batch, with each equal to 0 or 1. Consider
where \(\mu\) is a baseline, \(\tau\) is a condition contrast, \(\gamma\) is a batch contrast, and \(\varepsilon\) is residual variation. This model is only an illustration of the attribution problem; a colored embedding is not a fit of this model.
If every control cell is in batch A and every treated cell is in batch B, then \(B=C\) for every observed cell. Substitution gives
The observations can reveal the combined contrast \(\tau+\gamma\), but not its separate components. For any number \(a\), replacing \(\tau\) with \(\tau+a\) and \(\gamma\) with \(\gamma-a\) leaves \(\tau+\gamma\) unchanged, and therefore leaves the fitted values unchanged. The separate condition and batch contributions are not identifiable from this design. A color overlay cannot supply the missing design information.
This argument also explains why a large number of cells does not solve exact confounding. More cells in the same two condition-batch combinations can make those combinations look clearer, but cannot create observations in the absent combinations. In studies with multiple donors or samples, cells from one sample are also not independent experimental replicates for a condition-level claim. The number of plotted points should not be mistaken for the number of independent biological replicates.
Worked Example: A Crossed Design With a Condition Pattern
Hypothetical data. Two batches each contain 20 control cells and 20 treated cells. In a condition-colored PCA plot, treated cells appear shifted toward higher values on the horizontal axis in both batches; batch-colored points overlap substantially.
The design table has 20 cells in each of the four batch-condition combinations. Thus both conditions occur in both batches, and neither condition is restricted to one batch. The plot's repeated within-batch pattern is a more informative descriptive observation than a shift seen only between batches: the condition-associated direction is visible among cells processed in each batch.
This pattern is consistent with a condition-associated expression structure in the displayed representation, but it does not prove a biological treatment effect. For example, if each condition was applied to a different set of donors, donor-level differences could still contribute. Nor does batch-color mixing prove that batch has no effect: smaller batch-related structure may be hard to see in two dimensions. The defensible conclusion is limited to the visible pattern and the fact that the design permits, but does not itself guarantee, separation of condition from batch.
Worked Example: Exact Confounding Cannot Be Read Away
Hypothetical data. A study has 30 control cells, all processed in batch A, and 30 treated cells, all processed in batch B. The mean horizontal embedding coordinate is \(-2.0\) for controls and \(2.0\) for treated cells, a displayed difference of \(2.0-(-2.0)=4.0\) coordinate units.
The arithmetic establishes a difference in the plotted coordinate between these two groups. But every control is also from batch A, and every treated cell is from batch B. In the illustrative model above, \(B=C\), so the observed contrast corresponds to \(\tau+\gamma=4.0\) coordinate units if the model is applied to that coordinate. There is no information in these data that determines how much of the contrast is attributable to condition and how much to batch.
A condition-colored plot may look strongly separated, and a batch-colored plot may show the same separation. Those are two views of the same labels in this design, not independent evidence for two causes. The result should be described as a difference between the observed groups, with its technical-versus-biological attribution unresolved.
Diagnostics, Alternatives, and Limits
Several checks help prevent overreading a colored plot:
- Check the sample-level design. Tabulate samples or biological replicates by condition and batch. Cell-level totals can conceal that an entire condition was collected from only one donor or processed in only one run.
- Look for missing combinations. Identify whether each condition occurs in each batch. A blank cell in the design table signals a comparison that the data cannot directly make.
- Check label alignment and exclusions. Verify that plotted cells retain the intended metadata, and note how cells with missing labels or quality-control exclusions were handled.
- Describe within-group patterns, not just overall separation. Ask whether the condition pattern is visible within multiple batches or whether it appears only across batches.
- Use the plot as a diagnostic, not a correction certificate. Overlap of batch colors does not establish that technical effects are absent; separation of batch colors does not by itself quantify their size or show that a correction is appropriate.
A useful comparison is between the colored embedding and evidence that retains the design structure. A table of samples by batch and condition reveals imbalance directly. Examining expression summaries or fitting an appropriate model can address questions that a two-dimensional display cannot, provided the design supports the comparison and the analysis respects the experimental units. Overlaying known cell labels or other sample annotations may help describe what regions contain, but does not resolve exact confounding.
The main limitation is fundamental: an embedding discards or distorts information when representing high-dimensional profiles in two dimensions, and color only adds labels to that representation. Visual overlap can hide structure, and visible separation can arise from technical effects, biological differences, or both. No visual arrangement can identify a cause that the experimental design does not distinguish.
A Practical Interpretation Sequence
Confirm the embedding, cell set, legend, and metadata alignment. State which variable controls the colors.
Report where labels overlap or separate in the displayed coordinates, without assigning a cause.
Tabulate samples across batch and condition, identify missing combinations, and distinguish cells from independent biological replicates.
State whether the plot is compatible with a batch- or condition-associated pattern, and whether the design permits their contributions to be distinguished.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In a condition-colored UMAP, treated cells occupy a separate island from controls. What can be concluded directly from the plot, and what cannot?
- All samples from condition A were processed in batch 1, and all samples from condition B in batch 2. Would adding more cells from those same samples resolve condition-batch confounding? Explain.
- Each of two conditions is represented in each of three batches. Does this guarantee that an observed condition pattern is biological? Why or why not?
- Batch colors overlap throughout a PCA plot. Does this establish that batch has no technical effect?
Solutions. (1) The displayed coordinates differ between the labeled groups in this UMAP. The plot alone cannot establish that condition caused the separation or rule out batch, sample, or other explanations. (2) No. The same condition-batch combinations remain; additional cells do not create the missing combinations needed to distinguish their contributions. (3) No. Crossing permits comparisons within batches, but other sample-level differences or design limitations may remain, and a visual pattern is not causal proof. (4) No. Technical effects may be subtle, obscured in two dimensions, or present in directions not visible in the plot; overlap is not proof of their absence.