"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[759,7489],{59870:(e,t,n)=>{n.r(t),n.d(t,{bufferToString:()=>r,parseCsvBuffer:()=>u,parseTsvBuffer:()=>m});var a=n(99546);function r(e){return new TextDecoder("utf8",{fatal:!0}).decode(e)}async function s(e,t={}){return(await n.e(2847).then(n.t.bind(n,82847,23)).then((e=>e.default)))({noheader:!0,output:"csv",...t}).fromString(r(e))}function o(e,t,n){const r=e.rows[0].cells[t].text||"";let s,o="Text";try{s=(0,a.parseLocString)(r,n)}catch(e){}return s?.refName&&"number"==typeof s.start?o="LocString":/^\d+(\.\d+)?$/.test(r)&&(o="Number"),o}function c(e,t={}){const{hasColumnNameLine:n=!1,columnNameLineNumber:r=1,isValidRefName:s=()=>!1,selectedAssemblyName:c}=t;let u=0;const m={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})))}}))},i={};if(n&&void 0!==r){const[e]=m.rows.splice(r-1,1);e&&e.cells.forEach(((e,t)=>{i[t]=e.text||""}))}const l=[],f=[];for(let e=0;e<u;e+=1){f.push(e);const t=o(m,e,s);if("LocString"===t)for(const t of m.rows){const n=t.cells[e];n.extendedData=(0,a.parseLocString)(n.text,s)}l[e]={name:i[e],dataType:{type:t}}}return{rowSet:m,columnDisplayOrder:f,hasColumnNames:!!n,columns:l,assemblyName:c}}async function u(e,t){return c(await s(e),t)}async function m(e,t){return c(await s(e,{delimiter:"\t"}),t)}},759:(e,t,n)=>{n.r(t),n.d(t,{parseSTARFusionBuffer:()=>o});var a=n(59870);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((({text:e},t)=>{const o=n.columns[t];if("LeftBreakpoint"===o.name&&e){const{refName:t,pos:n,strand:s}=r(e);a.refName=t,a.start=n,a.end=n,a.strand=s}else if("RightBreakpoint"===o.name&&e){const{refName:t,pos:n,strand:s}=r(e);a.mate={refName:t,start:n,end:n,strand:s}}else e&&s[o.name]?a[o.name]=Number.parseFloat(e):a[o.name]=e})),a.uniqueId=`sf-${t+1}`,e.extendedData={feature:a}})),n}}}]);
//# sourceMappingURL=759.f02401f3.chunk.js.map