Spaces:
Running
Running
Commit History
-
Add §7 species tree, slim down §6 UMAP, mount /experiments
§7 · Species tree (Carbon-derived phylogeny) - scripts/build_species_tree.py derives a 27-species tree from Carbon-3B mean embeddings: per-species centroid distance matrix + Ward/UPGMA linkage + precomputed dendrogram layout. Output ships as data/species_tree.json (32 KB), served by new /species_tree endpoint. - demo.html gains a §7 section rendering the dendrogram as an SVG spine on the left and aligned rows on the right, with linkage + scope toggles and an "agreement vs NCBI" headline score. - scripts/render_tree_{mockups,mockups_v2,d_plus}.py: offline PNG mockups used during the §7 design review. §6 · UMAP refinements - Drop pos_3d from data/umap.bin. v1 only renders the 2D scatter and the frontend already skipped pos_3d on parse, so the int16×3 coords were 3.3 MB of dead bandwidth per visit. New WRITE_POS_3D toggle in build_real_umap.py for an easy re-enable. Wire payload 6.24 → 3.09 MB gzipped (~−50%). - New /umap_names endpoint serving the lazy-loaded per-poi…1f90847 -
§6 UMAP: integrate Dana's real Carbon 3B embeddings
Replace the synthetic 500K-point fixture with 571,810 real Carbon 3B sequence embeddings projected to 2D with UMAP, covering 27 species across six kingdoms (vertebrates, invertebrates, plants, fungi, bacteria, viruses). Includes per-point species, biotype, strand, and gc_content metadata. scripts/build_real_umap.py reads viz.csv from Dana's HuggingFace bucket (carbon_dana_embeddings_middle), quantizes coordinates to int16 and categorical metadata to uint8, packs everything into a compact binary header + payload (~5.8 MB gzipped, served via /umap and /umap_labels). Co-authored-by: Cursor <cursoragent@cursor.com>5c11b40
-
§6: WebGL UMAP scatter, 500K points on a fake fixture
Replaces the "coming soon" stub for §6 with an interactive scatter that loads 500K points and lets you toggle the coloring axis (species, biotype, strand, codon phase) on the same vertex stream. Frontend (demo.html, ~290 LOC): - Vanilla WebGL (no library) — gl.POINTS + 1D palette texture, fragment shader does smoothstep AA on gl_PointCoord so dots stay clean at any zoom. Pan/zoom-around-cursor + hover picking via a 128² spatial grid. - Toggle coloring rebinds the category attribute on a different uint8 buffer and swaps the palette texture — no re-upload of the 500K vertices. Switch is instant on GPU. - Render-on-demand (no rAF loop); IntersectionObserver defers the /umap fetch until the section approaches the viewport so first paint isn't taxed. Backend (app.py): - GZipMiddleware (minimum_size=1024, compresslevel=6) — gzip(1)'s default level: ~3% worse ratio than 9, ~5x cheaper CPU. Cuts /umap from 4 MB to ~2.1 MB on the wire. - GET /umap → b…f039f0b