"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[8180,3285],{23285:(e,t,n)=>{n.r(t),n.d(t,{bufferToString:()=>r,parseCsvBuffer:()=>u,parseTsvBuffer:()=>l});var a=n(90872);function r(e){return new TextDecoder("utf8",{fatal:!0}).decode(e)}async function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await n.e(6226).then(n.t.bind(n,16226,23)).then((e=>e.default)))({noheader:!0,output:"csv",...t}).fromString(r(e))}function o(e,t,n){var r;const s=e.rows[0].cells[t].text||"";let o,c="Text";try{o=(0,a.parseLocString)(s,n)}catch(u){}return null!==(r=o)&&void 0!==r&&r.refName&&"number"===typeof o.start?c="LocString":/^\d+(\.\d+)?$/.test(s)&&(c="Number"),c}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{hasColumnNameLine:n=!1,columnNameLineNumber:r=1,isValidRefName:s=(()=>!1),selectedAssemblyName:c}=t;let u=0;const l={isLoaded:!0,rows:e.map(((e,t)=>{const a=t+(n?0:1);return e.length>u&&(u=e.length),{id:String(a),cells:e.map(((e,t)=>({columnNumber:t,text:e})))}}))},m={};if(n&&void 0!==r){const[e]=l.rows.splice(r-1,1);e&&e.cells.forEach(((e,t)=>{m[t]=e.text||""}))}const i=[],f=[];for(let d=0;d<u;d+=1){f.push(d);const e=o(l,d,s);if("LocString"===e)for(const t of l.rows){const e=t.cells[d];e.extendedData=(0,a.parseLocString)(e.text,s)}i[d]={name:m[d],dataType:{type:e}}}return{rowSet:l,columnDisplayOrder:f,hasColumnNames:!!n,columns:i,assemblyName:c}}async function u(e,t){return c(await s(e),t)}async function l(e,t){return c(await s(e,{delimiter:"\t"}),t)}},18180:(e,t,n)=>{n.r(t),n.d(t,{parseSTARFusionBuffer:()=>o});var a=n(23285);function r(e){const t=e.split(":");return{refName:t[0],pos:Number.parseInt(t[1],10),strand:"-"===t[2]?-1:1}}const s={SpanningFragCount:!0,FFPM:!0,LeftBreakEntropy:!0,RightBreakEntropy:!0,JunctionReadCount:!0};async function o(e,t){const n=await(0,a.parseTsvBuffer)(e,{hasColumnNameLine:!0,columnNameLineNumber:1,selectedAssemblyName:t.selectedAssemblyName,isValidRefName:()=>!1});return n.columns[0].name=n.columns[0].name.replace("#",""),n.columns.forEach((e=>{s[e.name]&&(e.dataType={type:"Number"})})),n.rowSet.rows.forEach(((e,t)=>{const a={};e.cells.forEach(((e,t)=>{let{text:o}=e;const c=n.columns[t];if("LeftBreakpoint"===c.name&&o){const{refName:e,pos:t,strand:n}=r(o);a.refName=e,a.start=t,a.end=t,a.strand=n}else if("RightBreakpoint"===c.name&&o){const{refName:e,pos:t,strand:n}=r(o);a.mate={refName:e,start:t,end:t,strand:n}}else o&&s[c.name]?a[c.name]=parseFloat(o):a[c.name]=o})),a.uniqueId="sf-".concat(t+1),e.extendedData={feature:a}})),n}}}]);
//# sourceMappingURL=8180.27c432db.chunk.js.map