Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Common Support for Batch-Adjusted Comparisons

Batch Effects Confounded With Biological Condition · Tutorial 141 of 700

Common Support for Batch-Adjusted Comparisons

You will learn to find batch-level overlap, calculate supported condition contrasts, and state clearly which samples and population those contrasts represent.

Advanced 11 min read

What You'll Learn

  • Identify batches that contain independent samples from both conditions.
  • Distinguish supported samples from batches that lack a comparison group.
  • Define a within-support contrast and specify its batch weights.
  • Derive when an additive batch model justifies a within-batch contrast.
  • Explain how restriction changes the target population and limits generalization.
  • Diagnose sparse overlap, unsupported batches, and misleading pooled comparisons.

Why Common Support Matters

A batch-adjusted condition comparison is grounded most directly in batches that contain samples from both conditions. Within such a batch, the two groups share the recorded batch label, so their observed difference can be formed without comparing one batch's treated samples with another batch's control samples. This is the practical meaning of common support for a discrete batch variable.

The restriction has a cost: it changes which samples, batches, and potentially which biological settings the comparison describes. If some batches contain only one condition, their samples cannot contribute a direct within-batch contrast. A result estimated from the remaining batches is not automatically an estimate for every sample originally collected. The key tasks are therefore to identify support before fitting or interpreting a comparison, and to state the target population that remains.

Definition: For two conditions, call a batch supported if it contains at least one independent biological sample from each condition. The common-support set is the set of supported batches. Samples in those batches are supported samples; samples in batches with only one represented condition are outside this set. Common support is a property of the observed design, not proof that the groups are otherwise comparable.

Finding Supported Batches and Samples

Start from a cross-tabulation of biological samples by batch and condition. A batch with a positive sample count in both condition columns supports a within-batch comparison. A batch with a zero in either column does not. Count biological samples, not cells, when deciding whether each condition is represented: thousands of cells from one donor or specimen do not create thousands of independent biological replicates.

This support check is distinct from asking whether the comparison is precise. A batch with one sample in each condition is structurally supported, but its contrast may be highly uncertain and sensitive to those two samples. Likewise, a large number of cells cannot repair a lack of biological replication. Common support answers whether both groups are present; it does not establish adequate sample size, balance, or reliable measurement.

Worked Example: Classifying Batches by Representation

Suppose a hypothetical single-cell study has four batches. The table gives the number of independent samples in each batch-condition cell.

BatchControl samplesTreated samplesSupported?
A86Yes
B50No
C07No
D43Yes

Batches A and D are supported because both condition counts are positive. B is control-only and C is treated-only, so neither provides a within-batch comparison. The common-support set is \(\{A,D\}\).

There are \(8+6+5+7+4+3=33\) samples in total. Supported samples number \(8+6+4+3=21\), while the 12 samples in B and C are outside the common-support set. This does not mean those 12 samples are unusable for every scientific purpose; it means they cannot contribute direct within-batch contrasts for this particular condition comparison.

Defining the Comparison on Common Support

Let \(Y_i\) denote a sample-level outcome for a specified gene or other prespecified quantity, \(b_i\) the batch for sample \(i\), and \(c_i\) its condition. A sample-level outcome could be a summary derived from that sample's cells; the inferential unit should still reflect biological replication. For each supported batch \(b\), define the condition contrast as the treated mean minus the control mean within that batch:

$$ \widehat{\Delta}_b = \bar{Y}_{b,\mathrm{treated}}-\bar{Y}_{b,\mathrm{control}}. $$

A summary across supported batches requires a choice of weights. For prespecified weights \(w_b\) satisfying \(w_b\geq 0\) and \(\sum_{b\in S}w_b=1\), where \(S\) is the common-support set, the supported contrast is

$$ \widehat{\Delta}_{S} = \sum_{b\in S}w_b\widehat{\Delta}_b. $$

Equal weights give each supported batch the same influence. Other weights may reflect a defined target distribution of batches or samples, but must be stated: weighting by sample counts, for example, targets a different mixture from equal-batch weighting. Weights cannot create information in unsupported batches.

Interpretation: A weighted contrast on common support summarizes within-batch treated-minus-control differences among the represented batches, according to the stated weights. It does not, without additional assumptions, describe the condition difference in batches containing only one condition or in a broader population with a different batch composition.

Worked Example: Combining Within-Batch Differences

In a hypothetical dataset, a sample-level expression summary for one gene has the following values in two supported batches. The entries are sample summaries in arbitrary expression units.

BatchControl valuesTreated values
A2, 3, 45, 6
D1, 32, 4

For batch A, the control mean is \((2+3+4)/3=3\), and the treated mean is \((5+6)/2=5.5\). Thus \(\widehat{\Delta}_A=5.5-3=2.5\) expression units. For batch D, the corresponding means are \((1+3)/2=2\) and \((2+4)/2=3\), so \(\widehat{\Delta}_D=3-2=1\) expression unit.

With equal batch weights, \(w_A=w_D=1/2\), the supported contrast is

$$ \widehat{\Delta}_S = \frac{1}{2}(2.5)+\frac{1}{2}(1) = 1.75 \text{ expression units}. $$

This estimate gives the two supported batches equal weight, despite their different sample counts. It is a descriptive weighted average of the two within-batch contrasts; the calculation alone does not quantify uncertainty or establish a causal effect.

Why Within-Batch Cancellation Requires an Assumption

