Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Diagnosing Rare Cluster Stability

Cluster Validity and Stability · Tutorial 283 of 700

Diagnosing Rare Cluster Stability

You will learn to quantify whether a rare cluster recurs across resamples, how closely it overlaps its reference members, and whether its observed size variation is compatible with reproducible structure.

Advanced 12 min read

What You'll Learn

  • Separate resamples with no reference members from resamples where an available rare cluster is not recovered.
  • Calculate conditional recovery and unconditional detection rates with their correct denominators.
  • Use recall, precision, and Jaccard overlap to describe different aspects of cluster reproduction.
  • Summarize matched-cluster size variation while accounting for unequal sampling fractions.
  • Identify how small counts, matching rules, and resampling design can make stability summaries misleading.

Why Rare Clusters Need Their Own Stability Check

A cluster containing only a small fraction of the cells can look stable or unstable for reasons that a single overall partition score obscures. In a resample, it may have no members available to recover; it may be available but fail to reappear; or it may reappear with only partial overlap or a substantially different size. These are distinct outcomes. Treating them all as “unstable” loses information, while counting only successful resamples can make a fragile rare group look reliably recovered.

The focus here is on diagnosing a candidate rare cluster across repeated resampled runs. The resampling design should be appropriate to the study; donor-stratified resampling, for example, preserves the intended donor structure. For each run, the cluster-matching rule and any criterion for calling a corresponding cluster detected should be held fixed. The earlier material on matching clusters across resampled runs provides the matching framework; the summaries below make explicit how to handle small-cluster availability, overlap, and size.

Definition: Let \(C\) be a reference cluster among \(N\) cells, and let \(S_r\) be the cells included in resampled run \(r\), for \(r=1,\ldots,B\). The available reference members are \(A_r=C\cap S_r\), with count \(m_r=|A_r|\). If \(m_r>0\), the reference cluster is available in run \(r\). Let \(M_r\) be the cluster matched to \(C\), restricted to cells in \(S_r\), when a corresponding cluster is detected. A fixed, stated matching and detection rule is required. The overlap count is \(t_r=|A_r\cap M_r|\).

A matching rule should not be adjusted after inspecting the results merely to make the rare cluster look more reproducible. If detection requires a minimum overlap or other admissibility criterion, specify it in advance and report it. In some matching schemes, a corresponding cluster can be identified even when \(m_r=0\), for example by using information other than direct overlap. In a scheme that relies solely on overlap with reference members, detection cannot be assessed in that run. That distinction matters when reporting an all-run detection rate.

Availability, Detection, and Recovery Are Different

Let \(A\) be the number of runs with \(m_r>0\). Among these available runs, let \(D\) count runs in which the prespecified rule detects a corresponding cluster. When \(A>0\), \(D/A\) estimates the fraction of available runs with a detected corresponding cluster; when \(A=0\), conditional detection is unestimable from these runs. It does not count resamples in which the reference cluster had no members to recover.

$$ \widehat P(\text{detected}\mid\text{available})=\frac{D}{A}. $$

The joint fraction of all runs with both available reference members and a detected corresponding cluster is \(D/B\). It is not generally the unconditional detection fraction: a corresponding cluster might also be detected in a run with \(m_r=0\), if the matching procedure can assess it. For an unconditional detection fraction, count detected corresponding clusters across all \(B\) runs, including assessable runs with \(m_r=0\), and divide by \(B\). If detection is not assessable in some runs, state the number of assessable runs and use that denominator instead of implying a result for all \(B\).

$$ \frac{D}{B} = \frac{A}{B}\frac{D}{A} \quad\text{when } A>0. $$

This identity follows because \(D/B=(A/B)(D/A)\): the joint fraction is the available-run fraction multiplied by the detection fraction among available runs. Thus, a low joint fraction can reflect infrequent availability, low conditional detection, or both. Reporting the two components helps distinguish those explanations.

Worked Example: Separating Availability From Detection

Suppose six hypothetical resampled runs are assessed for a candidate rare cluster. The available-member counts are \(8, 7, 0, 9, 6, 8\). A corresponding cluster is detected in runs 1, 2, 3, 5, and 6. Detection in run 3, where \(m_3=0\), is assessable under the stated matching rule.

Five runs have available reference members, so \(A=5\). Four of those five runs have a detected corresponding cluster, so the conditional detection fraction is \(D/A=4/5=0.8000\), or 80.00%.

