Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Bootstrap Intervals for Differential Abundance

Differential Abundance and Compositional Effects · Tutorial 542 of 700

Bootstrap Intervals for Differential Abundance

Use donor-level resampling to construct and interpret uncertainty intervals for differential-abundance contrasts, while recognizing when limited replication makes those intervals unreliable.

Advanced 10 min read

What You'll Learn

  • Define a contrast between average donor-level cell-type proportions.
  • Choose an independent or paired donor bootstrap to match the study design.
  • Construct percentile intervals from bootstrap contrasts and interpret them correctly.
  • Distinguish biological replication from the number of cells sequenced per donor.
  • Recognize how few donors, zeros, and rare cell types destabilize bootstrap intervals.

Why the Resampling Unit Matters

A cell-type proportion is calculated from cells, but evidence about a condition difference comes from biological replication. Cells from the same donor share biological and technical influences, so treating them as independent resampling units exaggerates how much independent information the study contains. For an interval about a population of donors, the bootstrap must therefore resample donors.

Let \(p_{ig}\) be the observed proportion of cells assigned to a particular cell type for donor \(i\) in group \(g\), where \(g=0\) denotes the reference condition and \(g=1\) the comparison condition. If there are \(n_g\) donors in group \(g\), define the equally weighted group mean as \(\bar p_g=n_g^{-1}\sum_{i=1}^{n_g}p_{ig}\). The contrast considered here is the difference in mean donor-level proportions, \(\Delta=\mu_1-\mu_0\), estimated by \(\hat\Delta=\bar p_1-\bar p_0\). The units are proportion points: a contrast of \(0.04\) is a difference of 4 percentage points.

Definition: A donor-level bootstrap interval is an interval formed from repeated resamples of the observed donors, with each resample preserving the study’s independent or paired sampling structure. For each resample, calculate the same donor-level contrast as in the original data. The resulting bootstrap contrasts approximate the sampling variability of that contrast across studies that could have sampled different donors.

This target gives each donor equal weight, regardless of how many cells were captured from that donor. It is different from pooling all cells in a group and calculating one cell-weighted proportion: that pooled quantity gives more influence to donors contributing more cells. Decide which quantity matches the scientific question before resampling.

Independent-Group Percentile Intervals

For independent groups, resample the \(n_0\) reference donors with replacement from the observed reference donors, and separately resample the \(n_1\) comparison donors with replacement from their observed donors. Each bootstrap resample contains the original number of donors in its group. Compute the two resampled means and subtract them to obtain one bootstrap contrast, \(\hat\Delta^{*b}\). Repeat this process \(B\) times.

$$ \hat\Delta^{*b}=\bar p_1^{*b}-\bar p_0^{*b}, \qquad b=1,\ldots,B $$

The percentile interval uses the empirical quantiles of these \(B\) bootstrap contrasts. For a nominal 95% interval, its endpoints are the 2.5th and 97.5th percentiles. More generally, for confidence level \(1-\alpha\), use quantiles \(\alpha/2\) and \(1-\alpha/2\). This procedure approximates the sampling distribution of the estimator by the distribution generated when observed donors stand in for the donor population.

The basic assumptions are substantive as well as computational: donors are independent across groups; within each group, the observed donors are reasonably representative and exchangeable for the target donor population; and the statistic is calculated consistently in every resample. If assignment was paired, or observations were clustered by a higher-level unit, the resampling must preserve that structure. Resampling cells independently does not satisfy these requirements.

Worked Example: Enumerating a Small Independent-Group Bootstrap

Suppose two hypothetical reference-condition donors have observed proportions \(0.05\) and \(0.15\), while two comparison-condition donors have proportions \(0.10\) and \(0.20\). Each proportion is the fraction of that donor’s captured cells assigned to the specified cell type. The observed means are \(0.10\) and \(0.15\), so the estimated contrast is \(0.15-0.10=0.05\), or 5 percentage points.

For a bootstrap sample of size two from the reference donors, the possible resampled means are \(0.05\), \(0.10\), and \(0.15\), with probabilities \(0.25\), \(0.50\), and \(0.25\), respectively. For the comparison donors, the possible means are \(0.10\), \(0.15\), and \(0.20\), with the same probabilities. Because the groups are resampled independently, multiply the probabilities of each pair of means and combine pairs that give the same contrast.

