Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Diagnosing Complete Condition-Batch Confounding

Multi-Sample and Multi-Condition Study Designs · Tutorial 576 of 700

Diagnosing Complete Condition-Batch Confounding

You will learn to diagnose complete condition-batch confounding and explain what the observed data can—and cannot—say about condition effects.

Advanced 10 min read

What You'll Learn

  • Identify perfect alignment between biological condition and processing batch from an allocation table.
  • Distinguish a condition contrast from a combined condition-and-batch contrast.
  • Use an additive model to demonstrate why separate effects are not identifiable.
  • Explain why additional cells or batch adjustment cannot resolve complete confounding.
  • Recognize analysis and interpretation errors caused by zero condition-by-batch combinations.

Why Allocation Matters

A difference in measured expression between conditions is informative about biology only to the extent that it can be distinguished from other differences in how samples were processed. If every sample in one condition was processed in one batch and every sample in the other condition in another batch, the observed condition contrast also contains any batch contrast. This is complete condition-batch confounding: the allocation does not provide observations that separate the two sources of difference.

The problem is about the design, not the number of cells measured. Single-cell data may contain thousands of cells per sample, but the condition and batch assignments are made at the sample level. Cells from the same sample do not create new condition-by-batch combinations. The introductory material on crossing biological condition with batch motivates allocation that permits the effects to be distinguished; here the focus is diagnosing what happens when the allocation does not.

Definition: Condition and batch are completely confounded in a two-condition, two-batch design when each condition occurs in exactly one batch and each batch contains exactly one condition. Equivalently, the observed condition-by-batch allocation table has observations in only the two cells that pair each condition with its corresponding batch, and zero observations in the other two cells.

An allocation table counts independent biological samples, not cells. For a study with multiple donors, a useful first check is to tabulate donor samples by condition and batch. If sample processing is recorded at a finer or different level, the table should reflect the actual units assigned to batches. A large cell count in an occupied table cell does not compensate for a missing combination.

A Model Shows What Cannot Be Separated

Consider a response \(Y_i\) for sample \(i\), such as a sample-level expression summary for one gene in one cell type. Let \(C_i=1\) for condition B and \(C_i=0\) for condition A. Let \(B_i=1\) for batch 2 and \(B_i=0\) for batch 1. A simple additive model for the sample mean is

$$ E(Y_i\mid C_i,B_i)=\beta_0+\beta_C C_i+\beta_B B_i. $$

Here \(\beta_C\) represents the condition contrast at a fixed batch, and \(\beta_B\) represents the batch contrast at a fixed condition. This interpretation depends on the additive model and on the design containing comparisons at fixed batch and fixed condition. The model is a diagnostic device here: it makes explicit which contrasts the allocation can support. It does not assert that expression data must follow a simple linear model in every analysis.

Suppose all condition A samples are in batch 1 and all condition B samples are in batch 2. Then every observed sample has \(B_i=C_i\), so the model reduces, for the observed samples, to

$$ E(Y_i\mid C_i)=\beta_0+(\beta_C+\beta_B)C_i. $$

The observed difference between condition means can therefore inform the sum \(\beta_C+\beta_B\), but not its separate components. For example, a contrast of 5 units is compatible with a condition effect of 5 and batch effect of 0, a condition effect of 0 and batch effect of 5, or a condition effect of 2 and batch effect of 3. All produce the same expected observed contrast under this allocation.

This is non-identifiability: different values of the separate parameters imply the same distribution for the observed data under the model. More samples in the same two condition-batch combinations may estimate the combined contrast more precisely, but cannot distinguish its components. If instead the two conditions are paired with batches in the opposite direction, so \(B_i=1-C_i\), the observed contrast is \(\beta_C-\beta_B\). The conclusion is the same: only a combined contrast is observed, not the separate effects.

Key result: Under the additive model, perfect condition-batch alignment leaves no observed comparison that holds batch fixed while changing condition, or holds condition fixed while changing batch. The separate condition and batch effects are therefore not identified by that allocation. A condition-associated difference may be reported descriptively, but it cannot be attributed to condition rather than batch from these data alone.

Worked Examples

Worked Example: Finding Complete Confounding in a Sample Table

A hypothetical study measures a cell type in eight donor samples. Four condition A samples are processed in batch 1, and four condition B samples are processed in batch 2. The allocation table is:

ConditionBatch 1Batch 2Total samples
A404
B044
Total samples448

Condition A appears only in batch 1, and condition B appears only in batch 2. Both mixed combinations—A in batch 2 and B in batch 1—have zero samples. The design therefore meets the definition of complete confounding. In the binary coding above, every observed sample has \(B_i=C_i\).

The four donors in each observed combination provide biological replication for comparing the two observed groups. They do not provide a way to decide whether a difference between those groups is due to condition, batch, or both. Counting more cells from these same samples would not change any of the table entries that are zero.

Worked Example: Decomposing an Observed Expression Difference

In a hypothetical analysis, the sample-level mean expression of a gene is 8.0 units for condition A in batch 1 and 13.0 units for condition B in batch 2. Assume the two groups have the same number of independent samples for this illustration. The observed contrast is

$$ 13.0-8.0=5.0\text{ expression units}. $$

Under the additive model and the alignment \(B_i=C_i\), this contrast estimates \(\beta_C+\beta_B\), not \(\beta_C\) alone. The following parameter pairs all give the same fitted means of 8.0 and 13.0:

  • If \(\beta_C=5.0\) and \(\beta_B=0\), then the combined contrast is \(5.0+0=5.0\).
  • If \(\beta_C=0\) and \(\beta_B=5.0\), then the combined contrast is \(0+5.0=5.0\).
  • If \(\beta_C=2.0\) and \(\beta_B=3.0\), then the combined contrast is \(2.0+3.0=5.0\).

