Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Fate mapping and potency

Compute the probability that each of 3,696 cells from the embryonic mouse pancreas Bastidas-Ponce et al., 2019 reaches each of four endocrine fates: the Alpha, Beta, Delta and Epsilon cells, which make glucagon, insulin, somatostatin and ghrelin. The probabilities come from a random walk on the cells’ neighbor graph. A pseudotime from the Ductal cells first sets the direction of the walk; a potency score, computed from each cell’s own expression, then sets it without naming any source cells.

The Ductal cells and the Ngn3 low and Ngn3 high endocrine progenitors (EP) share nearly the same split, 0.45 Beta, 0.29 Epsilon, 0.23 Alpha and 0.04 Delta, and the probabilities diverge in the Pre-endocrine cells. The potency score orders the progenitor stages as published. The map that it directs correlates with the pseudotime-directed map at r = 0.96 to 0.99 for each fate and shifts the shared split toward Alpha, 0.31 instead of 0.23. The last section finds the endpoints instead of naming them: a search of the walk that the potency score directs calls the four endocrine types terminal, beside the Pre-endocrine cells, where the walk slows before the fates part.

Open the prepared analysis

Started: 2026-11-24T17:33:12.191435Z | Wall time: 24.732 s

ds.pipeline.open(label="rna") reopens the store’s saved RNA analysis. Indexing the run by an output name, such as connectivity_map, returns an ArtifactRef, a reference to that saved result. The fate map walks on the analysis’s neighbor graph, and the figures draw the cells on its UMAP.

DataStore has 3696 (3696) cells with 1 assays: RNA Cell metadata: 'I', 'ids', 'names', 'G2M_score', 'RNA_UMAP1', 'RNA_UMAP2', 'RNA_clusters', 'RNA_leiden_cluster', 'RNA_nCounts', 'RNA_nFeatures', 'RNA_percentMito', 'RNA_percentRibo', 'S_score', 'clusters', 'clusters_coarse' RNA assay has 27998 features and following metadata: 'I', 'ids', 'names', 'dropOuts', 'highly_variable_genes', 'nCells'

Started: 2026-11-24T17:33:36.924739Z | Wall time: 20.640 s

Map four endocrine fates

A pseudotime orders the cells from source cells to sink cells, the endpoints of the process, as the pseudotime tutorial explains. Here the Ductal cells share a total weight of -1 and the cells of the four endocrine types share +1. ds.trajectory.fate then starts a random walk from every cell. The walk follows the graph’s edges, and an edge back to an earlier cell keeps less of its weight the further back in pseudotime it leads, so the walk moves mostly forward. The walk stops at the first endpoint cell it reaches, and a cell’s probability of each fate is the chance that its walk stops in that fate’s cells: the absorption probability that CellRank also computes Lange et al., 2022.

A pseudotime records the cells it scored as a frozen cell selection, a saved list of cells that later calls take as input. ds.snapshot_cluster_labels freezes the published cell types of those cells as a label artifact, a saved copy that later edits of the cell metadata cannot change, so the map records exactly which cells were its endpoints.

Ductal 916 Alpha 481 Beta 591 Delta 70 Epsilon 142 Name: count, dtype: int64

Started: 2026-11-24T17:33:57.565658Z | Wall time: 1.087 s

The 916 Ductal cells form the source, and every Alpha, Beta, Delta and Epsilon cell is an endpoint of its own fate: 481, 591, 70 and 142 cells. An endpoint cell has probability one for its own fate.

Read the probabilities by stage

ds.trajectory.load_fate returns one row of probabilities per scored cell, with one column per fate in the order of sink_labels, and a valid mask of the cells that the map covers. A pseudotime scores one connected component of the graph, so a cell outside that component has no probabilities. Each valid row sums to one. Average the probabilities within each progenitor stage of the published annotation, from the Ductal cells to the Pre-endocrine cells, and count the cells whose probability of some fate differs by more than 0.05 from the Ductal cells’ average, the Ductal split:

