Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Bootstrapping Donors Rather Than Cells

Biological Replication and Donor-Level Inference · Tutorial 447 of 700

Bootstrapping Donors Rather Than Cells

You will learn to construct donor-level bootstrap distributions, estimate uncertainty for donor-weighted statistics, and diagnose why a cell-level bootstrap answers a different question.

Advanced 10 min read

What You'll Learn

  • Define the donor-level statistic and sampling unit before resampling.
  • Construct a nonparametric bootstrap by drawing donors with replacement.
  • Estimate bootstrap standard errors and percentile intervals from replicate statistics.
  • Compare donor-resampling uncertainty with the often narrower cell-bootstrap estimate.
  • Resample separately within groups when estimating a between-group contrast.
  • Recognize the limits of bootstrap inference when the number of independent donors is small.

Why the Resampling Unit Matters

A single-cell data set may contain thousands of cells but only a modest number of donors. Cells from one donor share biological and technical features, so they are not independent biological replicates. For population-level inference, the donor is ordinarily the sampling unit: the unit that would be independently sampled from the population of interest. A bootstrap that treats every cell as an independent unit replaces this sampling structure with a different one.

The donor-level bootstrap starts with one summary per donor, such as a cell-type proportion or mean expression value, and resamples those summaries with replacement. Each bootstrap replicate contains the same number of donors as the observed sample, but some donors appear more than once and others may be absent. The statistic is recalculated for every replicate; the resulting distribution estimates how the statistic varies under repeated sampling of donors, subject to the assumptions and limitations described below.

Definition: Given \(m\) observed, independent donors with donor-level summaries \(Y_1,\ldots,Y_m\), a nonparametric donor bootstrap draws \(m\) summaries with replacement from the observed \(m\) summaries and recalculates the target statistic. Repeating this procedure \(B\) times gives bootstrap statistics \(T_1^*,\ldots,T_B^*\). Their spread estimates sampling uncertainty at the donor level.

The statistic must match the estimand. If the target is the average donor summary, each donor receives equal weight, regardless of how many cells were measured for that donor. Resampling cells and averaging all selected cells instead generally targets a cell-weighted quantity and treats clustered observations as if they were independent. The earlier material on donor-level summaries and confidence intervals provides the context for defining a donor-level target; here the focus is how to resample its independent units.

Constructing the Donor Bootstrap

For an equal-weighted mean of donor summaries, the observed estimate is \(\bar{Y}=m^{-1}\sum_{i=1}^{m}Y_i\). In bootstrap replicate \(b\), let \(Y_{1b}^*,\ldots,Y_{mb}^*\) be the resampled donor summaries and calculate \(\bar{Y}_b^*=m^{-1}\sum_{j=1}^{m}Y_{jb}^*\). Other statistics, including medians or differences between group means, are handled by recalculating that statistic in each replicate.

A common bootstrap standard error is the sample standard deviation of the replicate statistics:

$$ \widehat{SE}_{\mathrm{boot}}(T) = \sqrt{\frac{1}{B-1}\sum_{b=1}^{B}(T_b^*-\bar{T}^*)^2}, \qquad \bar{T}^*=\frac{1}{B}\sum_{b=1}^{B}T_b^*. $$

A percentile interval uses the empirical quantiles of the bootstrap statistics. For example, the 2.5th and 97.5th percentiles form a nominal 95% percentile interval. This is a procedure for estimating uncertainty, not a guarantee of 95% coverage in every setting. With few donors, the empirical distribution is coarse, and the percentile endpoints can be unstable.

The donor bootstrap relies on the donors being independent and reasonably representative of the population to which conclusions are intended to apply. The resampling scheme must also preserve the design. If estimating a difference between two independent groups, resample donors with replacement separately within each group, retaining each group’s observed donor count. Pooling the groups before resampling would fail to preserve their group membership and sizes.

Why the Donor Bootstrap Has This Spread

The bootstrap standard error is not an arbitrary measure: for a mean, its conditional variance can be derived directly. Conditional on the observed donor summaries, one bootstrap draw \(Y^*\) takes each observed value \(Y_i\) with probability \(1/m\). Its conditional mean is \(\bar{Y}\), and its conditional variance is \(m^{-1}\sum_{i=1}^{m}(Y_i-\bar{Y})^2\). A replicate mean averages \(m\) independent draws from this empirical distribution, so its variance is the variance of one draw divided by \(m\):

