Lung Regeneration - Club-to-Ciliated Trajectory
20,000 cellssingle-cellgenomicstrajectorycosine
A TMAP of a 20,000-cell lung regeneration time course (24,051 genes, PCA input, cosine metric, n_neighbors=20). Cell-state boundaries are sharp: 17,360/19,999 edges (86.8%) connect same-labeled cells, with mean subtree purity 0.736 (min_size=25). Tree pseudotime from a fixed root spans [0, 7.58] (95th percentile 5.60), and an 83-hop example trajectory from a Club-to-ciliated cell to a distal target crosses 8 label transitions over a time span of day 2 to day 15 - passing through Club activated states along the way. A Krt8/Krt18/Cldn4 transition-marker score (median 0.33, max 64) highlights the alveolar differentiation intermediates along these paths.
Lung Regeneration - Club-to-Ciliated TrajectoryOpen full page
Loading interactive demo…
How it was made
generate.pypython
import scanpy as sc
from tmap import TMAP
adata = sc.read_h5ad("lung_regeneration.h5ad")
model = TMAP(metric="cosine", n_neighbors=20, seed=42)
model.fit(adata.obsm["X_pca"])
# Cell-state boundary edges
clusters = adata.obs["clusters"].values
edges = model.tree_.edges
same_label = clusters[edges[:, 0]] == clusters[edges[:, 1]]
print(f"Same-label edges: {same_label.mean():.1%}")
# Trajectory from an early Club cell toward a ciliated target
path = model.path(root_idx, target_idx)
day = adata.obs["day"].values[path]
pseudotime = model.distances_from(root_idx)[path]
viz = model.to_tmapviz()
viz.add_color_layout("cell state", clusters.tolist(), categorical=True)
viz.add_color_layout("day", adata.obs["day"].tolist(), color="plasma")
viz.write_html("lung-regeneration.html")