The joint fraction of runs with both availability and detection is \(D/B=4/6=0.6667\), or 66.67%. The unconditional detection fraction is instead \(5/6=0.8333\), or 83.33%, because the detected cluster in run 3 is included. The availability fraction is \(A/B=5/6\); multiplying it by the conditional detection fraction gives \((5/6)(4/5)=4/6\), as required for the joint fraction.

These numbers answer different questions. The 80.00% figure asks how often a corresponding cluster is detected when reference members are present. The 66.67% figure requires both availability and detection. The 83.33% figure counts detection in all runs where the rule can identify it, including run 3.

Measure Overlap Rather Than Detection Alone

A detected cluster need not reproduce the reference membership well. For an available run with a detected matched cluster, define recall as the fraction of available reference members assigned to that matched cluster, and precision as the fraction of the matched cluster’s cells that are available reference members. The Jaccard index compares the intersection with the union. These measures describe different errors: recall is reduced by reference members left out, while precision is reduced by additional cells included.

$$ \text{Recall}_r=\frac{t_r}{m_r},\qquad \text{Precision}_r=\frac{t_r}{|M_r|},\qquad J_r=\frac{t_r}{m_r+|M_r|-t_r}. $$

The Jaccard denominator is the size of the union \(A_r\cup M_r\), since \(|A_r\cup M_r|=|A_r|+|M_r|-|A_r\cap M_r|\). Thus, \(J_r=1\) for identical sets and \(J_r=0\) for disjoint sets. If no corresponding cluster is detected, overlap is not defined from a matched set; report non-detection separately rather than silently dropping the run. A summary may additionally assign zero recovery to such available runs, but that convention must be stated.

Worked Example: A Detected Cluster With Imperfect Membership

In one hypothetical run, eight reference-cluster cells are available. The matched cluster contains ten cells, six of which are among those eight reference members. Thus \(m_r=8\), \(|M_r|=10\), and \(t_r=6\).

Recall is \(6/8=0.7500\), so 75.00% of the available reference members are recovered. Precision is \(6/10=0.6000\), so 60.00% of the cells in the matched cluster are available reference members. The union contains \(8+10-6=12\) cells, giving Jaccard overlap \(6/12=0.5000\).

The matched cluster is detected, but that statement alone would hide both the two reference members it misses and the four additional cells it contains. Here, recall is higher than precision because the matched cluster contains a relatively large share of the reference members but also includes extra cells. These are descriptive stability summaries, not evidence that cluster membership has a causal interpretation.

For a rare cluster, the denominator in each run may be very small. If only two reference members are available, recall can change by 0.5 when one cell changes assignment. It is therefore useful to report the available-member counts alongside overlap summaries, and to examine the distribution across runs rather than relying only on a mean. Do not average per-run fractions without noting that runs with different \(m_r\) contribute equally to an unweighted mean; a pooled fraction weights runs according to their available cell counts and answers a different question.

Summarize Size Variation on a Comparable Scale

Among runs with a detected corresponding cluster, its size can vary. Raw cluster counts are comparable only when the number of sampled cells is the same across runs. When sampling fractions differ, compare the matched-cluster proportion \(|M_r|/|S_r|\), or another scale standardized to the resampling design, rather than interpreting raw counts alone. The reference proportion \(|C|/N\) gives a useful baseline, but a resampled cluster proportion need not equal it exactly, even under reproducible structure.

For \(K\) detected matched clusters with sizes \(q_1,\ldots,q_K\), where \(K\geq1\), the sample mean size is \(\bar{x}=\sum_{i=1}^{K}q_i/K\), and, when \(K\geq2\), the sample standard deviation is \(s=\sqrt{\sum_{i=1}^{K}(q_i-\bar{x})^2/(K-1)}\). If fewer than two clusters are detected, report the sample standard deviation and coefficient of variation as undefined; when \(K=0\), the mean is also undefined. When \(\bar{x}>0\), the coefficient of variation \(s/\bar{x}\) expresses the standard deviation relative to the mean. It is unitless and can help compare relative size variability across clusters with different average sizes. It does not correct unequal sampling fractions, nor does it make a small set of runs precise.

Worked Example: Relative Variation in Matched-Cluster Size

Suppose five hypothetical runs use the same number of sampled cells, and the detected matched-cluster sizes are \(7,13,8,12,10\) cells. Because the sampled totals are equal and detection is available in all five runs, these raw counts are comparable for this illustration.