$$ \operatorname{Var}_*(\bar{Y}^*) = \frac{1}{m}\left\{\frac{1}{m}\sum_{i=1}^{m}(Y_i-\bar{Y})^2\right\} = \frac{m-1}{m^2}s_Y^2, $$

where \(s_Y^2=(m-1)^{-1}\sum_{i=1}^{m}(Y_i-\bar{Y})^2\), and \(\operatorname{Var}_*\) denotes variance under repeated bootstrap resampling conditional on the observed data. The usual estimated standard error of the sample mean is \(s_Y/\sqrt{m}\). The conditional bootstrap standard deviation is \(\sqrt{(m-1)/m}\,s_Y/\sqrt{m}\); the difference reflects the finite empirical distribution used by the bootstrap and diminishes as \(m\) grows.

This calculation also clarifies what a cell bootstrap misses. If cells from the same donor are correlated, treating them as independent resampling units does not reproduce the variation that would arise from drawing a new set of donors. Increasing the number of sampled cells can make a cell-bootstrap standard error very small without increasing the number of independent biological replicates.

Worked Example: Resampling Two Donors

Suppose a hypothetical experiment has two independent donors with donor-level expression summaries of 1 and 3 normalized units. The target is the equal-weighted mean donor summary, which is \(\bar{Y}=(1+3)/2=2\) normalized units. For clarity, enumerate all four ordered bootstrap samples of size two. Each has probability \(1/4\).

The samples \((1,1),(1,3),(3,1),(3,3)\) give replicate means \(1,2,2,3\) normalized units. Their mean is \(\bar{T}^*=2\), and their bootstrap variance is

$$ \frac{(1-2)^2+(2-2)^2+(2-2)^2+(3-2)^2}{4} =\frac{2}{4}=0.5. $$

Thus the exact bootstrap standard error for this empirical distribution is \(\sqrt{0.5}=0.7071\) normalized units. This example shows the resampling mechanics, not a reliable population interval: two donors provide very little information, and the bootstrap distribution has only three distinct values.

Comparing Donor and Cell Resampling

The difference can be substantial even when every donor contributes the same number of cells. Equal cell counts make the pooled cell average equal to the average of donor means, but they do not make cells independent. A cell bootstrap resamples from the cell-level empirical distribution; a donor bootstrap resamples from the donor-level empirical distribution. Their uncertainty estimates therefore describe different sources of variation.

Worked Example: A Cell Bootstrap Can Be Much Too Narrow

Consider four hypothetical donors with 100 cells each. Their donor-level summaries are 2, 4, 6, and 8 normalized units. Assume, for this calculation, that the 100 cell measurements within each donor have variance 1 normalized-unit-squared, and that the cell-level summaries average to the stated donor values. The target is the equally weighted mean across donors, \(5\) normalized units.

For the donor bootstrap, the empirical variance of a single resampled donor summary is \(((-3)^2+(-1)^2+1^2+3^2)/4=5\) normalized-unit-squared. Each bootstrap mean averages four independent draws from that empirical distribution. Its variance is \(5/4=1.25\), so its bootstrap standard error is \(\sqrt{1.25}=1.118\) normalized units.

Now consider resampling all 400 cells as if independent. The pooled cell variance is 6 normalized-unit-squared: 5 comes from the spread of donor means around 5, and 1 is the assumed within-donor variance. The variance of the cell-bootstrap mean is approximately \(6/400=0.015\), giving a standard error of \(\sqrt{0.015}=0.1225\) normalized units. The small finite-sample adjustment for resampling from 400 observed cells gives the same value here to the shown precision.

The cell-bootstrap estimate is about nine times smaller than the donor-bootstrap estimate. It has treated 400 correlated cell measurements as 400 independent replicates, rather than recognizing that the evidence about population differences comes from four donors. The exact amount of discrepancy depends on the data and design; the key point is that cell count alone does not determine donor-level uncertainty.

When there are many donors, the donor bootstrap can be a practical, distribution-light way to estimate uncertainty for a donor-level statistic. Compared with a donor-level \(t\) interval, it does not impose a normal model for the donor summaries, but it still depends on having enough independent donors for the empirical distribution to represent population variation. With very few donors, neither resampling nor a different interval formula can manufacture information absent from the sample.

Group Contrasts and Design-Preserving Resampling

