Mercurial > repos > fubar > jbrowse2
view x/static/js/7489.b8a76d29.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/7489.b8a76d29.chunk.js","mappings":"wOAmBe,MAAMA,UAA4BC,EAAAA,oBAGvCC,SAAW,IAAIC,EAAAA,EAA6C,CAClEC,MAAO,IAAIC,EAAAA,EAAS,CAAEC,QAAS,MAC/BC,KAAMC,MAAOC,EAASC,KACpB,MAAM,QAAEC,EAAO,MAAEC,EAAK,IAAEC,EAAG,MAAEC,GAAUL,EACvC,OAAOK,EAAMC,YAAYJ,EAASC,EAAOC,EAAK,IAAKJ,EAAMC,UAAS,IAItE,iBAAaM,CAAYC,GACvB,MAAM,MAAEH,SAAgBI,KAAKC,QAC7B,OAAOL,EAAMM,iBAAiBH,EAChC,CAEA,gBAAaI,CAAWJ,GACtB,MAAM,MAAEH,SAAgBI,KAAKC,QACvBG,QAAiBR,EAAMS,iBAAiBN,GAC9C,OAAOO,OAAOC,KAAKH,GAAUI,KAAIf,IAAW,CAC1CA,UACAC,MAAO,EACPC,IAAKS,EAASX,MAElB,CAEA,cAAagB,GACX,MAAMC,EAAgBV,KAAKW,QAAQ,iBAC7BC,EAAcZ,KAAKW,QAAQ,eAEjC,MAAO,CACLf,MAAO,IAAIiB,EAAAA,GAAa,CACtBjB,OAAOkB,EAAAA,EAAAA,cAAaJ,EAAeV,KAAKe,eACxCC,KAAKF,EAAAA,EAAAA,cAAaF,EAAaZ,KAAKe,iBAG1C,CAEA,eAAaE,GACX,MAAMC,EAAMlB,KAAKW,QAAQ,oBACzB,MAAmB,KAAZO,EAAIC,KAA0B,8BAAZD,EAAIC,IACzB,MACAL,EAAAA,EAAAA,cAAaI,EAAKlB,KAAKe,eAAeK,SAAS,OACrD,CAEA,WAAanB,GAOX,OANKD,KAAKqB,SACRrB,KAAKqB,OAASrB,KAAKS,WAAWa,OAAOC,IAEnC,MADAvB,KAAKqB,YAASG,EACRD,CAAC,KAGJvB,KAAKqB,MACd,CAEOI,WAAAA,CAAYC,EAA0B3B,GAC3C,MAAM,QAAEN,EAAO,MAAEC,EAAK,IAAEC,GAAQ+B,EAChC,OAAOC,EAAAA,EAAAA,mBAA0BrC,UAC/B,MAAM,MAAEM,SAAgBI,KAAKC,QACvB2B,QAAahC,EAAMiC,gBAAgBpC,EAASM,GAC5C+B,EAAYC,KAAKC,IAAIJ,EAAMjC,GAC3BsC,EAAS,GACTC,EAAY,MAEZC,EAAIzC,EAASA,EAAQwC,EACrBX,EAAI5B,GAAOuC,EAAavC,EAAMuC,GACpC,IAAK,IAAIE,EAAaD,EAAGC,EAAab,EAAGa,GAAcF,EAAW,CAChE,MAAMG,EAAI,CACR5C,UACAC,MAAO0C,EACPzC,IAAKyC,EAAaF,GAEpBD,EAAOK,KACLtC,KAAKhB,SAASuD,IAAIC,KAAKC,UAAUJ,GAAI,IAAKA,EAAGzC,SAASG,GAAMP,QAEhE,CACA,MAAMkD,SAAaC,QAAQC,IAAIX,IAC5BY,KAAK,IACLC,MAAMpD,EAAQyC,GACdW,MAAM,EAAGnD,EAAMD,GACdgD,GACFK,EAASC,KACP,IAAIC,EAAAA,cAAc,CAChBC,GAAI,GAAGzD,KAAWC,KAASoC,IAC3BqB,KAAM,CAAE1D,UAASC,QAAOC,IAAKmC,EAAWY,UAI9CK,EAASK,UAAU,GAEvB,CAOOC,aAAAA,GAAuC,E","sources":["../../../plugins/sequence/src/IndexedFastaAdapter/IndexedFastaAdapter.ts"],"sourcesContent":["import { IndexedFasta } from '@gmod/indexedfasta'\nimport {\n BaseSequenceAdapter,\n BaseOptions,\n} from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { FileLocation, NoAssemblyRegion } from '@jbrowse/core/util/types'\nimport { openLocation } from '@jbrowse/core/util/io'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport { SimpleFeature, Feature } from '@jbrowse/core/util'\nimport AbortablePromiseCache from '@gmod/abortable-promise-cache'\nimport QuickLRU from '@jbrowse/core/util/QuickLRU'\n\ninterface T {\n refName: string\n start: number\n end: number\n fasta: IndexedFasta\n}\n\nexport default class IndexedFastaAdapter extends BaseSequenceAdapter {\n protected setupP?: Promise<{ fasta: IndexedFasta }>\n\n private seqCache = new AbortablePromiseCache<T, string | undefined>({\n cache: new QuickLRU({ maxSize: 200 }),\n fill: async (args: T, signal?: AbortSignal) => {\n const { refName, start, end, fasta } = args\n return fasta.getSequence(refName, start, end, { ...args, signal })\n },\n })\n\n public async getRefNames(opts?: BaseOptions) {\n const { fasta } = await this.setup()\n return fasta.getSequenceNames(opts)\n }\n\n public async getRegions(opts?: BaseOptions) {\n const { fasta } = await this.setup()\n const seqSizes = await fasta.getSequenceSizes(opts)\n return Object.keys(seqSizes).map(refName => ({\n refName,\n start: 0,\n end: seqSizes[refName]!,\n }))\n }\n\n public async setupPre() {\n const fastaLocation = this.getConf('fastaLocation') as FileLocation\n const faiLocation = this.getConf('faiLocation') as FileLocation\n\n return {\n fasta: new IndexedFasta({\n fasta: openLocation(fastaLocation, this.pluginManager),\n fai: openLocation(faiLocation, this.pluginManager),\n }),\n }\n }\n\n public async getHeader() {\n const loc = this.getConf('metadataLocation')\n return loc.uri === '' || loc.uri === '/path/to/fa.metadata.yaml'\n ? null\n : openLocation(loc, this.pluginManager).readFile('utf8')\n }\n\n public async setup() {\n if (!this.setupP) {\n this.setupP = this.setupPre().catch((e: unknown) => {\n this.setupP = undefined\n throw e\n })\n }\n return this.setupP\n }\n\n public getFeatures(region: NoAssemblyRegion, opts?: BaseOptions) {\n const { refName, start, end } = region\n return ObservableCreate<Feature>(async observer => {\n const { fasta } = await this.setup()\n const size = await fasta.getSequenceSize(refName, opts)\n const regionEnd = Math.min(size, end)\n const chunks = []\n const chunkSize = 128000\n\n const s = start - (start % chunkSize)\n const e = end + (chunkSize - (end % chunkSize))\n for (let chunkStart = s; chunkStart < e; chunkStart += chunkSize) {\n const r = {\n refName,\n start: chunkStart,\n end: chunkStart + chunkSize,\n }\n chunks.push(\n this.seqCache.get(JSON.stringify(r), { ...r, fasta }, opts?.signal),\n )\n }\n const seq = (await Promise.all(chunks))\n .join('')\n .slice(start - s)\n .slice(0, end - start)\n if (seq) {\n observer.next(\n new SimpleFeature({\n id: `${refName} ${start}-${regionEnd}`,\n data: { refName, start, end: regionEnd, seq },\n }),\n )\n }\n observer.complete()\n })\n }\n\n /**\n * called to provide a hint that data tied to a certain region\n * will not be needed for the foreseeable future and can be purged\n * from caches, etc\n */\n public freeResources(/* { region } */): void {}\n}\n"],"names":["IndexedFastaAdapter","BaseSequenceAdapter","seqCache","AbortablePromiseCache","cache","QuickLRU","maxSize","fill","async","args","signal","refName","start","end","fasta","getSequence","getRefNames","opts","this","setup","getSequenceNames","getRegions","seqSizes","getSequenceSizes","Object","keys","map","setupPre","fastaLocation","getConf","faiLocation","IndexedFasta","openLocation","pluginManager","fai","getHeader","loc","uri","readFile","setupP","catch","e","undefined","getFeatures","region","ObservableCreate","size","getSequenceSize","regionEnd","Math","min","chunks","chunkSize","s","chunkStart","r","push","get","JSON","stringify","seq","Promise","all","join","slice","observer","next","SimpleFeature","id","data","complete","freeResources"],"sourceRoot":""}