Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Resampling Stability of Inferred Pseudotime

Pseudotime and Trajectory Inference · Tutorial 380 of 700

Resampling Stability of Inferred Pseudotime

Learn to refit trajectory pipelines under resampling, compare paths and cell orderings on a common scale, and interpret instability without treating it as biological uncertainty.

Advanced 12 min read

What You'll Learn

  • Distinguish cell-level resampling stability from biological-replicate uncertainty.
  • Design subsampling or bootstrap analyses that repeat the relevant trajectory-fitting steps.
  • Compare pseudotime orderings using normalized ranks and rank-based agreement measures.
  • Summarize path stability with edge frequencies and Jaccard similarity.
  • Diagnose instability caused by roots, branches, sparse regions, or changing cell sets.
  • Interpret resampling summaries without treating them as confidence intervals or proof of a true path.

Why Assess Resampling Stability?

A trajectory method returns a path and an ordering of cells from a particular data set, but those outputs can depend on which cells were observed. A path may be determined by a small number of cells in a sparse region; a slightly different sample could connect the same broad regions in another way. Likewise, a cell’s position may shift substantially even when the overall path looks similar. Resampling stability asks how much these inferred structures change when the observed cells are perturbed by a specified sampling scheme.

This is a robustness analysis, not a test that establishes a unique biological trajectory. It is useful only after defining what is being compared: the path, the relative ordering of cells, or both. The comparison must also account for arbitrary pseudotime scales and for the possibility that a fitted path changes direction or branch structure.

Definition: Resampling stability is the degree to which an inferred trajectory feature—such as a path edge, branch assignment, or cell ordering—recurs across data sets generated by a stated resampling procedure and a stated refitting pipeline. It is conditional on the cells, measurements, preprocessing choices, method, and resampling scheme used.

Specify the Resampling and Refitting Procedure

Let the observed cells be \(1,\ldots,n\), and let a trajectory-fitting pipeline return a path and a pseudotime \(t_i\) for cells it represents. A resampling analysis creates data sets indexed by \(b=1,\ldots,B\), fits the pipeline to each, and compares the resulting outputs. In a subsampling analysis, each data set contains a specified fraction of the cells sampled without replacement. In a cell bootstrap, \(n\) cells are drawn with replacement; some original cells therefore occur multiple times and some do not occur in a particular draw.

State the sampling unit and what is held fixed. If the question concerns sensitivity to which cells were observed, resample cells and repeat the data-dependent steps that define the trajectory, including graph construction, path fitting, and root selection when root selection is part of the intended pipeline. If the root is fixed by design, keep the same root rule in every fit. A different choice answers a different stability question. Similarly, if preprocessing is treated as part of the method, refit it in each resample; if it is deliberately held fixed, report that the result is conditional on that preprocessing.

For subsamples, the fitted trajectory may not assign pseudotime to omitted cells. Compare ordering on the cells shared by the fits, or use a prespecified projection rule to place omitted cells onto each fitted trajectory. Do not silently treat unassigned cells as if they had unchanged positions. For bootstrap fits, track original cell identities and state how duplicate draws are handled; counting a duplicated cell as multiple independent identities can distort comparisons.

1
Define the target feature.
Choose path structure, cell ordering, branch assignment, or a specified combination.
2
Choose the resampling unit and scheme.
Specify subsample size or bootstrap procedure, number of resamples, and any fixed elements such as the root rule.
3
Refit consistently.
Apply the same stated pipeline to each resampled data set and record failures or disconnected fits rather than discarding them without explanation.
4
Align and summarize.
Match cell identities and path orientation or branches as required, then calculate the chosen stability measures across resamples.

Comparing Cell Orderings

Raw pseudotime values are often unsuitable for direct comparison. Their numerical scale can change across fits even when the order is essentially the same. A rank comparison removes this scale difference. For a fit \(b\) on \(m\) shared cells, let \(r_i^{(b)}\) be cell \(i\)'s rank, using average ranks for ties. Define its normalized rank by

$$ q_i^{(b)}=\frac{r_i^{(b)}-1}{m-1}. $$

For \(m>1\), the normalized ranks run from 0 to 1 when there are no ties. They describe relative position, not time in hours or a rate of biological change. Before comparing ranks, orient each fit consistently—for example, by using the same root rule. If orientation cannot be aligned, a reversed ordering can look maximally different even when it describes the same unoriented path.

One summary is Spearman's rank correlation, the ordinary correlation of the two rank vectors on the shared cells. With no ties, it can be calculated from rank differences \(d_i=r_i^{(b)}-r_i^{(\mathrm{ref})}\):