An additive model helps explain what a within-batch comparison removes. For a sample in batch \(b\) and condition \(c\), write

$$ Y_{ibc}=\mu+\gamma_b+\tau_c+\varepsilon_{ibc}. $$

Here \(\mu\) is a baseline, \(\gamma_b\) is the batch contribution, \(\tau_c\) is the condition contribution, and \(\varepsilon_{ibc}\) is the residual. To derive the conditional-mean contrast from this model, assume explicitly that the residual has conditional mean zero in each observed batch-condition cell: \(E(\varepsilon\mid b,c)=0\). The model also assumes a common condition effect across batches; if effects differ by batch, a single \(\tau_c\) does not represent every within-batch difference.

$$ \begin{aligned} E(Y\mid b,\mathrm{treated})-E(Y\mid b,\mathrm{control}) &=(\mu+\gamma_b+\tau_{\mathrm{treated}}) -(\mu+\gamma_b+\tau_{\mathrm{control}})\\ &=\tau_{\mathrm{treated}}-\tau_{\mathrm{control}}. \end{aligned} $$

The zero conditional-mean assumption is what permits each conditional expectation to omit its residual term. If instead residual means differ between conditions within a batch, the difference includes that residual-mean difference. Common support makes the within-batch contrast available, but does not by itself guarantee the model assumptions or eliminate all bias.

Worked Example: What the Restriction Changes

Return to the supported observations in batches A and D, and suppose their sample summaries are those in the previous example. Add hypothetical unsupported samples: batch B has control values 10 and 11, and batch C has treated values 20 and 22. These batches still have no within-batch condition contrast.

Across all batches, the pooled control mean is \((2+3+4+1+3+10+11)/7=34/7\approx4.857\) units. The pooled treated mean is \((5+6+2+4+20+22)/6=59/6\approx9.833\) units. Their difference is \(59/6-34/7=209/42\approx4.976\) units.

That pooled difference is not the same target as the equal-batch supported contrast of 1.75 units. In the pooled calculation, the control group includes the high-valued control-only batch B, while the treated group includes the high-valued treated-only batch C. Condition and batch composition therefore differ. The arithmetic does not separate a condition difference from those batch differences.

Restricting to A and D gives an interpretable within-batch summary for the supported batches under the chosen equal weights. It also excludes B and C, so the result does not directly describe their samples. If the scientific target includes those unsupported settings, the supported estimate alone cannot answer that broader question.

Diagnostics, Alternatives, and Limitations

Before interpreting a batch-adjusted comparison, inspect the batch-by-condition table and report both the supported batches and the excluded samples. Then examine the number of independent samples per cell, not just the binary presence of a group. Large imbalances, singleton cells, or a contrast driven by one batch are warning signs. Compare batch-specific contrasts as a diagnostic: substantial differences may indicate effect heterogeneity, residual imbalance, or unstable estimation, and should not be concealed by a single average.

For a discrete batch variable, restricting to common support is transparent and avoids pretending that a direct within-batch contrast exists in unsupported batches. A model-based analysis may retain more observations by imposing assumptions that permit comparisons across batches, but those comparisons rely on extrapolation where a condition is absent. Neither strategy is universally preferable: the choice depends on the target population and the credibility of the assumptions. Matching or reweighting can also alter the represented sample mixture, but cannot supply an observed comparison in a batch-condition cell with no samples.

Common support is limited in several ways. First, it is only support with respect to the recorded batch labels; other imbalanced characteristics may remain. Second, sparse overlap can yield noisy contrasts even when support technically exists. Third, an average over supported batches may not transport to unsupported batches, especially if treatment effects vary with batch or biological context. Finally, support is determined by the actual experimental design: adding cells to existing samples does not resolve a missing condition at the biological-sample level.

Common mistake: “Both conditions occur somewhere in the study, so all samples can contribute to a batch-adjusted condition comparison.” This is wrong because global representation does not imply within-batch representation. The correction is to check each batch separately, form direct contrasts only where both conditions occur, and state that the resulting target is restricted to the supported batches and the chosen weighting scheme.
1
Tabulate biological samples.
Count samples by batch and condition; do not treat cells from one sample as independent samples.
2
Mark common support.
Retain batches with at least one sample from each condition for direct within-batch contrasts.
3
Specify the target and weights.
State which supported batches are represented and whether weights are equal, sample-based, or chosen for another defined target.
4
Report what is not identified by support alone.
Describe excluded samples, assess sparse or unbalanced cells, and avoid extending the result to unsupported batches without additional assumptions.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. Batch X has 3 control samples and 0 treated samples; batch Y has 2 control and 4 treated samples. Which batch is supported?
  2. In a supported batch, the control mean is 7 expression units and the treated mean is 9.5. What is the treated-minus-control contrast?
  3. Two supported batches have contrasts of 1 and 5 units. What is their equal-batch average, and what does it summarize?
  4. Why does adding more cells from the sole treated sample in a treated-only batch not create common support?

Solutions. (1) Only Y is supported, because it contains samples from both conditions. (2) The contrast is \(9.5-7=2.5\) expression units. (3) The equal-batch average is \((1+5)/2=3\) units; it summarizes the two supported batch-specific contrasts with equal weight, not necessarily the contrast in all study batches. (4) Cells are nested within that one biological sample; they do not provide a control sample in the batch or independent biological replication for the missing condition.

Clinical Biostats