Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Donor-Stratified Resampling for Cluster Stability

Cluster Validity and Stability · Tutorial 282 of 700

Donor-Stratified Resampling for Cluster Stability

Learn to design and interpret donor-stratified resampling so cluster stability reflects a chosen donor representation rather than the accidental dominance of heavily sampled donors.

Advanced 12 min read

What You'll Learn

  • Explain why pooled cell resampling can give unstable donor representation across replicates.
  • Choose between proportional within-donor resampling and equal-count donor balancing.
  • Match resampled clusters to reference clusters before comparing assignments.
  • Calculate and interpret donor-specific and donor-aggregated stability summaries.
  • Distinguish cell-level perturbation stability from uncertainty across donors.
  • Identify when stratified resampling does not address the source of instability.

Why Resample Within Donors?

In single-cell data, a donor is more than a label attached to a cell. Cells from the same donor share biological and technical conditions, so they need not behave like independent observations from one pooled population. If one donor contributes many more cells than another, a pooled cell-resampling procedure can make the stability summary primarily reflect the heavily sampled donor. A smaller donor may also be represented by very few cells, or not at all, in some replicates.

Donor-stratified resampling addresses a specific question: does the clustering recover when cells are perturbed within each donor while donor representation is controlled? It is a stability diagnostic, not a test of whether clusters are biologically true. The design must match the interpretation sought. Preserving each donor’s approximate share answers a different question from giving every donor equal influence.

Definition: Let \(N_d\) be the number of eligible cells from donor \(d\), for \(d=1,\ldots,D\). Donor-stratified resampling draws cells separately within each donor stratum, using a specified sample size or sampling fraction for each stratum. The resampled data retain donor identity, and clustering is refit to the pooled resampled cells. The choice of stratum-specific sample sizes determines how donors are represented.

The procedure needs a reference partition, such as a clustering of the full eligible data, and a defined clustering pipeline. For each resample, fit the same clustering target and settings, then compare the resampled partition with the reference on cells present in both. Cluster labels such as “1” and “2” are arbitrary: comparisons require matching clusters or using a label-invariant partition comparison. A matching can pair clusters to maximize overlap, but such a score should be interpreted as an agreement summary, not as a chance-adjusted measure.

Choose the Donor Representation First

There are two common designs. In proportional stratified resampling, sample approximately the same fraction \(f\) of eligible cells from every donor, so \(m_d\) is approximately \(fN_d\). This preserves the observed donor composition, subject to integer rounding. In equal-count stratified resampling, sample the same number \(m\) from each donor, usually no more than the smallest donor can supply when sampling without replacement. This gives each donor equal cell counts in the resampled data and intentionally changes the representation relative to the original dataset.

$$ \text{Proportional design: }m_d \approx fN_d \qquad \text{Equal-count design: }m_d=m \text{ for every donor }d $$

Proportional resampling is often appropriate when the aim is to check whether the observed, pooled clustering is sensitive to cell perturbation while keeping donor shares nearly fixed. Equal-count resampling is useful when the diagnostic should give donors comparable representation. It does not estimate stability for the original cell-weighted mixture: it asks about a donor-balanced construction instead.

Sampling without replacement is a natural choice for subsampling when the purpose is to perturb the set of observed cells without creating duplicates. Sampling with replacement is a bootstrap design and may include repeated copies of a cell; duplicates can affect clustering distances and apparent cluster size. If a bootstrap is used, state it explicitly and account for duplicated cells in the comparison. Do not describe these designs as interchangeable.

Worked Example: Setting Proportional Sample Sizes

Suppose a hypothetical dataset has three donors with 600, 300, and 100 eligible cells. The goal is to assess stability after retaining approximately half the cells from each donor, sampled without replacement.

Set \(f=0.5\). The donor-specific sample sizes are \(m_1=0.5(600)=300\), \(m_2=0.5(300)=150\), and \(m_3=0.5(100)=50\). Thus, each replicate contains \(300+150+50=500\) cells.

