view x/static/js/4234.63e1ba57.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/4234.63e1ba57.chunk.js","mappings":"6NAkBe,MAAMA,UAAsBC,EAAAA,uBAMzC,oBAA6B,CAC3B,gBACA,gBACA,kBAGF,cAAcC,CAASC,GACrB,MAAM,eAAEC,EAAiBA,QAAaD,GAAQ,CAAC,EACzCE,EAAKC,KAAKC,cACVC,EAAS,IAAIC,EAAAA,EAAO,CACxBC,YAAYC,EAAAA,EAAAA,cAAaL,KAAKM,QAAQ,kBAAmBP,KAErDQ,QAAeC,EAAAA,EAAAA,cACnB,4BACAV,GACA,IAAMI,EAAOO,UAAUZ,KAEzB,MAAO,CAAEK,SAAQK,SACnB,CAEA,WAAMG,CAAMb,GAOV,OANKG,KAAKW,SACRX,KAAKW,OAASX,KAAKJ,SAASC,GAAMe,OAAOC,IAEvC,MADAb,KAAKW,YAASG,EACRD,CAAC,KAGJb,KAAKW,MACd,CAEA,iBAAaI,CAAYlB,GACvB,MAAM,OAAEU,SAAiBP,KAAKU,MAAMb,GACpC,OAAOmB,OAAOC,KAAKV,EAAOW,WAC5B,CAEA,iBAAaC,CAAYC,GACvB,MAAM,OAAEb,SAAiBP,KAAKU,QAC9B,OAAOH,EAAOc,aAAaD,IAAQE,IACrC,CAEA,oBAAaC,CAAe1B,GAC1B,MAAM,OAAEU,SAAiBP,KAAKU,MAAMb,GACpC,OAAO2B,EAAAA,EAAAA,IAAajB,EAAOkB,aAC7B,CAEOC,WAAAA,CAAYC,EAAgB9B,EAAsB,CAAC,GACxD,MAAM,QAAE+B,EAAO,MAAEC,EAAK,IAAEC,GAAQH,GAC1B,QACJI,EAAU,EAAC,OACXC,EAAM,WACNC,EAAa,EAAC,eACdnC,EAAiBA,QACfD,EACJ,OAAOqC,EAAAA,EAAAA,mBAA0BC,UAC/BrC,EAAe,2BACf,MAAMsC,EAASpC,KAAKM,QAAQ,WACtB,OAAEJ,SAAiBF,KAAKU,MAAMb,GAC9BwC,QAAcnC,EAAOwB,YAAYE,EAASC,EAAOC,EAAK,IACvDjC,EACHyC,aAAcP,EAAUE,IAG1B,IAAK,MAAMM,KAAQF,EAAO,CACpBD,IAEFG,EAAKH,OAASA,GAEhB,MAAMI,EAAW,GAAGJ,KAAUT,EAAOC,WAAWW,EAAKV,SAASU,EAAKT,MAEnES,EAAKX,QAAUA,EACfW,EAAKC,SAAWA,EAChBC,EAASC,KAAK,CAEZC,IAAMC,GAAiBL,EAAiCK,GACxDC,GAAIA,IAAML,EAEVM,OAAQA,IAAMP,GAElB,CACAE,EAASM,UAAU,GAClBf,EACL,CAGA,uCAAMgB,CAAkCC,GACtC,MAAO,CAAEC,eAAgB,EAC3B,CAEOC,aAAAA,GAAuB,E","sources":["../../../plugins/wiggle/src/BigWigAdapter/BigWigAdapter.ts"],"sourcesContent":["import { BigWig } from '@gmod/bbi'\nimport {\n  BaseFeatureDataAdapter,\n  BaseOptions,\n} from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { AugmentedRegion as Region } from '@jbrowse/core/util/types'\nimport { openLocation } from '@jbrowse/core/util/io'\nimport { updateStatus, Feature } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport {\n  rectifyStats,\n  UnrectifiedQuantitativeStats,\n} from '@jbrowse/core/util/stats'\n\ninterface WiggleOptions extends BaseOptions {\n  resolution?: number\n}\n\nexport default class BigWigAdapter extends BaseFeatureDataAdapter {\n  private setupP?: Promise<{\n    bigwig: BigWig\n    header: Awaited<ReturnType<BigWig['getHeader']>>\n  }>\n\n  public static capabilities = [\n    'hasResolution',\n    'hasLocalStats',\n    'hasGlobalStats',\n  ]\n\n  private async setupPre(opts?: BaseOptions) {\n    const { statusCallback = () => {} } = opts || {}\n    const pm = this.pluginManager\n    const bigwig = new BigWig({\n      filehandle: openLocation(this.getConf('bigWigLocation'), pm),\n    })\n    const header = await updateStatus(\n      'Downloading bigwig header',\n      statusCallback,\n      () => bigwig.getHeader(opts),\n    )\n    return { bigwig, header }\n  }\n\n  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 async getRefNames(opts?: BaseOptions) {\n    const { header } = await this.setup(opts)\n    return Object.keys(header.refsByName)\n  }\n\n  public async refIdToName(refId: number) {\n    const { header } = await this.setup()\n    return header.refsByNumber[refId]?.name\n  }\n\n  public async getGlobalStats(opts?: BaseOptions) {\n    const { header } = await this.setup(opts)\n    return rectifyStats(header.totalSummary as UnrectifiedQuantitativeStats)\n  }\n\n  public getFeatures(region: Region, opts: WiggleOptions = {}) {\n    const { refName, start, end } = region\n    const {\n      bpPerPx = 0,\n      signal,\n      resolution = 1,\n      statusCallback = () => {},\n    } = opts\n    return ObservableCreate<Feature>(async observer => {\n      statusCallback('Downloading bigwig data')\n      const source = this.getConf('source')\n      const { bigwig } = await this.setup(opts)\n      const feats = await bigwig.getFeatures(refName, start, end, {\n        ...opts,\n        basesPerSpan: bpPerPx / resolution,\n      })\n\n      for (const data of feats) {\n        if (source) {\n          // @ts-expect-error\n          data.source = source\n        }\n        const uniqueId = `${source}:${region.refName}:${data.start}-${data.end}`\n        // @ts-expect-error\n        data.refName = refName\n        data.uniqueId = uniqueId\n        observer.next({\n          // @ts-expect-error\n          get: (str: string) => (data as Record<string, unknown>)[str],\n          id: () => uniqueId,\n          // @ts-expect-error\n          toJSON: () => data,\n        })\n      }\n      observer.complete()\n    }, signal)\n  }\n\n  // always render bigwig instead of calculating a feature density for it\n  async getMultiRegionFeatureDensityStats(_regions: Region[]) {\n    return { featureDensity: 0 }\n  }\n\n  public freeResources(): void {}\n}\n"],"names":["BigWigAdapter","BaseFeatureDataAdapter","setupPre","opts","statusCallback","pm","this","pluginManager","bigwig","BigWig","filehandle","openLocation","getConf","header","updateStatus","getHeader","setup","setupP","catch","e","undefined","getRefNames","Object","keys","refsByName","refIdToName","refId","refsByNumber","name","getGlobalStats","rectifyStats","totalSummary","getFeatures","region","refName","start","end","bpPerPx","signal","resolution","ObservableCreate","async","source","feats","basesPerSpan","data","uniqueId","observer","next","get","str","id","toJSON","complete","getMultiRegionFeatureDensityStats","_regions","featureDensity","freeResources"],"sourceRoot":""}