$$ \rho_s=1-\frac{6\sum_{i=1}^{m}d_i^2}{m(m^2-1)}. $$

This formula follows from the correlation of the two rank vectors. Each vector has mean \((m+1)/2\) and sum of squared deviations \(m(m^2-1)/12\). Since both vectors have the same sum of squares, expanding \(\sum_i(r_i^{(b)}-r_i^{(\mathrm{ref})})^2\) gives \(2\sum_i(r_i-\bar r)^2(1-\rho_s)\). Substituting the rank sum of squares and rearranging yields the displayed formula. With ties, calculate the correlation of average ranks directly rather than applying the no-ties shortcut.

Correlation summarizes broad agreement but can conceal important local changes. Also report a measure such as the mean absolute normalized-rank displacement,

$$ D^{(b)}=\frac{1}{m}\sum_{i=1}^{m}\left|q_i^{(b)}-q_i^{(\mathrm{ref})}\right|. $$

A smaller \(D^{(b)}\) means less average movement in relative position. Pairwise order agreement is another interpretable option: among cell pairs, count the proportion ordered the same way in both fits, with a pair tied in one fit contributing one-half. These summaries should be calculated over a clearly specified set of shared cells.

Worked Example: Comparing Two Cell Orderings

Suppose five hypothetical cells, A through E, have reference ranks 1, 2, 3, 4, 5. One subsample fit gives ranks 1, 3, 2, 5, 4 in that same cell order. Assume the root and direction have been aligned and there are no ties.

The rank differences are \(d=(0,1,-1,1,-1)\), so \(\sum d_i^2=0+1+1+1+1=4\). The rank-correlation formula gives

$$ \rho_s=1-\frac{6(4)}{5(5^2-1)} =1-\frac{24}{120} =0.800. $$

Thus the two orderings have substantial, but not perfect, rank agreement. The result does not say that every cell moved only a little: B and C exchange places, as do D and E. The conclusion is limited to these five shared cells and this comparison fit; a stability assessment uses the distribution of such comparisons across many resamples.

Comparing Inferred Paths

For a cell-level tree or graph, a direct summary is the frequency with which each edge appears across fitted paths. If \(I_e^{(b)}=1\) when edge \(e\) appears in resample \(b\), and \(0\) otherwise, its empirical edge frequency is

$$ \hat f_e=\frac{1}{B}\sum_{b=1}^{B} I_e^{(b)}. $$

A value near 1 indicates that the edge recurs under the chosen resampling and fitting procedure; a value near 0 indicates that it rarely does. This interpretation requires edges to be comparable across fits. For cell-level edges, use consistent cell identities and specify how missing cells are handled. For geometric paths or skeletons represented differently across fits, define a matching rule before calculating frequencies; otherwise, apparent differences may reflect representation rather than a changed trajectory.

A set-level comparison can use Jaccard similarity. For edge sets \(E_a\) and \(E_b\) on a comparable representation, it is the size of their intersection divided by the size of their union. It equals 1 for identical nonempty sets and 0 for disjoint sets. Report how pairwise similarities are aggregated—for example, the mean similarity between each resampled path and a reference path—because a single average can conceal a small group of very different fits.

Worked Example: Edge Frequencies and Path Similarity

Consider a hypothetical reference path with edges \(E_0=\{AB,BC,CD\}\). Four resampled fits produce these edge sets: \(E_1=\{AB,BC,CD\}\), \(E_2=\{AB,BC,CE\}\), \(E_3=\{AB,BD,DC\}\), and \(E_4=\{AB,BC,CD\}\). All sets use the same cell identities.

The edge AB appears in all four fits, so \(\hat f_{AB}=4/4=1.00\). BC appears in \(E_1,E_2,E_4\), giving \(\hat f_{BC}=3/4=0.750\). CD (written DC in \(E_3\)) appears in \(E_1,E_3,E_4\), giving \(\hat f_{CD}=3/4=0.750\). The alternative edges CE and BD each appear once, so each has frequency \(1/4=0.250\).

The Jaccard similarities to the reference are \(1\) for \(E_1\), \(2/4=0.500\) for \(E_2\), \(2/4=0.500\) for \(E_3\) (the shared edges are AB and CD), and \(1\) for \(E_4\). Their mean is

$$ \frac{1+0.500+0.500+1}{4}=0.750. $$

The common edge AB is especially stable in this small illustration, while the alternatives CE and BD are infrequent. The mean similarity is only a compact summary; the edge frequencies reveal which parts of the path account for its departures from the reference.

Interpret the Distribution, Not Just One Number

