"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[2323],{82323:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var n=s(32078),r=s(56798),a=s(59062),i=s(16979),o=s(40441),c=s(71396);class d extends r.BaseFeatureDataAdapter{constructor(e,t,s){super(e,t,s),this.parser=void 0,this.bed=void 0,this.columnNames=void 0,this.scoreColumn=void 0;const r=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)(r,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 n.Z({autoSql:d})}async getRefNames(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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 null!==e&&void 0!==e&&e.includes("\t")?e.slice(1).split("\t").map((e=>e.trim())):void 0}getFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.ObservableCreate)((async s=>{const n=await this.bed.getMetadata(),{columnNumbers:r}=n,a=r.ref-1,i=r.start-1,o=r.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,"".concat(this.id,"-").concat(t),d))},signal:t.signal}),s.complete()}),t.signal)}freeResources(){}}d.capabilities=["getFeatures","getRefNames"]},71396:(e,t,s)=>{s.d(t,{P:()=>a,d:()=>r});var n=s(90872);function r(e){const t=e.children(),s=e.get("thickStart"),r=e.get("thickEnd");if(!s&&!r)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 n=t.get("start"),a=t.get("end");if(s>=a){const t=e.get("strand")>0?"five":"three";i.push({type:"".concat(t,"_prime_UTR"),start:n,end:a})}else if(s>n&&s<a&&r>=a){const t=e.get("strand")>0?"five":"three";i.push({type:"".concat(t,"_prime_UTR"),start:n,end:s},{type:"CDS",start:s,end:a})}else if(s<=n&&r>=a)i.push({type:"CDS",start:n,end:a});else if(s>n&&s<a&&r<a){const t=e.get("strand")>0?"five":"three",o=e.get("strand")>0?"three":"five";i.push({type:"".concat(t,"_prime_UTR"),start:n,end:s},{type:"CDS",start:s,end:r},{type:"".concat(o,"_prime_UTR"),start:r,end:a})}else if(s<=n&&r>n&&r<a){const t=e.get("strand")>0?"three":"five";i.push({type:"CDS",start:n,end:r},{type:"".concat(t,"_prime_UTR"),start:r,end:a})}else if(r<=n){const t=e.get("strand")>0?"three":"five";i.push({type:"".concat(t,"_prime_UTR"),start:n,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 n.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 n=0;n<g;n+=1){const r=(e[n]||0)+s,a=r+(t[n]||0);f.subfeatures.push({uniqueId:"".concat(c,"-").concat(n),start:r,end:a,type:"block"})}}i&&(f.score=+f[i]),delete f.chrom,delete f.chromStart,delete f.chromEnd;const k=new n.SimpleFeature({...f,start:h,end:m,refName:u,uniqueId:c});return k.get("thickStart")?r(k):k}}}]);
//# sourceMappingURL=2323.38345296.chunk.js.map