For a contrast between independent groups, resampling should take place within each group. If group A has \(m_A\) donors and group B has \(m_B\), draw \(m_A\) donors with replacement from A and \(m_B\) with replacement from B. In each replicate, calculate the group summaries and their difference using the same direction as the observed contrast. This retains group sizes and prevents a replicate from changing the design.

Worked Example: Bootstrap Standard Error for a Group Difference

Suppose a hypothetical study has donor summaries of 2, 4, and 6 normalized units in group A, and 5, 7, and 9 normalized units in group B. Define the contrast as group B mean minus group A mean. The observed means are 4 and 7 normalized units, so the contrast is \(7-4=3\) normalized units.

Under separate donor resampling, each group has three bootstrap draws per replicate. For either group, the empirical variance of one draw is \(((-2)^2+0^2+2^2)/3=8/3\) normalized-unit-squared. Thus the variance of a bootstrap group mean is \((8/3)/3=8/9\). Since the two groups are independently resampled, the bootstrap variance of their difference is the sum:

$$ \operatorname{Var}_*(\bar{Y}_B^*-\bar{Y}_A^*) = \frac{8}{9}+\frac{8}{9} = \frac{16}{9}, \qquad \widehat{SE}_{\mathrm{boot}}=\sqrt{\frac{16}{9}}=1.333 $$

The estimated uncertainty is therefore 1.333 normalized units for a contrast estimated at 3 normalized units. The formula depends on the groups being independently sampled and the bootstrap resampling them separately. In practice, one uses a large number of replicates and calculates the contrast each time; the calculation above gives the exact conditional variance for this small empirical example.

Diagnostics, Limitations, and Common Mistakes

A bootstrap is useful only when the resampling scheme reflects the design and the target statistic. Before interpreting its output, check that the resampled rows correspond to independent donors, that group membership is preserved where relevant, and that each replicate recomputes the intended donor-weighted statistic. Inspect the bootstrap distribution for discreteness, strong skew, or replicates dominated by one or two donor values. A very small donor count or an extreme donor can make standard errors and percentile endpoints sensitive to the observed sample.

  • Wrong unit: resampling individual cells as if they were independent donors typically understates uncertainty when cells are correlated within donors. Resample donors for donor-population inference.
  • Wrong weighting: resampling cells and taking a pooled mean can give more influence to donors with more cells. If the target is the average donor, calculate the donor summaries and average donors equally.
  • Wrong group scheme: pooling donors from separate groups and resampling them together does not preserve the group design. Resample within groups for an independent-group contrast.
  • Overinterpreting a small sample: many bootstrap replicates reduce Monte Carlo noise, but do not increase the number of observed donors or resolve a coarse, unstable bootstrap distribution.

The donor bootstrap estimates between-donor sampling uncertainty for the statistic calculated from the observed donor summaries. It does not, by itself, simulate additional cell measurements within each donor. If donor summaries are noisy because only a limited number of cells were measured, that source of uncertainty is not separately represented by resampling the summaries as fixed values. The appropriate analysis depends on the estimand and data-generating process; the donor bootstrap should not be described as capturing every source of uncertainty.

Key takeaway: Match the bootstrap sampling unit to the independent unit relevant to the inference. For donor-population inference, resample whole donors, recalculate the donor-level statistic, and interpret the resulting spread in light of the number and representativeness of the donors.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. A study has 12 donors and 800 cells. For inference about the average donor summary, how many donor summaries are drawn in each ordinary bootstrap replicate?
  2. Why can a cell bootstrap produce a much smaller standard error than a donor bootstrap?
  3. Two independent groups have 8 and 10 donors. How should the donors be resampled for a bootstrap distribution of the group-mean difference?
  4. For donor summaries \(1,3\), what are the four ordered bootstrap samples of size two and their replicate means?
  5. Does increasing the number of bootstrap replicates compensate for having only four donors? Explain.

Solutions. (1) Draw 12 donor summaries with replacement, because the observed number of independent donors is 12. (2) The cell bootstrap treats correlated cells from the same donor as independent resampling units and can therefore omit much of the donor-to-donor variation relevant to population inference. (3) Draw 8 donors with replacement within the first group and 10 with replacement within the second group, then compute the contrast for each replicate. (4) The ordered samples are \((1,1),(1,3),(3,1),(3,3)\), with means \(1,2,2,3\). (5) No. More replicates reduce Monte Carlo error in estimating the bootstrap distribution, but they do not add observed donors or make the underlying donor-level information more precise.

Clinical Biostats