Pancreas Development - scVelo Pseudotime Audit

3,696 cellssingle-cellgenomicstrajectorycosine

A TMAP of the scVelo pancreas tutorial dataset (3,696 cells, 1,945 genes, Bergen et al. 2020, Nature Biotechnology), built from the first 30 PCA components with cosine metric (n_neighbors=20), rooted at the cell with maximum scVelo root-cell probability (an Ngn3-low endocrine progenitor). Without recomputing RNA velocity, TMAP's rooted tree-hop distance correlates with scVelo's latent_time at Spearman 0.897 and with velocity_pseudotime at 0.931 - weighted tree distance gives 0.877. A graph-local audit shows the mean latent-time delta across TMAP edges (0.0122) is over 27x smaller than across random cell pairs (0.3381, p=0.000), and 88.5% of edges connect same-cluster cells. A root-sensitivity sweep across the top 20 scVelo root candidates confirms this is not root-choice-dependent: Spearman(tree hops, latent_time) = 0.897 +/- 0.012 across all 20 alternate roots.

Pancreas Development - scVelo Pseudotime AuditOpen full page
Loading interactive demo…

How it was made

generate.pypython
import scvelo as scv
from tmap import TMAP

adata = scv.datasets.pancreas()  # or load scvelo-pancreas.h5ad directly
X = adata.obsm["X_pca"][:, :30]

model = TMAP(metric="cosine", n_neighbors=20, seed=42).fit(X)

# Root at the cell with maximum scVelo root-cell probability
root = int(np.argmax(adata.obs["root_cells"]))
tree_hops = model.distances_from(root)

from scipy.stats import spearmanr
rho = spearmanr(tree_hops, adata.obs["latent_time"]).statistic
print(f"Spearman(tree hops, scVelo latent_time) = {rho:.3f}")

viz = model.to_tmapviz()
viz.add_color_layout("latent time", adata.obs["latent_time"].tolist(), color="viridis")
viz.add_color_layout("cluster", adata.obs["clusters"].tolist(), categorical=True)
viz.write_html("pancreas-pseudotime.html")