3,696 of 3,696 cells have probabilities
Stacked horizontal bars of the mean fate probability in each progenitor stage, from Ductal at the top to Pre-endocrine at the bottom, split into Alpha in dark blue, Beta in light green, Delta in dark purple and Epsilon in light purple. The Ductal, Ngn3 low EP and Ngn3 high EP bars look identical, at about 0.23 Alpha, 0.45 Beta, 0.04 Delta and 0.29 Epsilon; the Pre-endocrine bar holds more Alpha and Beta, 0.29 and 0.53, and half as much Epsilon, 0.14.
AlphaBetaDeltaEpsiloncellslargest SDcells off the Ductal split
Ductal0.230.450.040.299160.0010
Ngn3 low EP0.230.450.040.292620.0030
Ngn3 high EP0.230.450.040.296420.01815
Pre-endocrine0.290.530.040.145920.207565

Started: 2026-11-24T17:33:58.653745Z | Wall time: 0.485 s

All 3,696 cells have probabilities. The Ductal, Ngn3 low EP and Ngn3 high EP cells, the trunk that leads to every fate, share one split: 0.45 Beta, 0.29 Epsilon, 0.23 Alpha and 0.04 Delta. No Ductal or Ngn3 low EP cell is off the Ductal split, and the largest standard deviation of a fate’s probability in these two stages is 0.001 and 0.003: a walk from anywhere on this part of the trunk passes through the same cells before the branches part, so where it starts no longer matters. In the Ngn3 high EP cells the largest standard deviation is 0.018, and 15 of the 642 cells are off the split. The probabilities diverge in the Pre-endocrine cells: 565 of the 592 are off the split, the largest standard deviation is 0.207, and the mean Epsilon probability halves to 0.14, while Beta rises to 0.53 and Alpha to 0.29.

The trunk’s split does not follow the sizes of the endpoint populations: the 142 Epsilon cells take 0.29 of the trunk’s probability and the 481 Alpha cells 0.23, because a fate’s share depends on how directly the graph joins the trunk to that fate’s cells, not on how many cells the fate has. Draw the four probabilities on the UMAP beside the published cell types, on one zero-to-one color scale:

Five panels of the pancreas UMAP in a grid of three columns, with the cell type legend on the right. The first colors the cells by published type: Ductal and Ngn3 low EP cells on the right, Ngn3 high EP cells along an arc at the top, Pre-endocrine cells at the upper left, Beta cells at the lower left, and Alpha, Delta and Epsilon cells in the center. The other four color each cell by its Alpha, Beta, Delta or Epsilon probability on a shared zero-to-one scale. Each endocrine type is at one for its own fate and zero for the others. The Ductal, Ngn3 low EP and Ngn3 high EP cells have a nearly uniform color per panel, near 0.23 Alpha, 0.45 Beta, 0.04 Delta and 0.29 Epsilon, apart from a small patch of higher Epsilon probability where the top arc meets the Pre-endocrine cells, above the Epsilon cells. The colors change mainly among the Pre-endocrine cells, where the Beta probability rises toward the Beta cells and the Alpha probability toward the Alpha cells.

Started: 2026-11-24T17:33:59.139420Z | Wall time: 0.417 s

The trunk, from the Ductal and Ngn3 low EP cells on the right along the Ngn3 high EP cells at the top, has nearly one color in each panel. The colors change in the Pre-endocrine cells at the upper left, where the Beta probability rises toward the Beta cells below them and the Alpha probability toward the Alpha cells beside them. A small patch of higher Epsilon probability lies where the Ngn3 high EP cells meet the Pre-endocrine cells, above the Epsilon cells, and holds most of the Ngn3 high EP cells that are off the split. The map therefore places the choice between the four fates in the Pre-endocrine cells and in the few Ngn3 high EP cells beside them.

ds.trajectory.fate takes its endpoints as input. On a dataset without a trusted annotation, the lineage curves tutorial proposes candidate endpoints from a cluster tree.

Score differentiation without source cells

The pseudotime above needed the Ductal cells named as its source. ds.scores.potency instead scores how differentiated each cell is from its own expression on a STRING protein interaction network Szklarczyk et al., 2024, so it needs no source. The call computes two measures, both high in less differentiated cells. CCAT Teschendorff et al., 2020 is the correlation between a cell’s expression of the network’s genes and the genes’ numbers of links. The signaling entropy rate, SR Teschendorff & Enver, 2017, is high when the cell’s expression lets signals spread evenly over the network. The call saves a cell_potency artifact whose differentiation array is one minus each cell’s rank by CCAT, the default measure, on a scale from 0 to 1, so it rises as cells differentiate. The scores order some processes and fail on others, as the comparison on fifteen systems shows, and the sections below test the order on this dataset.

