Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Comparing Principal Curves, MSTs, and Diffusion Maps

Pseudotime and Trajectory Inference · Tutorial 379 of 700

Comparing Principal Curves, MSTs, and Diffusion Maps

Learn how three trajectory representations behave on curved, noisy, and unevenly sampled paths, and how to diagnose which assumptions are driving their differences.

Advanced 12 min read

What You'll Learn

  • Distinguish the geometric and graph-based outputs of principal curves, MSTs, and diffusion maps.
  • Identify assumptions needed to interpret each representation as a cell-state trajectory.
  • Compare curve arc length, tree-path length, and diffusion distance on a curved synthetic path.
  • Explain how uneven sampling and noise can alter each method’s result.
  • Diagnose false branches, shortcuts, oversmoothing, and diffusion-scale failures.

Three Representations of a Cell-State Path

A trajectory method does not reveal a path independently of its assumptions. A principal curve summarizes observations with a smooth geometric path; a minimum spanning tree (MST) connects observations with a tree of short edges; and a diffusion map represents cells by how their local transition behavior relates across a neighborhood graph. These objects can agree on a simple, densely sampled path and differ substantially when the path bends, sampling is uneven, or noise creates misleading neighbors.

For comparison, imagine a low-dimensional representation \(X_i\) of cell \(i\), such as coordinates in a selected feature space. Each method uses distances or neighborhoods in that representation. Its output depends on the representation, distance metric, and tuning choices, as well as on the underlying geometry. A trajectory inferred in an embedding is therefore a description of that geometry, not by itself evidence of a causal or temporal process.

Definition: A principal curve is a smooth curve \(f(\lambda)\) through a data distribution such that, at a given projection index \(\lambda\), the curve equals the conditional mean of observations whose nearest point on the curve has index \(\lambda\): \(E[X\mid \lambda(X)=\lambda]=f(\lambda)\). An MST is a connected, cycle-free graph on the observed points whose sum of edge weights is minimal among such graphs. A diffusion map represents cells using eigenvectors of a transition operator on a neighborhood graph, so that proximity reflects multi-step connectivity under that operator.

These definitions describe different objects. A principal curve is a continuous geometric summary; an MST is a discrete tree; a diffusion map is a spectral coordinate system derived from transitions. Pseudotime can be assigned along a selected curve or tree path, or by diffusion distance from a root, but the resulting numbers are not automatically on a common scale.

Assumptions and Outputs

A principal curve is most interpretable when the cell states occupy a single, reasonably well-sampled, one-dimensional path with noise around it. The nearest-point projection should be sufficiently unambiguous, and the curve should not need to pass through a genuine branch point. Its self-consistency condition is an ideal population property; in a finite data set, a fitted curve only approximates it. In particular, a fitting procedure that minimizes distance to observations can be pulled toward densely sampled regions, while smoothing can flatten a sharp turn or erase a short segment.

An MST needs a meaningful edge-weight definition and enough local observations for short edges to reflect nearby states. It always connects the supplied vertices if a spanning tree is constructed on a connected weighted graph, but a minimum total edge length does not guarantee that every edge is biologically plausible. A long edge can bridge a sampling gap, and noise can create a spur or an accidental shortcut. A tree can represent branching, but its branches may be sampling artifacts rather than distinct fate paths. Rooted pseudotime also depends on the selected root and the path through the tree.

A diffusion map requires a neighborhood graph and a transition kernel whose local connections are appropriate for the data. Its eigenvectors summarize the resulting transitions; they do not directly specify a unique ordered path. Diffusion distances compare transition profiles after a chosen number of steps, so both the kernel scale and diffusion time affect the geometry. A graph that is disconnected has no transitions between components, while an overly broad kernel can connect states that should remain separate. The earlier material on diffusion kernels, eigenvectors, and diffusion distance establishes these ingredients; here the issue is how their outputs compare with curve and tree representations.

MethodPrimary outputWhat defines proximity or orderTypical failure mode
Principal curveSmooth curve through the point cloudNearest-point projection and position along the curveOversmoothing, density influence, or ambiguous projection near a bend or branch
MSTTree connecting observed cellsEdge weights and paths through the treeFalse bridges, noisy branches, or path distortion from uneven sampling
Diffusion mapSpectral coordinates from graph transitionsMulti-step transition similarity and diffusion distanceSensitivity to neighborhood scale, graph disconnection, or misleading global eigenvectors

Worked Comparisons on Synthetic Paths

Worked Example: A Curved Path and Three Different Lengths

Suppose three hypothetical, noiseless cells lie at \((1,0)\), \((0,1)\), and \((-1,0)\) on the upper unit semicircle. Compare the arc length of the semicircle with the MST path between the endpoints and their straight-line distance.

