SARS-CoV-2 Spike Evolution - Nextstrain Lineages

24,820 sequencesbiologyvirologyphylogenetics

A TMAP of 24,820 SARS-CoV-2 spike protein sequences from the Nextstrain ncov open build, anchored to the Wuhan-Hu-1 reference spike (NC_045512.2). Sequences are represented as amino-acid 5-mers under a Jaccard-metric TMAP (n_neighbors=30), forming a single connected tree of 24,821 nodes with maximum depth 145 hops and median depth 51 from the ancestral reference. Tree hops from Wuhan-Hu-1 correlate strongly with collection date (Spearman 0.855), and the graph-local audit confirms real evolutionary structure: TMAP edges connect sequences with a mean collection-date gap of just 0.328 years, versus 1.698 years for random pairs (p < 0.001). Only 22.5% of edges cross Nextstrain clade boundaries, versus 96.2% for random pairs - the tree overwhelmingly keeps each clade (Alpha, Beta, Gamma, Delta, Omicron sublineages, etc.) together, with dozens of pure single-clade subtrees exceeding 100 sequences each.

SARS-CoV-2 Spike Evolution - Nextstrain LineagesOpen full page
Loading interactive demo…

How it was made

generate.pypython
from tmap import TMAP

# Amino-acid 5-mer sets per spike sequence, anchored to Wuhan-Hu-1 (root)
model = TMAP(
    metric="jaccard",
    n_neighbors=30,
    n_permutations=256,
    kc=80,
    seed=42,
).fit(aa_kmer_sets)

depth = [d for _, _, d in model.tree_.bfs(root=wuhan_hu_1_idx)]

viz = model.to_tmapviz()
viz.add_color_layout("Nextstrain clade", clades, categorical=True, color="tab20")
viz.add_color_layout("Tree hops from Wuhan-Hu-1", depth, color="magma")
viz.add_color_layout("Collection date", collection_dates, color="viridis")
viz.write_html("sars_cov2_spike.html")