Score the graph’s cells. This dataset names its features by gene symbol rather than Ensembl ID, so species="mouse" chooses the network and genes match by symbol; without it, the call stops and asks for the species.

network genes matched 14004 network genes used 13858 network links used 123839 matched by symbol dtype: object

Started: 2026-11-24T17:33:59.557829Z | Wall time: 1.978 s

The assay’s gene symbols match 14,004 of the 14,599 genes in the mouse network, and the scores use the 13,858 genes that form the largest connected component of the matched ones, joined by 123,839 links. ds.scores.potency refuses an assay that matches fewer than 5,000 network genes, since a network cut down that far no longer describes a cell’s signaling.

Compare the score’s order with that of the pseudotime, which the Ductal source and the endocrine endpoints supervise. The artifact also stores both raw measures, so rank the cells by SR as well:

Two panels of the pancreas UMAP on a shared zero-to-one color scale. Left, the pseudotime from the Ductal source rises smoothly from 0 in the Ductal cells on the right, along the arc at the top, to near 1 in the endocrine cells on the left. Right, the source-free CCAT differentiation score runs in the same direction, low on the right and high on the left, but varies strongly between neighboring cells.
CCAT 0.80 SR 0.81 dtype: float64

Started: 2026-11-24T17:34:01.536912Z | Wall time: 0.211 s

Both orders run from the Ductal cells on the right to the endocrine cells on the left. The pseudotime rises smoothly, while the CCAT score varies strongly between neighboring cells. Over all cells, CCAT’s ranks correlate with the pseudotime at Spearman’s rho = 0.80, and SR’s at 0.81.

Next, check the order of both measures against the published annotation, which neither measure read:

Two box-plot panels of the differentiation rank of each published population's cells, by CCAT on the left and by SR on the right, with the populations in stage order from Ductal to Epsilon and the boxes colored as the cell types. In both panels the boxes rise from Ductal, at medians of 0.15 and 0.19, through Ngn3 low EP and Ngn3 high EP to the Pre-endocrine and hormone-producing types. Under CCAT the Beta box, at 0.69, sits below the Pre-endocrine box, at 0.72; under SR the Pre-endocrine box, at 0.67, sits below all four hormone-producing types. Every box is wide, and neighboring boxes overlap except at the step from Ngn3 high EP to Pre-endocrine, where the medians jump from 0.37 to 0.72 under CCAT and from 0.34 to 0.67 under SR and the boxes do not meet.
median rankCCATSR
Ductal0.150.19
Ngn3 low EP0.220.22
Ngn3 high EP0.370.34
Pre-endocrine0.720.67
Alpha0.810.75
Beta0.690.80
Delta0.860.78
Epsilon0.810.80

Started: 2026-11-24T17:34:01.748857Z | Wall time: 0.813 s

Both measures rank the stages in their published order up to the Pre-endocrine cells: the Ductal cells least differentiated, at medians of 0.15 under CCAT and 0.19 under SR, then the Ngn3 low EP and Ngn3 high EP cells. The largest step under both measures comes next, from the Ngn3 high EP cells, at 0.37 and 0.34, to the Pre-endocrine cells, at 0.72 and 0.67, the stage in which the fate probabilities diverge. Past that step the measures disagree: CCAT scores the Beta cells as slightly less differentiated than the Pre-endocrine cells that precede them, at 0.69 against 0.72, while SR places all four hormone-producing types, at 0.75 to 0.80, after the Pre-endocrine cells, as published. On a dataset without an annotation you trust, check that the least differentiated cells express known progenitor markers.

Within each population the ranks spread widely, and the boxes of neighboring populations overlap at every step except the one from the Ngn3 high EP to the Pre-endocrine cells. In the comparison on fifteen systems, both measures followed a cell’s sequencing depth within a stage, so correlate each raw measure with the cells’ total counts within each population, and show each population’s median total counts:

rho with total countstotal counts
CCATSRmedian
Ductal0.870.138044
Ngn3 low EP0.83-0.047360
Ngn3 high EP0.730.455899
Pre-endocrine0.400.094876
Alpha0.690.345576
Beta0.690.276172
Delta0.470.165624
Epsilon0.530.296522

Started: 2026-11-24T17:34:02.562463Z | Wall time: 0.013 s

Within a population, a cell’s CCAT rises with its total counts at Spearman’s rho = 0.40 to 0.87, most strongly in the Ductal and Ngn3 low EP cells, while SR’s rho is only -0.04 to 0.45. A deeply sequenced cell therefore looks less differentiated than a shallow one of the same stage, more so under CCAT. Total counts also fall along the progenitor stages, from a median of 8,044 in the Ductal cells to 4,876 in the Pre-endocrine cells, so depth by itself would order those stages the same way. Two results show that depth alone does not set the order: SR, which follows depth far less, orders the stages as CCAT does, and the hormone-producing cells hold more counts than the Pre-endocrine cells, at medians of 5,576 to 6,522, yet both measures rank them as more differentiated, apart from CCAT’s Beta cells. Read the scores per population rather than per cell, and compare samples only when they were sequenced to similar depth.

Passing the graph as graph= smooths the measure over neighboring cells before it ranks them. Smoothing is off by default: in the comparison on fifteen systems it strengthened the order of the pancreas stages but also deepened the reversals of the systems that the measures order backward, so a smoothed score needs the same checks.

Direct the map by potency

ds.trajectory.fate takes the cell_potency artifact as its direction in place of a pseudotime, with the graph to walk on and the same endpoints as before. The walk then discounts each edge toward a less differentiated cell as it discounted each edge back in pseudotime:

3,696 of 3,696 cells have probabilities

Started: 2026-11-24T17:34:02.576752Z | Wall time: 0.133 s

All 3,696 cells have probabilities again. Compare the two maps outside the endpoint populations, whose probabilities the model fixes. Uncommitted cells spread their probability over the fates, so their most probable fate is a weak preference; count the agreement again among committed cells, those whose largest probability is above one half in either map.

{'cells compared': 2412, 'probability correlation': {'Alpha': 0.967, 'Beta': 0.985, 'Delta': 0.987, 'Epsilon': 0.962}, 'same leading fate': 0.991, 'committed cells': 494, 'same leading fate, committed': 0.982}

Started: 2026-11-24T17:34:02.711263Z | Wall time: 0.005 s

Each fate’s probabilities correlate at r = 0.96 to 0.99 between the maps over the 2,412 cells compared, and 99% of the cells have the same most probable fate. Most of the compared cells belong to the trunk, whose cells share nearly one split in each map, so the 99% mostly repeats a single comparison; among the 494 committed cells, 98% agree. Plot each fate’s probability in both maps, and average both maps within each stage:

Four scatter plots, one per fate, of each compared cell's probability in the potency-directed map against the pseudotime-directed map, with a dashed identity line and the cells colored by progenitor stage, the Pre-endocrine cells as small dots under the larger markers of the other stages. In panels titled r = 0.97 for Alpha, 0.99 for Beta and Delta, and 0.96 for Epsilon, the Pre-endocrine cells lie close to the identity line, slightly above it for Alpha and Delta and below it for Beta. The Ductal, Ngn3 low EP and Ngn3 high EP cells form one tight group per panel, above the line for Alpha, at about 0.23 by pseudotime and 0.31 by potency, and below it for Beta and Epsilon; a few Ngn3 high EP cells spread from that group parallel to the line, most of them toward higher Epsilon probability, up to about 0.45 by pseudotime.
pseudotime mappotency mapleading fate
AlphaBetaDeltaEpsilonAlphaBetaDeltaEpsiloncellssame
Ductal0.230.450.040.290.310.410.060.229161.00
Ngn3 low EP0.230.450.040.290.310.410.060.222621.00
Ngn3 high EP0.230.450.040.290.310.410.060.226421.00
Pre-endocrine0.290.530.040.140.340.470.060.145920.96

Started: 2026-11-24T17:34:02.717555Z | Wall time: 0.111 s