The semicircle has radius \(1\) and angle \(\pi\), so its arc length is \(1\cdot\pi=\pi\), approximately \(3.142\) coordinate units. The distances between adjacent cells are both \(\sqrt{(1-0)^2+(0-1)^2}=\sqrt{2}\), while the endpoint distance is \(2\). The MST chooses the two shorter adjacent edges, giving total length \(2\sqrt{2}\approx2.828\). The tree path between the endpoint cells therefore has length \(2.828\), not the semicircle’s \(3.142\); their direct chord is only \(2\).

If the semicircle is the specified candidate principal curve, each cell lies on it and has zero distance to it. A fitted curve from real noisy observations would not be known in advance and would not generally have zero residuals. This example isolates the geometric distinction: curve arc length follows the specified bend, whereas an MST path approximates it with discrete chords. With only three points, the MST underestimates the arc length, and more points along the bend would be needed for a closer approximation.

Worked Example: A Right-Angle Path and an MST Shortcut Risk

Consider four hypothetical cells at \(A=(0,0)\), \(B=(1,0)\), \(C=(1,1)\), and \(D=(2,1)\). Assume Euclidean distance is the edge weight. Compute the MST and compare the tree path from \(A\) to \(D\) with the straight-line distance.

The three successive distances are \(d(A,B)=1\), \(d(B,C)=1\), and \(d(C,D)=1\). Every other pair is at least \(\sqrt{2}\): for example, \(d(A,C)=\sqrt{2}\) and \(d(B,D)=\sqrt{2}\). Thus the three unit edges connect all four cells with total weight \(3\), and no spanning tree can have a smaller total because each vertex must be connected and those three edges are the shortest available way to connect this chain. The MST path from \(A\) to \(D\) has length \(1+1+1=3\).

The endpoint chord is \(d(A,D)=\sqrt{(2-0)^2+(1-0)^2}=\sqrt{5}\approx2.236\), shorter than the tree path because it cuts across the bend. If sparse sampling omitted \(B\) and \(C\), the observed endpoints alone would not reveal that bend. In a larger point cloud, a short cross-gap edge could likewise replace a biologically relevant route if the geometry or sampling makes the shortcut appear cheaper. The MST reports the minimum tree under its edge weights, not proof that every chosen edge follows the underlying process.

Worked Example: Diffusion Distance Depends on Transition Profiles

For a small hypothetical neighborhood graph with three cells, suppose the one-step transition matrix and stationary probabilities are \(P=\begin{pmatrix}0.5&0.5&0\\0.25&0.5&0.25\\0&0.5&0.5\end{pmatrix}\) and \(\pi=(0.25,0.5,0.25)\). Use the one-step diffusion distance \(D_1(i,j)\), defined by \(D_1(i,j)^2=\sum_l (P_{il}-P_{jl})^2/\pi_l\), to compare cell 1 with cells 2 and 3.

For cells 1 and 3, the row difference is \((0.5,0,-0.5)\). Therefore, \(D_1(1,3)^2=0.5^2/0.25+0^2/0.5+(-0.5)^2/0.25=1+0+1=2\), so \(D_1(1,3)=\sqrt{2}\approx1.414\).

For cells 1 and 2, the row difference is \((0.25,0,-0.25)\). Thus, \(D_1(1,2)^2=0.25^2/0.25+0^2/0.5+(-0.25)^2/0.25=0.25+0+0.25=0.5\), so \(D_1(1,2)=\sqrt{0.5}\approx0.7071\). Cell 1 is closer to cell 2 in this diffusion geometry because their one-step transition profiles are more similar. This is not the same as a curve’s position or an MST path length, and changing the transition graph or diffusion time can change the comparison.

Why the Methods Diverge

The main mathematical distinction is what each method preserves. A principal curve seeks a smooth central trend through the observations. An MST preserves a minimum-weight connected skeleton on the observed vertices. A diffusion map preserves aspects of neighborhood transitions, including multi-step routes. The same data can therefore support three different answers to “how far apart are these cells?”: curve distance along a fitted path, accumulated edge weights along a tree path, or diffusion distance between transition profiles.

Curvature exposes this difference. A straight chord between points on a bend is shorter than the route along the bend. As the number of points increases and local spacing decreases, an MST path can better approximate a smooth route, provided its edges remain local. A principal curve can represent the bend continuously but may smooth it if its fitting penalty or bandwidth favors gentler curvature. Diffusion geometry can connect the bend through successive neighborhoods, but its coordinates may depend on eigenvector scaling and can compress or stretch portions of the path.