For example, the bootstrap contrast \(0.05\) arises from comparison mean \(0.10\) minus reference mean \(0.05\), from \(0.15-0.10\), or from \(0.20-0.15\). Its probability is \(0.25(0.25)+0.50(0.50)+0.25(0.25)=0.375\). The full distribution is:

Bootstrap contrastProbability
\(-0.05\)0.0625
0.000.2500
0.050.3750
0.100.2500
0.150.0625

The probabilities sum to \(1.000\). For example, the probability at \(0.10\) includes the pairings \(0.15-0.05\) and \(0.20-0.10\), so it is \(0.50(0.25)+0.25(0.50)=0.250\). Using the empirical quantile convention that selects the smallest value whose cumulative probability reaches the requested percentile, the 2.5th percentile is \(-0.05\), and the 97.5th percentile is \(0.15\). The resulting percentile interval is \([-0.05,0.15]\), in proportion units. It includes zero, but this tiny example is for arithmetic, not evidence that a two-donor-per-group study gives a dependable interval.

From Resamples to an Interval

In practice, the number of possible resamples is usually too large to enumerate. A computer draws \(B\) resamples, calculates one contrast for each, and sorts the results. A large \(B\), such as 10,000 or more, reduces Monte Carlo noise in the estimated quantiles; it does not create additional biological replication or remove uncertainty caused by having few donors.

1
Set the estimand and sampling unit.
Specify the cell type, the donor-level proportion, the group contrast, and whether donors are independent or paired.
2
Resample donors in a design-respecting way.
For independent groups, sample donors with replacement separately within each group. For paired data, sample complete donor pairs.
3
Recalculate the contrast.
Use the same definition and weighting as in the original analysis for every resample.
4
Take bootstrap quantiles.
For a percentile interval, report the chosen lower and upper quantiles, with the confidence level and units.

A percentile interval is not a statement that the fixed parameter has a specified probability of lying between these particular endpoints. In repeated studies under the stated sampling conditions, a well-calibrated 95% confidence-interval procedure would cover the target parameter about 95% of the time. Bootstrap coverage is approximate, and can be poor when the number of independent donors is small or the statistic has a highly discrete or boundary-heavy distribution.

Worked Example: A Percentile Interval From Hypothetical Resampling

Consider five hypothetical donors per condition. Their observed proportions are \(0.08, 0.10, 0.12, 0.14, 0.16\) in the reference group and \(0.12, 0.15, 0.18, 0.20, 0.25\) in the comparison group. The group means are \(0.120\) and \(0.180\), respectively, giving \(\hat\Delta=0.180-0.120=0.060\), or 6 percentage points.

Suppose 20,000 independent-group donor bootstrap resamples are drawn and the 2.5th and 97.5th percentiles of the resulting contrasts are \(0.020\) and \(0.100\). These are hypothetical software results, not values obtained by enumerating the resamples. The percentile interval is therefore \([0.020,0.100]\), or 2 to 10 percentage points. In context, the interval estimates a positive difference in the average observed donor-level proportion for this cell type in the comparison condition, under the sampling assumptions.

The interval’s interpretation depends on the definition of the proportion. If each donor’s value is its cell-type count divided by its total captured-cell count, the bootstrap reflects variation among donors’ observed proportions. It does not automatically account for every source of uncertainty in cell capture, cell classification, or within-donor measurement. More bootstrap draws would make the computed quantiles more stable, but the study still has only five independent donors per group.

Paired Designs and the Choice of Alternative

When each comparison-condition observation is linked to a reference-condition observation from the same donor, preserve that pairing. For each donor, calculate the within-donor difference \(d_i=p_{i1}-p_{i0}\), resample the observed differences with replacement, and calculate their mean for each replicate. Resampling the two condition columns separately would break the pairing and generally estimate the wrong variability.

$$ \hat\Delta_{\mathrm{paired}}=\bar d=\frac{1}{n}\sum_{i=1}^{n}d_i $$

