"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[8873],{98873:function(e,n,t){t.r(n),t.d(n,{default:function(){return k}});var r=t(33028),a=t(32723),i=t(34795),u=t(9249),c=t(87371),s=t(93069),o=t(95058),f=t(45754),p=t(13820),h=t(29598),l=t(33528),v=t(81073),g=t(26131),d=t(78022),Z=t(6556),w=t(9077),b=t(4795),k=function(e){(0,f.Z)(t,e);var n=(0,p.Z)(t);function t(){var e;(0,u.Z)(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return(e=n.call.apply(n,[this].concat(a))).configured=void 0,e}return(0,c.Z)(t,[{key:"configurePre",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var n,t,r,i,u,c,s;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,w.readConfObject)(this.config,"vcfGzLocation"),t=(0,w.readConfObject)(this.config,["index","location"]),r=(0,w.readConfObject)(this.config,["index","indexType"]),i=(0,l.openLocation)(n,this.pluginManager),u="CSI"===r,c=new d.pC({filehandle:i,csiFilehandle:u?(0,l.openLocation)(t,this.pluginManager):void 0,tbiFilehandle:u?void 0:(0,l.openLocation)(t,this.pluginManager),chunkCacheSize:50*Math.pow(2,20),chunkSizeLimit:1e9}),e.next=8,c.getHeader();case 8:return s=e.sent,e.abrupt("return",{filehandle:i,vcf:c,parser:new Z.Z({header:s})});case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"configure",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var n=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.configured||(this.configured=this.configurePre().catch((function(e){throw n.configured=void 0,e}))),e.abrupt("return",this.configured);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var n,t,r,i=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>0&&void 0!==i[0]?i[0]:{},e.next=3,this.configure();case 3:return t=e.sent,r=t.vcf,e.abrupt("return",r.getReferenceSequenceNames(n));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var n,t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,t=n.vcf,e.abrupt("return",t.getHeader());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getMetadata",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var n,t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,t=n.parser,e.abrupt("return",t.getMetadata());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,g.ObservableCreate)(function(){var u=(0,i.Z)((0,a.Z)().mark((function i(u){var c,s,o,f,p,h;return(0,a.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return c=e.refName,s=e.start,o=e.end,a.next=3,n.configure();case 3:return f=a.sent,p=f.vcf,h=f.parser,a.next=8,p.getLines(c,s,o,(0,r.Z)({lineCallback:function(e,t){u.next(new b.Z({variant:h.parseLine(e),parser:h,id:"".concat(n.id,"-vcf-").concat(t)}))}},t));case 8:u.complete();case 9:case"end":return a.stop()}}),i)})));return function(e){return u.apply(this,arguments)}}(),t.signal)}},{key:"getFeaturesInMultipleRegions",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,g.ObservableCreate)(function(){var u=(0,i.Z)((0,a.Z)().mark((function i(u){var c,f,p,h,l,g,d;return(0,a.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,n.configure();case 2:return c=a.sent,f=c.vcf,a.next=6,(0,v.bytesForRegions)(e,f.index);case 6:return p=a.sent,a.next=9,n.configure();case 9:return h=a.sent,l=h.filehandle,a.next=13,l.stat();case 13:g=a.sent,(d=Math.round(p/g.size*100))>100&&(d=100),d>60&&console.warn("getFeaturesInMultipleRegions fetching ".concat(d,"% of VCF file, but whole-file streaming not yet implemented")),(0,s.Z)((0,o.Z)(t.prototype),"getFeaturesInMultipleRegions",n).call(n,e,r).subscribe(u);case 18:case"end":return a.stop()}}),i)})));return function(e){return u.apply(this,arguments)}}())}},{key:"freeResources",value:function(){}}]),t}(h.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=8873.48855055.chunk.js.map