The mean size is \(\bar{x}=(7+13+8+12+10)/5=50/5=10\) cells. The sum of squared deviations is \((7-10)^2+(13-10)^2+(8-10)^2+(12-10)^2+(10-10)^2=9+9+4+4+0=26\) cells squared. Therefore, \(s=\sqrt{26/(5-1)}=\sqrt{6.5}\approx2.5495\) cells.

The coefficient of variation is \(s/\bar{x}=\sqrt{6.5}/10\approx0.2550\), or approximately 25.50%. This describes substantial relative run-to-run size variation in this small hypothetical set; it does not by itself establish whether that variation exceeds what the resampling design would produce under a stable cluster.

Diagnostics, Alternatives, and Limits

A useful rare-cluster assessment presents availability, conditional detection, overlap, and size together. Check whether the available-member counts are often zero or just one or two; whether a single run determines the mean overlap; whether detection depends on a matching threshold; and whether sampling fractions differ. Also inspect the distribution of run-level values. A mean can conceal a mixture of nearly perfect recoveries and complete failures.

Several common alternatives answer related but not identical questions. The adjusted Rand index compares whole partitions and adjusts pair agreement for chance, but a good global value can coexist with failure to recover a small cluster. Variation of information summarizes partition differences, while co-association summaries describe how often pairs of cells are grouped together. These global or pair-based summaries can complement rare-cluster-specific recovery and overlap; they do not replace reporting the cluster’s availability and denominators.

Rare-cluster diagnostics have important limits. A cluster that recurs under a chosen perturbation is reproducible under that perturbation, not necessarily a distinct biological population. Conversely, low recovery can result from too few sampled members, unstable boundaries, an unsuitable matching rule, or genuine sensitivity to the analysis choices. Resampling observations from the same study does not create independent biological replication, and repeated runs are not independent new experiments. Interpret stability conditional on the data, preprocessing, clustering procedure, and resampling design.

Common mistake: “The cluster was found in four of six runs, so its recovery rate is 66.7%.” This may use the wrong denominator and merge availability with detection. First count runs with available reference members, then report detection conditional on availability as \(D/A\), the joint fraction as \(D/B\), and an all-run detection fraction separately when detection is assessable for runs with no available reference members.

A Practical Reporting Sequence

1
State the reference and resampling setup.
Give the reference cluster size, number of runs, sampling design, and the fixed matching and detection rule.
2
Report availability and detection separately.
Give \(A/B\), \(D/A\), and \(D/B\); if detection is assessable for all runs, also give the all-run detection fraction with its numerator and denominator.
3
Describe membership overlap and size.
Report recall, precision, or Jaccard with their run-level denominators, and summarize size on a scale comparable across sampling fractions.
4
Inspect fragility and qualify the conclusion.
Show variation across runs, identify small denominators or threshold dependence, and state that the finding concerns reproducibility under the specified perturbation.

Check Your Understanding

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

  1. Across eight runs, six have available reference members; four of those six have a detected corresponding cluster. What are the conditional detection fraction and the joint availability-and-detection fraction?
  2. In a run, \(m_r=5\), \(|M_r|=8\), and \(t_r=4\). Calculate recall, precision, and Jaccard overlap.
  3. Why is it incorrect to call \(D/B\) the unconditional detection fraction if a corresponding cluster is detected in an assessable run with \(m_r=0\)?
  4. Matched-cluster sizes are compared across runs with different numbers of sampled cells. What size summary is preferable to raw counts, and why?
  5. What does a high rare-cluster recovery rate establish, and what does it not establish?

Solutions. (1) Conditional detection is \(4/6=0.6667\), or 66.67%; the joint fraction is \(4/8=0.5000\), or 50.00%. (2) Recall is \(4/5=0.8000\); precision is \(4/8=0.5000\); Jaccard is \(4/(5+8-4)=4/9\approx0.4444\). (3) \(D\) counts only runs that have available reference members and a detected corresponding cluster. It omits the assessable detection at \(m_r=0\), so \(D/B\) is the joint fraction, not the unconditional detection fraction. (4) Compare cluster proportions \(|M_r|/|S_r|\), since raw counts change mechanically with the total sampled cells. (5) High recovery supports reproducibility under the specified resampling, matching, and clustering choices; it does not prove the cluster is a distinct or biologically true population.

Clinical Biostats