What Cell Subsampling Measures
A clustering can look convincing in one analysis and still depend heavily on which cells happened to be included. Cell subsampling examines this sensitivity: repeatedly select subsets of cells, rerun a specified clustering procedure, and compare the results for cells that occur both in a reference run and a subsampled run. The target is repeatability under this particular perturbation, not whether the clusters are biologically true.
The comparison requires care because a cluster label such as “2” is an arbitrary name. Label 2 in one run need not represent label 2 in another. Instead of comparing the names directly, compare the relationships between shared cells: were two cells placed together in both runs, or separated in both? This permits cell-level summaries without first matching cluster labels.
A useful design begins by fixing what is meant by a run. Specify the cell-sampling fraction, preprocessing and features, clustering algorithm and resolution, and whether the neighbor graph is rebuilt on each subset or restricted from a fixed graph. Rebuilding the graph assesses the effect of cell removal on both graph construction and clustering; restricting a fixed graph focuses more narrowly on clustering after node removal. Neither choice is universally correct, but it must be stated because it changes the perturbation being studied.
For an assessment focused on cell-sampling effects, use a deterministic clustering procedure or hold its random-seed policy fixed across runs. Otherwise, variation combines cell-sampling effects with algorithmic randomness. If both sources matter, they should be assessed separately. The earlier material on stochasticity and random seeds in graph clustering explains why this distinction matters.
Shared Cells and a Label-Invariant Cell Score
Suppose the reference clustering is fixed and a subsample is reclustered. For any two shared cells \(i\) and \(j\), define their reference relationship as “together” when \(z_i^{(0)}=z_j^{(0)}\), and their subsample relationship as “together” when \(z_i^{(b)}=z_j^{(b)}\). These comparisons do not depend on the numerical names assigned to clusters.
For a focal cell \(i\), divide the other shared cells into two groups according to the reference: cells in \(i\)'s reference cluster and cells outside it. The first group measures whether reference co-clustering is retained; the second measures whether reference separation is retained. Averaging the two proportions gives a balanced score so that a large group of reference-separated cells does not automatically dominate a smaller group of reference-cluster peers.
This is a relational agreement score, not the probability that a cell belongs to a true cluster. It is undefined if either peer group is empty, so report the number of eligible cells and runs rather than silently assigning a value. In particular, a cell may have no reference-cluster peers among the shared cells if its cluster is rare or the overlap is small.
Worked Example: Expected Overlap Between Subsamples
Suppose a hypothetical data set contains \(N=1{,}000\) cells. Two independent subsamples each include 80% of the cells, selected without replacement. What is the expected number of cells shared by the two subsamples?
For each cell \(i\), define \(X_i=1\) if it appears in both subsamples and 0 otherwise. The probability of inclusion in each subsample is \(0.8\), and the two selections are independent, so \(P(X_i=1)=0.8\times0.8=0.64\). The total overlap is \(X=\sum_{i=1}^{1000}X_i\). By linearity of expectation, $$ E(X)=\sum_{i=1}^{1000}E(X_i)=1{,}000(0.64)=640\text{ cells}. $$
Thus the expected pairwise overlap is 640 cells. This is an expectation, not a guarantee that every pair of runs will share exactly 640 cells. If instead a subsample is compared with the full-data reference, all sampled cells are shared with that reference; at an 80% sampling fraction, that overlap is 800 cells.
Calculating and Summarizing Stability
The score is calculated from the reference relationships, not from the label numbers themselves. For each cell and run, count the reference-cluster peers retained with the focal cell and the reference-separated cells kept apart. Divide each count by the corresponding group size, then average the two proportions. This gives each type of relationship equal weight for that focal cell.
Worked Example: A Cell With a Balanced Score of Five-Sixths
In a hypothetical run, a focal cell \(i\) has one other shared cell in its reference cluster and six shared cells outside that cluster. The subsample keeps \(i\) together with its one reference-cluster peer. Of the six reference-separated cells, four remain in a different subsample cluster from \(i\), while two are grouped with it.
The proportion of reference-cluster peers retained is \(1/1=1\). The proportion of reference-separated cells kept apart is \(4/6\). Therefore, $$ C_{ib}=\frac{1}{2}\left(1+\frac{4}{6}\right) =\frac{1}{2}\left(\frac{10}{6}\right) =\frac{5}{6} \approx 0.8333. $$
The score is about 0.833, to three significant figures. The cell retained its reference relationship with its sole same-cluster peer, but two of the six cells from other reference clusters were grouped with it. The exact fraction \(4/6\) is kept through the calculation; rounding it before taking the average would unnecessarily alter the result.
Repeat this calculation for each eligible cell in every subsampling run. A cell's average score across its eligible runs describes how consistently its relationships with other cells are retained under the chosen subsampling design. A summary across cells, such as the median and an interquartile range, describes the distribution of these cell-level scores. Also report how many cells and runs contributed: a high summary based on a small, selective set of eligible cells can be misleading.
Worked Example: Averaging a Cell's Scores Across Runs
A hypothetical focal cell has eligible balanced scores of \(1\), \(5/6\), and \(1/2\) in three runs. Its mean score across those runs is $$ \bar{C}_i=\frac{1+\frac{5}{6}+\frac{1}{2}}{3} =\frac{\frac{6}{6}+\frac{5}{6}+\frac{3}{6}}{3} =\frac{14}{18} =\frac{7}{9} \approx 0.7778. $$
The cell's mean relational agreement is about 0.778 across these three eligible runs. The individual scores also matter: they show that this average combines one run with complete relational agreement and another with substantially lower agreement. A mean alone can hide such run-to-run variation, so inspect the distribution of scores as well.
A global summary can also be useful, but it should not replace cell-level inspection. For example, the average of eligible \(C_{ib}\) values summarizes average balanced relational agreement for a stated set of cells and runs. The adjusted Rand index, covered in the earlier material on chance-corrected partition comparison, is another label-invariant global comparison of two partitions on shared cells. It compresses the comparison to one number and does not identify which cells are unstable. The cell-level score answers a different question by showing where the relationship changes concentrate.
Assumptions, Diagnostics, and Limitations
These summaries are descriptive of a specified analysis pipeline and resampling scheme. Their interpretation relies on a clearly defined reference partition, correctly matched cell identities across runs, and a consistent rule for including and clustering the sampled cells. If the reference clustering changes between calculations, the scores no longer share the same comparison target. If cluster labels are compared as if their numbers were meaningful, arbitrary relabeling can create apparent instability even when the partitions are identical.
Check the overlap sizes, the number of eligible cells, and cluster representation in every run. A subsample may omit a small reference cluster entirely, or retain too few of its cells to evaluate co-clustering reliably. A high score among cells with abundant peers does not establish stability for a rare group. Conversely, a low score may be driven by a handful of boundary cells rather than broad changes across the data. Inspect cell-level results and the pattern across runs alongside any overall summary.
The sampling fraction is a design choice. Very small fractions can leave too few shared cells for meaningful comparisons and can omit rare populations; fractions close to 100% may produce highly overlapping runs and reveal only modest perturbations. There is no universal fraction or score threshold that makes clustering “stable.” Choose a fraction relevant to the intended question, report it, and examine whether conclusions change under reasonable alternatives.
Cell subsampling is not a substitute for biological replication. Cells from the same specimen are not independent biological replicates, and repeated subsamples of one data set do not create new donors or experiments. These results describe sensitivity to removing cells from the observed data, conditional on the reference clustering and analysis choices. They do not establish that a cluster is a distinct cell type, nor do they quantify uncertainty about a population-level biological effect.
A practical comparison is with rerunning the algorithm using different random seeds on the same cells. Seed-only reruns assess algorithmic randomness; subsampling assesses sensitivity to the included cells, and may also affect graph construction if the graph is rebuilt. A perturbation analysis can vary other elements of the analysis, but changing several elements at once makes it harder to attribute instability to cell sampling. State which source of variation is being studied.
Record the full-data reference partition, sampling fraction, preprocessing, graph choice, clustering settings, and random-seed policy.
Repeat the specified cell subsampling procedure and retain the cell identities and cluster assignments from each run.
For each run, restrict the reference partition to the shared cells and calculate eligible cell-level balanced scores.
Summarize scores across runs and cells, and report overlap, excluded cells, and representation of small clusters.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A full-data reference contains 500 cells. A subsample contains 350 of them. How many cells are shared with the reference?
- A focal cell has two reference-cluster peers and four reference-separated cells among the shared cells. In a subsample, one of its two peers remains together with it, and three of the four separated cells remain apart. Calculate its balanced score.
- Why can comparing cluster label numbers directly give a false impression of instability?
- What does a high cell-subsampling stability score establish, and what does it not establish?
Solutions. (1) All 350 subsampled cells are in the full-data reference, so the overlap is 350 cells. (2) The two proportions are \(1/2\) and \(3/4\), so the score is \(\frac{1}{2}(1/2+3/4)=\frac{1}{2}(5/4)=5/8=0.625\). (3) Cluster numbers are arbitrary labels; two identical partitions can use different numbers for corresponding groups. Compare co-clustering relationships instead. (4) A high score indicates that the cell's relationships to shared cells are often retained under the stated sampling and analysis choices. It does not establish that the clusters are biologically true or that the result generalizes to new donors.