Uneven sampling affects all three methods, though not in the same way. In dense regions, empirical curve fitting has more observations influencing the fit. In sparse regions, MST edges tend to be longer and more vulnerable to bridging gaps. For diffusion methods, density changes neighborhood degrees and transition probabilities; normalization and adaptive neighborhood choices can mitigate some density effects but do not remove the need to inspect the graph. The earlier material on uneven cell density motivates treating local spacing as part of the geometry rather than as an irrelevant nuisance.

A short justification clarifies why an MST path need not equal curve length. For points ordered along a curved route, each straight edge between consecutive points has length no greater than the corresponding curved segment, because the straight segment is the shortest connection between its endpoints. Summing over segments gives a polygonal path length no greater than the curve length. Equality requires each segment to be straight; otherwise the inequality is strict. This argument applies only when the tree path connects consecutive points in their route order. An MST can instead select a shortcut or branch, so even the polygonal approximation interpretation requires a locally faithful graph.

$$ \sum_{k=1}^{m} \|x_k-x_{k-1}\| \leq L(\text{curve from }x_0\text{ to }x_m) $$

The inequality explains a common geometric bias, not a guarantee that an MST reconstructs the intended trajectory. If a local graph contains a long gap, or if points from separate nearby arms are closer across the gap than along the true route, the minimum-tree criterion can favor the wrong connection. A principal curve can also fail when a single smooth curve is an inappropriate summary of a branching process. Diffusion maps may preserve broad connectivity without yielding a unique one-dimensional ordering. None of the three outputs should be read as a direct measurement of biological time.

Diagnostics and Practical Choice

Compare the representations on the same cell representation and inspect the local geometry before interpreting pseudotime. Useful checks include plotting candidate paths over the points, examining MST edge lengths relative to nearby edge lengths, checking whether a curve has large residuals or ambiguous projections, and verifying that the diffusion neighborhood graph is connected where the proposed trajectory requires connectivity. In diffusion coordinates, inspect whether leading eigenvectors separate components or reflect a broad gradient unrelated to the proposed path. These diagnostics reveal mismatches; they do not establish that one method is biologically correct.

  • Suspect an MST bridge when an edge is much longer than neighboring edges or crosses a visibly empty region. Check whether the edge is supported by the chosen feature-space metric and neighborhood graph.
  • Suspect curve oversmoothing when observations systematically fall to one side of a bend or when projections pile up at a narrow region. A smooth summary may be inadequate for sharp turns or branches.
  • Suspect density-driven distortion when the fitted curve follows a dense cluster closely but cuts across sparse regions, or when graph edge lengths change markedly with local cell density.
  • Suspect diffusion-scale failure when small changes in neighborhood scale alter connectivity, when components are disconnected, or when broad neighborhoods create edges across distinct arms.

The choice should follow the scientific and geometric target. Use a principal curve when a smooth, essentially one-dimensional central path is appropriate and projections are meaningful. Use an MST when a discrete skeleton and explicit tree paths are useful, while checking edge plausibility and branch support. Use diffusion maps when multi-step neighborhood connectivity is central and a spectral representation is useful, while keeping its scale and graph assumptions visible. These approaches are alternatives with different strengths, not interchangeable implementations of one estimator.

A common mistake is to treat agreement between two methods as validation, or disagreement as evidence that one method is simply wrong. The correction is to ask which object each method estimates and whether its assumptions fit the data. For example, a shorter MST path than curve arc length can be the expected chord approximation; it becomes concerning when the tree path changes because of a long, unsupported shortcut. Similarly, a diffusion coordinate is not automatically a time coordinate just because it varies smoothly along a plotted path.

Key takeaway: Interpret the inferred trajectory together with its representation. A smooth curve, a minimum-weight tree path, and diffusion distance answer different geometric questions; curvature, uneven density, noise, and graph construction determine how far their answers diverge.

Check Your Understanding

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

  1. On a curved path, why can an MST path be shorter than the underlying curve’s arc length?
  2. What does a principal curve assume about the organization of the data, and what warning sign suggests that this assumption is failing?
  3. Two cells have similar diffusion distance but are not immediate graph neighbors. Is that possible? Explain.
  4. A tree contains one edge far longer than all nearby edges. What failure should be investigated before interpreting the resulting pseudotime?

Solutions. (1) Each straight edge is a chord and no longer than the curved segment it approximates; summing chords can therefore underestimate arc length. (2) It is most interpretable for a single smooth, well-sampled path with sufficiently unambiguous projections; systematic residuals or ambiguous projections near a branch or bend are warnings. (3) Yes. Diffusion distance compares transition profiles, which can be similar through multi-step connectivity even without a direct edge. (4) Investigate a false bridge across a sparse gap or an implausible edge induced by the chosen representation or metric.

Clinical Biostats