"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8100],{38100:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(73553),a=r(79460),n=r(56798),i=r(59062),c=r(16979),o=r(85291),d=r(54663),u=r(22509),h=r(71396);class l extends n.BaseFeatureDataAdapter{async configurePre(e){const t=this.pluginManager,r=new s.Q({filehandle:(0,i.openLocation)(this.getConf("bigBedLocation"),t)}),n=await r.getHeader(e);return{bigbed:r,header:n,parser:new a.Z({autoSql:n.autoSql})}}async configure(e){return this.cached||(this.cached=this.configurePre(e).catch((e=>{throw this.cached=void 0,e}))),this.cached}async getRefNames(e){const{header:t}=await this.configure(e);return Object.keys(t.refsByName)}async getHeader(e){const{parser:t,header:r}=await this.configure(e),{version:s,fileType:a}=r,{fields:n,...i}=t.autoSql;return{version:s,fileType:a,autoSql:{...i},fields:Object.fromEntries(n.map((({name:e,comment:t})=>[e,t])))}}getFeatures(e,t={}){const{refName:r,start:s,end:a}=e,{signal:n}=t;return(0,c.ObservableCreate)((async e=>{try{const{parser:i,bigbed:c}=await this.configure(t);(await c.getFeatureStream(r,s,a,{signal:n,basesPerSpan:a-s})).pipe((0,d.J)(),(0,u.U)((e=>{const t=i.parseLine(`${r}\t${e.start}\t${e.end}\t${e.rest}`,{uniqueId:e.uniqueId}),{blockCount:s,blockSizes:a,blockStarts:n,chromStarts:c}=t;if(s){const r=c||n||[],i=a,o=e.start;t.subfeatures=[];for(let a=0;a<s;a+=1){const s=(r[a]||0)+o,n=s+(i[a]||0);t.subfeatures.push({uniqueId:`${e.uniqueId}-${a}`,start:s,end:n,type:"block"})}}if(void 0===e.uniqueId)throw new Error("invalid bbi feature");const{chromStart:d,chromEnd:u,chrom:l,...f}=t,p=new o.Z({id:`${this.id}-${e.uniqueId}`,data:{...f,start:e.start,end:e.end,refName:r}});return function(e){return e.get("thickStart")&&e.get("blockCount")&&0!==e.get("strand")}(p)?(0,h.d)(p):p}))).subscribe(e)}catch(t){e.error(t)}}),t.signal)}freeResources(){}}},71396:(e,t,r)=>{r.d(t,{P:()=>n,d:()=>a});var s=r(90872);function a(e){const t=e.children(),r=e.get("thickStart"),a=e.get("thickEnd");if(!r&&!a)return e;const n=t?t.filter((e=>"block"===e.get("type"))).sort(((e,t)=>e.get("start")-t.get("start"))):[],i=[];n.forEach((t=>{const s=t.get("start"),n=t.get("end");if(r>=n){const t=e.get("strand")>0?"five":"three";i.push({type:`${t}_prime_UTR`,start:s,end:n})}else if(r>s&&r<n&&a>=n){const t=e.get("strand")>0?"five":"three";i.push({type:`${t}_prime_UTR`,start:s,end:r},{type:"CDS",start:r,end:n})}else if(r<=s&&a>=n)i.push({type:"CDS",start:s,end:n});else if(r>s&&r<n&&a<n){const t=e.get("strand")>0?"five":"three",c=e.get("strand")>0?"three":"five";i.push({type:`${t}_prime_UTR`,start:s,end:r},{type:"CDS",start:r,end:a},{type:`${c}_prime_UTR`,start:a,end:n})}else if(r<=s&&a>s&&a<n){const t=e.get("strand")>0?"three":"five";i.push({type:"CDS",start:s,end:a},{type:`${t}_prime_UTR`,start:a,end:n})}else if(a<=s){const t=e.get("strand")>0?"three":"five";i.push({type:`${t}_prime_UTR`,start:s,end:n})}}));const c=Object.fromEntries(e.tags().map((t=>[t,e.get(t)])));return c.subfeatures=i,c.type="mRNA",c.uniqueId=e.id(),delete c.chromStarts,delete c.chromStart,delete c.chromEnd,delete c.chrom,delete c.blockStarts,delete c.blockSizes,delete c.blockCount,delete c.thickStart,delete c.thickEnd,new s.SimpleFeature({data:c,id:e.id()})}function n(e,t,r,n,i,c,o,d){const u=e.split("\t"),h=u[t],l=+u[r],f=r===n?1:0,p=+u[n]+f,b=d?function(e,t){return Object.fromEntries(t.split("\t").map(((t,r)=>[e[r],t])))}(d,e):c.parseLine(e,{uniqueId:o}),{blockCount:g,blockSizes:m,blockStarts:S,chromStarts:k}=b;if(g){const e=k||S||[],t=m,r=l;b.subfeatures=[];for(let s=0;s<g;s+=1){const a=(e[s]||0)+r,n=a+(t[s]||0);b.subfeatures.push({uniqueId:`${o}-${s}`,start:a,end:n,type:"block"})}}i&&(b.score=+b[i]),delete b.chrom,delete b.chromStart,delete b.chromEnd;const y=new s.SimpleFeature({...b,start:l,end:p,refName:h,uniqueId:o});return y.get("thickStart")?a(y):y}}}]);
//# sourceMappingURL=8100.36d982e6.chunk.js.map