Spaces:
Running
Running
Commit History
-
Species tree: drop viruses + retitle (25 species, 571,789 sequences)
Removes SARS-CoV-2 and HIV-1 from the §7 dendrogram since viruses are not part of the tree of life. Retitles the section to "How Carbon groups species from DNA", reframes the lede as a representation-geometry question (not a phylogenetic claim), and updates the takeaway to use kingdom-correct terminology ("animals cluster with animals" rather than "vertebrates cluster with vertebrates"). §6 UMAP is intentionally left intact. Recomputes Ward + UPGMA linkages and dendrogram layouts on the trimmed 25-leaf distance matrix; removes the viruses kingdom from the build script, the demo legend, and the tree-tip color table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>a54539b
-
§3 VEP: replace variant set with audited 8-pick spread
Old set: 6 variants, two disagreed with ClinVar at the 4 kb scoring window, one was effectively invisible, one had a contested clinical classification (TP53 Pro72Arg). Replaced with 8 picks (6 Pathogenic + 1 Risk + 1 Benign), all checked against Carbon-3B at the demo's window length: HBB, BRCA2, TP53 c.712T>A, F9, LDLR splice donor, VHL stop, LRRK2 G2019S, VHL 3' UTR benign. The two VHL rows are paired by design as the narrative payoff (same gene, opposite verdicts: −323 nats vs ≈0). Regenerated data/variants.json end to end via fetch_variants.py + precompute_vep against the live /score endpoint; rewrote GENE_INFO / VARIANT_DESC for the new genes; updated the VEP takeaway to point at the VHL pair instead of the retired sign-disagreement framing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>41739ad -
Demo polish: colorblind-safe §6 strand; §5 completion-fold; §1 helix occlusion; §7 score chip; logo SVG; §8 evals refresh
- §6 UMAP: strand palette switched from green/red to Okabe-Ito blue/vermillion so the +/- coloring survives deuteranopia and protanopia (the previous pair collapsed to two near-identical grays under both common CVD types). - §5 Folding: new completion-fold pipeline (75% CDS prompt → 25% predicted → fold the C-term tail with ESMFold); mrna-info row reads the prompt/predict ratio for completion-fold genes, falls back to the original genomic→mRNA→ORF chain for legacy fixtures. genes.json gains the fold_setup / fold_example fields and a sections[] tag to scope the showcase set per panel. - §1 Intro: helix occlusion now splits each strand at depth-zero PEAKS rather than centerline crossings, so the "behind" arcs alternate between upper and lower lobes and rungs occlude correctly under the front strand. Edge-touching arcs render solid (no ghosted 5'/3' label ties). - §7 Tree: agreement-score chip redesigned as a typographic stat block — percentage in Carbon green + raw …f5d37e0 -
§4 Species: anchor prompt to 2nd exon, drop zebrafish
- fetch_species.py: also capture per-species exon coords from Ensembl, translated into 0-based offsets in the trimmed seq - species.js: new getPromptWindow() — anchors prefixEnd 35 bp into the 2nd exon (like §1's gene completion); slides prefixStart back by the user-selected prefixLen; falls back to flat slice when exon 2 isn't visible. Always render the prompt (no more "click run all" placeholder). Per-row "{N} bp prompt" note. - species.json: regenerated with exon data; zebrafish dropped (~450 My drift made the row look like noise next to mammals + bird) - demo.html §4 lede/takeaway: reflect new framing and dropped species2c5ccd8
-
Intro tab + central-dogma primer + em-dash sweep
- New Intro tab as default landing: release blurb, tab-nav guide (bullet list with banner-style links), and an optional "quick primer in genetics" §1-§5 walkthrough using the existing section--two-col + .demo primitives. - Primer visuals: skeletal-formula SVGs for the four bases, static DNA helix (~10 bp/turn), gene strip (promoter / exons / introns), splice diagram with transcribe arrows, 10-column codon to amino-acid table with peptide-bond chain, and a live 3Dmol.js viewer of human hemoglobin (PDB 1A3N) bundled in assets/data/ for fast first paint. - Lazy-init the 3D viewer via MutationObserver on the panel's .active class, so visitors who deep-link to #demo / #sandbox skip the fetch. - Tabs renamed: Demo to DNA Lab, Model to Carbon Recipe (display labels only; data-tab slugs and URL hashes stay 'demo' / 'model' for backwards-compat). - Banner: add Code placeholder link to banner-links; tab buttons use min-width + nowrap so "Carbon Recipe" stays on one line. - …5ea40ce -
Carry over §2 Variant rework + §1/§4 polish dropped by the -s ours merge
The previous merge (32c9c3a) used -s ours to keep the local tree intact while preserving Leandro's two upstream commits (57bce37 §2 Variant rework, 176caed banner wordmark) in the history for attribution. Most of those changes had already been adapted locally to the new modular CSS/JS split, but the actual content carry-over wasn't yet committed. This commit applies the remaining ports on top of the merge. §3 VEP (was §2 in Leandro's tree) — refonte complète - 4 kb scoring window: fetch_variants.py WINDOW 60 → 4002 (well below the 8 kb eval recipe but enough that all 3 pathogenic variants land on the correct side of zero). data/variants.json regenerated. - Two-row sequence display: original above, click-editable mutation below, with arrows on every base that differs from the original. Click cycles A → C → G → T, debounced 500 ms rescore against /score. - Per-row log-likelihood score on the right (green if more likely, red if less likely); mutation score blanks to '—' while a…1d3e72f -
Sandbox card layout, sticky-nav breadcrumb, drop §2/§3 score buttons
- Sandbox: refactor into stacked cards (sb-card with eyebrow/title/hint headers, Input → Output) plus a Connected-to strip up top, replacing the flat wall of controls. - Sticky nav: add a CARBON / huggingfacebio-carbon-3b breadcrumb on the left of the sticky strip so the "you're on the Carbon page" cue stays visible after the hero scrolls out. - §2 (VEP) and §3 (Track): drop the manual ▶ score / score all buttons. §3 tracks are precomputed (logprobs ship in data/genes.json), so the toolbar is just a gene selector now; §2 will auto-score on select. - Misc: app.py, precompute.py, controls.css, layout.css, section-tree.css, banner.js and data/genes.json picked up along the way. - Add social-banner.html. Co-authored-by: Cursor <cursoragent@cursor.com>b64beb5
-
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
-
Merge feature/umap-scatter into feat/folding-3d (local-only)
Combines the §6 UMAP scatter and §5 Folding work into one branch for end-to-end local testing. To be split back into two separate PRs. demo.html conflict resolution: kept §6 UMAP IIFE from umap-scatter, kept the Canvas 2D banner comment from folding-3d (perf branch already merged into main). No code changes, just a comment block. Co-authored-by: Cursor <cursoragent@cursor.com>45f472e
-
§5 Folding: hydrate the section from a precomputed fixture
The Carbon endpoint and the NVIDIA NIM ESMFold call together take 10-20s on a cold start, which leaves the section blank when the visitor first scrolls into it. We now ship a precomputed example (Carbon continuation + both ESMFold structures + stats) inside data/genes.json so the section renders instantly. Clicking ▶ fold still triggers a fresh live run. Notable details: - scripts/precompute.py grows a precompute_folds() step that mirrors the live pipeline: it calls the backend /generate (same left-pad-to-six, same <dna> prefix, same streaming framing as runFold()) and then hits NVIDIA NIM directly to fold both the spliced-mRNA reference and Carbon's spliced mRNA. Genes whose last exon sits past 2.5 kb (TP53, MYC) are skipped — Carbon would need to generate too many bases live. - Temperature is set to 0.9 for the fixture, not 0.7. At T<=0.7 the model collapses into low-complexity sinks on long-context generation (poly-T at T<=0.5, AATC-repeat at T=0.7) — a known autoregr…2c4851e -
§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
-
Add tabbed Demo / Model / Sandbox page (default = Sandbox)
New /demo route serves a single-page app with three tabs: - Demo: 4 interactive sections (gene completion, VEP, likelihood track, cross-species) plus folding/UMAP placeholders - Model: tokenizer, training objective (CE→FNS), data, architecture - Sandbox: the existing DNA continuation playground (default tab) Server-side: new /score endpoint (echo-logprobs), /genes /variants /species data routes, /img static mount, and left-padding for prompts that aren't a multiple of 6 bases (avoids phantom-A artifacts at the prompt boundary). Includes data fetchers (Ensembl REST) for genes / variants / species and a precompute script that bakes per-token logprobs and ref-vs-alt window scores into the JSON files so the page renders instantly without round-tripping the inference endpoint on first paint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>971b586