(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[83],{2303:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return O}));var r=n(89),a=n(86),c=n(84),i=n(12),u=n(168),s=n(148),o=n(91),f=n(92),p=n(83),h=n.n(p),l=n(121),d=n(110),v=n(134),b=n(791),g=n(251),w=n(82),j=n(544),O=function(e){Object(o.a)(n,e);var t=Object(f.a)(n);function n(){var e;Object(c.a)(this,n);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return(e=t.call.apply(t,[this].concat(a))).configured=void 0,e}return Object(i.a)(n,[{key:"configure",value:function(){var e=Object(a.a)(h.a.mark((function e(){var t,n,r,a,c,i,u=this;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.configured||(t=Object(w.readConfObject)(this.config,"vcfGzLocation"),n=Object(w.readConfObject)(this.config,["index","location"]),r=Object(w.readConfObject)(this.config,["index","indexType"]),a=Object(d.openLocation)(t,this.pluginManager),c="CSI"===r,i=new b.TabixIndexedFile({filehandle:a,csiFilehandle:c?Object(d.openLocation)(n,this.pluginManager):void 0,tbiFilehandle:c?void 0:Object(d.openLocation)(n,this.pluginManager),chunkCacheSize:50*Math.pow(2,20),chunkSizeLimit:1e9}),this.configured=i.getHeader().then((function(e){return{filehandle:a,vcf:i,parser:new g.a({header:e})}})).catch((function(e){throw u.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=Object(a.a)(h.a.mark((function e(){var t,n,r,a=arguments;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},e.next=3,this.configure();case 3:return n=e.sent,r=n.vcf,e.abrupt("return",r.getReferenceSequenceNames(t));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=Object(a.a)(h.a.mark((function e(){var t,n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return t=e.sent,n=t.vcf,e.abrupt("return",n.getHeader());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getMetadata",value:function(){var e=Object(a.a)(h.a.mark((function e(){var t,n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return t=e.sent,n=t.parser,e.abrupt("return",n.getMetadata());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(v.ObservableCreate)(function(){var c=Object(a.a)(h.a.mark((function a(c){var i,u,s,o,f,p;return h.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return i=e.refName,u=e.start,s=e.end,a.next=3,t.configure();case 3:return o=a.sent,f=o.vcf,p=o.parser,a.next=8,f.getLines(i,u,s,Object(r.a)({lineCallback:function(e,n){c.next(new j.a({variant:p.parseLine(e),parser:p,id:"".concat(t.id,"-vcf-").concat(n)}))}},n));case 8:c.complete();case 9:case"end":return a.stop()}}),a)})));return function(e){return c.apply(this,arguments)}}(),n.signal)}},{key:"getFeaturesInMultipleRegions",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=Object(u.a)(Object(s.a)(n.prototype),"getFeaturesInMultipleRegions",this);return Object(v.ObservableCreate)(function(){var n=Object(a.a)(h.a.mark((function n(a){var i,u,s,o,f;return h.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.bytesForRegions(e);case 2:return i=n.sent,n.next=5,t.configure();case 5:return u=n.sent,s=u.filehandle,n.next=9,s.stat();case 9:o=n.sent,(f=Math.round(i/o.size*100))>100&&(f=100),f>60&&console.warn("getFeaturesInMultipleRegions fetching ".concat(f,"% of VCF file, but whole-file streaming not yet implemented")),c.call(t,e,r).subscribe(a);case 14:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}},{key:"bytesForRegions",value:function(){var e=Object(a.a)(h.a.mark((function e(t){var n,r,a,c;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,r=n.vcf,e.next=6,Promise.all(t.map((function(e){return r.index.blocksForRange(e.refName,e.start,e.end)})));case 6:return a=e.sent,c=[],a.forEach((function(e){e.forEach((function(e){var t=e.minv.blockPosition,n=e.maxv.blockPosition+64e3;c.find((function(e){return e.start<=n&&e.end>=t&&(e.start=Math.min(e.start,t),e.end=Math.max(e.end,n),!0)}))||c.push({start:t,end:n})}))})),e.abrupt("return",c.reduce((function(e,t){return e+t.end-t.start+1}),0));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"freeResources",value:function(){}}]),n}(l.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=83.f3572c2c.chunk.js.map