Spaces:
Running
Running
Add radial locus bars and Genome Atlas node silhouettes
Browse filesFiles changed (21)
- .gitattributes+3
- README.md+11-3
- app.js+12-10
- build.py+4-1
- carbon-a-strand-poc.png
- carbon-a-strand-source.zip+2-2
- check_layers.pyAdded+24
- detail.png
- export_still.py+4-4
- fetch_loci.pyAdded+25
- genes.png
- index.html
- layers.jsAdded+76
- loci-overview.pngAdded
- loci-raw.pngAdded
- locus-detail.pngAdded
- overview.png
- prepare_icons.pyAdded+24
- provenance.json+13-3
- refseq.png
- template.html+2-1
37 unmodified lines38394037 unmodified linesgenes.png filter=lfs diff=lfs merge=lfs -textrefseq.png filter=lfs diff=lfs merge=lfs -textcarbon-a-strand-poc.png filter=lfs diff=lfs merge=lfs -text37 unmodified lines38394041424337 unmodified linesgenes.png filter=lfs diff=lfs merge=lfs -textrefseq.png filter=lfs diff=lfs merge=lfs -textcarbon-a-strand-poc.png filter=lfs diff=lfs merge=lfs -textloci-overview.png filter=lfs diff=lfs merge=lfs -textloci-raw.png filter=lfs diff=lfs merge=lfs -textlocus-detail.png filter=lfs diff=lfs merge=lfs -text
11 unmodified lines121314151617184 unmodified lines2324252627282930313233343536373811 unmodified linesAn interactive proof of concept: a separate, continuous strand for every real assembly in the reusable taxonomy snapshot. Shared ancestors form bundles; zooming separates the strands. Green and blue distinguish assemblies with and without existing annotation evidence under the selected comparison.The PoC contains **33,588 unique assemblies across 16,976 taxa**, taken from the existing [GenBank annotation explorer](https://huggingface.co/spaces/HuggingFaceBio/genbank-annotation-explorer). The full release totals supplied on 8 October 2026 are **48,167 assemblies, 22,617 taxa, 566.34M coding loci and 27.18 Tbp**. Those totals are displayed separately: this PoC does not invent missing assembly identities or apportion the gene total using assumed weights.Two comparison modes are available:4 unmodified linesThe human assembly detail uses actual published GFF3 coordinates, with 23,767 predicted loci across GCA_000001405.29 and 13 beginning in the first megabase of CM000663.2. CDS rectangles are actual coding segments. These are predictions, not experimental validation.## Layout and implementationThe taxonomy and plain-language names reuse the earlier explorer work. Only ancestor nodes on paths to included assemblies are retained. The drawing simplifies intervening taxonomy to standard ranks; full lineage metadata is preserved. Radius is a layout choice, not evolutionary time or branch length.Every assembly has its own lane through parent bundles and its own endpoint. A common taper makes individual paths finer towards the root; all assemblies use the same width at a given radius. Density and bundle width encode assembly counts, not coding-locus counts. At overview scale, many paths occupy the same pixel. Zoom, pan, search and clicking reveal the underlying accession.The self-contained HTML includes compressed data, JavaScript and two local font families (Manrope and Inter). It makes no network requests to draw the tree. Links to source records open only when selected. WebGL is required. Source and data preparation scripts are included for reuse.## Rebuild`python prepare_data.py` reproduces the compact dataset from the copied taxonomy database and cached NCBI summary (paths at the top of the script). `python build.py` builds the self-contained HTML from `template.html`, `app.js`, the data files, and the existing release font assets. `python check.py` runs browser checks and captures previews.Data provenance and limitations are recorded in `provenance.json`. The original release video and explorer were not modified.11 unmodified lines121314151617184 unmodified lines23242526272829303132333435363738394041424344454611 unmodified linesAn interactive proof of concept: a separate, continuous strand for every real assembly in the reusable taxonomy snapshot. Shared ancestors form bundles; zooming separates the strands. Green and blue distinguish assemblies with and without existing annotation evidence under the selected comparison.The PoC contains **33,588 unique assemblies across 16,976 taxa**, taken from the existing [GenBank annotation explorer](https://huggingface.co/spaces/HuggingFaceBio/genbank-annotation-explorer). The full release totals supplied on 8 October 2026 are **48,167 assemblies, 22,617 taxa, 566.34M coding loci and 27.18 Tbp**. Those totals are displayed separately. The new radial bars use published per-assembly `gene_count` values wherever available; missing counts are explicitly marked.Two comparison modes are available:4 unmodified linesThe human assembly detail uses actual published GFF3 coordinates, with 23,767 predicted loci across GCA_000001405.29 and 13 beginning in the first megabase of CM000663.2. CDS rectangles are actual coding segments. These are predictions, not experimental validation.## Locus bars and atlas silhouettesThe outer annulus aligns to the exact same ordered assembly tips as the tree. Published counts are available for **17,828 of the 33,588 displayed assemblies**, summing to **212,905,534 predicted coding loci**; the other 15,760 assemblies have unavailable counts in this metadata inventory. The default sums available locus counts across **50 consecutive assemblies**; 200-assembly bins and individual assembly bars are selectable. Bins partition taxonomic display order, and can straddle named taxon boundaries. Bar length uses a linear scale, recalculated for each bin size and labelled above the tree. Hover reveals the count and number of measured assemblies. Clicking a bin switches to individual bars and zooms into its strands.Grey marks at the bar bases indicate missing counts. For bins, the grey mark spans the fraction of assemblies without measurements. A bin sums only available values: missing counts are not imputed, treated as measured zero, or scaled up to the full release. Green locus bars count all predicted loci in the covered assemblies; the blue/green colouring of the tree still describes annotation records at assembly level, not whether individual loci are new.The original **Genome Atlas silhouettes** sit on their corresponding taxonomic nodes. Clicking an icon focuses the branch. Icons appear progressively with zoom and are hidden when they would overlap; the checkbox hides them all. All original PhyloPic source links and licence/attribution records are retained in the interface under **About the data → Icon credits and licences** and in the source data. The SVG artwork is unmodified.## Layout and implementationThe taxonomy and plain-language names reuse the earlier explorer work. Only ancestor nodes on paths to included assemblies are retained. The drawing simplifies intervening taxonomy to standard ranks; full lineage metadata is preserved. Radius is a layout choice, not evolutionary time or branch length.Every assembly has its own lane through parent bundles and its own endpoint. A common taper makes individual paths finer towards the root; all assemblies use the same width at a given radius. Density and bundle width encode assembly counts, not coding-locus counts. At overview scale, many paths occupy the same pixel. Zoom, pan, search and clicking reveal the underlying accession.The self-contained HTML includes compressed data, JavaScript and two local font families (Manrope and Inter). It makes no network requests to draw the tree. Links to source records open only when selected. WebGL is required. Source and data preparation scripts are included for reuse. The metadata counts include source paths, content hashes and pipeline revisions for auditing. The icon data includes each original source page and licence.## Rebuild`python prepare_data.py` reproduces the compact dataset from the copied taxonomy database and cached NCBI summary (paths at the top of the script). `python build.py` builds the self-contained HTML from `template.html`, `app.js`, the data files, and the existing release font assets. `python check.py` runs the base browser checks; `python check_layers.py` checks bin totals, missing-count handling, raw/binned switching, clickable bars, node icons and attribution links. `python fetch_loci.py` refreshes the available metadata counts and `python prepare_icons.py` prepares the atlas icons.Data provenance and limitations are recorded in `provenance.json`. The original release video and explorer were not modified.
12 unmodified lines1314151617181931 unmodified lines51525354555657585960616263646566676869707 unmodified lines787980818283848586878889909192939412 unmodified linesfunction prepare(){nodes=new Map(D.nodes.map(r=>[r[0],{id:r[0],parent:r[1],name:r[2],rank:r[3],common:r[4],children:[],own:[],count:0}]));for(const n of nodes.values())if(n.parent)nodes.get(n.parent)?.children.push(n);D.assemblies.forEach((r,index)=>{nodes.get(r[1]).own.push({row:r,index,accession:r[0],taxid:r[1],name:r[2],flag:(r[4]===1?1:0)+(r[5]?2:0)});});const root=nodes.get(2759);function count(n){n.count=n.own.length;for(let c of n.children)n.count+=count(c);n.children.sort((a,b)=>b.count-a.count||a.id-b.id);return n.count}count(root);leaves=[];31 unmodified lines}function hash(x){x=((x>>>16)^x)*0x45d9f3b;x=((x>>>16)^x)*0x45d9f3b;return ((x>>>16)^x)>>>0}function schedule(){if(!pending){pending=true;requestAnimationFrame(()=>{pending=false;draw()})}}function resize(){const b=stage.getBoundingClientRect();W=b.width;H=b.height;let dpr=Math.min(devicePixelRatio,2);canvas.width=overlay.width=Math.round(W*dpr);canvas.height=overlay.height=Math.round(H*dpr);baseScale=Math.min(W/(R*2+180),H/(R*2+180));schedule()}function screen(p){let s=baseScale*zoom;return [W/2+pan.x+p[0]*s,H/2+pan.y+p[1]*s]}function world(x,y){let s=baseScale*zoom;return [(x-W/2-pan.x)/s,(y-H/2-pan.y)/s]}function draw(){if(!gl)return;let dpr=canvas.width/W;gl.viewport(0,0,canvas.width,canvas.height);gl.clearColor(1,1,1,1);gl.clear(gl.COLOR_BUFFER_BIT);gl.useProgram(program);gl.uniform2f(gl.getUniformLocation(program,'size'),W,H);gl.uniform2f(gl.getUniformLocation(program,'pan'),pan.x,pan.y);gl.uniform1f(gl.getUniformLocation(program,'scale'),baseScale*zoom);gl.uniform1f(gl.getUniformLocation(program,'dpr'),dpr);gl.uniform1f(gl.getUniformLocation(program,'mode'),mode);gl.uniform1f(gl.getUniformLocation(program,'only'),view==='existing'?1:0);gl.drawArrays(gl.LINES,0,vertexCount);ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,W,H);if(zoom<2){let c=screen([0,0]);ctx.textAlign='center';ctx.fillStyle='#14221c';ctx.font='700 20px Manrope';ctx.fillText(fmt(leaves.length),c[0],c[1]+1);ctx.fillStyle='#748078';ctx.font='10px Inter';ctx.fillText('assembly strands',c[0],c[1]+18);}const labels=zoom<2.5?groups:[...nodes.values()].filter(n=>['family','order','genus'].includes(n.rank)&&n.count>10&&n.count<leaves.length/zoom*.6);let placed=[];for(const n of labels){let angle=START+SPAN*(n.mid+.5)/leaves.length;let [x,y]=screen(polar(R+45,angle));if(x<35||x>W-35||y<25||y>H-25)continue;let name=n.common||n.name;if(name.length>27)name=n.name;ctx.font=(zoom<2.5?'500 13px':'500 12px')+' Inter';let tw=ctx.measureText(name).width,anchor=Math.cos(angle)>.25?'left':Math.cos(angle)<-.25?'right':'center';let bx=anchor==='left'?x:anchor==='right'?x-tw:x-tw/2;if(bx<8){x+=8-bx;bx=8}if(bx+tw>W-8){x-=bx+tw-W+8;bx=W-8-tw}if(placed.some(b=>bx<b.x+b.w+8&&bx+tw>b.x-8&&Math.abs(y-b.y)<32))continue;placed.push({x:bx,y,w:tw});ctx.textAlign=anchor;ctx.fillStyle='#273b30';ctx.strokeStyle='#fff';ctx.lineWidth=4;ctx.strokeText(name,x,y);ctx.fillText(name,x,y);ctx.font='10px Inter';ctx.fillStyle='#7a857f';ctx.strokeText(fmt(n.count)+' assemblies',x,y+15);ctx.fillText(fmt(n.count)+' assemblies',x,y+15);}if(selected){const a=selected;ctx.strokeStyle='#15392c';ctx.lineWidth=1.8;ctx.beginPath();let p=screen(a.points[0]);ctx.moveTo(...p);for(let j=1;j<a.points.length;j++){let [c,d]=controls(a.points[j-1],a.points[j]);ctx.bezierCurveTo(...screen(c),...screen(d),...screen(a.points[j]));}ctx.stroke();let q=screen(a.tip);ctx.fillStyle='#15392c';ctx.beginPath();ctx.arc(...q,4,0,TAU);ctx.fill();}$('#zoom-readout').textContent=zoom.toFixed(1)+'×';$('#zoomout').disabled=zoom<=1;$('#zoomin').disabled=zoom>=320;window.POC&&(window.POC.zoom=zoom);}function zoomAt(factor,x=W/2,y=H/2){let old=zoom,n=Math.max(1,Math.min(320,zoom*factor));let ratio=n/old;pan.x=(pan.x+W/2-x)*ratio+x-W/2;pan.y=(pan.y+H/2-y)*ratio+y-H/2;zoom=n;if(zoom===1)pan={x:0,y:0};schedule()}function reset(){zoom=1;pan={x:0,y:0};selected=null;$('#selection').hidden=true;schedule()}function nearest(x,y){const [wx,wy]=world(x,y),pad=7/(baseScale*zoom);let best=pad*pad,found=null;for(let k=0;k<hitData.length;k+=8){let ax=hitData[k],ay=hitData[k+1],bx=hitData[k+4],by=hitData[k+5];7 unmodified linesfunction selectAssembly(a){if(!a)return;selected=a;let r=a.row;$('#selection').hidden=false;$('#sel-name').textContent=a.name;$('#sel-id').textContent=a.accession;$('#sel-id').href='https://www.ncbi.nlm.nih.gov/datasets/genome/'+a.accession+'/';$('#sel-lineage').textContent=a.lineage.filter(n=>['kingdom','phylum','class','order','family','genus'].includes(n.rank)).map(n=>n.common||n.name).join(' › ');const has=mode?r[5]:r[4]===1;$('#sel-status').innerHTML=mode?`<i class="dot ${has?'blue':'green'}"></i>${has?'In the RefSeq comparison corpus':'Outside the RefSeq comparison corpus'}`:r[4]===1?`<i class="dot blue"></i>Existing annotation listed<br><small>${esc(r[7])} · ${esc(r[9])}</small>`:'<i class="dot green"></i>No annotation listed in this GenBank snapshot';$('#sel-data').innerHTML=(r[3]?`<span>Assembly length</span><b>${(r[3]/1e6).toLocaleString('en-US',{maximumFractionDigits:2})} Mb</b>`:'')+(r[6]?`<span>RefSeq counterpart</span><b>${esc(r[6])}</b>`:'')+(mode&&r[4]===1?`<span>GenBank annotation provider</span><b>${esc(r[7])}</b>`:'');$('#sel-loci').hidden=a.accession!=='GCA_000001405.29';schedule()}function updateLegend(){let n=mode?D.meta.refseq_matches:D.meta.classification_counts['1'];$('#blue-count').textContent=fmt(n);$('#green-count').textContent=fmt(leaves.length-n);$('#blue-label').textContent=mode?'In RefSeq comparison corpus':'Existing annotation listed';$('#green-label').textContent=mode?'Outside that comparison corpus':'No annotation listed';$('#scope-note').textContent=mode?'Exact paired-accession matches to the project’s RefSeq comparison corpus. This is not all of RefSeq; green does not mean a gene is new.':'Existing annotations: a named annotation provider in the NCBI GenBank assembly summary. A missing record does not establish that an assembly was never annotated.';if(selected)selectAssembly(selected);schedule()}function search(q){q=q.trim().toLowerCase();let out=[];if(q.length>1){out=leaves.filter(a=>a.accession.toLowerCase().includes(q)||a.name.toLowerCase().includes(q)||(nodes.get(a.taxid).common||'').toLowerCase().includes(q)).slice(0,7);}$('#results').replaceChildren(...out.map(a=>{let b=document.createElement('button');b.innerHTML=`<strong>${esc(a.name)}</strong><span>${esc(a.accession)}</span>`;b.onclick=()=>{focusAssembly(a);$('#results').replaceChildren();$('#search').value=''};return b}));if(q.length>1&&!out.length)$('#results').textContent='No match in this PoC subset.';}function geneModal(){const g=D.example;$('#gene-dialog').showModal();$('#gene-summary').textContent=fmt(g.gene_count)+' candidate coding loci in this assembly';const svg=$('#gene-svg');let start=0,end=1000000,width=1100,left=30,right=1080;let x=p=>left+(p-start)/(end-start)*(right-left);let parts=[];for(let p=0;p<=end;p+=100000){parts.push(`<line x1="${x(p)}" y1="38" x2="${x(p)}" y2="198" stroke="#edf0ed"/><text x="${x(p)}" y="24" text-anchor="middle">${p/1e6} Mb</text>`)}for(let gene of g.genes){if(gene.start>end)continue;let y=gene.strand==='+'?92:158;parts.push(`<g><title>${esc(gene.id)} · ${fmt(gene.start)}–${fmt(gene.end)} bp · ${gene.strand}</title><line x1="${x(gene.start)}" x2="${x(Math.min(end,gene.end))}" y1="${y}" y2="${y}" stroke="#81d8ae"/>`);for(let [s,e] of gene.cds)if(s<=end)parts.push(`<rect x="${x(s)}" y="${y-7}" width="${Math.max(.6,x(Math.min(end,e))-x(s))}" height="14" fill="${GREEN}"/>`);parts.push('</g>')};svg.innerHTML=parts.join('');$('#gene-count-window').textContent=g.genes.filter(g=>g.start<=end).length+' candidate loci in this 1 Mb window. Bars show predicted coding segments; connecting lines span intervening sequence.';}async function init(){try{const raw=Uint8Array.from(atob($('#dataset').textContent.trim()),c=>c.charCodeAt(0));D=JSON.parse(await new Response(new Blob([raw]).stream().pipeThrough(new DecompressionStream('gzip'))).text());prepare();await document.fonts.ready;setupGL();resize();updateLegend();$('#loading').remove();$('#shown').textContent=fmt(leaves.length);$('#taxa-shown').textContent=fmt(D.meta.taxa);$('#search').disabled=false;new ResizeObserver(resize).observe(stage);canvas.addEventListener('wheel',e=>{e.preventDefault();let r=canvas.getBoundingClientRect();zoomAt(Math.exp(-e.deltaY*.0017),e.clientX-r.left,e.clientY-r.top)},{passive:false});let down=null,moved=false;canvas.addEventListener('pointerdown',e=>{down={x:e.clientX,y:e.clientY};moved=false;canvas.setPointerCapture(e.pointerId);canvas.style.cursor='grabbing'});canvas.addEventListener('pointermove',e=>{if(!down)return;let dx=e.clientX-down.x,dy=e.clientY-down.y;if(Math.abs(dx)+Math.abs(dy)>2)moved=true;pan.x+=dx;pan.y+=dy;down={x:e.clientX,y:e.clientY};schedule()});canvas.addEventListener('pointerup',e=>{if(!moved){let b=canvas.getBoundingClientRect();selectAssembly(nearest(e.clientX-b.left,e.clientY-b.top))}down=null;canvas.style.cursor='grab'});canvas.addEventListener('pointercancel',()=>down=null);canvas.addEventListener('dblclick',e=>{let b=canvas.getBoundingClientRect();zoomAt(3,e.clientX-b.left,e.clientY-b.top)});$('#zoomin').onclick=()=>zoomAt(2);$('#zoomout').onclick=()=>zoomAt(.5);$('#reset').onclick=reset;$('#search').addEventListener('input',e=>search(e.target.value));$('#search').addEventListener('keydown',e=>{if(e.key==='Escape')$('#results').replaceChildren();if(e.key==='Enter')$('#results button')?.click()});$('#scope').onchange=e=>{mode=Number(e.target.value);updateLegend()};$('#existing-only').onchange=e=>{view=e.target.checked?'existing':'all';schedule()};$('#human').onclick=()=>focusAssembly(leaves.find(a=>a.accession==='GCA_000001405.29'));$('#detail').onclick=()=>focusAssembly(leaves.find(a=>a.accession==='GCA_000001405.29'),95);$('#sel-loci').onclick=geneModal;$('#gene-open').onclick=geneModal;$('#gene-close').onclick=()=>$('#gene-dialog').close();$('#sel-close').onclick=()=>{selected=null;$('#selection').hidden=true;schedule()};$('#sel-focus').onclick=()=>focusAssembly(selected,100);$('#about').onclick=()=>$('#about-dialog').showModal();$('#about-close').onclick=()=>$('#about-dialog').close();}catch(e){$('#loading').textContent='Unable to load the tree: '+e.message;console.error(e)}}12 unmodified lines1314151617181931 unmodified lines5152535455565758596061626364656667686970717 unmodified lines79808182838485868788899091929394959612 unmodified linesfunction prepare(){nodes=new Map(D.nodes.map(r=>[r[0],{id:r[0],parent:r[1],name:r[2],rank:r[3],common:r[4],children:[],own:[],count:0}]));for(const n of nodes.values())if(n.parent)nodes.get(n.parent)?.children.push(n);D.assemblies.forEach((r,index)=>{nodes.get(r[1]).own.push({row:r,index,accession:r[0],taxid:r[1],name:r[2],loci:D.loci.counts[r[0]]??null,flag:(r[4]===1?1:0)+(r[5]?2:0)});});const root=nodes.get(2759);function count(n){n.count=n.own.length;for(let c of n.children)n.count+=count(c);n.children.sort((a,b)=>b.count-a.count||a.id-b.id);return n.count}count(root);leaves=[];31 unmodified lines}function hash(x){x=((x>>>16)^x)*0x45d9f3b;x=((x>>>16)^x)*0x45d9f3b;return ((x>>>16)^x)>>>0}function schedule(){if(!pending){pending=true;requestAnimationFrame(()=>{pending=false;draw()})}}function resize(){const b=stage.getBoundingClientRect();W=b.width;H=b.height;let dpr=Math.min(devicePixelRatio,2);canvas.width=overlay.width=Math.round(W*dpr);canvas.height=overlay.height=Math.round(H*dpr);baseScale=Math.min(W/((R+BAR_HEIGHT)*2+180),H/((R+BAR_HEIGHT)*2+180));schedule()}function screen(p){let s=baseScale*zoom;return [W/2+pan.x+p[0]*s,H/2+pan.y+p[1]*s]}function world(x,y){let s=baseScale*zoom;return [(x-W/2-pan.x)/s,(y-H/2-pan.y)/s]}function draw(){if(!gl)return;let dpr=canvas.width/W;gl.viewport(0,0,canvas.width,canvas.height);gl.clearColor(1,1,1,1);gl.clear(gl.COLOR_BUFFER_BIT);gl.useProgram(program);gl.uniform2f(gl.getUniformLocation(program,'size'),W,H);gl.uniform2f(gl.getUniformLocation(program,'pan'),pan.x,pan.y);gl.uniform1f(gl.getUniformLocation(program,'scale'),baseScale*zoom);gl.uniform1f(gl.getUniformLocation(program,'dpr'),dpr);gl.uniform1f(gl.getUniformLocation(program,'mode'),mode);gl.uniform1f(gl.getUniformLocation(program,'only'),view==='existing'?1:0);gl.drawArrays(gl.LINES,0,vertexCount);ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,W,H);drawLoci();if(zoom<2){let c=screen([0,0]);ctx.textAlign='center';ctx.fillStyle='#14221c';ctx.font='700 17px Manrope';ctx.fillText(fmt(leaves.length),c[0],c[1]+1);ctx.fillStyle='#748078';ctx.font='9px Inter';ctx.fillText('assembly strands',c[0],c[1]+18);}const labels=zoom<2.5?groups:[...nodes.values()].filter(n=>['family','order','genus'].includes(n.rank)&&n.count>10&&n.count<leaves.length/zoom*.6);let placed=[];for(const n of labels){let angle=START+SPAN*(n.mid+.5)/leaves.length;let [x,y]=screen(polar(R+BAR_HEIGHT+42,angle));if(x<35||x>W-35||y<25||y>H-25)continue;let name=n.common||n.name;if(name.length>27)name=n.name;ctx.font=(zoom<2.5?'500 13px':'500 12px')+' Inter';let tw=ctx.measureText(name).width,anchor=Math.cos(angle)>.25?'left':Math.cos(angle)<-.25?'right':'center';let bx=anchor==='left'?x:anchor==='right'?x-tw:x-tw/2;if(bx<8){x+=8-bx;bx=8}if(bx+tw>W-8){x-=bx+tw-W+8;bx=W-8-tw}if(placed.some(b=>bx<b.x+b.w+8&&bx+tw>b.x-8&&Math.abs(y-b.y)<32))continue;placed.push({x:bx,y,w:tw});ctx.textAlign=anchor;ctx.fillStyle='#273b30';ctx.strokeStyle='#fff';ctx.lineWidth=4;ctx.strokeText(name,x,y);ctx.fillText(name,x,y);ctx.font='10px Inter';ctx.fillStyle='#7a857f';ctx.strokeText(fmt(n.count)+' assemblies',x,y+15);ctx.fillText(fmt(n.count)+' assemblies',x,y+15);}drawAtlasIcons();if(selected){const a=selected;ctx.strokeStyle='#15392c';ctx.lineWidth=1.8;ctx.beginPath();let p=screen(a.points[0]);ctx.moveTo(...p);for(let j=1;j<a.points.length;j++){let [c,d]=controls(a.points[j-1],a.points[j]);ctx.bezierCurveTo(...screen(c),...screen(d),...screen(a.points[j]));}ctx.stroke();let q=screen(a.tip);ctx.fillStyle='#15392c';ctx.beginPath();ctx.arc(...q,4,0,TAU);ctx.fill();}$('#zoom-readout').textContent=zoom.toFixed(1)+'×';$('#zoomout').disabled=zoom<=1;$('#zoomin').disabled=zoom>=320;window.POC&&(window.POC.zoom=zoom);}function zoomAt(factor,x=W/2,y=H/2){$('#layer-tooltip').hidden=true;hoverBin=null;let old=zoom,n=Math.max(1,Math.min(320,zoom*factor));let ratio=n/old;pan.x=(pan.x+W/2-x)*ratio+x-W/2;pan.y=(pan.y+H/2-y)*ratio+y-H/2;zoom=n;if(zoom===1)pan={x:0,y:0};schedule()}function reset(){$('#layer-tooltip').hidden=true;hoverBin=null;zoom=1;pan={x:0,y:0};selected=null;$('#selection').hidden=true;schedule()}function nearest(x,y){const [wx,wy]=world(x,y),pad=7/(baseScale*zoom);let best=pad*pad,found=null;for(let k=0;k<hitData.length;k+=8){let ax=hitData[k],ay=hitData[k+1],bx=hitData[k+4],by=hitData[k+5];7 unmodified linesfunction selectAssembly(a){if(!a)return;selected=a;let r=a.row;$('#selection').hidden=false;$('#sel-name').textContent=a.name;$('#sel-id').textContent=a.accession;$('#sel-id').href='https://www.ncbi.nlm.nih.gov/datasets/genome/'+a.accession+'/';$('#sel-lineage').textContent=a.lineage.filter(n=>['kingdom','phylum','class','order','family','genus'].includes(n.rank)).map(n=>n.common||n.name).join(' › ');const has=mode?r[5]:r[4]===1;$('#sel-status').innerHTML=mode?`<i class="dot ${has?'blue':'green'}"></i>${has?'In the RefSeq comparison corpus':'Outside the RefSeq comparison corpus'}`:r[4]===1?`<i class="dot blue"></i>Existing annotation listed<br><small>${esc(r[7])} · ${esc(r[9])}</small>`:'<i class="dot green"></i>No annotation listed in this GenBank snapshot';$('#sel-data').innerHTML=`<span>Predicted coding loci</span><b>${a.loci===null?'Count unavailable':fmt(a.loci)}</b>`+(r[3]?`<span>Assembly length</span><b>${(r[3]/1e6).toLocaleString('en-US',{maximumFractionDigits:2})} Mb</b>`:'')+(r[6]?`<span>RefSeq counterpart</span><b>${esc(r[6])}</b>`:'')+(mode&&r[4]===1?`<span>GenBank annotation provider</span><b>${esc(r[7])}</b>`:'');$('#sel-loci').hidden=a.accession!=='GCA_000001405.29';schedule()}function updateLegend(){let n=mode?D.meta.refseq_matches:D.meta.classification_counts['1'];$('#blue-count').textContent=fmt(n);$('#green-count').textContent=fmt(leaves.length-n);$('#blue-label').textContent=mode?'In RefSeq comparison corpus':'Existing annotation listed';$('#green-label').textContent=mode?'Outside that comparison corpus':'No annotation listed';$('#scope-note').textContent=mode?'Exact paired-accession matches to the project’s RefSeq comparison corpus. This is not all of RefSeq; green does not mean a gene is new.':'Existing annotations: a named annotation provider in the NCBI GenBank assembly summary. A missing record does not establish that an assembly was never annotated.';if(selected)selectAssembly(selected);schedule()}function search(q){q=q.trim().toLowerCase();let out=[];if(q.length>1){out=leaves.filter(a=>a.accession.toLowerCase().includes(q)||a.name.toLowerCase().includes(q)||(nodes.get(a.taxid).common||'').toLowerCase().includes(q)).slice(0,7);}$('#results').replaceChildren(...out.map(a=>{let b=document.createElement('button');b.innerHTML=`<strong>${esc(a.name)}</strong><span>${esc(a.accession)}</span>`;b.onclick=()=>{focusAssembly(a);$('#results').replaceChildren();$('#search').value=''};return b}));if(q.length>1&&!out.length)$('#results').textContent='No match in this PoC subset.';}function geneModal(){const g=D.example;$('#gene-dialog').showModal();$('#gene-summary').textContent=fmt(g.gene_count)+' candidate coding loci in this assembly';const svg=$('#gene-svg');let start=0,end=1000000,width=1100,left=30,right=1080;let x=p=>left+(p-start)/(end-start)*(right-left);let parts=[];for(let p=0;p<=end;p+=100000){parts.push(`<line x1="${x(p)}" y1="38" x2="${x(p)}" y2="198" stroke="#edf0ed"/><text x="${x(p)}" y="24" text-anchor="middle">${p/1e6} Mb</text>`)}for(let gene of g.genes){if(gene.start>end)continue;let y=gene.strand==='+'?92:158;parts.push(`<g><title>${esc(gene.id)} · ${fmt(gene.start)}–${fmt(gene.end)} bp · ${gene.strand}</title><line x1="${x(gene.start)}" x2="${x(Math.min(end,gene.end))}" y1="${y}" y2="${y}" stroke="#81d8ae"/>`);for(let [s,e] of gene.cds)if(s<=end)parts.push(`<rect x="${x(s)}" y="${y-7}" width="${Math.max(.6,x(Math.min(end,e))-x(s))}" height="14" fill="${GREEN}"/>`);parts.push('</g>')};svg.innerHTML=parts.join('');$('#gene-count-window').textContent=g.genes.filter(g=>g.start<=end).length+' candidate loci in this 1 Mb window. Bars show predicted coding segments; connecting lines span intervening sequence.';}async function init(){try{const raw=Uint8Array.from(atob($('#dataset').textContent.trim()),c=>c.charCodeAt(0));D=JSON.parse(await new Response(new Blob([raw]).stream().pipeThrough(new DecompressionStream('gzip'))).text());prepare();await Promise.all([document.fonts.ready,loadAtlasIcons()]);setupGL();makeLocusBins();resize();updateLegend();$('#loading').remove();$('#shown').textContent=fmt(leaves.length);$('#taxa-shown').textContent=fmt(D.meta.taxa);$('#search').disabled=false;new ResizeObserver(resize).observe(stage);canvas.addEventListener('wheel',e=>{e.preventDefault();let r=canvas.getBoundingClientRect();zoomAt(Math.exp(-e.deltaY*.0017),e.clientX-r.left,e.clientY-r.top)},{passive:false});let down=null,moved=false;canvas.addEventListener('pointerdown',e=>{down={x:e.clientX,y:e.clientY};moved=false;canvas.setPointerCapture(e.pointerId);canvas.style.cursor='grabbing'});canvas.addEventListener('pointermove',e=>{if(!down){hoverLayers(e);return}$('#layer-tooltip').hidden=true;let dx=e.clientX-down.x,dy=e.clientY-down.y;if(Math.abs(dx)+Math.abs(dy)>2)moved=true;pan.x+=dx;pan.y+=dy;down={x:e.clientX,y:e.clientY};schedule()});canvas.addEventListener('pointerup',e=>{if(!moved){let b=canvas.getBoundingClientRect();if(!clickLayers(e.clientX-b.left,e.clientY-b.top))selectAssembly(nearest(e.clientX-b.left,e.clientY-b.top))}down=null;canvas.style.cursor='grab'});canvas.addEventListener('pointercancel',()=>down=null);canvas.addEventListener('pointerleave',()=>{$('#layer-tooltip').hidden=true;hoverBin=null;schedule()});$('#locus-mode').onchange=e=>{locusMode=e.target.value;makeLocusBins()};$('#show-icons').onchange=e=>{showIcons=e.target.checked;schedule()};$('#credits-open').onclick=()=>$('#credits-dialog').showModal();$('#credits-close').onclick=()=>$('#credits-dialog').close();canvas.addEventListener('dblclick',e=>{let b=canvas.getBoundingClientRect();zoomAt(3,e.clientX-b.left,e.clientY-b.top)});$('#zoomin').onclick=()=>zoomAt(2);$('#zoomout').onclick=()=>zoomAt(.5);$('#reset').onclick=reset;$('#search').addEventListener('input',e=>search(e.target.value));$('#search').addEventListener('keydown',e=>{if(e.key==='Escape')$('#results').replaceChildren();if(e.key==='Enter')$('#results button')?.click()});$('#scope').onchange=e=>{mode=Number(e.target.value);updateLegend()};$('#existing-only').onchange=e=>{view=e.target.checked?'existing':'all';schedule()};$('#human').onclick=()=>focusAssembly(leaves.find(a=>a.accession==='GCA_000001405.29'));$('#detail').onclick=()=>focusAssembly(leaves.find(a=>a.accession==='GCA_000001405.29'),95);$('#sel-loci').onclick=geneModal;$('#gene-open').onclick=geneModal;$('#gene-close').onclick=()=>$('#gene-dialog').close();$('#sel-close').onclick=()=>{selected=null;$('#selection').hidden=true;schedule()};$('#sel-focus').onclick=()=>focusAssembly(selected,100);$('#about').onclick=()=>$('#about-dialog').showModal();$('#about-close').onclick=()=>$('#about-dialog').close();}catch(e){$('#loading').textContent='Unable to load the tree: '+e.message;console.error(e)}}
13 unmodified lines14151617181920212213 unmodified linesif r[2]=='CDS' and last:last['cds'].append([int(r[3]),int(r[4])])assert count==meta['gene_count'],(count,meta['gene_count'])D['example']={'accession':meta['genbank_accession'],'gene_count':meta['gene_count'],'genes':genes}css=''.join(f"@font-face{{font-family:{n};src:url(data:font/ttf;base64,{base64.b64encode((ROOT.parent/'assets'/f'{n}.ttf').read_bytes()).decode()}) format('truetype');font-weight:100 900;font-display:swap}}" for n in ['Inter','Manrope'])payload=base64.b64encode(gzip.compress(json.dumps(D,separators=(',',':'),ensure_ascii=False).encode(),mtime=0)).decode()s=(ROOT/'template.html').read_text().replace('__FONTS__',css).replace('__DATA__',payload).replace('__SCRIPT__',(ROOT/'app.js').read_text())(ROOT/'index.html').write_text(s)(ROOT/'data/example-genes.json').write_text(json.dumps(D['example'],indent=2))print('html',len(s),'real genes',count,'window loci',len(genes))13 unmodified lines14151617181920212223242513 unmodified linesif r[2]=='CDS' and last:last['cds'].append([int(r[3]),int(r[4])])assert count==meta['gene_count'],(count,meta['gene_count'])D['example']={'accession':meta['genbank_accession'],'gene_count':meta['gene_count'],'genes':genes}counts=json.loads((ROOT/'data/locus-counts.json').read_text())D['loci']={'counts':{a:v['loci'] for a,v in counts['records'].items()},'summary':counts['summary'],'source_field':'gene_count','retrieved_at':counts['retrieved_at']}D['icons']=json.loads((ROOT/'data/atlas-icons.json').read_text())css=''.join(f"@font-face{{font-family:{n};src:url(data:font/ttf;base64,{base64.b64encode((ROOT.parent/'assets'/f'{n}.ttf').read_bytes()).decode()}) format('truetype');font-weight:100 900;font-display:swap}}" for n in ['Inter','Manrope'])payload=base64.b64encode(gzip.compress(json.dumps(D,separators=(',',':'),ensure_ascii=False).encode(),mtime=0)).decode()s=(ROOT/'template.html').read_text().replace('__FONTS__',css).replace('__DATA__',payload).replace('__SCRIPT__',(ROOT/'layers.js').read_text()+'\n'+(ROOT/'app.js').read_text())(ROOT/'index.html').write_text(s)(ROOT/'data/example-genes.json').write_text(json.dumps(D['example'],indent=2))print('html',len(s),'real genes',count,'window loci',len(genes))
123version https://git-lfs.github.com/spec/v1oid sha256:5b01380db7827213d2390aacc6ee95773c877e6986dc729c056e0f19d4aeec62size 13552312123version https://git-lfs.github.com/spec/v1oid sha256:cf7b4abb7fe337a230bd69e3cb29159f6807ae2c2f225dd537683279c4adee12size 15045565
123456789101112131415161718192021222324from pathlib import Pathimport sys,jsonsys.path.insert(0,'/home/node/local/carbon-a-render/python')from playwright.sync_api import sync_playwrightR=Path(__file__).parentwith sync_playwright() as p: b=p.chromium.launch(executable_path='/opt/pw-browsers/chromium_headless_shell-1234/chrome-headless-shell-linux64/chrome-headless-shell',headless=True,args=['--no-sandbox','--enable-webgl','--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader']) page=b.new_page(viewport={'width':1500,'height':1100},device_scale_factor=1) errors=[];page.on('pageerror',lambda e:errors.append(str(e)));page.goto((R/'index.html').as_uri());page.wait_for_function('window.POC && !document.querySelector("#loading")',timeout=90000) page.wait_for_timeout(300) stats=page.evaluate('({available:POC.locusAvailable,total:POC.locusTotal,sum:locusBins.reduce((n,b)=>n+b.value,0),known:locusBins.reduce((n,b)=>n+b.known,0),bins:locusBins.length,icons:iconImages.size,drawn:POC.iconsDrawn.length})') assert stats['available']==stats['known'];assert stats['total']==stats['sum'];assert stats['icons']==len(json.loads((R/'data/atlas-icons.json').read_text())['images']);assert stats['drawn']>=5 print('initial',stats,flush=True) # The annulus is clickable and switches to individual bars without losing counts. pos=page.evaluate('''()=>{let b=locusBins.find(b=>b.known===50),p=screen(polar(R+BAR_GAP+barHeight(b.value)/2,START+SPAN*(b.mid+.5)/leaves.length)),r=stage.getBoundingClientRect();return {x:r.x+p[0],y:r.y+p[1]}}''') page.mouse.click(pos['x'],pos['y']);page.wait_for_timeout(150);assert page.locator('#locus-mode').input_value()=='raw';assert page.evaluate('locusBins.length')==33588 assert page.evaluate('locusBins.reduce((n,b)=>n+b.value,0)')==stats['total'];assert page.evaluate('locusBins.filter(b=>!b.known).length')==33588-stats['available'] page.screenshot(path=str(R/'locus-detail.png')) page.locator('#reset').click();page.locator('#locus-mode').select_option('200');assert page.evaluate('locusBins.reduce((n,b)=>n+b.value,0)')==stats['total'];page.locator('#locus-mode').select_option('50');page.wait_for_timeout(100) hit=page.evaluate('''()=>{let h=iconHits.find(h=>h.n.count<6000),r=stage.getBoundingClientRect();return {x:r.x+h.x,y:r.y+h.y}}''');page.mouse.move(hit['x'],hit['y']);assert page.locator('#layer-tooltip').is_visible();page.mouse.click(hit['x'],hit['y']);page.wait_for_timeout(100);assert page.evaluate('POC.zoom')>1 page.locator('#reset').click();page.locator('#show-icons').uncheck();page.wait_for_timeout(100);assert page.evaluate('iconHits.length')==0;page.locator('#show-icons').check();page.locator('#locus-mode').select_option('off');page.wait_for_timeout(100);assert page.evaluate('locusMode')=='off';page.locator('#locus-mode').select_option('50') page.locator('#about').click();page.locator('#credits-open').click();assert page.locator('#icon-credits tbody tr').count()==stats['icons'];page.locator('#credits-close').click();page.locator('#about-close').click();assert not errors,errors page.screenshot(path=str(R/'loci-overview.png'));page.locator('#locus-mode').select_option('raw');page.screenshot(path=str(R/'loci-raw.png')) print('all layer checks passed',flush=True);b.close()4 unmodified lines56789101112134 unmodified linesR=Path(__file__).parentwith sync_playwright() as p:b=p.chromium.launch(executable_path='/opt/pw-browsers/chromium_headless_shell-1234/chrome-headless-shell-linux64/chrome-headless-shell',headless=True,args=['--no-sandbox','--enable-webgl','--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader'])page=b.new_page(viewport={'width':1200,'height':1370},device_scale_factor=2)page.goto((R/'index.html').as_uri());page.wait_for_function('window.POC && !document.querySelector("#loading")')page.add_style_tag(content='''header{height:90px;padding:0 50px}.brand{font-size:29px}.header-right button{display:none}main{display:block;height:1280px;min-height:1280px}aside,.topbar,.controls,.help,#selection{display:none!important}.stage-wrap{height:100%}#stage{inset:132px 22px 120px}.poster-heading{position:absolute;left:50px;top:35px}.poster-heading h1{font-size:39px;letter-spacing:-1.5px;margin-bottom:11px}.poster-heading p{font-size:15px;color:#6e7b73;margin:0}.poster-footer{position:absolute;bottom:20px;left:50px;right:50px;border-top:1px solid #e6ece8;padding-top:22px}.poster-key{display:flex;justify-content:space-between;font-size:16px;font-weight:500}.poster-key span{display:flex;align-items:center;gap:12px}.poster-key i{width:34px;height:2px;background:#00b86b;display:inline-block}.poster-key i.blue{background:#4167ec}.poster-footer p{font-size:11px;line-height:1.7;color:#6e7b73;margin-top:18px}''')page.evaluate('''() => {document.querySelector('.stage-wrap').insertAdjacentHTML('beforeend',`<div class="poster-heading"><h1>One assembly. One strand.</h1><p>33,588 real assemblies, connected through the NCBI taxonomy.</p></div><div class="poster-footer"><div class="poster-key"><span><i></i>29,350 with no annotation record listed</span><span><i class="blue"></i>4,238 with existing annotation records</span></div><p>Proof of concept: 33,588 of the release’s 48,167 assemblies. Colours reflect GenBank annotation records in the 7 October 2026 snapshot.<br>A missing record does not establish that an assembly was never annotated. Branch lengths do not represent evolutionary time.</p></div>`)}''')page.wait_for_timeout(800);page.screenshot(path=str(R/'carbon-a-strand-poc.png'));b.close()print(R/'carbon-a-strand-poc.png')4 unmodified lines56789101112134 unmodified linesR=Path(__file__).parentwith sync_playwright() as p:b=p.chromium.launch(executable_path='/opt/pw-browsers/chromium_headless_shell-1234/chrome-headless-shell-linux64/chrome-headless-shell',headless=True,args=['--no-sandbox','--enable-webgl','--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader'])page=b.new_page(viewport={'width':1200,'height':1420},device_scale_factor=2)page.goto((R/'index.html').as_uri());page.wait_for_function('window.POC && !document.querySelector("#loading")')page.add_style_tag(content='''header{height:90px;padding:0 50px}.brand{font-size:29px}.header-right button{display:none}main{display:block;height:1330px;min-height:1330px}aside,.topbar,.controls,.help,#selection{display:none!important}.stage-wrap{height:100%}#stage{inset:132px 22px 120px}.poster-heading{position:absolute;left:50px;top:35px}.poster-heading h1{font-size:39px;letter-spacing:-1.5px;margin-bottom:11px}.poster-heading p{font-size:15px;color:#6e7b73;margin:0}.poster-footer{position:absolute;bottom:20px;left:50px;right:50px;border-top:1px solid #e6ece8;padding-top:22px}.poster-key{display:flex;justify-content:space-between;font-size:16px;font-weight:500}.poster-key span{display:flex;align-items:center;gap:12px}.poster-key i{width:34px;height:2px;background:#00b86b;display:inline-block}.poster-key i.blue{background:#4167ec}.poster-footer p{font-size:11px;line-height:1.7;color:#6e7b73;margin-top:18px}''')page.evaluate('''() => {document.querySelector('.stage-wrap').insertAdjacentHTML('beforeend',`<div class="poster-heading"><h1>One assembly. One strand.</h1><p>33,588 assemblies · outer bars sum predicted coding loci across 50 adjacent strands.</p></div><div class="poster-footer"><div class="poster-key"><span><i></i>29,350 with no annotation record listed</span><span><i class="blue"></i>4,238 with existing annotation records</span></div><p>Proof of concept: 33,588 of the release’s 48,167 assemblies. Colours reflect GenBank annotation records in the 7 October 2026 snapshot.<br>Locus bars use available counts; grey base marks show missing counts. Branch length is not evolutionary time.<br>Genome Atlas silhouettes: PhyloPic. Original image credits and licences are included in the interactive preview.</p></div>`)}''')page.evaluate("document.querySelector('.poster-heading p').textContent='33,588 assemblies · '+shortCount(POC.locusTotal)+' loci across '+fmt(POC.locusAvailable)+' assemblies with counts.'");page.wait_for_timeout(800);page.screenshot(path=str(R/'carbon-a-strand-poc.png'));b.close()print(R/'carbon-a-strand-poc.png')
12345678910111213141516171819202122232425"""Read measured gene_count values from published per-assembly metadata."""from pathlib import Pathfrom huggingface_hub import HfApiimport json,hashlib,timeR=Path(__file__).parent; CACHE=Path('/home/node/local/carbon-a-strand-metadata');CACHE.mkdir(exist_ok=True)D=json.loads((R/'data/tree-data.json').read_text());ids={r[0] for r in D['assemblies']}inv=json.loads((R/'data/cds-inventory.json').read_text());want=[r for r in inv if r['accession'] in ids]api=HfApi();records={};target=R/'data/locus-counts.json'if target.exists():records=json.loads(target.read_text())['records']remaining=[r for r in want if r['accession'] not in records];read_bytes=0;start=time.time()for k in range(0,len(remaining),500): batch=remaining[k:k+500];lookup={r['path']+'/metadata.json':r for r in batch} entries=list(api.get_bucket_paths_info('HuggingFaceBio/genbank-annotations',list(lookup))) read_bytes+=sum(e.size for e in entries) api.download_bucket_files('HuggingFaceBio/genbank-annotations',[(e,str(CACHE/(lookup[e.path]['accession']+'.json'))) for e in entries],raise_on_missing_files=True) for e in entries: info=lookup[e.path];local=CACHE/(info['accession']+'.json');raw=local.read_bytes();m=json.loads(raw) assert m['genbank_accession']==info['accession'] assert isinstance(m.get('gene_count'),int) and m['gene_count']>=0 records[info['accession']]={'loci':m['gene_count'],'bases':m.get('annotated_bases'),'path':e.path,'sha256':hashlib.sha256(raw).hexdigest(),'pipeline_revision':m.get('postprocessing',{}).get('revision')} local.unlink() out={'source_bucket':'HuggingFaceBio/genbank-annotations','field':'gene_count','retrieved_at':'2026-10-09','inventory':'cds-inventory.json from 2026-10-09','records':records,'summary':{'available_assemblies':len(records),'shown_assemblies':len(ids),'missing_counts':len(ids)-len(records),'sum_available_loci':sum(r['loci'] for r in records.values())}} target.write_text(json.dumps(out,separators=(',',':'))) print('counts',len(records),'/',len(want),'downloaded_MB',round(read_bytes/1e6,1),'elapsed_s',round(time.time()-start),flush=True)print(out['summary'],flush=True)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576// Measured annotation counts aligned to the same assembly ordering as the tree.let locusMode='50',locusBins=[],locusMax=1,iconImages=new Map(),iconHits=[],hoverBin=null,showIcons=true;const BAR_GAP=14,BAR_HEIGHT=174;function shortCount(n){return n>=1e6?(n/1e6).toLocaleString('en-US',{maximumFractionDigits:2})+'M':n>=1000?(n/1000).toLocaleString('en-US',{maximumFractionDigits:1})+'k':fmt(n)}function niceCeiling(n){if(!n)return 1;let p=10**Math.floor(Math.log10(n)),f=n/p;return (f<=1?1:f<=2?2:f<=5?5:10)*p}function makeLocusBins(){ const size=locusMode==='raw'?1:Number(locusMode)||50;locusBins=[]; for(let lo=0;lo<leaves.length;lo+=size){let hi=Math.min(leaves.length,lo+size),known=0,value=0; for(let i=lo;i<hi;i++){let v=leaves[i].loci;if(v!==null){known++;value+=v}} locusBins.push({lo,hi,known,value,mid:(lo+hi-1)/2}); } locusMax=niceCeiling(Math.max(...locusBins.map(b=>b.value)));hoverBin=null; $('#locus-readout').textContent=shortCount(D.loci.summary.sum_available_loci)+' loci · '+fmt(D.loci.summary.available_assemblies)+' assemblies with counts'; $('#locus-explain').textContent=locusMode==='off'?'Locus bars hidden.':locusMode==='raw'?'One bar per assembly. Length = predicted coding loci. Grey ticks mark missing counts.':'Each bar sums available loci across up to '+size+' neighbouring assembly strands. Grey base marks show the fraction with missing counts.'; if(window.POC)Object.assign(POC,{locusBins,locusMax,locusMode,locusTotal:D.loci.summary.sum_available_loci,locusAvailable:D.loci.summary.available_assemblies}); schedule();}function barHeight(v){return BAR_HEIGHT*v/locusMax}function wedge(a,b,r0,r1,color){let c=screen([0,0]),s=baseScale*zoom;if(r1<=r0)return;ctx.beginPath();ctx.arc(c[0],c[1],r1*s,a,b);ctx.arc(c[0],c[1],r0*s,b,a,true);ctx.closePath();ctx.fillStyle=color;ctx.fill()}function drawLoci(){ if(locusMode==='off')return; const s=baseScale*zoom,c=screen([0,0]),base=R+BAR_GAP; // A common radial zero and linear scale; missing measurements are distinct marks. if(zoom<3){ctx.strokeStyle='#edf1ee';ctx.lineWidth=.7;ctx.setLineDash([2,5]);for(let v of [0,locusMax/2,locusMax]){ctx.beginPath();ctx.arc(c[0],c[1],(base+barHeight(v))*s,START,START+SPAN);ctx.stroke()}ctx.setLineDash([]);} for(const b of locusBins){ let a0=START+SPAN*b.lo/leaves.length,a1=START+SPAN*b.hi/leaves.length,ang=(a0+a1)/2,p=screen(polar(base+barHeight(b.value)/2,ang)),h=(barHeight(b.value)+(a1-a0)*(base+barHeight(b.value)))*s; // Cull only when the entire bar is outside the viewport. if((p[0]<-h-20||p[0]>W+h+20||p[1]<-h-20||p[1]>H+h+20)&&zoom>2)continue; if(locusMode==='raw'){ if(b.known){ctx.strokeStyle=b===hoverBin?'#13281d':'#13895e';ctx.lineWidth=Math.max(.3,Math.min(3,(a1-a0)*base*s*.7));ctx.globalAlpha=Math.min(1,Math.max(.14,(a1-a0)*base*s));ctx.beginPath();ctx.moveTo(...screen(polar(base,ang)));ctx.lineTo(...screen(polar(base+barHeight(b.value),ang)));ctx.stroke();ctx.globalAlpha=1;if(b.value===0){ctx.fillStyle='#13895e';let q=screen(polar(base,ang));ctx.fillRect(q[0]-.6,q[1]-.6,1.2,1.2)}} else{ctx.strokeStyle='#b9c3bd';ctx.lineWidth=Math.max(.35,Math.min(2,(a1-a0)*base*s*.7));ctx.beginPath();ctx.moveTo(...screen(polar(R+4,ang)));ctx.lineTo(...screen(polar(R+4+Math.min(5,3/s),ang)));ctx.stroke()} }else{ let pad=Math.min((a1-a0)*.16,.0007); if(b.known)wedge(a0+pad,a1-pad,base,base+barHeight(b.value),b===hoverBin?'#123e2a':'#13895e'); if(b.known<b.hi-b.lo){let fraction=1-b.known/(b.hi-b.lo);wedge(a0,a0+(a1-a0)*fraction,R+4,R+4+Math.min(6,3/s),'#b9c3bd')} } } // A compact key sits in the otherwise empty top seam. if(zoom<1.6){let [x,y]=screen(polar(base+BAR_HEIGHT,START));ctx.textAlign='center';ctx.font='9px Inter';ctx.fillStyle='#60766a';ctx.fillText(shortCount(locusMax),c[0],y-7);ctx.fillText('loci / '+(locusMode==='raw'?'assembly':'bin'),c[0],y-20);let p=screen(polar(base,START));ctx.fillText('0',c[0],p[1]-2)}}async function loadAtlasIcons(){ const items=Object.entries(D.icons.images); await Promise.all(items.map(([uid,info])=>new Promise(resolve=>{let img=new Image();img.onload=()=>{iconImages.set(uid,img);resolve()};img.onerror=()=>resolve();img.src='data:image/svg+xml;base64,'+btoa(unescape(encodeURIComponent(info.svg)))}))); const rows=items.map(([uid,v])=>`<tr><td><a href="${esc(v.page)}" target="_blank" rel="noopener">${esc(v.attribution||v.contributor||'PhyloPic contributor')}</a></td><td><a href="${esc(v.license)}" target="_blank" rel="noopener">${esc(v.license.includes('/zero/')?'CC0':v.license.includes('/mark/')?'Public domain':v.license.includes('/by/3.')?'CC BY 3.0':'CC BY 4.0')}</a></td></tr>`).join(''); $('#icon-credits').innerHTML='<table><thead><tr><th>Original image / credit</th><th>Licence</th></tr></thead><tbody>'+rows+'</tbody></table>';}function drawAtlasIcons(){ iconHits=[];if(!showIcons)return; const candidates=[...nodes.values()].filter(n=>n.id!==2759&&n.r&&D.icons.taxa[n.id]&&n.count>=Math.max(5,leaves.length/(zoom*150))).sort((a,b)=>b.count-a.count); let max=zoom<1.5?13:26; for(const n of candidates){ const uid=D.icons.taxa[n.id],im=iconImages.get(uid);if(!im)continue; const p=screen(point(n,n.mid)),size=zoom<1.5?27:31,x=p[0],y=p[1]; if(x<25||x>W-25||y<30||y>H-30)continue; if(iconHits.some(h=>h.uid===uid||Math.hypot(h.x-x,h.y-y)<57))continue; const ratio=im.naturalWidth/im.naturalHeight||D.icons.images[uid].ratio||1,iw=ratio>1?size:size*ratio,ih=ratio>1?size/ratio:size; ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(x,y,size*.67,0,TAU);ctx.fill(); ctx.drawImage(im,x-iw/2,y-ih/2,iw,ih);iconHits.push({x,y,r:size*.8,n,uid}); if(iconHits.length>=max)break; } if(window.POC)POC.iconsDrawn=iconHits.map(h=>h.n.id);}function hitIcon(x,y){return iconHits.find(h=>Math.hypot(h.x-x,h.y-y)<h.r)}function hitBar(x,y){if(locusMode==='off')return null;let p=world(x,y),rad=Math.hypot(...p);if(rad<R+2||rad>R+BAR_GAP+BAR_HEIGHT+8)return null;let angle=Math.atan2(p[1],p[0]);while(angle<START)angle+=TAU;if(angle>START+SPAN)return null;let i=Math.floor((angle-START)/SPAN*leaves.length),size=locusMode==='raw'?1:Number(locusMode);return locusBins[Math.floor(i/size)]||null}function hoverLayers(e){if($('#gene-dialog').open||$('#about-dialog').open)return;let box=stage.getBoundingClientRect(),x=e.clientX-box.left,y=e.clientY-box.top,ic=hitIcon(x,y),bin=hitBar(x,y),tip=$('#layer-tooltip'); if(!ic&&!bin){tip.hidden=true;if(hoverBin){hoverBin=null;schedule()}canvas.style.cursor='grab';return} canvas.style.cursor='pointer'; if(ic){tip.innerHTML=`<b>${esc(ic.n.common||ic.n.name)}</b><span>${esc(ic.n.name)} · ${fmt(ic.n.count)} assemblies</span><small>Click to explore this branch</small>`} else{const n=bin.hi-bin.lo,one=n===1,a=leaves[bin.lo];tip.innerHTML=`<b>${one?esc(a.name):shortCount(bin.value)+' predicted coding loci'}</b><span>${one?(bin.known?fmt(bin.value)+' predicted coding loci':'Locus count unavailable'):fmt(bin.known)+' of '+fmt(n)+' assemblies have counts'}</span><small>${one?esc(a.accession):'Sum of available counts · click to inspect individual bars'}</small>`;if(hoverBin!==bin){hoverBin=bin;schedule()}} tip.hidden=false;tip.style.left=Math.max(8,Math.min(W-270,x+16))+14+'px';tip.style.top=Math.max(65,Math.min(H-75,y+15))+64+'px';}function focusNode(n){let pts=[point(n,n.mid)];for(let j=0;j<=16;j++)pts.push(polar(R,START+SPAN*(n.lo+(n.hi-n.lo)*j/16)/leaves.length));let xs=pts.map(p=>p[0]),ys=pts.map(p=>p[1]),minx=Math.min(...xs),maxx=Math.max(...xs),miny=Math.min(...ys),maxy=Math.max(...ys);zoom=Math.max(1,Math.min(35,Math.min(W/(maxx-minx+140),H/(maxy-miny+140))/baseScale));pan={x:-(minx+maxx)/2*baseScale*zoom,y:-(miny+maxy)/2*baseScale*zoom};selected=null;$('#selection').hidden=true;$('#layer-tooltip').hidden=true;schedule()}function clickLayers(x,y){const ic=hitIcon(x,y);if(ic){focusNode(ic.n);return true}const b=hitBar(x,y);if(!b)return false; if(locusMode==='raw'){selectAssembly(leaves[b.lo]);return true} const mid=b.mid,p=polar(R+BAR_GAP,START+SPAN*(mid+.5)/leaves.length);locusMode='raw';$('#locus-mode').value='raw';makeLocusBins();zoom=24;pan={x:-p[0]*baseScale*zoom,y:-p[1]*baseScale*zoom};$('#layer-tooltip').hidden=true;schedule();return true;}123456789101112131415161718192021222324from pathlib import Pathimport json,gzip,base64,shutilR=Path(__file__).parent; atlas=Path('/home/node/local/git/genbank-annotation-explorer/data');d=json.loads((atlas/'icons.json').read_text()); data=json.loads((R/'data/tree-data.json').read_text());nodes={str(r[0]):r for r in data['nodes']}# Reuse the atlas's taxid-to-image assignments; retain every original credit.# Rank-bearing nodes and key clades supply enough silhouettes without embedding all 443 files.priority={2759,33208,4751,33090,40674,9606,8782,50557,7898,33630,554915,2763,554296,5761}keep={t:i for t,i in d['taxa'].items() if t in nodes and (nodes[t][3] in ['kingdom','phylum','class','order','family'] or int(t) in priority)}counts={t:0 for t in nodes}for r in data['assemblies']: t=str(r[1]) while t in nodes: counts[t]+=1 if nodes[t][1]==0:break t=str(nodes[t][1])keep=dict(sorted(keep.items(),key=lambda kv:(int(kv[0]) not in priority,-counts[kv[0]]))[:100])images={}(R/'data/icons').mkdir(exist_ok=True)for uid in set(keep.values()): path=atlas/'icons'/(uid+'.svg');svg=path.read_text();assert '<script' not in svg.lower();assert '<image' not in svg.lower() shutil.copy2(path,R/'data/icons'/path.name) images[uid]={**d['images'][uid],'svg':svg}out={'source':d['source'],'note':'Original, unmodified PhyloPic silhouettes and taxid assignments reused from the Genome Atlas.','taxa':keep,'images':images}(R/'data/atlas-icons.json').write_text(json.dumps(out,separators=(',',':')))print('taxa',len(keep),'images',len(images),'compressed',len(gzip.compress(json.dumps(out).encode())))28 unmodified lines2930313233343 unmodified lines3839404142434445464748495028 unmodified lines"human_gff3": "HuggingFaceBio/genbank-annotations/cds/vertebrate_mammalian/GCA_000001405.29/annotations.gff3.gz","human_pipeline_commit": "6ffa159","refseq_comparison": "HF_GENERanno_organized/analysis/training_data_stats/refseq_assembly_taxids.csv","release_totals": "User-supplied values, 2026-10-08"},"sha256": {3 unmodified lines"human-metadata.json": "a4b825732a128d0745cfc6b0fa0b8c28c1909bd5a6c1f04eec48ee9584d0b76a","human-annotations.gff3.gz": "c7fa0b8df740641718f65f65a0ef7c9d76c14cf537070d5e6222071c36a68087","tree-data.json": "ee3b3b9373bc9dc9109febef8d8027405b0da0d7fb21a0aea69cac06e42e6dad","example-genes.json": "d9640190ee771eb099df5bb1e059a837552bfbdeb734b1daa929d7a76cec98d7"},"important_limits": ["This is the 33,588-accession explorer subset, not the complete 48,167-assembly release.","No per-assembly coding-locus distribution has been inferred.","Existing annotation evidence is at assembly level, not evidence that an individual Carbon-A locus is novel.","RefSeq comparison corpus is a filtered project corpus, not all RefSeq.","Green indicates no listed match under the chosen comparison, not confirmed absence of previous annotation."]}28 unmodified lines29303132333435363 unmodified lines40414243444546474849505152535455565758596028 unmodified lines"human_gff3": "HuggingFaceBio/genbank-annotations/cds/vertebrate_mammalian/GCA_000001405.29/annotations.gff3.gz","human_pipeline_commit": "6ffa159","refseq_comparison": "HF_GENERanno_organized/analysis/training_data_stats/refseq_assembly_taxids.csv","locus_counts": "Per-assembly metadata.json / gene_count in HuggingFaceBio/genbank-annotations/cds, retrieved 2026-10-09","atlas_icons": "Original PhyloPic SVGs and taxid assignments from genbank-annotation-explorer/data/icons.json; per-image credits retained in atlas-icons.json","release_totals": "User-supplied values, 2026-10-08"},"sha256": {3 unmodified lines"human-metadata.json": "a4b825732a128d0745cfc6b0fa0b8c28c1909bd5a6c1f04eec48ee9584d0b76a","human-annotations.gff3.gz": "c7fa0b8df740641718f65f65a0ef7c9d76c14cf537070d5e6222071c36a68087","tree-data.json": "ee3b3b9373bc9dc9109febef8d8027405b0da0d7fb21a0aea69cac06e42e6dad","example-genes.json": "d9640190ee771eb099df5bb1e059a837552bfbdeb734b1daa929d7a76cec98d7","locus-counts.json": "aa2d237238567ec8e7cb15bb3448d629c4f1698ce2733171dee4b6d8f27b4113","atlas-icons.json": "1f4b52b0e58c8663f2a46ac841915774489c18e15dd9ba9a300c47e723854ddb"},"important_limits": ["This is the 33,588-accession explorer subset, not the complete 48,167-assembly release.","Locus bars use published gene_count values for available assemblies; missing measurements are marked, not imputed.","Existing annotation evidence is at assembly level, not evidence that an individual Carbon-A locus is novel.","RefSeq comparison corpus is a filtered project corpus, not all RefSeq.","Green indicates no listed match under the chosen comparison, not confirmed absence of previous annotation."],"locus_coverage": {"available_assemblies": 17828,"shown_assemblies": 33588,"missing_counts": 15760,"sum_available_loci": 212905534}}
2 unmodified lines34562 unmodified lines:root{--green:#00b86b;--blue:#4167ec;--ink:#14221c;--muted:#6e7b73;--rule:#e6ece8}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:#fff;font-family:Inter,Arial,sans-serif;font-size:13px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;background:#fff;border:1px solid var(--rule);padding:9px 13px}button:hover{border-color:#80978a;background:#f6faf7}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--green);outline-offset:3px}button:disabled{opacity:.35;cursor:default}a{color:inherit}header{height:87px;padding:0 40px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--rule)}.brand{font-family:Manrope,Arial,sans-serif;font-weight:800;font-size:26px;letter-spacing:-1px}.brand em{font-style:normal;color:var(--green)}.tag{font-size:10px;letter-spacing:1.3px;color:var(--muted);text-transform:uppercase}.header-right{display:flex;gap:24px;align-items:center}main{display:grid;grid-template-columns:320px 1fr;height:calc(100vh - 87px);min-height:720px}aside{padding:34px 28px 20px 40px;position:relative;z-index:3;border-right:1px solid var(--rule);overflow-y:auto}h1{font-family:Manrope,Arial,sans-serif;font-size:32px;letter-spacing:-1.5px;line-height:1.12;font-weight:700;margin:0 0 16px}.intro{font-size:13px;line-height:1.6;color:var(--muted);margin:0 0 24px}.release{border-top:1px solid var(--rule);padding-top:19px;margin-bottom:24px}.release .big{font-family:Manrope;font-size:38px;letter-spacing:-1.7px;font-weight:700;margin-top:10px;line-height:1.1}.release .big em{font-style:normal;color:var(--green)}.release .sub{font-size:12px;color:var(--muted);margin-top:5px}.stats{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin-top:20px}.stats b{font-family:Manrope;font-size:21px;display:block;letter-spacing:-.6px}.stats span{font-size:10px;color:var(--muted)}.stat-wide{grid-column:1/-1}.legend{border-top:1px solid var(--rule);padding-top:20px}.legend select{width:100%;border:0;border-bottom:1px solid var(--rule);padding:7px 0 9px;margin:6px 0 12px;background:#fff;font-size:12px;font-weight:500}.key{display:flex;align-items:center;gap:8px;font-size:11px;margin-bottom:10px}.key strong{margin-left:auto;font-weight:500;font-variant-numeric:tabular-nums}.sample-line{height:2px;width:21px;display:inline-block;background:var(--green);flex-shrink:0}.sample-line.blue{background:var(--blue)}.scope-note{font-size:10px;color:var(--muted);line-height:1.5;margin:10px 0 13px}.checkbox{font-size:11px;display:flex;gap:7px;align-items:center}.checkbox input{accent-color:var(--blue)}.subset{font-size:10px;line-height:1.6;color:var(--muted);margin-top:20px;padding-top:16px;border-top:1px solid var(--rule)}.subset b{color:#3a4d42;font-weight:500}.quick{display:flex;gap:6px;margin:20px 0 6px}.quick button{font-size:11px;padding:8px 10px}.stage-wrap{position:relative;min-width:0;overflow:hidden}#stage{position:absolute;inset:64px 14px 44px}canvas{position:absolute;width:100%;height:100%;inset:0}#tree{cursor:grab;touch-action:none}#overlay{pointer-events:none}.topbar{position:absolute;top:18px;left:25px;right:25px;display:flex;align-items:center;justify-content:space-between;gap:10px;z-index:4}.searchbox{position:relative;width:280px}#search{width:100%;padding:10px 12px;border:1px solid var(--rule);background:#fff;font-size:11px}#results{position:absolute;top:39px;width:100%;background:#fff;box-shadow:0 10px 30px #10291a0d;font-size:11px}#results:empty{display:none}#results button{display:block;width:100%;text-align:left;padding:11px;border:0;border-bottom:1px solid var(--rule)}#results strong,#results span{display:block;font-size:11px;font-weight:500}#results span{font-size:10px;color:var(--muted);margin-top:3px}.one-line{font-size:11px;color:var(--muted)}.controls{display:flex;align-items:center;gap:4px;position:absolute;right:26px;bottom:21px;z-index:3}.controls button{padding:7px 12px}.controls span{font-size:10px;padding:0 7px;min-width:42px;text-align:center;color:var(--muted)}.help{position:absolute;bottom:25px;left:25px;font-size:10px;line-height:1.7;color:var(--muted);pointer-events:none}.help b{color:#435a4c;font-weight:500}#selection{position:absolute;right:22px;top:69px;width:295px;background:#fff;border:1px solid #dfe8e2;box-shadow:0 8px 40px #2035280c;z-index:5;padding:23px}#sel-close{position:absolute;top:6px;right:8px;border:0;background:transparent;font-size:20px;padding:0 4px;color:var(--muted)}#sel-name{font-size:18px;letter-spacing:-.5px;font-family:Manrope;margin:0 0 6px;line-height:1.25}#sel-id{font-size:11px;color:var(--green);font-weight:500;text-decoration:none}#sel-lineage{font-size:10px;line-height:1.7;color:var(--muted);margin-top:15px}#sel-status{font-size:11px;line-height:1.6;border-top:1px solid var(--rule);padding-top:13px;margin-top:14px}#sel-status small{font-size:10px;color:var(--muted);margin-left:13px}.dot{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:6px}.dot.blue{background:var(--blue)}#sel-data{display:grid;grid-template-columns:1fr;gap:3px;margin:16px 0;font-size:10px}#sel-data span{color:var(--muted);margin-top:7px}#sel-data b{font-weight:500;font-size:12px}#selection button:not(#sel-close){font-size:10px;margin:4px 0;padding:8px 10px}#loading{position:absolute;inset:0;display:grid;place-content:center;background:white;color:var(--muted);z-index:10}dialog{border:1px solid var(--rule);padding:36px;max-width:calc(100vw - 40px);width:1000px;color:var(--ink)}dialog::backdrop{background:#10271930;backdrop-filter:blur(3px)}dialog h2{font-family:Manrope;font-size:28px;letter-spacing:-1px;margin:0 0 7px}dialog p{font-size:13px;line-height:1.7;color:var(--muted)}.dialog-close{float:right;border:0;font-size:22px;padding:0 4px}.gene-label{font-size:11px;margin-top:28px;color:var(--muted)}#gene-svg{width:100%;height:auto;font:11px Inter;fill:#718279;margin:16px 0}.gene-notes{border-top:1px solid var(--rule);padding-top:15px;font-size:11px}#about-dialog{width:680px}#about-dialog p{font-size:12px}#about-dialog ul{padding-left:18px;font-size:12px;line-height:1.9;color:var(--muted)}@media(min-width:1600px){main{grid-template-columns:365px 1fr}aside{padding:40px}.release .big{font-size:44px}h1{font-size:38px}}@media(max-width:850px){header{padding:0 20px;height:72px}.brand{font-size:22px}.header-right .tag{display:none}main{height:auto;min-height:0;display:flex;flex-direction:column}aside{padding:25px 22px;border-right:0;border-bottom:1px solid var(--rule);overflow:visible}h1{font-size:30px;max-width:420px}.intro{max-width:520px;margin-bottom:18px}.release{display:none}.legend{padding-top:10px;border-top:0;max-width:520px}.legend .tag{display:none}.scope-note{max-width:500px}.subset{margin-top:15px;padding-top:10px}.quick{margin-top:15px}.stage-wrap{height:740px}.topbar{left:20px;right:20px}.one-line{display:none}#stage{inset:68px 0 85px}.help{left:20px;bottom:62px}.controls{left:20px;right:auto}#selection{right:15px;top:68px;width:275px}dialog{padding:25px}.header-right{gap:10px}}</style></head><body><header><div class="brand">Carbon-<em>A</em> Database</div><div class="header-right"><span class="tag">Assembly strands · Proof of concept</span><button id="about">About the data</button></div></header><main><aside><h1>The scale is<br>in the tree.</h1><p class="intro">One strand for every assembly.<br>Shared ancestry brings the strands together. Zoom in to follow them apart.</p><div class="release"><span class="tag">Full release</span><div class="big">566.34<em>M</em></div><div class="sub">candidate coding loci</div><div class="stats"><div><b>48,167</b><span>annotated assemblies</span></div><div><b>22,617</b><span>annotated taxa</span></div><div class="stat-wide"><b>27.18 Tbp</b><span>across included assemblies</span></div></div></div><section class="legend"><label class="tag" for="scope">Highlight existing annotations</label><select id="scope"><option value="0">NCBI annotation records</option><option value="1">RefSeq comparison corpus</option></select><div class="key"><i class="sample-line blue"></i><span id="blue-label"></span><strong id="blue-count"></strong></div><div class="key"><i class="sample-line"></i><span id="green-label"></span><strong id="green-count"></strong></div><label class="checkbox"><input id="existing-only" type="checkbox">Emphasise existing annotations</label><p id="scope-note" class="scope-note"></p></section><div class="quick"><button id="human">Find a human assembly ↗</button></div><button id="gene-open" style="font-size:11px;border:0;padding:6px 0;color:var(--green)">See its coding regions →</button><p class="subset"><b>This PoC draws <span id="shown">33,588</span> verified assemblies across <span id="taxa-shown">16,976</span> taxa.</b><br>The reusable explorer snapshot is a subset of the full release. Strand width represents assemblies; the release gene total is not yet distributed across branches.</p></aside><section class="stage-wrap"><div class="topbar"><div class="searchbox"><input id="search" type="search" aria-label="Search assemblies or species" placeholder="Search a species or assembly…" disabled autocomplete="off"><div id="results"></div></div><span class="one-line">Real assemblies · NCBI taxonomy</span></div><div id="stage"><canvas id="tree" aria-label="Interactive taxonomic tree of 33,588 assembly strands. Use search or the human assembly button to inspect individual records."></canvas><canvas id="overlay" aria-hidden="true"></canvas><div id="loading">Preparing 33,588 assembly strands…</div></div><section id="selection" hidden><button id="sel-close" aria-label="Close assembly details">×</button><h2 id="sel-name"></h2><a id="sel-id" target="_blank" rel="noopener"></a><div id="sel-lineage"></div><div id="sel-status"></div><div id="sel-data"></div><button id="sel-focus">Follow this strand ↗</button><button id="sel-loci" hidden>See coding regions →</button></section><div class="help"><b>Scroll to zoom · Drag to pan · Click a strand</b><br>Topology follows taxonomy. Branch length does not represent evolutionary time.</div><div class="controls"><button id="detail">Strand detail</button><button id="zoomout" aria-label="Zoom out">−</button><span id="zoom-readout">1.0×</span><button id="zoomin" aria-label="Zoom in">+</button><button id="reset">Whole tree</button></div></section></main><dialog id="gene-dialog"><button class="dialog-close" id="gene-close" aria-label="Close coding-region view">×</button><span class="tag">From an assembly to its annotations</span><h2 style="margin-top:16px">Homo sapiens</h2><p id="gene-summary"></p><div class="gene-label">GCA_000001405.29 · chromosome 1, CM000663.2 · first 1,000,000 bases<br>Upper track: forward strand · lower track: reverse strand</div><svg id="gene-svg" viewBox="0 0 1110 210" role="img" aria-label="Actual predicted coding segments in the first one million bases of human chromosome 1"></svg><p id="gene-count-window"></p><p class="gene-notes">Real coordinates from the published Carbon-A GFF3. These are model predictions, not experimentally confirmed genes. The blue/green tree colours describe annotation records for an assembly; they do not classify individual loci as known or new.</p></dialog><dialog id="about-dialog"><button class="dialog-close" id="about-close" aria-label="Close data information">×</button><h2>What is being drawn</h2><p>Each of the 33,588 strands is a distinct accession from the explorer’s covered-assembly table, mapped through the NCBI taxonomy. No assemblies or taxonomic branches have been invented to fill out the release total.</p><ul><li>Tree and common names: the existing HuggingFaceBio GenBank annotation explorer, 7 October 2026.</li><li>Existing annotation evidence: the cached NCBI GenBank assembly summary, 7 October 2026; a named annotation provider is required.</li><li>RefSeq mode: exact versioned matches between an assembly’s paired GCF accession and the project’s 2,055-assembly comparison corpus. It does not cover all RefSeq annotations.</li><li>Gene detail: actual published GFF3 coordinates and metadata for GCA_000001405.29.</li><li>Release totals supplied on 8 October 2026: 48,167 assemblies, 22,617 taxa, 566.34M coding loci and 27.18 Tbp.</li></ul><p>Equal-width assembly strands preserve count through shared ancestors. At overview scale many strands fall within a pixel; zoom reveals them separately. Radius and branch length are layout choices, not dates or evolutionary distances.</p><p>Per-assembly Carbon-A locus counts are not complete in this snapshot. They have not been estimated from genome size or from existing annotations.</p><p><a href="https://huggingface.co/spaces/HuggingFaceBio/genbank-annotation-explorer" target="_blank" rel="noopener">Source explorer ↗</a> · <a href="https://www.ncbi.nlm.nih.gov/datasets/docs/v2/reference-docs/ftp-browsing/" target="_blank" rel="noopener">NCBI metadata ↗</a></p></dialog><script id="dataset" type="application/octet-stream">__DATA__</script><script>__SCRIPT__</script></body></html>2 unmodified lines345672 unmodified lines:root{--green:#00b86b;--blue:#4167ec;--ink:#14221c;--muted:#6e7b73;--rule:#e6ece8}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:#fff;font-family:Inter,Arial,sans-serif;font-size:13px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;background:#fff;border:1px solid var(--rule);padding:9px 13px}button:hover{border-color:#80978a;background:#f6faf7}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--green);outline-offset:3px}button:disabled{opacity:.35;cursor:default}a{color:inherit}header{height:87px;padding:0 40px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--rule)}.brand{font-family:Manrope,Arial,sans-serif;font-weight:800;font-size:26px;letter-spacing:-1px}.brand em{font-style:normal;color:var(--green)}.tag{font-size:10px;letter-spacing:1.3px;color:var(--muted);text-transform:uppercase}.header-right{display:flex;gap:24px;align-items:center}main{display:grid;grid-template-columns:320px 1fr;height:calc(100vh - 87px);min-height:720px}aside{padding:34px 28px 20px 40px;position:relative;z-index:3;border-right:1px solid var(--rule);overflow-y:auto}h1{font-family:Manrope,Arial,sans-serif;font-size:32px;letter-spacing:-1.5px;line-height:1.12;font-weight:700;margin:0 0 16px}.intro{font-size:13px;line-height:1.6;color:var(--muted);margin:0 0 24px}.release{border-top:1px solid var(--rule);padding-top:19px;margin-bottom:24px}.release .big{font-family:Manrope;font-size:38px;letter-spacing:-1.7px;font-weight:700;margin-top:10px;line-height:1.1}.release .big em{font-style:normal;color:var(--green)}.release .sub{font-size:12px;color:var(--muted);margin-top:5px}.stats{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin-top:20px}.stats b{font-family:Manrope;font-size:21px;display:block;letter-spacing:-.6px}.stats span{font-size:10px;color:var(--muted)}.stat-wide{grid-column:1/-1}.legend{border-top:1px solid var(--rule);padding-top:20px}.legend select{width:100%;border:0;border-bottom:1px solid var(--rule);padding:7px 0 9px;margin:6px 0 12px;background:#fff;font-size:12px;font-weight:500}.key{display:flex;align-items:center;gap:8px;font-size:11px;margin-bottom:10px}.key strong{margin-left:auto;font-weight:500;font-variant-numeric:tabular-nums}.sample-line{height:2px;width:21px;display:inline-block;background:var(--green);flex-shrink:0}.sample-line.blue{background:var(--blue)}.scope-note{font-size:10px;color:var(--muted);line-height:1.5;margin:10px 0 13px}.checkbox{font-size:11px;display:flex;gap:7px;align-items:center}.checkbox input{accent-color:var(--blue)}.subset{font-size:10px;line-height:1.6;color:var(--muted);margin-top:20px;padding-top:16px;border-top:1px solid var(--rule)}.subset b{color:#3a4d42;font-weight:500}.quick{display:flex;gap:6px;margin:20px 0 6px}.quick button{font-size:11px;padding:8px 10px}.stage-wrap{position:relative;min-width:0;overflow:hidden}#stage{position:absolute;inset:64px 14px 44px}canvas{position:absolute;width:100%;height:100%;inset:0}#tree{cursor:grab;touch-action:none}#overlay{pointer-events:none}.topbar{position:absolute;top:18px;left:25px;right:25px;display:flex;align-items:center;justify-content:space-between;gap:10px;z-index:4}.searchbox{position:relative;width:280px}#search{width:100%;padding:10px 12px;border:1px solid var(--rule);background:#fff;font-size:11px}#results{position:absolute;top:39px;width:100%;background:#fff;box-shadow:0 10px 30px #10291a0d;font-size:11px}#results:empty{display:none}#results button{display:block;width:100%;text-align:left;padding:11px;border:0;border-bottom:1px solid var(--rule)}#results strong,#results span{display:block;font-size:11px;font-weight:500}#results span{font-size:10px;color:var(--muted);margin-top:3px}.one-line{font-size:11px;color:var(--muted)}.controls{display:flex;align-items:center;gap:4px;position:absolute;right:26px;bottom:21px;z-index:3}.controls button{padding:7px 12px}.controls span{font-size:10px;padding:0 7px;min-width:42px;text-align:center;color:var(--muted)}.help{position:absolute;bottom:25px;left:25px;font-size:10px;line-height:1.7;color:var(--muted);pointer-events:none}.help b{color:#435a4c;font-weight:500}#selection{position:absolute;right:22px;top:69px;width:295px;background:#fff;border:1px solid #dfe8e2;box-shadow:0 8px 40px #2035280c;z-index:5;padding:23px}#sel-close{position:absolute;top:6px;right:8px;border:0;background:transparent;font-size:20px;padding:0 4px;color:var(--muted)}#sel-name{font-size:18px;letter-spacing:-.5px;font-family:Manrope;margin:0 0 6px;line-height:1.25}#sel-id{font-size:11px;color:var(--green);font-weight:500;text-decoration:none}#sel-lineage{font-size:10px;line-height:1.7;color:var(--muted);margin-top:15px}#sel-status{font-size:11px;line-height:1.6;border-top:1px solid var(--rule);padding-top:13px;margin-top:14px}#sel-status small{font-size:10px;color:var(--muted);margin-left:13px}.dot{display:inline-block;width:6px;height:6px;background:var(--green);border-radius:50%;margin-right:6px}.dot.blue{background:var(--blue)}#sel-data{display:grid;grid-template-columns:1fr;gap:3px;margin:16px 0;font-size:10px}#sel-data span{color:var(--muted);margin-top:7px}#sel-data b{font-weight:500;font-size:12px}#selection button:not(#sel-close){font-size:10px;margin:4px 0;padding:8px 10px}#loading{position:absolute;inset:0;display:grid;place-content:center;background:white;color:var(--muted);z-index:10}dialog{border:1px solid var(--rule);padding:36px;max-width:calc(100vw - 40px);width:1000px;color:var(--ink)}dialog::backdrop{background:#10271930;backdrop-filter:blur(3px)}dialog h2{font-family:Manrope;font-size:28px;letter-spacing:-1px;margin:0 0 7px}dialog p{font-size:13px;line-height:1.7;color:var(--muted)}.dialog-close{float:right;border:0;font-size:22px;padding:0 4px}.gene-label{font-size:11px;margin-top:28px;color:var(--muted)}#gene-svg{width:100%;height:auto;font:11px Inter;fill:#718279;margin:16px 0}.gene-notes{border-top:1px solid var(--rule);padding-top:15px;font-size:11px}#about-dialog{width:680px}#about-dialog p{font-size:12px}#about-dialog ul{padding-left:18px;font-size:12px;line-height:1.9;color:var(--muted)}@media(min-width:1600px){main{grid-template-columns:365px 1fr}aside{padding:40px}.release .big{font-size:44px}h1{font-size:38px}}@media(max-width:850px){header{padding:0 20px;height:72px}.brand{font-size:22px}.header-right .tag{display:none}main{height:auto;min-height:0;display:flex;flex-direction:column}aside{padding:25px 22px;border-right:0;border-bottom:1px solid var(--rule);overflow:visible}h1{font-size:30px;max-width:420px}.intro{max-width:520px;margin-bottom:18px}.release{display:none}.legend{padding-top:10px;border-top:0;max-width:520px}.legend .tag{display:none}.scope-note{max-width:500px}.subset{margin-top:15px;padding-top:10px}.quick{margin-top:15px}.stage-wrap{height:740px}.topbar{left:20px;right:20px}.one-line{display:none}#stage{inset:68px 0 85px}.help{left:20px;bottom:62px}.controls{left:20px;right:auto}#selection{right:15px;top:68px;width:275px}dialog{padding:25px}.header-right{gap:10px}}.subset{margin:0 0 14px;padding:0;border-top:0}.locus-controls{border-top:1px solid var(--rule);padding-top:15px;margin:16px 0 20px}.locus-controls select{width:100%;padding:8px 0;border:0;border-bottom:1px solid var(--rule);background:white;font-size:12px}.locus-controls p{font-size:10px;line-height:1.5;color:var(--muted);margin:8px 0}.locus-controls strong{display:block;font-size:11px;font-weight:500;margin-top:10px}.icon-toggle{margin-top:12px}.icon-toggle input{accent-color:var(--green)}#layer-tooltip{position:absolute;z-index:8;width:250px;pointer-events:none;padding:13px 15px;background:#fff;border:1px solid #dbe5de;box-shadow:0 5px 25px #142a1b0c;font-size:11px}#layer-tooltip b,#layer-tooltip span,#layer-tooltip small{display:block}#layer-tooltip b{font-weight:600;margin-bottom:6px}#layer-tooltip span{line-height:1.5}#layer-tooltip small{font-size:10px;color:var(--muted);margin-top:6px}#credits-dialog{width:740px}#icon-credits{max-height:60vh;overflow:auto}#icon-credits table{border-collapse:collapse;width:100%;font-size:11px;text-align:left}#icon-credits th,#icon-credits td{padding:10px 8px;border-bottom:1px solid var(--rule)}#icon-credits a{color:#406651}.release{padding-top:13px;margin-bottom:17px}.release .big{font-size:31px;margin-top:7px}.stats{gap:10px;margin-top:12px}.stats .stat-wide{grid-column:auto}.stats b{font-size:18px}.intro{margin-bottom:17px}h1{font-size:30px}</style></head><body><header><div class="brand">Carbon-<em>A</em> Database</div><div class="header-right"><span class="tag">Assembly strands · Proof of concept</span><button id="about">About the data</button></div></header><main><aside><h1>The scale is<br>in the tree.</h1><p class="intro">One strand for every assembly.<br>Shared ancestry brings the strands together. Zoom in to follow them apart.</p><p class="subset"><b>PoC subset · <span id="shown">33,588</span> assemblies · <span id="taxa-shown">16,976</span> taxa.</b><br>The full release contains 48,167 assemblies.</p><section class="locus-controls"><label class="tag" for="locus-mode">Coding loci at the strand tips</label><select id="locus-mode"><option value="50">Binned · 50 assemblies per bar</option><option value="200">Binned · 200 assemblies per bar</option><option value="raw">Individual assemblies</option><option value="off">Hide locus bars</option></select><strong id="locus-readout"></strong><p id="locus-explain"></p><label class="checkbox icon-toggle"><input type="checkbox" id="show-icons" checked>Genome Atlas silhouettes</label></section><div class="release"><span class="tag">Full release</span><div class="big">566.34<em>M</em></div><div class="sub">candidate coding loci</div><div class="stats"><div><b>48,167</b><span>annotated assemblies</span></div><div><b>22,617</b><span>annotated taxa</span></div><div class="stat-wide"><b>27.18 Tbp</b><span>across included assemblies</span></div></div></div><section class="legend"><label class="tag" for="scope">Highlight existing annotations</label><select id="scope"><option value="0">NCBI annotation records</option><option value="1">RefSeq comparison corpus</option></select><div class="key"><i class="sample-line blue"></i><span id="blue-label"></span><strong id="blue-count"></strong></div><div class="key"><i class="sample-line"></i><span id="green-label"></span><strong id="green-count"></strong></div><label class="checkbox"><input id="existing-only" type="checkbox">Emphasise existing annotations</label><p id="scope-note" class="scope-note"></p></section><div class="quick"><button id="human">Find a human assembly ↗</button></div><button id="gene-open" style="font-size:11px;border:0;padding:6px 0;color:var(--green)">See its coding regions →</button></aside><section class="stage-wrap"><div class="topbar"><div class="searchbox"><input id="search" type="search" aria-label="Search assemblies or species" placeholder="Search a species or assembly…" disabled autocomplete="off"><div id="results"></div></div><span class="one-line">Real assemblies · NCBI taxonomy</span></div><div id="stage"><canvas id="tree" aria-label="Interactive taxonomic tree of 33,588 assembly strands. Use search or the human assembly button to inspect individual records."></canvas><canvas id="overlay" aria-hidden="true"></canvas><div id="loading">Preparing 33,588 assembly strands…</div></div><div id="layer-tooltip" hidden></div><section id="selection" hidden><button id="sel-close" aria-label="Close assembly details">×</button><h2 id="sel-name"></h2><a id="sel-id" target="_blank" rel="noopener"></a><div id="sel-lineage"></div><div id="sel-status"></div><div id="sel-data"></div><button id="sel-focus">Follow this strand ↗</button><button id="sel-loci" hidden>See coding regions →</button></section><div class="help"><b>Scroll to zoom · Drag to pan · Click an icon or bar</b><br>Topology follows taxonomy. Branch length does not represent evolutionary time.</div><div class="controls"><button id="detail">Strand detail</button><button id="zoomout" aria-label="Zoom out">−</button><span id="zoom-readout">1.0×</span><button id="zoomin" aria-label="Zoom in">+</button><button id="reset">Whole tree</button></div></section></main><dialog id="gene-dialog"><button class="dialog-close" id="gene-close" aria-label="Close coding-region view">×</button><span class="tag">From an assembly to its annotations</span><h2 style="margin-top:16px">Homo sapiens</h2><p id="gene-summary"></p><div class="gene-label">GCA_000001405.29 · chromosome 1, CM000663.2 · first 1,000,000 bases<br>Upper track: forward strand · lower track: reverse strand</div><svg id="gene-svg" viewBox="0 0 1110 210" role="img" aria-label="Actual predicted coding segments in the first one million bases of human chromosome 1"></svg><p id="gene-count-window"></p><p class="gene-notes">Real coordinates from the published Carbon-A GFF3. These are model predictions, not experimentally confirmed genes. The blue/green tree colours describe annotation records for an assembly; they do not classify individual loci as known or new.</p></dialog><dialog id="about-dialog"><button class="dialog-close" id="about-close" aria-label="Close data information">×</button><h2>What is being drawn</h2><p>Each of the 33,588 strands is a distinct accession from the explorer’s covered-assembly table, mapped through the NCBI taxonomy. No assemblies or taxonomic branches have been invented to fill out the release total.</p><ul><li>Tree and common names: the existing HuggingFaceBio GenBank annotation explorer, 7 October 2026.</li><li>Existing annotation evidence: the cached NCBI GenBank assembly summary, 7 October 2026; a named annotation provider is required.</li><li>RefSeq mode: exact versioned matches between an assembly’s paired GCF accession and the project’s 2,055-assembly comparison corpus. It does not cover all RefSeq annotations.</li><li>Gene detail: actual published GFF3 coordinates and metadata for GCA_000001405.29.</li><li>Release totals supplied on 8 October 2026: 48,167 assemblies, 22,617 taxa, 566.34M coding loci and 27.18 Tbp.</li></ul><p>Equal-width assembly strands preserve count through shared ancestors. At overview scale many strands fall within a pixel; zoom reveals them separately. Radius and branch length are layout choices, not dates or evolutionary distances.</p><p>The outer bars sum measured gene_count values from published per-assembly metadata. Bins contain consecutive assembly tips in taxonomy order. Grey base marks indicate the fraction of assemblies without counts; these are not treated as measured zeros. The radial scale is linear and recalculated for each bin size. Colours within the tree classify assemblies; the green outer bars count all predicted loci, regardless of prior annotation status.</p><p>Silhouettes are the original PhyloPic assets and taxon assignments used by the Genome Atlas. Click an icon to explore its branch. <button id="credits-open">Icon credits and licences</button></p><p><a href="https://huggingface.co/spaces/HuggingFaceBio/genbank-annotation-explorer" target="_blank" rel="noopener">Source explorer ↗</a> · <a href="https://www.ncbi.nlm.nih.gov/datasets/docs/v2/reference-docs/ftp-browsing/" target="_blank" rel="noopener">NCBI metadata ↗</a></p></dialog><dialog id="credits-dialog"><button id="credits-close" class="dialog-close" aria-label="Close icon credits">×</button><h2>Genome Atlas silhouettes</h2><p>Original, unmodified images from PhyloPic, reused with the atlas’s taxonomic assignments. Each image’s source page and licence are linked below.</p><div id="icon-credits"></div></dialog><script id="dataset" type="application/octet-stream">__DATA__</script><script>__SCRIPT__</script></body></html>
.gitattributes+3
README.md+11-3
app.js+12-10
build.py+4-1
carbon-a-strand-poc.png

Large File Pointer Details
- SHA256: 58ac3d2343a1e19d2a53aedb4ed0bda6b5cf71a5dc9a575cc8cae69b076db47f
- Pointer size: 132 Bytes
- Size of remote file: 3.52 MB

Large File Pointer Details
- SHA256: 2d8c0ec92386b246470d45388ccea8d8f1a3d5717198be0ead202bc5613fa1e2
- Pointer size: 132 Bytes
- Size of remote file: 2.88 MB
carbon-a-strand-source.zip+2-2
check_layers.pyAdded+24
detail.png

Large File Pointer Details
- SHA256: 0b89c97fa826c714190a9762d2741e572fabe8b61731746295260cbc27349748
- Pointer size: 131 Bytes
- Size of remote file: 138 kB

Large File Pointer Details
- SHA256: 684ebc563d6b054102a48be2f6c510d40a7771ac4812030cc3baa7bf8113f381
- Pointer size: 131 Bytes
- Size of remote file: 153 kB
export_still.py+4-4
fetch_loci.pyAdded+25
genes.png

Large File Pointer Details
- SHA256: 0eb213fe31bf31ca1b5277586b5f9cc2daa7932ffe6280bb1033fe0b0321085c
- Pointer size: 131 Bytes
- Size of remote file: 270 kB

Large File Pointer Details
- SHA256: 0504d030fbc01c53c528bd9a052b48d4fae54e1e6735df9a97162e3f11092d1f
- Pointer size: 131 Bytes
- Size of remote file: 284 kB
index.html
layers.jsAdded+76
loci-overview.pngAdded

Large File Pointer Details
- SHA256: f100b2a09da2a43db9843cffe4ee42909359220da7d692e461e9d0f6fd8575fe
- Pointer size: 131 Bytes
- Size of remote file: 692 kB
loci-raw.pngAdded

Large File Pointer Details
- SHA256: c8f7576e767a6e5b5b41b8efeb32cc113e85946e705bf4a63ba55d9ff4a1c131
- Pointer size: 131 Bytes
- Size of remote file: 695 kB
locus-detail.pngAdded

Large File Pointer Details
- SHA256: 6049887579f914806b80a4b3e5f100f543fb22a654bfeef8462bd16ae696185c
- Pointer size: 131 Bytes
- Size of remote file: 357 kB
overview.png

Large File Pointer Details
- SHA256: ebb4d014d436ec682fe2d7c3cb42e1ca912823421c7178cfaf6abff64a2689e5
- Pointer size: 131 Bytes
- Size of remote file: 788 kB

Large File Pointer Details
- SHA256: 21d2f7663a426565185b2a4972fd6fc8fe71854f91923ef2b38a815c9d8740c6
- Pointer size: 131 Bytes
- Size of remote file: 631 kB
prepare_icons.pyAdded+24
provenance.json+13-3
refseq.png

Large File Pointer Details
- SHA256: 1540725ea980c817dfa2a60c4be792b6f5e1ce28ef3f046b3cb7705945878d6d
- Pointer size: 131 Bytes
- Size of remote file: 426 kB

Large File Pointer Details
- SHA256: e7f3822bf88c57eef6d4b77e336838f5c73f4ba27e6cc51690aa0ce5cbc7035e
- Pointer size: 131 Bytes
- Size of remote file: 407 kB
template.html+2-1