annotate x/static/js/5998.22bd8296.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
125
49f3d3878413 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
fubar
parents:
diff changeset
1 {"version":3,"file":"static/js/5998.22bd8296.chunk.js","mappings":"8LA0DO,SAASA,EACdC,EACAC,EACAC,GAEA,MAAMC,EAA2B,CAC/BC,SAASC,EAAAA,EAAAA,YAAWL,GACpBM,KAAMN,EAAeO,KAAOP,EAAeQ,OAGvCC,EACJT,EAAeU,WACdV,EAAeU,SAASD,aAAeT,EAAeU,SAASC,aAC9DF,IACFN,EAAeM,YAAcA,GAG/B,MAAMG,EAAWZ,EAAeY,UAAYZ,EAAeU,UAAUE,SACrET,EAAeS,SAAWA,EAAWA,EAASC,MAAM,YAAc,GAElE,MAAM,WAAEC,GAAed,EACvB,IAAKA,EAAee,YAAa,CAC/B,IAAKD,GAAYE,SAAS,cAAe,CACvC,MAAMC,EAAkBjB,EAAeO,KAAOP,EAAeQ,MAI7D,OAHAU,QAAQC,KACN,oCAAoCF,+EAE/BG,EAAAA,EAAAA,8BACLjB,EAAeG,KACfW,EACAd,EAAeS,SAEnB,CACA,OAsVJ,SACEZ,EACAG,GAEA,MACMkB,GADcrB,EAAesB,UAAY,IACfC,KAAKC,IACnC,MAAMC,EAAyBC,KAAKC,MAAMD,KAAKE,UAAUJ,IAKzD,OAJAC,EAAWI,QAAUL,EAAQM,OAC7BL,EAAWM,SAAW,GAAGP,EAAQM,UAAUN,EAAQQ,SAASR,EAAQS,OAClET,EAAQlB,MAAQ,KAEXmB,CAAU,IAOnB,OALAtB,EAAe+B,QAAU,CACvB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M,gBACND,UAEJ,CACA,GAAmB,+CAAfpB,EAA6D,CAC/D,MAAMoB,EAAsB,CAC1BC,KAAM,oBACN2B,cAAe,CAAEpB,IAAK3B,EAAa4B,aAAc,gBAoBnD,OAlBAT,EAAQ6B,YAAc/D,EAAegE,eACjC,CACEtB,IAAKL,EAAmBrC,EAAegE,gBACvCrB,aAAc,eAEhB,CACED,IAAK,GAAG3B,QACR4B,aAAc,eAEpBT,EAAQ+B,YAAcjE,EAAekE,eACjC,CACExB,IAAKL,EAAmBrC,EAAekE,gBACvCvB,aAAc,eAEhB,CACED,IAAK,GAAG3B,QACR4B,aAAc,eAEb,IACFxC,EACHgC,KAAM,yBACND,UAEJ,CACA,GAAmB,oCAAfpB,EACF,MAAO,IACFX,EACHgC,KAAM,yBACND,QAAS,CACPC,KAAM,gBACNgC,eAAgB,CAAEzB,IAAK3B,EAAa4B,aAAc,gBAI1D,CAUA,OANAxC,EAAe+B,SAAUkC,EAAAA,EAAAA,cACvB,CAAE1B,IAAK3B,EAAa4B,aAAc,oBAClC0B,EACAtD,GAGEZ,EAAe+B,QAAQC,OAASmC,EAAAA,aAC3BlD,EAAAA,EAAAA,8BACLjB,EAAeG,KACfS,EACAZ,EAAeS,UAGfT,EAAe+B,QAAQC,OAASoC,EAAAA,SAC3BC,EAAAA,EAAAA,0BACLrE,EAAeG,KACfS,EACAZ,EAAeS,WAInBT,EAAegC,MAAOsC,EAAAA,EAAAA,gBAAetE,EAAe+B,QAAQC,MAEhC,sBAAxBhC,EAAegC,OACbnC,EAAemC,MAAMnB,SAAS,UAChCb,EAAekD,iBAAmB,SACzBrD,EAAemC,MAAMnB,SAAS,aACvCb,EAAekD,iBAAmB,YAI/BlD,EACT,C","sources":["../../../plugins/legacy-jbrowse/src/JBrowse1Connection/jb1ToJb2.ts"],"sourcesContent":["import { openLocation } from '@jbrowse/core/util/io'\nimport { objectHash } from '@jbrowse/core/util'\nimport {\n generateUnknownTrackConf,\n generateUnsupportedTrackConf,\n guessAdapter,\n guessTrackType,\n UNKNOWN,\n UNSUPPORTED,\n} from '@jbrowse/core/util/tracks'\nimport { Track, RefSeqs, RefSeq } from './types'\n\ninterface Jb2Track {\n trackId: string\n name: string\n description?: string\n category?: string[]\n adapter?: Jb2Adapter\n type?: string\n defaultRendering?: string\n}\n\ninterface Jb2Adapter {\n type: string\n features?: Jb2Feature[]\n bamLocation?: Jb2Location\n cramLocation?: Jb2Location\n craiLocation?: Jb2Location\n fastaLocation?: Jb2Location\n faiLocation?: Jb2Location\n gziLocation?: Jb2Location\n twoBitLocation?: Jb2Location\n bigWigLocation?: Jb2Location\n bigBedLocation?: Jb2Location\n vcfGzLocation?: Jb2Location\n gffLocation?: Jb2Location\n gffGzLocation?: Jb2Location\n gtfLocation?: Jb2Location\n bedGzLocation?: Jb2Location\n index?: { location: Jb2Location; indexType?: string }\n rootUrlTemplate?: Jb2Location\n sequenceAdapter?: Jb2Adapter\n}\n\ninterface Jb2Feature {\n refName: string\n uniqueId: string\n start: number\n end: number\n}\n\ninterface Jb2Location {\n uri?: string\n localPath?: string\n blobId?: string\n locationType?: string\n}\n\nexport function convertTrackConfig(\n jb1TrackConfig: Track,\n dataRoot: string,\n sequenceAdapter: Jb2Adapter,\n): Jb2Track {\n const jb2TrackConfig: Jb2Track = {\n trackId: objectHash(jb1TrackConfig),\n name: jb1TrackConfig.key || jb1TrackConfig.label,\n }\n\n const description =\n jb1TrackConfig.metadata &&\n (jb1TrackConfig.metadata.description || jb1TrackConfig.metadata.Description)\n if (description) {\n jb2TrackConfig.description = description\n }\n\n const category = jb1TrackConfig.category || jb1TrackConfig.metadata?.category\n jb2TrackConfig.category = category ? category.split(/\\s*\\/\\s*/) : []\n\n const { storeClass } = jb1TrackConfig\n if (!jb1TrackConfig.urlTemplate) {\n if (!storeClass?.endsWith('FromConfig')) {\n const trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label\n console.warn(\n `Could not import JBrowse1 track \"${trackIdentifier}\" because it does not have a \"urlTemplate\" or is not a \"FromConfig\" track`,\n )\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n trackIdentifier,\n jb2TrackConfig.category,\n )\n }\n return generateFromConfigTrackConfig(jb1TrackConfig, jb2TrackConfig)\n }\n\n const resolveUrlTemplate = (urlTemplate: string) => {\n return new URL(urlTemplate, `${dataRoot}/`).href\n .replaceAll(/%7B/gi, '{')\n .replaceAll(/%7D/gi, '}')\n }\n const urlTemplate = resolveUrlTemplate(jb1TrackConfig.urlTemplate)\n\n if (storeClass) {\n if (storeClass === 'JBrowse/Store/SeqFeature/BAM') {\n const adapter: Jb2Adapter = {\n type: 'BamAdapter',\n bamLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n if (jb1TrackConfig.baiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.baiUrlTemplate),\n locationType: 'UriLocation',\n },\n }\n } else if (jb1TrackConfig.csiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),\n locationType: 'UriLocation',\n },\n indexType: 'CSI',\n }\n } else {\n adapter.index = {\n location: { uri: `${urlTemplate}.bai`, locationType: 'UriLocation' },\n }\n }\n return {\n ...jb2TrackConfig,\n type: 'AlignmentsTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/CRAM') {\n const adapter: Jb2Adapter = {\n type: 'CramAdapter',\n cramLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n sequenceAdapter,\n }\n adapter.craiLocation = jb1TrackConfig.craiUrlTemplate\n ? {\n uri: resolveUrlTemplate(jb1TrackConfig.craiUrlTemplate),\n locationType: 'UriLocation',\n }\n : {\n uri: `${urlTemplate}.crai`,\n locationType: 'UriLocation',\n }\n return {\n ...jb2TrackConfig,\n type: 'AlignmentsTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/NCList') {\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter: {\n type: 'NCListAdapter',\n rootUrlTemplate: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n if (\n storeClass === 'JBrowse/Store/SeqFeature/BigWig' ||\n storeClass === 'JBrowse/Store/BigWig'\n ) {\n if (jb1TrackConfig.type?.endsWith('XYPlot')) {\n jb2TrackConfig.defaultRendering = 'xyplot'\n } else if (jb1TrackConfig.type?.endsWith('Density')) {\n jb2TrackConfig.defaultRendering = 'density'\n }\n return {\n ...jb2TrackConfig,\n type: 'QuantitativeTrack',\n adapter: {\n type: 'BigWigAdapter',\n bigWigLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/VCFTabix') {\n const adapter: Jb2Adapter = {\n type: 'VcfTabixAdapter',\n vcfGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n if (jb1TrackConfig.tbiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),\n locationType: 'UriLocation',\n },\n }\n } else if (jb1TrackConfig.csiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),\n locationType: 'UriLocation',\n },\n indexType: 'CSI',\n }\n } else {\n adapter.index = {\n location: { uri: `${urlTemplate}.tbi`, locationType: 'UriLocation' },\n }\n }\n return {\n ...jb2TrackConfig,\n type: 'VariantTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/VCFTribble') {\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n `VCFTribble (${urlTemplate})`,\n jb2TrackConfig.category,\n )\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/GFF3') {\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter: {\n type: 'Gff3Adapter',\n gffLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/BigBed') {\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter: {\n type: 'BigBedAdapter',\n bigBedLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/GFF3Tabix') {\n const adapter: Jb2Adapter = {\n type: 'Gff3TabixAdapter',\n gffGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n if (jb1TrackConfig.tbiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),\n locationType: 'UriLocation',\n },\n }\n } else if (jb1TrackConfig.csiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),\n locationType: 'UriLocation',\n },\n indexType: 'CSI',\n }\n } else {\n adapter.index = {\n location: { uri: `${urlTemplate}.tbi`, locationType: 'UriLocation' },\n }\n }\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/BED') {\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n `BED (${urlTemplate})`,\n jb2TrackConfig.category,\n )\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/BEDTabix') {\n const adapter: Jb2Adapter = {\n type: 'BedTabixAdapter',\n bedGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n if (jb1TrackConfig.tbiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),\n locationType: 'UriLocation',\n },\n }\n } else if (jb1TrackConfig.csiUrlTemplate) {\n adapter.index = {\n location: {\n uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),\n locationType: 'UriLocation',\n },\n indexType: 'CSI',\n }\n } else {\n adapter.index = {\n location: { uri: `${urlTemplate}.tbi`, locationType: 'UriLocation' },\n }\n }\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/GTF') {\n return {\n ...jb2TrackConfig,\n type: 'FeatureTrack',\n adapter: {\n type: 'GtfAdapter',\n gtfLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n if (\n storeClass === 'JBrowse/Store/SeqFeature/StaticChunked' ||\n storeClass === 'JBrowse/Store/Sequence/StaticChunked'\n ) {\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n `StaticChunked (${urlTemplate})`,\n jb2TrackConfig.category,\n )\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/UnindexedFasta') {\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n `UnindexedFasta (${urlTemplate})`,\n jb2TrackConfig.category,\n )\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/IndexedFasta') {\n const adapter: Jb2Adapter = {\n type: 'IndexedFastaAdapter',\n fastaLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n adapter.faiLocation = jb1TrackConfig.faiUrlTemplate\n ? {\n uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),\n locationType: 'UriLocation',\n }\n : {\n uri: `${urlTemplate}.fai`,\n locationType: 'UriLocation',\n }\n return {\n ...jb2TrackConfig,\n type: 'SequenceTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/BgzipIndexedFasta') {\n const adapter: Jb2Adapter = {\n type: 'BgzipFastaAdapter',\n fastaLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n }\n adapter.faiLocation = jb1TrackConfig.faiUrlTemplate\n ? {\n uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),\n locationType: 'UriLocation',\n }\n : {\n uri: `${urlTemplate}.fai`,\n locationType: 'UriLocation',\n }\n adapter.gziLocation = jb1TrackConfig.gziUrlTemplate\n ? {\n uri: resolveUrlTemplate(jb1TrackConfig.gziUrlTemplate),\n locationType: 'UriLocation',\n }\n : {\n uri: `${urlTemplate}.gzi`,\n locationType: 'UriLocation',\n }\n return {\n ...jb2TrackConfig,\n type: 'ReferenceSequenceTrack',\n adapter,\n }\n }\n if (storeClass === 'JBrowse/Store/SeqFeature/TwoBit') {\n return {\n ...jb2TrackConfig,\n type: 'ReferenceSequenceTrack',\n adapter: {\n type: 'TwoBitAdapter',\n twoBitLocation: { uri: urlTemplate, locationType: 'UriLocation' },\n },\n }\n }\n }\n\n // If we don't recognize the store class, make a best effort to guess by file\n // type\n jb2TrackConfig.adapter = guessAdapter(\n { uri: urlTemplate, locationType: 'UriLocation' },\n undefined,\n urlTemplate,\n )\n\n if (jb2TrackConfig.adapter.type === UNSUPPORTED) {\n return generateUnsupportedTrackConf(\n jb2TrackConfig.name,\n urlTemplate,\n jb2TrackConfig.category,\n )\n }\n if (jb2TrackConfig.adapter.type === UNKNOWN) {\n return generateUnknownTrackConf(\n jb2TrackConfig.name,\n urlTemplate,\n jb2TrackConfig.category,\n )\n }\n\n jb2TrackConfig.type = guessTrackType(jb2TrackConfig.adapter.type)\n\n if (jb2TrackConfig.type === 'QuantitativeTrack') {\n if (jb1TrackConfig.type?.endsWith('XYPlot')) {\n jb2TrackConfig.defaultRendering = 'xyplot'\n } else if (jb1TrackConfig.type?.endsWith('Density')) {\n jb2TrackConfig.defaultRendering = 'density'\n }\n }\n\n return jb2TrackConfig\n}\n\nfunction generateFromConfigTrackConfig(\n jb1TrackConfig: Track,\n jb2TrackConfig: Jb2Track,\n): Jb2Track {\n const jb1Features = jb1TrackConfig.features || []\n const jb2Features = jb1Features.map((feature): Jb2Feature => {\n const jb2Feature: Jb2Feature = JSON.parse(JSON.stringify(feature))\n jb2Feature.refName = feature.seq_id\n jb2Feature.uniqueId = `${feature.seq_id}:${feature.start}-${feature.end}:${\n feature.name || ''\n }`\n return jb2Feature\n })\n jb2TrackConfig.adapter = {\n type: 'FromConfigAdapter',\n features: jb2Features,\n }\n jb2TrackConfig.type = 'FeatureTrack'\n return jb2TrackConfig\n}\n\nexport async function createRefSeqsAdapter(\n refSeqs: string | RefSeqs,\n): Promise<Jb2Adapter> {\n if (typeof refSeqs === 'string') {\n // assume refSeqs is a url if it is string\n refSeqs = {\n url: refSeqs,\n }\n }\n\n // check refseq urls\n if (refSeqs.url) {\n if (/.fai$/.exec(refSeqs.url)) {\n return {\n type: 'IndexedFastaAdapter',\n fastaLocation: {\n uri: refSeqs.url.slice(0, -4),\n locationType: 'UriLocation',\n },\n faiLocation: {\n uri: refSeqs.url,\n locationType: 'UriLocation',\n },\n }\n }\n if (/.2bit$/.exec(refSeqs.url)) {\n return {\n type: 'TwoBitAdapter',\n twoBitLocation: { uri: refSeqs.url, locationType: 'UriLocation' },\n }\n }\n if (/.fa$/.exec(refSeqs.url)) {\n throw new Error('Unindexed FASTA adapter not available')\n }\n if (/.sizes/.exec(refSeqs.url)) {\n throw new Error('chromosome SIZES adapter not available')\n }\n const refSeqsJson = await openLocation({\n uri: refSeqs.url,\n locationType: 'UriLocation',\n }).readFile('utf8')\n const refSeqsData: RefSeq[] = JSON.parse(refSeqsJson)\n return refSeqAdapterFromConfig(refSeqsData)\n }\n if ('data' in refSeqs) {\n return refSeqAdapterFromConfig(refSeqs.data || [])\n }\n throw new Error(\n `Could not determine adapter for JBrowse1 refSeqs: ${\n refSeqs.url || JSON.stringify(refSeqs)\n }`,\n )\n}\n\nfunction refSeqAdapterFromConfig(refSeqsData: RefSeq[]): Jb2Adapter {\n const features = refSeqsData.map(\n (refSeq): Jb2Feature => ({\n refName: refSeq.name,\n uniqueId: refSeq.name,\n start: refSeq.start,\n end: refSeq.end,\n }),\n )\n return {\n type: 'FromConfigAdapter',\n features,\n }\n}\n"],"names":["convertTrackConfig","jb1TrackConfig","dataRoot","sequenceAdapter","jb2TrackConfig","trackId","objectHash","name","key","label","description","metadata","Description","category","split","storeClass","urlTemplate","endsWith","trackIdentifier","console","warn","generateUnsupportedTrackConf","jb2Features","features","map","feature","jb2Feature","JSON","parse","stringify","refName","seq_id","uniqueId","start","end","adapter","type","generateFromConfigTrackConfig","resolveUrlTemplate","URL","href","replaceAll","bamLocation","uri","locationType","baiUrlTemplate","index","location","csiUrlTemplate","indexType","cramLocation","craiLocation","craiUrlTemplate","rootUrlTemplate","defaultRendering","bigWigLocation","vcfGzLocation","tbiUrlTemplate","gffLocation","bigBedLocation","gffGzLocation","bedGzLocation","gtfLocation","fastaLocation","faiLocation","faiUrlTemplate","gziLocation","gziUrlTemplate","twoBitLocation","guessAdapter","undefined","UNSUPPORTED","UNKNOWN","generateUnknownTrackConf","guessTrackType"],"sourceRoot":""}