For example, suppose three hypothetical paired donors have differences \(0.02\), \(0.04\), and \(0.09\). The estimated mean difference is \((0.02+0.04+0.09)/3=0.050\), or 5 percentage points. A paired bootstrap draws three differences with replacement per replicate and averages them. This keeps the within-donor correspondence intact; it does not make three pairs a large sample.

Bootstrap intervals and permutation tests answer related but different questions. A donor-level permutation test evaluates a null hypothesis using the assignment or exchangeability structure; it is a test, not by itself an interval estimate. A bootstrap interval estimates uncertainty in a chosen contrast under repeated donor sampling. For an interval, the independent-group bootstrap is appropriate for independent donors, while the paired bootstrap operates on pairs or within-pair differences. Model-based approaches such as beta-binomial or other proportion models can encode distributional structure and covariates; their conclusions rely on their own modeling assumptions rather than on donor resampling alone.

Few Donors, Zeros, and Diagnostics

Bootstrap resampling cannot generate donor patterns absent from the observed sample. With few donors, many resamples repeat the same donors, the bootstrap distribution may be coarse, and a percentile interval can be unstable or misleading. For a rare cell type, observed zeros may recur frequently in resamples; if all donors in one group have zero observed proportion, every ordinary donor bootstrap replicate for that group also has zero mean. The resulting interval cannot reveal unobserved positive proportions in the donor population.

Check the number of independent donors in each group, the donor-level proportions, and the bootstrap distribution itself. Look for a small number of donors dominating the contrast, a large mass of identical or boundary-valued replicates, marked skewness, or endpoints that change substantially when the number of bootstrap draws is increased. Changing \(B\) assesses simulation stability only. If endpoints remain unstable because the study has few donors, increasing \(B\) does not solve the problem.

A common mistake is to resample individual cells, obtain a very narrow interval, and interpret it as precise evidence about a condition effect. That procedure treats cells from one donor as if they were independent biological replicates. The correction is to resample donors—or complete donor pairs—because the target uncertainty concerns variation across biological donors. A separate mistake is to interpret a bootstrap interval that excludes zero as proof of causation; an observational condition contrast remains an association unless the design and assumptions justify a causal interpretation.

Key limitation: A donor bootstrap estimates uncertainty from the donor sample that was observed. It is not a remedy for an unrepresentative donor sample, confounding, annotation error, capture bias, or very limited biological replication. Report the donor counts, the estimand, the resampling scheme, the interval method, and the interval’s units.

Worked Example: Recognizing an Uninformative Rare-Type Bootstrap

Suppose a rare cell type has hypothetical observed donor proportions \(0,0,0.03\) in the reference group and \(0,0.03,0.03\) in the comparison group. The means are \(0.010\) and \(0.020\), so the estimated difference is \(0.020-0.010=0.010\), or 1 percentage point. There are only three donors per group, and two of the three observed proportions in each group are zero.

In an ordinary donor bootstrap, each group’s resample is assembled only from its three observed values. The reference group can never produce a donor value above \(0.03\), and the comparison group can never produce one outside \(0\) and \(0.03\). The resamples will often repeat zeros, so many bootstrap contrasts will be discrete and tied. The sample contrast is computable, but neither a large number of resamples nor a tidy-looking percentile interval can establish that the donor-population contrast is precisely known. The small number of donors and the rare-type zeros are substantive limitations to report.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. Why should an independent-group bootstrap resample donors rather than individual cells?
  2. For independent groups with donor means \(0.12\) and \(0.17\), what is the estimated contrast, and what are its units?
  3. In a paired study, what unit should be resampled, and why?
  4. Does increasing the number of bootstrap replicates compensate for having only three donors per group?

Solutions. (1) Donors are the biological replicates; cells within a donor are not independent biological units. Resampling cells would understate uncertainty across donors. (2) The contrast is \(0.17-0.12=0.05\), a difference of 5 percentage points in mean donor-level proportions. (3) Resample complete donor pairs, or equivalently resample the within-donor differences, to preserve the correspondence between conditions. (4) No. More replicates reduce Monte Carlo error in the estimated bootstrap quantiles, but they do not add donors or resolve the instability caused by limited biological replication.

Clinical Biostats