Why the Resampling Design Matters
A stability analysis asks whether a clustering persists when the data are perturbed. The perturbation is part of the question: clustering the same cells with different random draws is not the same experiment as clustering different cells, and sampling cells with replacement does not merely produce a fresh set of cells. It can place multiple copies of some observations in the analysis and omit others entirely.
That distinction is consequential for single-cell data. A graph-based method may treat each copied cell as another vertex, while a distance-based method may give repeated expression profiles extra weight. Either way, the fitted partition can reflect the resampling multiplicities as well as the structure among distinct cells. A low or high stability score can then be difficult to interpret as evidence about whether the original cell groups persist.
The earlier material on cell subsampling for stability assessment introduced repeated subsets without replacement. Here the focus is why a same-size cell bootstrap has different behavior, how to quantify that behavior, and how to design comparisons that retain a clear interpretation.
What a Cell Bootstrap Actually Samples
For a bootstrap sample with \(m=n\), the number of rows supplied to an algorithm is \(n\), but the number of distinct original cells is generally smaller. Let \(D\) be the number of distinct identities represented. For any particular cell, the probability of being absent in all \(m\) draws is \((1-1/n)^m\). Therefore its probability of appearing at least once is \(1-(1-1/n)^m\). Summing these appearance probabilities over the \(n\) cells gives the expected number of distinct cells:
This result follows by writing \(D\) as the sum of \(n\) indicator variables, one for each cell, where an indicator equals 1 if that cell appears and 0 otherwise. The expectation of a sum is the sum of expectations, whether or not the indicators are independent. For a same-size bootstrap, \(m=n\), the expected distinct fraction approaches \(1-e^{-1}\), about 0.632, as \(n\) grows. Thus a nominally \(n\)-row bootstrap often contains only about 63% as many distinct cells as the original data.
The multiplicity of a given cell has a binomial marginal distribution, \(N_i\sim\operatorname{Binomial}(m,1/n)\), where \(N_i\) is its number of appearances. Across all cells, the multiplicities sum to \(m\), but they need not be evenly distributed. A clustering procedure that uses the rows as observations therefore receives a randomly weighted version of the observed cells, not simply a fresh collection of \(n\) distinct cells.
Worked Example: How Many Cells Are Distinct?
Suppose a hypothetical data set contains \(n=1{,}000\) cells, and a bootstrap draws \(m=1{,}000\) times with replacement. The expected number of distinct cells is
Since \((0.999)^{1{,}000}\approx0.3677\), this gives \(E(D)\approx1{,}000(0.6323)=632.3\) distinct cells. The expected number of repeated draws beyond the first occurrence of each represented cell is \(1{,}000-E(D)\approx367.7\). These are expectations over repeated bootstrap samples, not a claim that every particular draw has exactly 632 distinct cells.
The bootstrap has 1,000 rows, but those rows do not provide the same cell coverage as a sample of 1,000 distinct cells. If a stability comparison is interpreted as asking how clustering changes across different sets of cells, this design changes the question by also changing the weights of represented cells.
How Duplicates Can Distort a Clustering
The effect depends on how the clustering procedure uses its input. In a graph-based workflow, copied rows can become separate vertices with identical or nearly identical expression values. They may have zero distance from one another, compete for nearest-neighbor slots, or contribute multiple edges to a local neighborhood. This can change graph connectivity and community boundaries even though no new biological observation has been added. If an implementation collapses identical rows, the multiplicities can still act as weights, or the result can depend on how ties and duplicate identities are handled.
For a clustering method that operates on distances or cluster summaries, repeated copies can give particular profiles extra influence. A cell drawn five times may contribute five times to a centroid-like calculation, while an omitted cell contributes nothing. In either case, the resampled partition is affected by random weighting. That may be a meaningful perturbation for some questions, but it should not be mistaken for the effect of observing a new set of distinct cells.
There is a second difficulty when stability is scored. A copied observation has one original cell identity but may appear as several rows. If those copies receive different cluster assignments, a comparison requires a rule for collapsing their labels back to the original identity. Choosing a majority label, keeping one copy, or treating the copies as separate observations produces different comparisons. Even when all copies receive the same label, counting them separately gives some original cells more influence in the score.
Worked Example: A Bootstrap Can Reweight a Small Partition
Consider a hypothetical set of 10 cells partitioned into cluster A, with four cells, and cluster B, with six cells. One possible size-10 bootstrap draw has multiplicities 7, 0, 0, 0 for the four cells in A, and 1, 1, 1, 0, 0, 0 for the six cells in B. The multiplicities sum to \(7+1+1+1=10\), so the bootstrap has 10 rows, but only four distinct cell identities.
Under this draw, cluster A contributes 7 of the 10 rows, or \(7/10=0.70\), while it contained only \(4/10=0.40\) of the original cells. Cluster B contributes \(3/10=0.30\) of the rows, though it contained \(6/10=0.60\) of the original cells. The changed row proportions arise from the sampling multiplicities, not from newly observed evidence that the relative sizes of the groups changed.
A clustering algorithm might respond to this weighting by changing neighborhoods or boundaries; it is not guaranteed to do so, because the response depends on the data and algorithm. The example identifies a source of distortion, not a universal direction or amount of change in the final partition.
Subsampling Without Replacement
Subsampling removes the duplicate-identity problem: each fitted run contains exactly \(b\) distinct cells. For a given cell, the probability of inclusion is \(b/n\), and the probability of omission is \(1-b/n\). For two independently drawn size-\(b\) subsamples, a given cell appears in both with probability \((b/n)^2\), so the expected number of shared cells is \(n(b/n)^2=b^2/n\).
To compare two partitions from separate subsamples, a direct comparison is possible on cells included in both runs. A label-invariant partition comparison, such as the adjusted Rand index, does not require cluster names to match: it assesses whether pairs of shared cells are grouped together consistently, with adjustment for chance agreement. The comparison is only as informative as the overlap permits. If few cells occur in both runs, a score based on that intersection can be noisy or uninformative.
Subsampling does not make all stability scores comparable automatically. The subset size \(b\) controls the strength of the perturbation: a smaller subset leaves out more cells, and can produce less stable partitions even if the underlying structure is unchanged. State the sampling fraction, use the same design across the runs being compared, and interpret stability as conditional on that design. The choice of \(b\) is not a universal constant; it should be large enough to support the intended clustering and comparison, while still creating a meaningful perturbation.
Worked Example: Expected Overlap Between Subsamples
Suppose \(n=1{,}000\) cells are repeatedly subsampled without replacement, with \(b=800\) cells in each run. Each run contains exactly 800 distinct cells, and a particular cell is included with probability \(800/1{,}000=0.8\). For two independently drawn subsamples, the probability that a particular cell is in both is
Summing across the 1,000 cells, the expected overlap is \(1{,}000(0.64)=640\) cells. This is an expectation: actual pairs of subsamples can overlap in more or fewer than 640 cells. A partition comparison should use the actual intersection of the two samples, not assume that the intersection always equals its expectation.
A same-size bootstrap of these 1,000 cells would instead have an expected 632.3 distinct identities, as calculated earlier, with random multiplicities among them. The size-800 subsample has fewer rows, but it has a known count of unique cells and no extra weight from duplicate identities. These designs answer different perturbation questions and should not be described as interchangeable.
Practical Design and Diagnostics
A defensible cell-subsampling stability analysis makes the resampling unit and comparison explicit. Use a consistent preprocessing and clustering workflow across runs when the goal is to isolate variation from the choice of cells. Record the cell identities in every subset, the subset size, the clustering settings, and the random seed. For each pair of runs, compare the assignments only on their shared cell identities and report how many cells support that comparison. A partition score without its overlap size can conceal a weak comparison.
Useful diagnostics include checking that each subset contains the intended number of unique identities, inspecting the distribution of pairwise overlap sizes, and verifying that a cluster comparison is calculated on the same shared cells for both partitions. Also inspect cluster representation: if a small group is frequently absent from a subsample, stability for that group cannot be inferred from runs in which it is missing. A low score may reflect the perturbation, limited overlap, or the algorithm's response; it is not by itself proof that the original clusters are invalid.
Cell-level resampling has a further limitation: cells from the same donor or sample may be dependent. Treating all cells as independent sampling units can overstate how much independent information the data contain. Subsampling without replacement prevents repeated identities within a run, but it does not remove dependence among distinct cells. The resampling unit must match the population and source of variation relevant to the scientific question.
The usual bootstrap has an important role in estimating many quantities from independent observations, but its behavior does not automatically transfer to cluster stability. A cluster partition is produced by an algorithm whose response to reweighting, omitted cells, graph construction, and ties can be irregular. The bootstrap is not inherently invalid; rather, a cell bootstrap can be misleading when its multiplicities and duplicate handling are not aligned with the stability question. Subsampling without replacement is a clearer alternative when the intended perturbation is to refit on distinct subsets of cells.
Common Mistakes and Limitations
- Equating row count with unique-cell count. A bootstrap with \(n\) rows does not generally contain \(n\) distinct cells. Report both when using a bootstrap.
- Calling duplicates new observations. Repeated identities are reweightings of observed cells, not additional independently measured cells.
- Comparing labels without restricting to shared cells. Partitions from different subsets have different membership lists. Use the intersection and state its size.
- Interpreting every low score as biological instability. The score may be affected by the subsampling fraction, limited overlap, or dependence among cells, as well as by cluster structure.
Subsampling without replacement solves the specific problem of repeated cell identities within a run; it does not prove that the clusters are biologically real, eliminate all sampling bias, or make every stability metric reliable. Conclusions should remain conditional on the cells available, the resampling design, and the clustering procedure used.
Check Your Understanding
Answer the questions, then check the solutions below.
- For a bootstrap of \(n\) cells using \(m=n\) draws, give the formula for the expected number of distinct cells and its large-\(n\) fraction of the original data.
- A bootstrap contains 500 rows but 318 distinct cell identities. How many rows beyond the first appearance of each represented identity are present?
- Two independent subsamples each contain 600 of \(n=1{,}000\) cells. What is their expected overlap?
- Why can repeated cells alter a graph-based clustering even if no new expression profiles were measured?
- Does subsampling without replacement make cell observations independent? Explain.
Solutions. (1) \(E(D)=n[1-(1-1/n)^n]\), and the expected fraction approaches \(1-e^{-1}\approx0.632\). (2) There are \(500-318=182\) rows beyond the first appearance of each represented identity. (3) The expected overlap is \(b^2/n=600^2/1{,}000=360\) cells. (4) Copies can become separate vertices or receive extra weight, changing neighborhood structure or the influence of profiles despite adding no new measured cells. (5) No. Sampling without replacement prevents duplicate identities within a run, but distinct cells may still be dependent, for example because they came from the same donor or sample.