With many resamples, summarize the distribution of ordering measures and path features. For each cell, the spread of its normalized ranks across fits can identify cells whose relative positions are uncertain under the specified perturbation. For edges, display frequencies or classify edges using a stated threshold chosen for the analysis. There is no universal cutoff that turns an edge into a true or false biological connection. Preserve and report failed, disconnected, or otherwise unusable fits: their frequency is itself evidence that the pipeline is sensitive to the resampling.

Worked Example: Reading Cell-Level Rank Variation

Suppose four hypothetical cells A–D have the following normalized rank values for cell C across five resampled fits: \(0.33, 0.67, 0.67, 1.00, 0.33\). The sorted values are \(0.33, 0.33, 0.67, 0.67, 1.00\), so the median is \(0.67\) and the observed range is \(1.00-0.33=0.67\).

This cell appears near the middle in some fits and last in another. The range is large relative to the full normalized scale from 0 to 1, suggesting that C's relative location is sensitive to these resamples. It is not a confidence interval for a fixed, known biological time: it describes the observed variation in ranks across this particular set of fitted data sets. With only five resamples, it is also a rough diagnostic, not a precise characterization of the resampling distribution.

Assumptions, Diagnostics, and Limitations

A cell-level bootstrap treats the observed cells as exchangeable draws from a population relevant to the analysis. That assumption may be implausible when cells are clustered within a small number of donors, samples, or batches. Resampling cells within one data set then assesses sensitivity to cell composition conditional on those data; it does not measure uncertainty across biological replicates. To assess between-replicate variation, the resampling unit must reflect the experimental design, such as resampling independent biological samples when that is justified and feasible.

Inspect whether instability is concentrated in particular regions or reflects a global change. Useful diagnostics include root changes, orientation reversals, branch creation or loss, disconnected fits, cells absent from many subsamples, and large rank displacements for particular cells. Check that comparisons use enough shared cells and that any projection or path-matching rule is applied consistently. Sensitivity to resampling fraction can also matter: very small subsamples may break a graph simply because too few cells remain, while very large subsamples can make resampled fits look similar.

Resampling is not the only robustness check. Parameter sensitivity analysis varies choices such as neighborhood or kernel scales while holding the observed cells fixed; it answers how the output responds to modeling choices, not which cells were observed. Comparing principal curves, MSTs, and diffusion maps assesses dependence on trajectory representation or method. These analyses complement one another and should not be conflated. A stable output can still be systematically wrong because of unsuitable measurements, confounding, or an inappropriate trajectory assumption. Conversely, instability may reflect limited sampling rather than absence of an underlying biological process.

Common Mistake

Wrong reasoning: “The edge appeared in 90% of bootstrap fits, so there is a 90% probability that this biological transition is real.” The edge frequency is not a posterior probability, a p-value, or a calibrated probability that a biological claim is true. It is the proportion of the specified resampled fits in which that edge was recovered, under the chosen data and pipeline.

Correction: Report the resampling scheme, refitting choices, comparison rule, and observed stability summaries. Interpret them as conditional robustness evidence. Do not use them alone to claim biological truth, causal direction, or uncertainty across donors.

Key takeaway: Resampling stability is meaningful only after the sampling unit, refitting procedure, alignment rule, and comparison measure are explicit. Rank agreement and path recurrence describe robustness to that procedure; they do not establish that the inferred trajectory is uniquely correct.

Check Your Understanding

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

  1. Why can raw pseudotime values be misleading when comparing two fits, and what does normalized rank comparison address?
  2. A cell is omitted from a subsample fit. What are two defensible ways to include that fit in a cell-ordering comparison?
  3. An edge appears in 18 of 20 resampled paths. State the empirical frequency and give one conclusion it supports and one conclusion it does not support.
  4. Why might resampling individual cells fail to measure uncertainty across biological replicates?
  5. Two paths have edge sets \(E_a=\{AB,BC,CD\}\) and \(E_b=\{AB,BC,CE\}\). Calculate their Jaccard similarity.

Solutions. (1) The numerical scale can differ across fits even when relative order is similar. Ranks compare relative position and are invariant to monotone changes of scale, though orientation must still be aligned. (2) Compare only cells shared by the fits, or use a prespecified projection rule to assign the omitted cell a position in the fitted trajectory. (3) The frequency is \(18/20=0.900\). It supports that the edge recurs often under this resampling and pipeline; it does not establish a 90% probability that the biological transition is real. (4) Cells from the same biological sample may be dependent, and cell-level resampling conditions on the observed samples rather than resampling independent biological units. (5) The intersection is \(\{AB,BC\}\), with size 2; the union is \(\{AB,BC,CD,CE\}\), with size 4. The Jaccard similarity is \(2/4=0.500\).

Clinical Biostats