"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7736],{7736:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var s=n(56798),a=n(59062),r=n(90872),o=n(16979),c=n(85579);class i extends s.BaseFeatureDataAdapter{constructor(){super(...arguments),this.setupP=void 0}async setup(e){return this.setupP||(this.setupP=this.setupPre(e).catch((e=>{throw this.setupP=void 0,e}))),this.setupP}async setupPre(e){const t=this.getConf("assemblyNames"),n=this.pluginManager,s=(0,a.openLocation)(this.getConf("bed1Location"),n),r=(0,a.openLocation)(this.getConf("bed2Location"),n),o=(0,a.openLocation)(this.getConf("mcscanAnchorsLocation"),n),[i,u,f]=await Promise.all([s,r,o].map((t=>(0,c.pJ)(t,e)))),d=(0,c.SN)(i),p=(0,c.SN)(u);return{assemblyNames:t,feats:f.split(/\n|\r\n|\r/).filter((e=>!!e&&"###"!==e)).map(((e,t)=>{const[n,s,a]=e.split("\t"),r=d.get(n),o=p.get(s);if(!r||!o)throw new Error("feature not found, ".concat(n," ").concat(s," ").concat(r," ").concat(o));return[r,o,+a,t]}))}}async hasDataForRefName(){return!0}async getRefNames(){return[]}getFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.ObservableCreate)((async n=>{const{assemblyNames:s,feats:a}=await this.setup(t),o=s.indexOf(e.assemblyName);if(-1!==o){const t=0===o;a.forEach((a=>{const[c,i,u,f]=a,[d,p]=t?[c,i]:[i,c];d.refName===e.refName&&(0,r.doesIntersect2)(e.start,e.end,d.start,d.end)&&n.next(new r.SimpleFeature({...d,uniqueId:"".concat(o,"-").concat(f),syntenyId:f,strand:d.strand*p.strand,assemblyName:s[+!t],score:u,mate:{...p,assemblyName:s[+t]}}))}))}n.complete()}))}freeResources(){}}i.capabilities=["getFeatures","getRefNames"]},85579:(e,t,n)=>{n.d(t,{$R:()=>c,SN:()=>r,WU:()=>u,lq:()=>a,pJ:()=>o});var s=n(31238);function a(e){return 31===e[0]&&139===e[1]&&8===e[2]}function r(e){return new Map(e.split(/\n|\r\n|\r/).filter((e=>!!e||e.startsWith("#"))).map((e=>{const[t,n,s,a,r,o]=e.split("\t");return[a,{refName:t,start:+n,end:+s,score:+r,name:a,strand:"-"===o?-1:1}]})))}async function o(e,t){const n=await e.readFile(t);return new TextDecoder("utf8",{fatal:!0}).decode(a(n)?await(0,s.unzip)(n):n)}function c(e,t){return e.map(((e,n)=>[e,t[n]]))}const i="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function u(e,t){let n=0;const s=[];for(;n<e.length;){const a=e.indexOf("\n",n);if(-1===a)break;const r=e.slice(n,a),o=((null===i||void 0===i?void 0:i.decode(r))||r.toString()).trim();o&&s.push(t(o)),n=a+1}return s}}}]);
//# sourceMappingURL=7736.fb9cf5a6.chunk.js.map