Mercurial > repos > fubar > jbrowse2
view x/static/js/759.9c32be0d.chunk.js.map @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | |
children |
line wrap: on
line source
{"version":3,"file":"static/js/759.9c32be0d.chunk.js","mappings":"2NAGO,SAASA,EAAeC,GAC7B,OAAO,IAAIC,YAAY,OAAQ,CAAEC,OAAO,IAAQC,OAAOH,EACzD,CAEAI,eAAeC,EAAUL,EAAgBM,EAAU,CAAC,GAElD,aADkB,qCAAoBC,MAAKC,GAAUA,EAAOC,WACjD,CAAEC,UAAU,EAAMC,OAAQ,SAAUL,IAAWM,WACxDb,EAAeC,GAEnB,CAgCA,SAASa,EACPC,EACAC,EACAC,GAEA,MAAMC,EAAOH,EAAOI,KAAK,GAAIC,MAAMJ,GAAeE,MAAQ,GAE1D,IAEIG,EAFAC,EAAc,OAGlB,IACED,GAAYE,EAAAA,EAAAA,gBAAeL,EAAMD,EACnC,CAAE,MAAOO,GACP,CAWF,OATIH,GAAWI,SAAsC,iBAApBJ,EAAUK,MACzCJ,EAAc,YACL,gBAAgBK,KAAKT,KAC9BI,EAAc,UAMTA,CACT,CAEA,SAASM,EACPT,EACAZ,EAAwB,CAAC,GAEzB,MAAM,kBACJsB,GAAoB,EAAK,qBACzBC,EAAuB,EAAC,eACxBb,EAAiBA,KAAM,EAAK,qBAC5Bc,GACExB,EAGJ,IAAIyB,EAAU,EACd,MAAMjB,EAAiB,CACrBkB,UAAU,EACVd,KAAMA,EAAKe,KAAI,CAACC,EAAKC,KACnB,MAAMC,EAAKD,GAAaP,EAAoB,EAAI,GAIhD,OAHIM,EAAIG,OAASN,IACfA,EAAUG,EAAIG,QAET,CACLD,GAAIE,OAAOF,GACXjB,MAAOe,EAAID,KAAI,CAAChB,EAAMF,KACb,CAAEA,eAAcE,WAE1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EAAAA,gBAAevD,EAAQ,CACxC4B,mBAAmB,EACnBC,qBAAsB,EACtBC,qBAAsBxB,EAAQwB,qBAC9Bd,eAAgBA,KAAM,IA6CxB,OAzCAwD,EAAK3B,QAAQ,GAAII,KAAOuB,EAAK3B,QAAQ,GAAII,KAAKwB,QAAQ,IAAK,IAE3DD,EAAK3B,QAAQF,SAAQ+B,IACfT,EAAeS,EAAIzB,QACrByB,EAAIxB,SAAW,CAAEC,KAAM,UACzB,IAIFqB,EAAK1D,OAAOI,KAAKyB,SAAQ,CAACT,EAAKC,KAC7B,MAAMwC,EAAmC,CAAC,EAC1CzC,EAAIf,MAAMwB,SAAQ,EAAG1B,QAAQF,KAC3B,MAAM6D,EAASJ,EAAK3B,QAAQ9B,GAC5B,GAAoB,mBAAhB6D,EAAO3B,MAA6BhC,EAAM,CAC5C,MAAM,QAAEO,EAAO,IAAEqC,EAAG,OAAEG,GAAWP,EAAgCxC,GACjE0D,EAAYnD,QAAUA,EACtBmD,EAAYlD,MAAQoC,EACpBc,EAAYE,IAAMhB,EAClBc,EAAYX,OAASA,CACvB,MAAO,GAAoB,oBAAhBY,EAAO3B,MAA8BhC,EAAM,CACpD,MAAM,QAAEO,EAAO,IAAEqC,EAAG,OAAEG,GAAWP,EAAgCxC,GACjE0D,EAAYG,KAAO,CACjBtD,UACAC,MAAOoC,EACPgB,IAAKhB,EACLG,SAEJ,MAAW/C,GAAQgD,EAAeW,EAAO3B,MAEvC0B,EAAYC,EAAO3B,MAAQa,OAAOiB,WAAW9D,GAG7C0D,EAAYC,EAAO3B,MAAQhC,CAC7B,IAEF0D,EAAYK,SAAW,MAAM7C,EAAY,IACzCD,EAAIc,aAAe,CACjBiC,QAASN,EACV,IAGIH,CACT,C","sources":["../../../plugins/spreadsheet-view/src/SpreadsheetView/importAdapters/ImportUtils.ts","../../../plugins/spreadsheet-view/src/SpreadsheetView/importAdapters/STARFusionImport.ts"],"sourcesContent":["import { ParsedLocString, parseLocString } from '@jbrowse/core/util'\nimport type { Buffer } from 'buffer'\n\nexport function bufferToString(buffer: Buffer) {\n return new TextDecoder('utf8', { fatal: true }).decode(buffer)\n}\n\nasync function parseWith(buffer: Buffer, options = {}) {\n const csv = await import('csvtojson').then(module => module.default)\n return csv({ noheader: true, output: 'csv', ...options }).fromString(\n bufferToString(buffer),\n )\n}\n\nexport interface Row {\n id: string\n\n extendedData?: any\n cells: {\n text: string\n\n extendedData?: any\n }[]\n}\n\nexport interface RowSet {\n isLoaded: boolean\n rows: Row[]\n}\n\nexport interface ParseOptions {\n hasColumnNameLine?: boolean\n columnNameLineNumber?: number\n selectedAssemblyName?: string\n isValidRefName?: (refName: string, assemblyName?: string) => boolean\n}\n\nexport interface Column {\n name: string\n dataType: { type: string }\n isDerived?: boolean\n derivationFunctionText?: string\n}\n\nfunction guessColumnType(\n rowSet: RowSet,\n columnNumber: number,\n isValidRefName: (refName: string, assemblyName?: string) => boolean,\n) {\n const text = rowSet.rows[0]!.cells[columnNumber]!.text || ''\n\n let guessedType = 'Text'\n\n let parsedLoc: ParsedLocString | undefined\n try {\n parsedLoc = parseLocString(text, isValidRefName)\n } catch (error) {\n //\n }\n if (parsedLoc?.refName && typeof parsedLoc.start === 'number') {\n guessedType = 'LocString'\n } else if (/^\\d+(\\.\\d+)?$/.test(text)) {\n guessedType = 'Number'\n }\n\n // MAYBE TODO: iterate over the rest of the rows to confirm\n // the type for all the rows\n\n return guessedType\n}\n\nfunction dataToSpreadsheetSnapshot(\n rows: string[][],\n options: ParseOptions = {},\n) {\n const {\n hasColumnNameLine = false,\n columnNameLineNumber = 1,\n isValidRefName = () => false,\n selectedAssemblyName,\n } = options\n // rows is an array of row objects and columnNames\n // is an array of column names (in import order)\n let maxCols = 0\n const rowSet: RowSet = {\n isLoaded: true,\n rows: rows.map((row, rowNumber) => {\n const id = rowNumber + (hasColumnNameLine ? 0 : 1)\n if (row.length > maxCols) {\n maxCols = row.length\n }\n return {\n id: String(id),\n cells: row.map((text, columnNumber) => {\n return { columnNumber, text }\n }),\n }\n }),\n }\n\n // process the column names row if present\n const columnNames: Record<string, string> = {}\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (hasColumnNameLine && columnNameLineNumber !== undefined) {\n const [colNamesRow] = rowSet.rows.splice(columnNameLineNumber - 1, 1)\n\n if (colNamesRow) {\n colNamesRow.cells.forEach((cell, columnNumber) => {\n columnNames[columnNumber] = cell.text || ''\n })\n }\n }\n\n // make our column definitions\n const columns: Column[] = []\n const columnDisplayOrder = []\n for (let columnNumber = 0; columnNumber < maxCols; columnNumber += 1) {\n columnDisplayOrder.push(columnNumber)\n const guessedType = guessColumnType(rowSet, columnNumber, isValidRefName)\n\n // store extendeddata for LocString column\n if (guessedType === 'LocString') {\n for (const row of rowSet.rows) {\n const cell = row.cells[columnNumber]!\n cell.extendedData = parseLocString(cell.text, isValidRefName)\n }\n }\n\n columns[columnNumber] = {\n name: columnNames[columnNumber]!,\n dataType: {\n type: guessedType,\n },\n }\n }\n\n return {\n rowSet,\n columnDisplayOrder,\n hasColumnNames: !!hasColumnNameLine,\n columns,\n assemblyName: selectedAssemblyName,\n }\n}\n\nexport async function parseCsvBuffer(buffer: Buffer, options?: ParseOptions) {\n const rows = await parseWith(buffer)\n return dataToSpreadsheetSnapshot(rows, options)\n}\n\nexport async function parseTsvBuffer(buffer: Buffer, options?: ParseOptions) {\n const rows = await parseWith(buffer, { delimiter: '\\t' })\n return dataToSpreadsheetSnapshot(rows, options)\n}\n","import { parseTsvBuffer, ParseOptions } from './ImportUtils'\nimport type { Buffer } from 'buffer'\n\nfunction parseSTARFusionBreakpointString(str: string) {\n const fields = str.split(':')\n const refName = fields[0]!\n const pos = Number.parseInt(fields[1]!, 10)\n const strand = fields[2] === '-' ? -1 : 1\n return { refName, pos, strand }\n}\n\nconst numericColumns: Record<string, boolean> = {\n SpanningFragCount: true,\n FFPM: true,\n LeftBreakEntropy: true,\n RightBreakEntropy: true,\n JunctionReadCount: true,\n}\n\nexport async function parseSTARFusionBuffer(\n buffer: Buffer,\n options: ParseOptions,\n) {\n const data = await parseTsvBuffer(buffer, {\n hasColumnNameLine: true,\n columnNameLineNumber: 1,\n selectedAssemblyName: options.selectedAssemblyName,\n isValidRefName: () => false,\n })\n\n // remove the # in #FusionName\n data.columns[0]!.name = data.columns[0]!.name.replace('#', '')\n // set some columns to be numeric\n data.columns.forEach(col => {\n if (numericColumns[col.name]) {\n col.dataType = { type: 'Number' }\n }\n })\n\n // decorate each row with a feature object in its extendedData\n data.rowSet.rows.forEach((row, rowNumber) => {\n const featureData: Record<string, any> = {}\n row.cells.forEach(({ text }, columnNumber) => {\n const column = data.columns[columnNumber]!\n if (column.name === 'LeftBreakpoint' && text) {\n const { refName, pos, strand } = parseSTARFusionBreakpointString(text)\n featureData.refName = refName\n featureData.start = pos\n featureData.end = pos\n featureData.strand = strand\n } else if (column.name === 'RightBreakpoint' && text) {\n const { refName, pos, strand } = parseSTARFusionBreakpointString(text)\n featureData.mate = {\n refName,\n start: pos,\n end: pos,\n strand,\n }\n } else if (text && numericColumns[column.name]) {\n // some other column, numeric\n featureData[column.name] = Number.parseFloat(text)\n } else {\n // some other column, text\n featureData[column.name] = text\n }\n })\n featureData.uniqueId = `sf-${rowNumber + 1}`\n row.extendedData = {\n feature: featureData,\n }\n })\n\n return data\n}\n"],"names":["bufferToString","buffer","TextDecoder","fatal","decode","async","parseWith","options","then","module","default","noheader","output","fromString","guessColumnType","rowSet","columnNumber","isValidRefName","text","rows","cells","parsedLoc","guessedType","parseLocString","error","refName","start","test","dataToSpreadsheetSnapshot","hasColumnNameLine","columnNameLineNumber","selectedAssemblyName","maxCols","isLoaded","map","row","rowNumber","id","length","String","columnNames","undefined","colNamesRow","splice","forEach","cell","columns","columnDisplayOrder","push","extendedData","name","dataType","type","hasColumnNames","assemblyName","parseCsvBuffer","parseTsvBuffer","delimiter","parseSTARFusionBreakpointString","str","fields","split","pos","Number","parseInt","strand","numericColumns","SpanningFragCount","FFPM","LeftBreakEntropy","RightBreakEntropy","JunctionReadCount","parseSTARFusionBuffer","data","replace","col","featureData","column","end","mate","parseFloat","uniqueId","feature"],"sourceRoot":""}