view x/static/js/3578.058bdae5.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/3578.058bdae5.chunk.js","mappings":"kNA8Be,MAAMA,UAA8BC,EAAAA,oBAKjD,iBAAaC,CAAYC,GACvB,MAAM,MAAEC,SAAgBC,KAAKC,MAAMH,GACnC,MAAO,IAAIC,EAAMG,OACnB,CAEA,gBAAaC,CAAWL,GACtB,MAAM,MAAEC,SAAgBC,KAAKC,MAAMH,GACnC,MAAO,IAAIC,EAAMK,WAAWC,KAAI,EAAEC,EAASC,MAAU,CACnDD,UACAE,MAAO,EACPC,IAAKF,EAAKG,SAASC,UAEvB,CAEA,cAAaC,CAASC,GACpB,MAAMC,EAAgBd,KAAKe,QAAQ,iBAC7BC,GAzCeC,QA0CbC,EAAAA,EAAAA,cAAaJ,EAAed,KAAKmB,eAAeC,SAAS,QAzC5D,IAAIC,IACTJ,EACGK,MAAM,KACNC,QAAOC,GAAK,KAAKC,KAAKD,KACtBnB,KAAIqB,IACH,MAAOC,KAAYC,GAAYF,EAAUJ,MAAM,OACxCO,KAAOC,GAAeH,EAASL,MAAM,KACtCZ,EAAWkB,EAASG,KAAK,IAAIC,QAAQ,MAAO,IAClD,MAAO,CACLH,EACA,CACEC,YAAaA,EAAYC,KAAK,KAC9BrB,YAEH,MAfT,IAAyBO,EA6CrB,MAAO,CACLlB,MAAO,IAAIsB,IACT,IAAIL,EAAIZ,WAAWC,KAAI,EAAEC,EAAS2B,KACzB,EACLC,EAAAA,EAAAA,gBAAelC,KAAKmC,OAAQ,kBAAmB,CAAE7B,aAC/CA,EACF2B,MAKV,CAEA,eAAaG,GACX,MAAMC,EAAMrC,KAAKe,QAAQ,oBACzB,MAAmB,KAAZsB,EAAIC,KAA0B,8BAAZD,EAAIC,IACzB,MACApB,EAAAA,EAAAA,cAAamB,EAAKrC,KAAKmB,eAAeC,SAAS,OACrD,CAEA,WAAanB,CAAMH,GAOjB,OANKE,KAAKuC,SACRvC,KAAKuC,OAASvC,KAAKY,SAASd,GAAM0C,OAAOC,IAEvC,MADAzC,KAAKuC,YAASG,EACRD,CAAC,KAGJzC,KAAKuC,MACd,CAEOI,WAAAA,CAAYC,EAA0B9C,GAC3C,MAAM,QAAEQ,EAAO,MAAEE,EAAK,IAAEC,GAAQmC,EAChC,OAAOC,EAAAA,EAAAA,mBAA0BC,UAC/B,MAAM,MAAE/C,SAAgBC,KAAKC,MAAMH,GAC7BiD,EAAQhD,EAAMiD,IAAI1C,GACpByC,GACFE,EAASC,KACP,IAAIC,EAAAA,cAAc,CAChBtB,GAAI,GAAGvB,KAAWE,KAASC,IAC3BF,KAAM,CACJD,UACAE,QACAC,MACA2C,IAAKL,EAAMrC,SAAS2C,MAAM7C,EAAOC,OAKzCwC,EAASK,UAAU,GAEvB,CAEOC,aAAAA,GAAuC,E","sources":["../../../plugins/sequence/src/UnindexedFastaAdapter/UnindexedFastaAdapter.ts"],"sourcesContent":["import {\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 { readConfObject } from '@jbrowse/core/configuration'\n\nfunction parseSmallFasta(text: string) {\n  return new Map(\n    text\n      .split('>')\n      .filter(t => /\\S/.test(t))\n      .map(entryText => {\n        const [defLine, ...seqLines] = entryText.split('\\n')\n        const [id, ...description] = defLine!.split(' ')\n        const sequence = seqLines.join('').replace(/\\s/g, '')\n        return [\n          id!,\n          {\n            description: description.join(' '),\n            sequence,\n          },\n        ] as const\n      }),\n  )\n}\n\nexport default class UnindexedFastaAdapter extends BaseSequenceAdapter {\n  protected setupP?: Promise<{\n    fasta: ReturnType<typeof parseSmallFasta>\n  }>\n\n  public async getRefNames(opts?: BaseOptions) {\n    const { fasta } = await this.setup(opts)\n    return [...fasta.keys()]\n  }\n\n  public async getRegions(opts?: BaseOptions) {\n    const { fasta } = await this.setup(opts)\n    return [...fasta.entries()].map(([refName, data]) => ({\n      refName,\n      start: 0,\n      end: data.sequence.length,\n    }))\n  }\n\n  public async setupPre(_opts?: BaseOptions) {\n    const fastaLocation = this.getConf('fastaLocation') as FileLocation\n    const res = parseSmallFasta(\n      await openLocation(fastaLocation, this.pluginManager).readFile('utf8'),\n    )\n\n    return {\n      fasta: new Map(\n        [...res.entries()].map(([refName, val]) => {\n          return [\n            readConfObject(this.config, 'rewriteRefNames', { refName }) ||\n              refName,\n            val,\n          ]\n        }),\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(opts?: BaseOptions) {\n    if (!this.setupP) {\n      this.setupP = this.setupPre(opts).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(opts)\n      const entry = fasta.get(refName)\n      if (entry) {\n        observer.next(\n          new SimpleFeature({\n            id: `${refName}-${start}-${end}`,\n            data: {\n              refName,\n              start,\n              end,\n              seq: entry.sequence.slice(start, end),\n            },\n          }),\n        )\n      }\n      observer.complete()\n    })\n  }\n\n  public freeResources(/* { region } */): void {}\n}\n"],"names":["UnindexedFastaAdapter","BaseSequenceAdapter","getRefNames","opts","fasta","this","setup","keys","getRegions","entries","map","refName","data","start","end","sequence","length","setupPre","_opts","fastaLocation","getConf","res","text","openLocation","pluginManager","readFile","Map","split","filter","t","test","entryText","defLine","seqLines","id","description","join","replace","val","readConfObject","config","getHeader","loc","uri","setupP","catch","e","undefined","getFeatures","region","ObservableCreate","async","entry","get","observer","next","SimpleFeature","seq","slice","complete","freeResources"],"sourceRoot":""}