The original donor shares are \(600/1000=0.60\), \(300/1000=0.30\), and \(100/1000=0.10\). The replicate shares are \(300/500=0.60\), \(150/500=0.30\), and \(50/500=0.10\), exactly the same in this example. Sampling without replacement is feasible because each \(m_d\) is no larger than \(N_d\). Repeating this draw gives different cells but keeps donor representation fixed.

This design addresses sensitivity to which cells are retained within each donor. It does not assess what would happen if a new set of donors were recruited, because the same three donors appear in every replicate.

Compare Partitions Without Confusing Labels

Cluster labels can switch across refits. If reference cluster A is called “2” in one run and resampled cluster A is called “1,” that is not evidence of instability. Compare partitions using a label-invariant measure, or match clusters before calculating assignment agreement. A simple matching approach pairs reference and resampled clusters to maximize the number of shared cells assigned to paired clusters. When cluster counts differ, unmatched clusters must be handled by a stated rule; silently forcing a one-to-one match can conceal splitting or merging.

For a direct cluster-by-cluster diagnostic, calculate agreement within each donor as well as across all included cells. One transparent statistic is matched assignment agreement: after matching cluster labels, divide the number of cells with the same matched assignment by the number of comparable cells. This statistic is easy to explain but is not adjusted for agreement expected by chance, and it can be high when one cluster is common. The adjusted Rand index (ARI), introduced in earlier material on cluster comparison, is another label-invariant measure; its interpretation should be reported alongside the design and compared cells.

Worked Example: Matching Clusters Within a Donor

In a hypothetical resample, 16 cells from one donor are present both in the reference and resampled partitions. Their overlap table is:

Reference clusterResampled cluster uResampled cluster v
A71
B26

Matching \(u\) to A and \(v\) to B gives \(7+6=13\) matched assignments. The alternative pairing gives \(1+2=3\), so the first pairing maximizes agreement. The matched assignment agreement is \(13/16=0.8125\), or 81.25%.

This is a descriptive comparison for the 16 overlapping cells in this donor and resample. It does not mean there is an 81.25% probability that the clusters are correct. Nor does this one number reveal whether the disagreement is concentrated in a particular cell type or whether the result would generalize to other donors. A fuller report would retain donor-specific summaries across many resamples and might also give a chance-adjusted, label-invariant partition measure.

Aggregate Stability Without Hiding Donor Differences

A pooled stability summary can conceal substantial differences between donors. For a donor-level summary, first define a per-donor stability measure \(S_d\), calculated consistently across resamples using comparable cells and the same comparison rule. Then choose how to aggregate. A cell-weighted summary gives more influence to donors with more cells; an equal-donor summary averages donor-specific values. Neither is universally correct: each describes a different weighting of the donors.

$$ S_{\mathrm{cell}}=\frac{\sum_{d=1}^{D}N_dS_d}{\sum_{d=1}^{D}N_d} \qquad S_{\mathrm{donor}}=\frac{1}{D}\sum_{d=1}^{D}S_d $$

The first expression weights each donor by its eligible cell count; the second gives every donor equal weight. If an equal-count resampling design is used, the resampled data give donors equal cell counts, but a summary can still be computed and reported in several ways. State the weighting rather than assuming the design makes it self-evident.

Worked Example: Cell-Weighted Versus Equal-Donor Stability

Suppose two hypothetical donors contribute 80 and 20 eligible cells. Across a set of proportional stratified resamples, their respective stability summaries are \(S_1=0.90\) and \(S_2=0.50\). Assume both summaries use the same comparison method and are based on adequately represented cells.

The cell-weighted value is \(S_{\mathrm{cell}}=[80(0.90)+20(0.50)]/100=(72+10)/100=0.82\). The equal-donor value is \(S_{\mathrm{donor}}=(0.90+0.50)/2=0.70\).

The cell-weighted summary is 0.82 because the more heavily sampled donor contributes four times as many cells. The equal-donor summary is 0.70 because each donor contributes one half of the average. The difference is substantively important: reporting only 0.82 would understate the instability observed for the smaller donor if the aim is to describe typical donor-level behavior. These values are stability summaries, not probabilities that a cluster is real.

