"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2323],{82323:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var r=s(79460),n=s(56798),a=s(59062),i=s(16979),o=s(88276),c=s(71396);class d extends n.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];constructor(e,t,s){super(e,t,s);const n=this.getConf("bedGzLocation"),i=this.getConf(["index","indexType"]),c=this.getConf(["index","location"]),d=this.getConf("autoSql"),l=this.pluginManager;this.bed=new o.pC({filehandle:(0,a.openLocation)(n,l),csiFilehandle:"CSI"===i?(0,a.openLocation)(c,l):void 0,tbiFilehandle:"CSI"!==i?(0,a.openLocation)(c,l):void 0,chunkCacheSize:52428800}),this.columnNames=this.getConf("columnNames"),this.scoreColumn=this.getConf("scoreColumn"),this.parser=new r.Z({autoSql:d})}async getRefNames(e={}){return this.bed.getReferenceSequenceNames(e)}async getHeader(){return this.bed.getHeader()}async getNames(){if(this.columnNames.length)return this.columnNames;const e=(await this.bed.getHeader()).split(/\n|\r\n|\r/).filter((e=>!!e)).at(-1);return e?.includes("\t")?e.slice(1).split("\t").map((e=>e.trim())):void 0}getFeatures(e,t={}){return(0,i.ObservableCreate)((async s=>{const r=await this.bed.getMetadata(),{columnNumbers:n}=r,a=n.ref-1,i=n.start-1,o=n.end-1,d=await this.getNames();await this.bed.getLines(e.refName,e.start,e.end,{lineCallback:(e,t)=>{s.next((0,c.P)(e,a,i,o,this.scoreColumn,this.parser,`${this.id}-${t}`,d))},signal:t.signal}),s.complete()}),t.signal)}freeResources(){}}},71396:(e,t,s)=>{s.d(t,{P:()=>a,d:()=>n});var r=s(90872);function n(e){const t=e.children(),s=e.get("thickStart"),n=e.get("thickEnd");if(!s&&!n)return e;const a=t?t.filter((e=>"block"===e.get("type"))).sort(((e,t)=>e.get("start")-t.get("start"))):[],i=[];a.forEach((t=>{const r=t.get("start"),a=t.get("end");if(s>=a){const t=e.get("strand")>0?"five":"three";i.push({type:`${t}_prime_UTR`,start:r,end:a})}else if(s>r&&s<a&&n>=a){const t=e.get("strand")>0?"five":"three";i.push({type:`${t}_prime_UTR`,start:r,end:s},{type:"CDS",start:s,end:a})}else if(s<=r&&n>=a)i.push({type:"CDS",start:r,end:a});else if(s>r&&s<a&&n<a){const t=e.get("strand")>0?"five":"three",o=e.get("strand")>0?"three":"five";i.push({type:`${t}_prime_UTR`,start:r,end:s},{type:"CDS",start:s,end:n},{type:`${o}_prime_UTR`,start:n,end:a})}else if(s<=r&&n>r&&n<a){const t=e.get("strand")>0?"three":"five";i.push({type:"CDS",start:r,end:n},{type:`${t}_prime_UTR`,start:n,end:a})}else if(n<=r){const t=e.get("strand")>0?"three":"five";i.push({type:`${t}_prime_UTR`,start:r,end:a})}}));const o=Object.fromEntries(e.tags().map((t=>[t,e.get(t)])));return o.subfeatures=i,o.type="mRNA",o.uniqueId=e.id(),delete o.chromStarts,delete o.chromStart,delete o.chromEnd,delete o.chrom,delete o.blockStarts,delete o.blockSizes,delete o.blockCount,delete o.thickStart,delete o.thickEnd,new r.SimpleFeature({data:o,id:e.id()})}function a(e,t,s,a,i,o,c,d){const l=e.split("\t"),u=l[t],h=+l[s],p=s===a?1:0,m=+l[a]+p,f=d?function(e,t){return Object.fromEntries(t.split("\t").map(((t,s)=>[e[s],t])))}(d,e):o.parseLine(e,{uniqueId:c}),{blockCount:g,blockSizes:b,blockStarts:C,chromStarts:S}=f;if(g){const e=S||C||[],t=b,s=h;f.subfeatures=[];for(let r=0;r<g;r+=1){const n=(e[r]||0)+s,a=n+(t[r]||0);f.subfeatures.push({uniqueId:`${c}-${r}`,start:n,end:a,type:"block"})}}i&&(f.score=+f[i]),delete f.chrom,delete f.chromStart,delete f.chromEnd;const k=new r.SimpleFeature({...f,start:h,end:m,refName:u,uniqueId:c});return k.get("thickStart")?n(k):k}}}]);
//# sourceMappingURL=2323.737ecdc4.chunk.js.map