The trunk forms one point per fate, off the diagonal, and a few Ngn3 high EP cells spread from it, most of them toward Epsilon in both maps. Directed by potency, the map gives the trunk 0.31 Alpha instead of 0.23 and 0.06 Delta instead of 0.04, at the expense of Epsilon, 0.22 instead of 0.29, and Beta, 0.41 instead of 0.45, which stays the trunk’s most probable fate. The Pre-endocrine cells lie close to the diagonal and shift toward Alpha the same way, to 0.34 Alpha and 0.47 Beta from 0.29 and 0.53, and 96% of them have the same most probable fate in both maps. Both maps share the graph and the endpoints and differ only in their direction, so their agreement shows that the map changes little when a score that needs no source cells directs the walk; the agreement is no independent evidence for the fates.

Find the initial and terminal states

Both maps above named their endpoints: the four endocrine types are sinks because the published annotation names them. ds.trajectory.states finds the states of the walk without naming any. It splits the walk that the potency score directs, the walk that fate takes with the same graph and score, into a chosen number of states: groups of cells that the walk enters and rarely leaves. Each cell gets a membership in each state, and each state gets a role. The state that the score places earliest is the initial state, and a state in which a long walk spends a larger share of its time than its share of the cells is terminal, since the walk collects there. The methods page describes the search.

Choose a few more states than the populations you expect along the process. labels names each state by the cell type most common among its 30 most likely cells, with _1, _2 for repeats:

/tmp/ipykernel_27057/3884071269.py:2: DiagnosticWarning: The optimization of the memberships of 11 states stopped at its limit of 20,000 trials before their crispness converged, so the states depend on where the optimization stopped, and a small change to the graph can give other terminal states. Compare the terminal states with those of n_states=10 and n_states=12, or check each terminal state with markers
  states_ref = ds.trajectory.states(graph, potency_ref, n_states=11, labels=cell_types)
labelrolecellscell_sharewalk_shareenrichmentstabilitydirection
state
Ductal_1Ductalinitial300.0420.0090.2160.9840.180
Ductal_2Ductalintermediate300.0280.0080.2830.9880.205
Ductal_3Ductalintermediate300.1110.0450.4020.9960.350
Ngn3 high EP_1Ngn3 high EPintermediate300.1300.1070.8220.9900.469
Ngn3 high EP_2Ngn3 high EPintermediate300.1020.0850.8370.9870.471
Ngn3 high EP_3Ngn3 high EPintermediate300.1240.0900.7240.9870.485
EpsilonEpsilonterminal300.0580.0701.2150.9790.543
Pre-endocrinePre-endocrineterminal300.2360.3071.3040.9920.585
AlphaAlphaterminal300.1150.1911.6620.9900.637
BetaBetaterminal300.0340.0361.0720.9920.637
DeltaDeltaterminal300.0200.0522.5990.9930.733

Started: 2026-11-24T17:34:02.829276Z | Wall time: 2.450 s

The search places a Ductal state first, as the initial state, and calls five states terminal: the four endocrine types, which a long walk visits 1.1 to 2.6 times as often as their share of the cells, and the Pre-endocrine cells, at 1.3 times. The Ductal and Ngn3 high EP states in between drain the walk toward them. stability, the probability that one step stays in a state, is above 0.97 for every state, so it does not tell the ends from the rest: one step of the walk moves a cell to one of its neighbors, which rarely leaves a large state.

A state can collect the walk without being an end, where the walk slows before the fates part, as it does in the Pre-endocrine cells, which the published annotation places before the endocrine fates. The warning above says that the optimizer stopped at its limit of 20,000 trials before the memberships converged, so they may not be the crispest that eleven states allow; comparing neighboring numbers of states shows which terminal states depend on where the optimizer stopped. Check which terminal states persist when the number of states moves by one:

/tmp/ipykernel_27057/3105110912.py:4: DiagnosticWarning: The optimization of the memberships of 11 states stopped at its limit of 20,000 trials before their crispness converged, so the states depend on where the optimization stopped, and a small change to the graph can give other terminal states. Compare the terminal states with those of n_states=10 and n_states=12, or check each terminal state with markers
  ds.trajectory.states(graph, potency_ref, n_states=n_states, labels=cell_types)
{10: ['Ngn3 high EP_3', 'Pre-endocrine', 'Beta', 'Alpha', 'Delta'], 11: ['Epsilon', 'Pre-endocrine', 'Alpha', 'Beta', 'Delta'], 12: ['Ngn3 high EP_4', 'Alpha', 'Epsilon', 'Beta', 'Pre-endocrine', 'Delta']}

