(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[40,10],{2486:function(e,t,n){"use strict";n.r(t),n.d(t,"parseVcfBuffer",(function(){return c})),n.d(t,"splitVcfFileHeaderAndBody",(function(){return m}));var r=n(259),a=n.n(r),u=n(1290),o=n(384),i=[{name:"CHROM",type:"Text"},{name:"POS",type:"Number"},{name:"ID",type:"Text"},{name:"REF",type:"Text"},{name:"ALT",type:"Text"},{name:"QUAL",type:"Number"},{name:"FILTER",type:"Text"},{name:"INFO",type:"Text"},{name:"FORMAT",type:"Text"}];function s(e,t,n){var r=e.parseLine(t),a=new u.a({variant:r,parser:e,id:"vcf-".concat(n)}),o=t.split("\t").map((function(e){return"."===e?"":e}));return 8===o.length&&o.push(""),{id:String(n+1),extendedData:{vcfFeature:a.toJSON()},cells:o.map((function(e,t){return{columnNumber:t,text:e}}))}}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{hasColumnNameLine:!1,columnNameLineNumber:0,isValidRefName:function(){return!1}},n=m(Object(o.bufferToString)(e)),r=n.header,u=n.body,c=[],f=new a.a({header:r});r="",u.split("\n").forEach((function(e,t){/\S/.test(e)&&c.push(s(f,e,t))})),u="";for(var d={isLoaded:!0,rows:c},l=[],p=[],h=0;h<i.length;h+=1)l.push(h),p[h]={name:i[h].name,dataType:{type:i[h].type}};for(var N=0;N<f.samples.length;N+=1){var v=i.length+N;l.push(v),p[v]={name:f.samples[N],dataType:{type:"Text"}}}return l.push(l.length),p.unshift({name:"Location",dataType:{type:"LocString"},isDerived:!0,derivationFunctionText:"jexl:{text:row.extendedData.vcfFeature.refName+':'\n\n    +row.extendedData.vcfFeature.start+'..'+row.extendedData.vcfFeature.end, extendedData:\n\n    {refName:row.extendedData.vcfFeature.refName,start:row.extendedData.vcfFeature.start,end:row.extendedData.vcfFeature.end}}"}),{rowSet:d,columnDisplayOrder:l,hasColumnNames:!0,columns:p,assemblyName:t.selectedAssemblyName}}function m(e){for(var t,n=0;n<e.length;n+=1){var r=e[n];if("\n"===t&&"#"!==r)break;t=r}return{header:e.substr(0,n),body:e.substr(n)}}},384:function(e,t,n){"use strict";n.r(t),n.d(t,"bufferToString",(function(){return f})),n.d(t,"parseCsvBuffer",(function(){return h})),n.d(t,"parseTsvBuffer",(function(){return v}));var r=n(89),a=n.n(r),u=n(91),o=n(83),i=n(92),s=n(615),c=n.n(s),m=n(84);function f(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c()(Object(i.a)({noheader:!0,output:"csv"},t)).fromString(f(e))}function l(e,t,n){var r,a=e.rows[0].cells[t].text||"",u="Text";try{r=Object(m.parseLocString)(a,n)}catch(o){}return r&&r.refName&&"number"===typeof r.start?u="LocString":/^\d+(\.\d+)?$/.test(a)&&(u="Number"),u}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},n=0,r={isLoaded:!0,rows:e.map((function(e,r){var a=r+(t.hasColumnNameLine?0:1);return e.length>n&&(n=e.length),{id:String(a),cells:e.map((function(e,t){return{columnNumber:t,text:e}}))}}))},a={};if(t.hasColumnNameLine&&void 0!==t.columnNameLineNumber){var u=r.rows.splice(t.columnNameLineNumber-1,1),i=Object(o.a)(u,1),s=i[0];s&&s.cells.forEach((function(e,t){a[t]=e.text||""}))}for(var c=[],f=[],d=function(e){f.push(e);var n=l(r,e,t.isValidRefName);"LocString"===n&&r.rows.forEach((function(n){var r=n.cells[e];r.extendedData=Object(m.parseLocString)(r.text,t.isValidRefName)})),c[e]={name:a[e],dataType:{type:n}}},p=0;p<n;p+=1)d(p);return{rowSet:r,columnDisplayOrder:f,hasColumnNames:!!t.hasColumnNameLine,columns:c,assemblyName:t.selectedAssemblyName}}function h(e){return N.apply(this,arguments)}function N(){return(N=Object(u.a)(a.a.mark((function e(t){var n,r,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,d(t);case 3:return r=e.sent,e.abrupt("return",p(r,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return b.apply(this,arguments)}function b(){return(b=Object(u.a)(a.a.mark((function e(t){var n,r,u=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,d(t,{delimiter:"\t"});case 3:return r=e.sent,e.abrupt("return",p(r,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}}]);
//# sourceMappingURL=40.06ac6bc0.chunk.js.map