A Justification for Proportional Stratification

The reason proportional stratification controls donor composition can be shown directly. If donor \(d\) contributes a fraction \(f\) of its \(N_d\) cells, its resampled count is \(m_d=fN_d\), ignoring integer rounding. The fraction of resampled cells from that donor is therefore:

$$ \frac{m_d}{\sum_{j=1}^{D}m_j} = \frac{fN_d}{\sum_{j=1}^{D}fN_j} = \frac{N_d}{\sum_{j=1}^{D}N_j} $$

Thus, every donor retains its original cell share. In actual implementation, sample sizes must be integers, so rounding can cause small deviations. This calculation explains why proportional stratification fixes representation more tightly than a pooled draw whose donor counts fluctuate from replicate to replicate. It does not imply that donors are independent, that cells within a donor are independent, or that the observed donor shares are the scientifically correct target.

Diagnostics, Alternatives, and Limitations

Before interpreting a stability result, check the resampling design and the resulting comparisons. Verify that every intended donor is represented in every replicate, that the sampling fraction or count was applied as specified, and that only cells present in both partitions enter a direct assignment comparison. Examine donor-specific summaries rather than just a pooled score. Large donor-to-donor differences, frequent cluster splitting or merging, and strong dependence on whether proportional or equal-count sampling is used are signals that a single overall number is inadequate.

Also decide what parts of the analysis are being perturbed. Holding normalization and feature selection fixed isolates the effect of cell resampling conditional on those preprocessing choices. Re-estimating them within each replicate assesses a broader pipeline perturbation. Either can be useful, but the interpretation differs. Keep clustering settings, distance choices, and comparison rules consistent unless their variation is itself part of the intended diagnostic.

Pooled cell subsampling is simpler and, under simple random sampling, its expected donor shares may match the observed shares. But the realized shares vary across replicates, and small donors can be inconsistently represented. Stratification reduces that variation by design. Equal-count stratification goes further by changing donor weights, while donor-level resampling addresses variation in which donors are included rather than which cells are included within fixed donors. These procedures answer distinct questions; choosing one does not make the others invalid.

Most importantly, repeated cells from the same donor do not create additional independent donors. Cell-stratified resampling is conditional on the represented donors and cannot by itself quantify population-level uncertainty across donors. It can also be misleading when donor-specific technical artifacts dominate, when a donor has too few eligible cells for the chosen sampling fraction, or when clusters are defined mainly by donor identity. In these settings, report the limitation and examine whether the interpretation changes under alternative donor weighting. Do not infer biological validity from stability alone.

Common pitfall: “The pooled stability is high, so the cluster is stable across donors.” This does not follow if one donor contributes most cells or if the pooled score masks low stability in other donors. Report the resampling design, donor-specific results, and aggregation weights; use “stable across donors” only when the donor-level evidence supports that wording.

Check Your Understanding

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

  1. Three donors contribute 120, 60, and 20 cells. Under a 50% proportional design, how many cells are sampled from each donor, and what are the replicate donor shares?
  2. Why does an equal-count design answer a different question from proportional stratification?
  3. Two donors have stability summaries 0.80 and 0.40, with 90 and 10 eligible cells. Calculate the cell-weighted and equal-donor summaries.
  4. What kind of uncertainty is not captured by repeatedly resampling cells within the same fixed donors?

Solutions. (1) The sample sizes are \(0.5(120)=60\), \(0.5(60)=30\), and \(0.5(20)=10\), for 100 cells total. The shares are 0.60, 0.30, and 0.10, matching the original shares. (2) Equal counts deliberately give each donor the same representation, whereas proportional sampling retains the original cell shares; the resulting stability summaries target different donor weightings. (3) The cell-weighted summary is \([90(0.80)+10(0.40)]/100=(72+4)/100=0.76\). The equal-donor summary is \((0.80+0.40)/2=0.60\). (4) Resampling cells within fixed donors does not capture uncertainty from sampling a different set of donors from the broader donor population.

Clinical Biostats