Mercurial > repos > fubar > jbrowse2
view x/static/js/8929.70ce258f.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/8929.70ce258f.chunk.js","mappings":"sMACA,MAAMA,EACmB,oBAAhBC,YAA8B,IAAIA,YAAY,aAAUC,EA2BjE,SAASC,EACPC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAO,CACLR,QACAC,SACAC,OACAE,QACAC,SACAC,OACAG,OAAoB,MAAZN,GAAmB,EAAI,EAC/BO,MAAO,CACLF,aACAG,SAAUC,KAAKC,IAAIX,EAAOD,EAAQK,EAAOD,GACzCS,YAAa,EACbC,GAAIR,GAGV,CC7Ce,MAAMS,UAAqBC,EAAAA,QACxC,cAAMC,CAASC,GACb,MAAMC,GAAMC,EAAAA,EAAAA,cAAaC,KAAKC,QAAQ,iBAAkBD,KAAKE,eACvDC,QAAgBL,EAAIM,SAASP,GAEnC,OD0CG,SAAuBM,GAC5B,IAAIE,EAAS,GACTC,EAAU,EACVC,EAAQ,EACRC,EAAS,GACTC,EAAS,GACTC,EAAW,GACXC,EAAU,EACVC,EAAQ,EACRC,EAAc,EACd5B,EAAQ,GACZ,MAAM6B,EAAU,GAEhB,IAAIC,EAAa,EACjB,KAAOA,EAAaZ,EAAOa,QAAQ,CACjC,MAAMC,EAAId,EAAOe,QAAQ,KAAMH,GAC/B,IAAW,IAAPE,EACF,MAEF,MAAME,EAAIhB,EAAOiB,SAASL,EAAYE,GAEtCF,EAAaE,EAAI,EACjB,MACMI,GAHK/C,GAASgD,OAAOH,IAAMA,EAAEI,YAAYC,OAE/BC,WAAW,IAAK,MACZC,MAAM,MAE1B,GAAiB,UAAbL,EAAM,GAAgB,CAuCxB,GArCIpC,GACF6B,EAAQa,KACNlD,EACE+B,EACAG,EACAC,EACAF,EACAL,EACAC,EACAC,EACAtB,EACA4B,IAkBNR,EAASgB,EAAM,GACff,GAAWe,EAAM,GACjBd,GAASc,EAAM,GACfb,EAASa,EAAM,GACfZ,EAASY,EAAM,GACfX,EAAWW,EAAM,GACjBV,GAAWU,EAAM,IACjBT,GAASS,EAAM,IACE,MAAbX,EAAkB,CACpB,MAAMkB,EAAMjB,EACZA,GAAWF,EAASG,EACpBA,GAASH,EAASmB,CACpB,CAGAf,EAAc,EACd5B,EAAQ,EACV,KAAO,CAQL,MAAM4C,GAA2BR,EAAM,IAAO,EACxCS,EAAiBT,EAAML,OAAS,GAAKK,EAAM,GAAM,EACjDU,EAAgBV,EAAML,OAAS,GAAKK,EAAM,GAAM,EAEtB,IAA5BQ,IACFhB,IAAgBgB,EAChB5C,GAAS,GAAG4C,MAEQ,IAAlBE,IACF9C,GAAS,GAAG8C,MAES,IAAnBD,IACF7C,GAAS,GAAG6C,KAEhB,CACF,CAgBA,OAbI7C,GACFR,EACE+B,EACAG,EACAC,EACAF,EACAL,EACAC,EACAC,EACAtB,EACA4B,GAGGC,CACT,CC3JWkB,EADKC,EAAAA,EAAAA,QAAO9B,SAAgB+B,EAAAA,EAAAA,OAAM/B,GAAUA,EAErD,E","sources":["../../../plugins/comparative-adapters/src/ChainAdapter/util.ts","../../../plugins/comparative-adapters/src/ChainAdapter/ChainAdapter.ts"],"sourcesContent":["import type { Buffer } from 'buffer'\nconst decoder =\n typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined\n\n/* adapted from chain2paf by Andrea Guarracino, license reproduced below\n *\n * MIT License\n *\n * Copyright (c) 2021 Andrea Guarracino\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nfunction generate_record(\n qname: string,\n qstart: number,\n qend: number,\n qstrand: string,\n tname: string,\n tstart: number,\n tend: number,\n cigar: string,\n numMatches: number,\n) {\n return {\n qname,\n qstart,\n qend,\n tname,\n tstart,\n tend,\n strand: qstrand === '-' ? -1 : 1,\n extra: {\n numMatches,\n blockLen: Math.max(qend - qstart, tend - tstart),\n mappingQual: 0,\n cg: cigar,\n },\n }\n}\n\nexport function paf_chain2paf(buffer: Buffer) {\n let t_name = ''\n let t_start = 0\n let t_end = 0\n let q_name = ''\n let q_size = ''\n let q_strand = ''\n let q_start = 0\n let q_end = 0\n let num_matches = 0\n let cigar = ''\n const records = []\n\n let blockStart = 0\n while (blockStart < buffer.length) {\n const n = buffer.indexOf('\\n', blockStart)\n if (n === -1) {\n break\n }\n const b = buffer.subarray(blockStart, n)\n const l = (decoder?.decode(b) || b.toString()).trim()\n blockStart = n + 1\n const l_tab = l.replaceAll(' ', '\\t') // There are CHAIN files with space-separated fields\n const l_vec = l_tab.split('\\t')\n\n if (l_vec[0] === 'chain') {\n // Emit previous PAF row, if available\n if (cigar) {\n records.push(\n generate_record(\n q_name,\n q_start,\n q_end,\n q_strand,\n t_name,\n t_start,\n t_end,\n cigar,\n num_matches,\n ),\n )\n }\n\n // Save query/target information\n // score -- chain score\n // tName -- chromosome (reference sequence)\n // tSize -- chromosome size (reference sequence)\n // tStrand -- strand (reference sequence)\n // tStart -- alignment start position (reference sequence)\n // tEnd -- alignment end position (reference sequence)\n // qName -- chromosome (query sequence)\n // qSize -- chromosome size (query sequence)\n // qStrand -- strand (query sequence)\n // qStart -- alignment start position (query sequence)\n // qEnd -- alignment end position (query sequence)\n // id -- chain ID\n t_name = l_vec[2]!\n t_start = +l_vec[5]!\n t_end = +l_vec[6]!\n q_name = l_vec[7]!\n q_size = l_vec[8]!\n q_strand = l_vec[9]!\n q_start = +l_vec[10]!\n q_end = +l_vec[11]!\n if (q_strand === '-') {\n const tmp = q_start\n q_start = +q_size - q_end\n q_end = +q_size - tmp\n }\n\n // Initialize PAF fields\n num_matches = 0\n cigar = ''\n } else {\n // size -- the size of the ungapped alignment\n //\n // dt -- the difference between the end of this block and the beginning\n // of the next block (reference sequence)\n //\n // dq -- the difference between the end of this block and the beginning\n // of the next block (query sequence)\n const size_ungapped_alignment = +l_vec[0]! || 0\n const diff_in_target = l_vec.length > 1 ? +l_vec[1]! : 0\n const diff_in_query = l_vec.length > 2 ? +l_vec[2]! : 0\n\n if (size_ungapped_alignment !== 0) {\n num_matches += +size_ungapped_alignment\n cigar += `${size_ungapped_alignment}M`\n }\n if (diff_in_query !== 0) {\n cigar += `${diff_in_query}I`\n }\n if (diff_in_target !== 0) {\n cigar += `${diff_in_target}D`\n }\n }\n }\n\n // Emit last PAF row, if available\n if (cigar) {\n generate_record(\n q_name,\n q_start,\n q_end,\n q_strand,\n t_name,\n t_start,\n t_end,\n cigar,\n num_matches,\n )\n }\n return records\n}\n","import { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { openLocation } from '@jbrowse/core/util/io'\nimport { isGzip } from '@jbrowse/core/util'\nimport { unzip } from '@gmod/bgzf-filehandle'\nimport type { Buffer } from 'buffer'\n\n// locals\nimport PAFAdapter from '../PAFAdapter/PAFAdapter'\nimport { paf_chain2paf } from './util'\n\nexport default class ChainAdapter extends PAFAdapter {\n async setupPre(opts?: BaseOptions) {\n const loc = openLocation(this.getConf('chainLocation'), this.pluginManager)\n const buffer = (await loc.readFile(opts)) as Buffer\n const buf = isGzip(buffer) ? await unzip(buffer) : buffer\n return paf_chain2paf(buf)\n }\n}\n"],"names":["decoder","TextDecoder","undefined","generate_record","qname","qstart","qend","qstrand","tname","tstart","tend","cigar","numMatches","strand","extra","blockLen","Math","max","mappingQual","cg","ChainAdapter","PAFAdapter","setupPre","opts","loc","openLocation","this","getConf","pluginManager","buffer","readFile","t_name","t_start","t_end","q_name","q_size","q_strand","q_start","q_end","num_matches","records","blockStart","length","n","indexOf","b","subarray","l_vec","decode","toString","trim","replaceAll","split","push","tmp","size_ungapped_alignment","diff_in_target","diff_in_query","paf_chain2paf","isGzip","unzip"],"sourceRoot":""}