view x/static/js/9756.4ac80c37.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/9756.4ac80c37.chunk.js","mappings":"kNASe,MAAMA,UAAyBC,EAAAA,uBACpCC,OAAS,UAEjB,oBAA6B,CAAC,iBAE9B,eAAaC,GACX,MAAMC,QAAgBC,KAAKC,gBAAgBD,KAAKE,QAAQ,qBACxD,IAAKH,EACH,MAAM,IAAII,MAAM,4BAElB,OAAOJ,EAAQK,WACjB,CAEA,iBAAaC,GAEX,aADsBL,KAAKF,aACZO,aACjB,CAEOC,WAAAA,CAAYC,EAAeC,GAChC,OAAOC,EAAAA,EAAAA,mBAA0BC,UAC/B,MAAMC,QAAwBX,KAAKF,YAC7Bc,EAAaZ,KAAKE,QAAQ,cAC1BW,EAAcb,KAAKE,QAAQ,eAC3BY,EAAoB,IAAfF,EAAmB,EAAIA,EAAa,EACzCG,EAAmB,IAAfH,EAEV,IAAMI,MAAOC,EAAYC,IAAKC,GAAaZ,EAI3C,GAHAU,EAAaG,KAAKC,IAAI,EAAGJ,EAAaH,GACtCK,GAAYL,EAERK,EAAW,GAAKF,EAAaE,EAE/B,YADAG,EAASC,WAIX,MAAMC,EAAMb,EAAgBL,YAC1B,IACKC,EACHS,MAAOC,EACPC,IAAKC,GAEPX,GAEIiB,QAAcC,EAAAA,EAAAA,GAAeF,EAAIG,MAAKC,EAAAA,EAAAA,OACtCC,EAAWJ,EAAM,IAAIK,IAAI,QAAU,GAEzC,IAAK,IAAIC,EAAIjB,EAAIiB,EAAIF,EAASG,OAASlB,EAAIiB,GAAKlB,EAAa,CAC3D,MAAMoB,EAAIlB,EAAIc,EAASE,GAAKF,EAASK,MAAMH,EAAIjB,EAAIiB,EAAIjB,GACvD,IAAIqB,EAAK,EACLC,EAAK,EACLC,EAAM,EACV,IAAK,MAAMC,KAAUL,EACJ,MAAXK,GAA6B,MAAXA,EACpBH,IACoB,MAAXG,GAA6B,MAAXA,GAC3BF,IAEa,MAAXE,GACFD,IAGJ,MAAME,EAAMtB,EACNuB,EACY,YAAhBxC,KAAKH,QACAuC,EAAKD,IAAOE,GAAO,GACJ,SAAhBrC,KAAKH,QACFuC,EAAKD,IAAOC,EAAKD,GAAM,GACxB,EAERb,EAASmB,KACP,IAAIC,EAAAA,cAAc,CAChBC,SAAU,GAAG3C,KAAK4C,MAAML,EAAMR,IAC9Bc,QAAStC,EAAMsC,QACf7B,MAAOuB,EAAMR,EACbb,IAAKqB,EAAMR,EAAIlB,EACf2B,UAGN,CACAlB,EAASC,UAAU,GAEvB,CAOOuB,aAAAA,GAAiC,E","sources":["../../../plugins/gccontent/src/GCContentAdapter/GCContentAdapter.ts"],"sourcesContent":["import {\n  BaseFeatureDataAdapter,\n  BaseOptions,\n} from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { firstValueFrom } from 'rxjs'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport { SimpleFeature, Feature, Region } from '@jbrowse/core/util'\nimport { toArray } from 'rxjs/operators'\n\nexport default class GCContentAdapter extends BaseFeatureDataAdapter {\n  private gcMode = 'content'\n\n  public static capabilities = ['hasLocalStats']\n\n  public async configure() {\n    const adapter = await this.getSubAdapter?.(this.getConf('sequenceAdapter'))\n    if (!adapter) {\n      throw new Error('Error getting subadapter')\n    }\n    return adapter.dataAdapter as BaseFeatureDataAdapter\n  }\n\n  public async getRefNames() {\n    const adapter = await this.configure()\n    return adapter.getRefNames()\n  }\n\n  public getFeatures(query: Region, opts: BaseOptions) {\n    return ObservableCreate<Feature>(async observer => {\n      const sequenceAdapter = await this.configure()\n      const windowSize = this.getConf('windowSize')\n      const windowDelta = this.getConf('windowDelta')\n      const hw = windowSize === 1 ? 1 : windowSize / 2 // Half the window size\n      const f = windowSize === 1\n\n      let { start: queryStart, end: queryEnd } = query\n      queryStart = Math.max(0, queryStart - hw)\n      queryEnd += hw\n\n      if (queryEnd < 0 || queryStart > queryEnd) {\n        observer.complete()\n        return\n      }\n\n      const ret = sequenceAdapter.getFeatures(\n        {\n          ...query,\n          start: queryStart,\n          end: queryEnd,\n        },\n        opts,\n      )\n      const feats = await firstValueFrom(ret.pipe(toArray()))\n      const residues = feats[0]?.get('seq') || ''\n\n      for (let i = hw; i < residues.length - hw; i += windowDelta) {\n        const r = f ? residues[i] : residues.slice(i - hw, i + hw)\n        let nc = 0\n        let ng = 0\n        let len = 0\n        for (const letter of r) {\n          if (letter === 'c' || letter === 'C') {\n            nc++\n          } else if (letter === 'g' || letter === 'G') {\n            ng++\n          }\n          if (letter !== 'N') {\n            len++\n          }\n        }\n        const pos = queryStart\n        const score =\n          this.gcMode === 'content'\n            ? (ng + nc) / (len || 1)\n            : this.gcMode === 'skew'\n              ? (ng - nc) / (ng + nc || 1)\n              : 0\n\n        observer.next(\n          new SimpleFeature({\n            uniqueId: `${this.id}_${pos + i}`,\n            refName: query.refName,\n            start: pos + i,\n            end: pos + i + windowDelta,\n            score,\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 } */) {}\n}\n"],"names":["GCContentAdapter","BaseFeatureDataAdapter","gcMode","configure","adapter","this","getSubAdapter","getConf","Error","dataAdapter","getRefNames","getFeatures","query","opts","ObservableCreate","async","sequenceAdapter","windowSize","windowDelta","hw","f","start","queryStart","end","queryEnd","Math","max","observer","complete","ret","feats","firstValueFrom","pipe","toArray","residues","get","i","length","r","slice","nc","ng","len","letter","pos","score","next","SimpleFeature","uniqueId","id","refName","freeResources"],"sourceRoot":""}