Algorithm Search⌘K

Problemadvanced

Trajectory inference

Also called pseudotime inference, pseudotime ordering.

Order cells along a continuous process such as differentiation, and find its branches, from a snapshot of single-cell profiles.

Trajectory inference orders single cells along a continuous process, such as the differentiation of stem cells into mature types, from one snapshot of many cells. Each cell is measured once, at one moment, but a population that changes all the time holds cells at every stage. A method finds a graph through the cells, often a path or a tree, assigns each cell to a place on it, and gives each cell a pseudotime: its position along the process from a chosen start. The known methods build a tree or graph through the cells and an order on it, and there is no general guarantee that the order is the real one. Saelens and co-authors (2019) compared many methods and found that the best choice depends on the shape of the trajectory.

In plain words

Imagine one photo of a long road race, taken from above. Each runner is a cell, and you see where each is, but not when they started. Runners who are close on the road are at a similar stage. Join the runners along the road and you can order them from the start to the finish, even though you only have one photo. Where the road forks, the runners split into groups. The photo does not tell you which end is the start, or how fast the runners move; you must know that from somewhere else.

Definition

Input. Cells x1,…,xnx_1, \dots, x_n in a space of expression, usually reduced by principal component analysis, and often a start cell or start cluster.

Output. A graph GG whose edges are the paths of the process, a place on GG for each cell, and a pseudotime τi\tau_i for each cell, the distance along GG from the start. Branch points of GG are where one cell fate splits into several.

Types of trajectory. Saelens and co-authors group them into types such as linear, cycle, bifurcation, tree, graph and disconnected.

What a snapshot cannot give (a theorem). Let the cells be states c(ti)c(t_i) on a curve cc at unknown times tit_i. For any strictly increasing function hh, the curve c∘h−1c \circ h^{-1} at the times h(ti)h(t_i) gives exactly the same cells. So the data fix at most the order of the cells along the curve, and its reverse, but not the real time or the speed of the process. Proof. c(h−1(h(ti)))=c(ti)c(h^{-1}(h(t_i))) = c(t_i) for every ii, and the set of cells is all that is measured. □\square The direction needs a known start or a different kind of data, such as RNA velocity, and a time scale needs cells sampled at known times.

Variants

  • Linear or branched. A single path, or a tree with branch points.
  • With or without a root. Most methods need the start cell; some find it from the data with extra assumptions.
  • Cycles. The cell cycle is a closed loop, which a tree cannot represent.
  • Disconnected. Several separate processes in one data set.
  • With direction. Use unspliced and spliced counts to give each cell a direction.

Examples

A small Y. The eight cells of the example on the minimum spanning tree pseudotime page form a stem of three cells and two arms. The tree finds the branch point, and with the start cell at the base of the stem the two arms get the same pseudotimes at the same depth. Without a given start, the longest path of the tree runs from one arm tip to the other, so the default start is a tip, which shows why the start must be given.

A curve that comes back. On the diffusion pseudotime page, cells on an arc whose two ends are close in space get the right order from the random-walk distance, with a rank correlation of 0.998 with the true time in the tests, while the straight distance from the start cell gives only 0.618.

Known algorithms

  • Minimum spanning tree pseudotime. A minimum spanning tree on the cells (Monocle 1, Trapnell et al. 2014) or on cluster centers (TSCAN), and the distance along the tree. The tree is exact; it is sensitive to noise when built on cells.
  • Diffusion pseudotime (Haghverdi et al. 2016). A distance from a random walk on the cells that adds up the walk over all numbers of steps. It needs no tree, and it has an exact formula in the eigenvectors of the walk. It differs from a diffusion map, which gives coordinates at one chosen number of steps and is used for display.
  • Cluster graphs. Methods such as Slingshot and PAGA build a graph on clusters and then order the cells on it.
  • Principal curves and graphs. Fit a smooth curve or a graph through the cells, as in later versions of Monocle.
  • RNA velocity (La Manno et al. 2018). It does not order the cells by itself; it gives each cell a local direction from a model of splicing, which can choose the start and the direction of a trajectory found by another method.
  • Learned spaces. A variational autoencoder learns a low dimensional space of the cells. It does not give an order; a trajectory method is then run in that space.
AlgorithmTimeSpacePropertiesCode
Diffusion pseudotimeO(n^2 d + n^3) worstO(n^2) extradeterministicnot exactofflineiterative1 language
Minimum spanning tree pseudotimeO(n^2 d) worstO(n) extradeterministicnot exactofflineiterative1 language
RNA velocityO(g n log n) worstO(g n) extradeterministicnot exactofflineiterative1 language

Bounds

There is no general guarantee: by the theorem above, a snapshot does not fix the time, the speed or the direction, and noise can change the graph. Some results are exact under strong assumptions: on the MST page, if the distance between two cells grows strictly with the gap between their times, the tree is the path of consecutive cells and the pseudotime gives the true order. Everything else is measured on simulated and real data with known order, as in the benchmark of Saelens and co-authors. Display methods such as t-SNE and UMAP do not keep distances between groups, so a path seen on such a drawing is not evidence of a trajectory.

Reductions

  • To a spanning tree: order by distance along a minimum spanning tree of cells or clusters.
  • To a random walk: order by a distance between rows of the accumulated transition matrix of a walk on a neighbor graph.
  • To clustering and a graph on clusters: cluster first, then find the graph of clusters and place the cells on its edges.
  • From dynamics: with spliced and unspliced counts, a model of each gene gives local directions that can orient any of the above.

Applications

  • Finding the order of states in the differentiation of stem cells, such as blood cells from their precursors.
  • Finding genes that change along a process, by testing expression against pseudotime.
  • Finding branch points where cells choose between fates, and the genes that change near them.
  • Studying responses to a stimulus over a continuum of cell states.

References

  1. Wouter Saelens, Robrecht Cannoodt, Helena Todorov and Yvan Saeys, A comparison of single-cell trajectory inference methods, Nature Biotechnology 37(5), 547 to 554 (2019), the types of trajectory, the benchmark of methods on real and synthetic data, and the guidelines for choosing a method
  2. Cole Trapnell et al., The dynamics and regulators of cell fate decisions are revealed by pseudotemporal ordering of single cells, Nature Biotechnology 32(4), 381 to 386 (2014), the idea of pseudotime and the ordering of cells along a minimum spanning tree
  3. Laleh Haghverdi, Maren Büttner, F. Alexander Wolf, Florian Buettner and Fabian J. Theis, Diffusion pseudotime robustly reconstructs lineage branching, Nature Methods 13(10), 845 to 848 (2016), the ordering of cells by a random-walk distance and the detection of branches
  4. Gioele La Manno et al., RNA velocity of single cells, Nature 560(7719), 494 to 498 (2018), the direction of change of each cell from unspliced and spliced counts

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml