PBMC 3k - Single-Cell RNA-seq
2,638 cellssingle-cellgenomicseuclidean
A TMAP of the PBMC 3k dataset (2,638 peripheral blood mononuclear cells, the standard single-cell benchmark). Built from 50-dimensional PCA coordinates using euclidean metric - the same input UMAP typically receives. The tree separates 8 cell types (CD4 T cells, B cells, CD14+ Monocytes, NK cells, CD8 T cells, FCGR3A+ Monocytes, Dendritic cells, Megakaryocytes) with only 5.8% boundary edges and mean subtree purity 0.88. Color layers include cell type, pseudotime (tree distance from a CD14+ Monocyte root), and gene expression for cell-type markers: CST3 (monocytes), NKG7 (NK cells), CD79A and MS4A1 (B cells), GNLY (cytotoxic), FCER1A (dendritic).
PBMC 3k - Single-Cell RNA-seqOpen full page
Loading interactive demo…
How it was made
generate.pypython
import scanpy as sc
from tmap import TMAP
from tmap.graph.analysis import boundary_edges, subtree_purity
adata = sc.datasets.pbmc3k_processed()
model = TMAP(metric="euclidean", n_neighbors=15, seed=42)
model.fit(adata.obsm["X_pca"])
# Cell type boundary analysis
cell_types = adata.obs["louvain"].values
be = boundary_edges(model.tree_, cell_types)
purity = subtree_purity(model.tree_, cell_types, min_size=10)
# Pseudotime from a monocyte root
root = np.where(adata.obs["louvain"] == "CD14+ Monocytes")[0][0]
pseudotime = model.distances_from(root)
viz = model.to_tmapviz()
viz.add_color_layout("cell type", cell_types.tolist(), categorical=True)
viz.add_color_layout("pseudotime", pseudotime.tolist(), color="magma")
viz.write_html("pbmc3k.html")