Why Test a Partition Against a Continuous State?
A clustering algorithm can divide a smooth expression gradient into groups even when the cells do not come from distinct populations. The resulting labels may look orderly, and a validity score may favor one cluster count over another. Neither fact alone establishes that the chosen groups correspond to discrete cell types or states.
A useful stability analysis therefore asks a narrower, answerable question: how do candidate partitions behave when the observed expression structure is continuous? We will examine a deliberately simple simulated example. Its purpose is not to mimic every feature of a single-cell dataset, but to make the role of cluster count, silhouette width, and resampling agreement transparent.
The calculations below assume that a one-dimensional expression score adequately represents the gradient, that Euclidean distance on this score is meaningful, and that the cells are comparable measurements for this illustrative analysis. Real analyses must also consider preprocessing, feature choice, donor structure, and the distance geometry; a one-score example cannot resolve those issues.
A Simulated Gradient and Candidate Partitions
Suppose eight hypothetical cells have scores \(x=0,1,\ldots,7\). Each score is a coordinate along a smooth expression gradient. The values are evenly spaced: there is no large gap that naturally separates one set of cells from another. We use one-dimensional \(k\)-means, whose clusters minimize the total squared distance from cells to their assigned cluster means.
| Cell | Gradient score |
|---|---|
| A | 0 |
| B | 1 |
| C | 2 |
| D | 3 |
| E | 4 |
| F | 5 |
| G | 6 |
| H | 7 |
For \(k=2\), the natural one-dimensional \(k\)-means partition is \(\{A,B,C,D\}\) and \(\{E,F,G,H\}\), with means 1.5 and 5.5. For \(k=3\), one minimizing partition is \(\{A,B,C\}\), \(\{D,E\}\), and \(\{F,G,H\}\); for \(k=4\), it is four adjacent pairs. These are contiguous segments because the data lie on a line, but their boundaries are choices imposed by the requested value of \(k\).
Worked Example: Comparing Within-Cluster Sums of Squares
For a cluster \(C_j\) with mean \(\bar{x}_j\), its within-cluster sum of squares is \(\sum_{i\in C_j}(x_i-\bar{x}_j)^2\). Summing over clusters gives \(W_k\). For the \(k=2\) split, the first cluster has mean 1.5 and the second has mean 5.5:
For \(k=3\), the outer groups each contribute 2, while the middle pair contributes \(0.5\), so \(W_3=4.5\). For \(k=4\), each adjacent pair contributes \(0.5\), giving \(W_4=2\). The reduction in \(W_k\) is expected as \(k\) increases: with one cluster per cell, \(W_8=0\). Thus decreasing within-cluster variation is not, by itself, evidence that a larger number of biological populations is appropriate.
Silhouette Widths: Separation Within the Observed Geometry
For a cell \(i\), let \(a(i)\) be its average distance to the other cells in its own cluster. Let \(b(i)\) be the smallest, across other clusters, of its average distance to cells in that cluster. When \(a(i)\) and \(b(i)\) are defined and \(a(i)\) or \(b(i)\) is positive, its silhouette width is
The score lies between \(-1\) and 1. A value near 1 means the cell is, on average, closer to its own cluster than to the nearest alternative cluster; a value near 0 indicates weak separation; a negative value indicates that the nearest alternative cluster is closer on average. The mean silhouette is the average over cells. This describes separation under the chosen distance and partition; it is not a test that the cells came from discrete populations.
Worked Example: Silhouette for a Boundary Cell
Use the \(k=2\) split \(\{A,B,C,D\}\mid\{E,F,G,H\}\) and absolute distance between scores. For cell D, with score 3, the average distance to A, B, and C is \(a(D)=(3+2+1)/3=2\). The average distance to E, F, G, and H is \(b(D)=(1+2+3+4)/4=2.5\). Therefore,
D is assigned to its own cluster, but its silhouette indicates only modest separation from the other side of the imposed boundary. By contrast, for A, \(a(A)=2\) and \(b(A)=(4+5+6+7)/4=5.5\), so \(s(A)=3.5/5.5\approx0.6364\). The cells nearer the ends of the gradient can look better separated than cells near the cut.
For these eight equally spaced scores, direct calculation gives mean silhouettes of approximately 0.5398 for \(k=2\), 0.4179 for the \(k=3\) partition above, and 0.4000 for \(k=4\). The \(k=2\) partition scores highest among these candidates, but the gradient remains continuous. Silhouette ranks the partitions according to within- versus between-cluster distances; it cannot determine whether the best-scoring partition represents true biological groups.
Resampling Agreement at Candidate Boundaries
Resampling asks whether a partition is reproducible under specified changes to the data. To make the comparison concrete, suppose repeated bootstrap fits of \(k=2\) are mapped back to the same eight cells by assigning each cell to its nearest fitted centroid. In this hypothetical exercise, three fitted boundaries fall after C, D, and E, respectively. The full-data reference boundary falls after D. This is an illustrative set of resampling results, not a claim about an observed dataset.
One simple agreement summary compares each run with the reference over all unordered cell pairs: a pair agrees if it is placed together in both partitions or apart in both. The reference has 28 pairs. Moving a boundary from after D to after C changes the relation of D to A, B, and C, and to E, F, G, and H: seven pairs disagree. The same count applies when the boundary moves from after D to after E.
Worked Example: Calculating Agreement Across Resampled Fits
The run with a cut after D agrees with the reference for all 28 pairs. Each of the other two runs agrees for \(28-7=21\) pairs. The mean pairwise agreement with the reference is therefore
Thus, the mean raw pair agreement is 83.33% across these three fits. The boundary movement is localized, but it changes the assignments of several pairs. This statistic is descriptive: raw agreement does not adjust for agreement expected by chance, and it can be influenced by the numbers of within- and between-cluster pairs. A chance-adjusted partition comparison or a co-association summary can add information, but neither turns reproducibility into evidence of discrete biological states.
The boundary changes also have a direct interpretation. Cells far from the cut tend to remain together or apart across runs; cells close to it can switch sides. That pattern is compatible with a smooth state in which nearby cells have similar expression, rather than with two sharply separated populations. It is important to examine which cells or pairs change, not only one overall agreement number.
Putting the Diagnostics Together
The three diagnostics answer different questions. Within-cluster sums of squares describe compactness and necessarily improve as clusters are added. Silhouette widths compare each cell's average within-cluster distance with its nearest alternative. Resampling agreement describes how much a chosen procedure's assignments vary under the resampling design. Their results need not identify the same \(k\), and agreement between them does not prove that discrete groups exist.
| Diagnostic | What it summarizes | What it cannot establish alone |
|---|---|---|
| Within-cluster sum of squares | Squared distances to cluster means | A biologically correct number of populations |
| Silhouette width | Relative within- and between-cluster distances | That the data-generating structure is discrete |
| Resampling agreement | Reproducibility under a specified perturbation or resampling scheme | That a stable partition is a true cell taxonomy |
| Continuous-state representation | Whether a gradient can describe the pattern without discrete cuts | That every observed expression trend is biological rather than technical |
A reasonable comparison includes both clustering and a continuous-state description. If the scientific question concerns gradual variation, a continuous score, ordering, or trajectory-oriented representation may preserve information that hard cluster labels discard. If the question concerns distinct populations, evaluate whether the proposed groups have meaningful separation and are robust to appropriate changes in features, preprocessing, and resampling. These alternatives answer different scientific questions; a clustering score should not decide the question by itself.
Plot or summarize the relevant expression coordinates and ask whether there are visible gaps or instead a gradual progression. A projection can conceal structure, so interpret it in light of the selected features and distance.
Report how compactness and silhouette change, including cell-level behavior near candidate boundaries. Do not interpret a lower within-cluster sum of squares as a standalone selection rule.
State what was resampled, how assignments were compared, and whether instability is concentrated near boundaries or spread across cells. The stability conclusion applies to that design.
Ask whether discrete labels add a defensible interpretation beyond dividing a smooth pattern. Report uncertainty and limitations rather than treating a preferred \(k\) as discovered fact.
Diagnostics are going wrong—or at least being overinterpreted—when a single score is treated as decisive, when resampling leaves out important sources of variation, or when a forced boundary is described as a biological discontinuity without supporting evidence. A stable cut may reflect a consistent algorithm operating on a gradient. Conversely, low agreement can arise from algorithmic randomness or an ill-suited representation as well as from genuinely ambiguous structure. The resampling design and the distance geometry must be considered before attributing a cause.
Common Mistake
Wrong reasoning: “The mean silhouette is positive, and the \(k=2\) assignments agree 83% across resamples, so the cells form two distinct populations.” The conclusion does not follow. Positive silhouettes and substantial agreement describe the chosen partition's geometry and reproducibility; both can occur when a smooth gradient is repeatedly divided at a similar location.
Correction: State the evidence at the level it supports: the selected \(k=2\) partition has the highest mean silhouette among the candidates considered, and its reference-pair agreement is 83.33% under the stated resampling exercise. Then note that the simulated scores have no gap and the boundary cells are less separated. These results do not establish two discrete biological populations.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- For the eight-cell gradient, why does \(W_k\) decrease as \(k\) increases, and why does that not identify the true number of populations?
- For cell D in the \(k=2\) partition, what does the silhouette value 0.2000 indicate?
- In the resampling example, how many of the 28 cell pairs disagree when the cut shifts from after D to after C?
- Why is 83.33% raw pair agreement not evidence by itself that the data contain two discrete populations?
Solutions. (1) Adding clusters gives cells more, smaller groups and cannot increase the minimum achievable within-cluster sum of squares; at \(k=8\), it is zero. This mechanical improvement does not show that the groups reflect biological populations. (2) D is, on average, somewhat closer to its own cluster than to the other cluster, but the separation is modest; its score does not prove a discrete boundary. (3) Seven pairs disagree: D changes its relation to A, B, C, E, F, and G, H—three pairs on one side and four on the other. (4) Raw agreement measures reproducibility relative to one reference under a particular resampling scheme. A stable algorithm can consistently cut a continuous gradient, and the statistic does not establish the biological interpretation of that cut.