Started: 2026-11-24T17:34:05.280310Z | Wall time: 2.588 s

The Alpha, Beta, Delta and Pre-endocrine states are terminal in all three searches, and Epsilon at eleven and twelve states, while ten and twelve states also call an Ngn3 high EP state terminal. Persistence therefore keeps the Pre-endocrine state, which the published annotation places before the fates. Keep the terminal states whose cells are mostly of an endocrine type, and draw their memberships on the UMAP:

Four panels of the pancreas UMAP on a shared zero-to-one color scale, one per endpoint state, Epsilon, Alpha, Beta and Delta, colored by each cell's membership in that state. Every panel is dark across the trunk and brightest in its own endocrine cells: at about 0.35 in the vertical strip of Epsilon cells at the center, 0.45 in the Alpha cells below it, 0.4 at the lower tip of the Beta cells and 0.55 in the small group of Delta cells at the center left.

Started: 2026-11-24T17:34:07.869228Z | Wall time: 0.305 s

Each membership peaks in its own endocrine population, at about 0.35 to 0.55, and falls to near zero across the trunk. The states artifact is also a label artifact: the 30 most likely cells of each state carry its name, and other cells carry none, so fate takes it as sink_labels, and any state can be passed as a sink. Map the fates to the four endocrine states, with no named source and with the sinks that the search found and the published annotation picked, and compare the map with the one that named the four cell types as sinks:

Epsilon 0.90 Alpha 0.49 Beta 0.76 Delta 0.62 dtype: float64

Started: 2026-11-24T17:34:08.175538Z | Wall time: 0.158 s

The probabilities correlate at r = 0.90 for Epsilon, 0.76 for Beta, 0.62 for Delta and 0.49 for Alpha over the cells outside the endocrine populations. The maps differ in their sinks: the found states end in their 30 most likely cells each, while the named sinks hold every cell of their type, 70 to 591, and a larger sink catches more of the walk. The state search therefore proposes where the process ends; the published annotation confirms it, and the named populations then make the sinks of the map that the earlier sections read.

The lineage dynamics tutorial follows genes along each lineage of this fate map and finds the genes that go with commitment to one fate. The lineage curves tutorial fits a curve to each lineage, and its checks of the trajectory score one lineage on its own cells, find the cells that follow no lineage and locate where the lineages part.

References
  1. Bastidas-Ponce, A., Tritschler, S., Dony, L., Scheibner, K., Tarquis-Medina, M., Salinno, C., Schirge, S., Burtscher, I., Böttcher, A., Theis, F. J., Lickert, H., & Bakhti, M. (2019). Comprehensive single cell mRNA profiling reveals a detailed roadmap for pancreatic endocrinogenesis. Development, 146(12), dev173849. 10.1242/dev.173849
  2. Lange, M., Bergen, V., Klein, M., Setty, M., Reuter, B., Bakhti, M., Lickert, H., Ansari, M., Schniering, J., Schiller, H. B., Pe’er, D., & Theis, F. J. (2022). CellRank for directed single-cell fate mapping. Nature Methods, 19(2), 159–170. 10.1038/s41592-021-01346-6
  3. Szklarczyk, D., Nastou, K., Koutrouli, M., Kirsch, R., Mehryary, F., Hachilif, R., Hu, D., Peluso, M. E., Huang, Q., Fang, T., Doncheva, N. T., Pyysalo, S., Bork, P., Jensen, L. J., & von Mering, C. (2024). The STRING database in 2025: protein networks with directionality of regulation. Nucleic Acids Research, 53(D1), D730–D737. 10.1093/nar/gkae1113
  4. Teschendorff, A. E., Maity, A. K., Hu, X., Weiyan, C., & Lechner, M. (2020). Ultra-fast scalable estimation of single-cell differentiation potency from scRNA-Seq data. Bioinformatics, 37(11), 1528–1534. 10.1093/bioinformatics/btaa987
  5. Teschendorff, A. E., & Enver, T. (2017). Single-cell entropy for accurate estimation of differentiation potency from a cell’s transcriptome. Nature Communications, 8(1). 10.1038/ncomms15599