For each pair, set \(\beta_0=8.0\). The predicted mean for A in batch 1 is then \(8.0\); the predicted mean for B in batch 2 is \(8.0+\beta_C+\beta_B=13.0\). The observations alone cannot choose among these decompositions. It would be incorrect to report the 5.0-unit difference as an estimated biological condition effect without additional information or design assumptions that separate condition from batch.

Worked Example: Three Conditions in Three Matched Batches

A hypothetical study assigns condition A only to batch 1, condition B only to batch 2, and condition C only to batch 3. The sample counts are 3, 3, and 3 in those matched combinations, with zero samples in every other condition-by-batch combination. Suppose the observed mean expression values are 10, 12, and 15 units, respectively.

For a categorical condition and categorical batch, an additive description can be written as an overall level plus a condition contribution and a batch contribution. For each observed pairing, the corresponding mean is the sum of those contributions. The observed values provide the three sums: 10 for A with batch 1, 12 for B with batch 2, and 15 for C with batch 3.

For instance, the observed difference between B with batch 2 and A with batch 1 is \(12-10=2\) units. That difference combines the B-versus-A condition contrast with the batch-2-versus-batch-1 contrast. The observed difference between C with batch 3 and A with batch 1 is \(15-10=5\) units and likewise combines condition and batch differences. The nine samples improve the estimates of the three observed means, but no condition is observed in more than one batch. Consequently, the allocation supplies no within-batch condition comparison to separate the contributions.

The same issue is visible directly from the table structure: each condition has one occupied batch, and each batch has one occupied condition. The number of conditions does not remove the confounding when the allocation preserves this one-to-one matching.

Diagnostics and Responses

The primary diagnostic is to tabulate independent samples by condition and batch before interpreting a condition contrast. Check the actual sample assignments, not just the intended design. A sample recorded in the wrong batch, a batch label that combines distinct processing runs, or a donor mistakenly counted as several independent samples can obscure the allocation. Also verify that the batch variable represents the processing factor under discussion; a table cannot diagnose a factor that was not recorded.

When the occupied cells lie only on a one-to-one condition-batch pairing, treat a condition-only interpretation as unsupported by the design. A statistical adjustment for batch cannot manufacture the missing comparisons. Software may still return a coefficient after dropping a term, choosing a constraint, or using external assumptions. Such output does not mean that the observed allocation has separated the biological and technical effects.

The main alternatives have different implications:

  • Ignore batch and compare conditions. This estimates a contrast between the observed condition-batch groups. It does not isolate a condition effect.
  • Include batch as an adjustment variable. With complete alignment, the observed data do not distinguish the two effects in the additive model. The software’s handling of the redundant information cannot supply the missing comparisons.
  • Use batch correction. A transformation or correction procedure cannot determine from these data which aligned difference is technical and which is biological without assumptions or information beyond the allocation. It may remove biological signal along with a batch-associated difference.
  • Collect additional cells in the existing samples. This can increase cell-level measurement but does not add independent condition-by-batch combinations. To resolve the design problem, new samples must provide informative combinations, or the analysis must rely transparently on justified external information.

These points do not imply that the data are useless. They can describe differences between the observed groups, support quality-control summaries, or motivate a better allocation in a future study. The limitation is specifically that the data alone do not identify separate condition and batch effects. Report the allocation, describe the contrast as condition-and-batch associated, and avoid presenting it as a batch-adjusted biological effect.

Common Mistake

A common but incorrect argument is: “There are many donors and thousands of cells per donor, so the condition effect can be estimated precisely after adjusting for batch.” More observations can reduce uncertainty about quantities that the design identifies; they do not make two inseparable effects separately identifiable. With perfect alignment, the expected contrast remains \(\beta_C+\beta_B\) (or the corresponding combined contrast under another coding), regardless of how many cells are measured. The correction is to inspect the sample-level allocation first and state which contrast the data actually support.

A second warning is not to confuse “the model produced a condition coefficient” with “the design identified a condition effect.” In a confounded analysis, a reported coefficient may depend on which term was removed or on constraints imposed by software. Explain those choices if such an analysis is unavoidable, and do not describe the resulting coefficient as separated from batch by the data.

Check Your Understanding

Use the allocation and identifiability principles above. Brief solutions follow each question.

  1. A study has 6 condition A samples in batch 1 and 6 condition B samples in batch 2, with both other table cells empty. Is condition completely confounded with batch? Solution: Yes. Each condition occurs in only one batch, and each batch contains only one condition.
  2. In the additive binary model, the observed condition B minus A contrast is 7 units and batch 2 aligns with condition B. What parameter combination does the contrast represent? Solution: It represents \(\beta_C+\beta_B=7\), not \(\beta_C=7\) by itself.
  3. Would sequencing ten times as many cells from every existing sample resolve complete confounding? Solution: No. The sample allocation remains unchanged, so no condition-by-batch combination is added.
  4. Why does including batch in a regression not, by itself, solve the problem? Solution: Under perfect alignment, condition and batch indicators carry the same sample-level pattern. The observed data contain no comparison that changes one while holding the other fixed, so separate effects are not identified.
  5. How should a 4-unit difference between condition-and-batch groups be described when the two factors are completely confounded? Solution: As a 4-unit observed difference between those groups, associated jointly with their condition and batch assignments. It should not be attributed to condition alone from these data.
Clinical Biostats