Mercurial > repos > fubar > jbrowse2
comparison x/static/js/3497.9db6611b.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 |
comparison
equal
deleted
inserted
replaced
124:137e08517410 | 125:49f3d3878413 |
---|---|
1 {"version":3,"file":"static/js/3497.9db6611b.chunk.js","mappings":"2LAIO,SAASA,EAA2CC,ICiIpD,SACLA,EACAC,IAGAC,EAAAA,EAAAA,aACEF,GACAG,EAAAA,EAAAA,UAAQC,UACN,UACQH,GACR,CAAE,MAAOI,IACHC,EAAAA,EAAAA,SAAQN,IACVA,EAAKO,SAASF,EAElB,IDzIF,CAAEG,MAAO,MC4Ib,CDjJEC,CACET,GACAI,gBEiCGA,eAA2BJ,GAEhC,MAAQU,aAAcC,IAAcC,EAAAA,EAAAA,oBAAmBZ,IACjD,WAAEa,IAAeC,EAAAA,EAAAA,YAAWd,GAC5Be,GAAOC,EAAAA,EAAAA,mBAAkBhB,GAE/B,IAAKe,EAAKE,aAAejB,EAAKkB,OAASlB,EAAKmB,eAC1C,OAGFnB,EAAKoB,YAAW,GAChB,MAAMC,QAAaR,EAAWS,KAAKX,EAAW,kBAAmB,CAC/DA,YACAY,QAASR,EAAKS,aAAaC,cAC3BC,cAAe1B,EAAK0B,gBAGtB1B,EAAK2B,aAAYC,EAAAA,EAAAA,QAAOP,GAAKQ,GAAKA,EAAEC,QACpC9B,EAAKoB,YAAW,EAClB,CFnDYW,CAAY/B,EAAK,GAI7B,C","sources":["../../../plugins/arc/src/LinearPairedArcDisplay/afterAttach.tsx","../../../plugins/arc/src/LinearPairedArcDisplay/util.ts","../../../plugins/arc/src/LinearPairedArcDisplay/fetchChains.ts"],"sourcesContent":["import { createAutorun } from './util'\nimport { fetchChains } from './fetchChains'\nimport { IAnyStateTreeNode } from 'mobx-state-tree'\n\nexport function doAfterAttach<T extends IAnyStateTreeNode>(self: T) {\n createAutorun(\n self,\n async () => {\n await fetchChains(self)\n },\n { delay: 1000 },\n )\n}\n","import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { Feature, AugmentedRegion } from '@jbrowse/core/util'\nimport { toArray } from 'rxjs/operators'\nimport { firstValueFrom } from 'rxjs'\nimport { IAnyStateTreeNode, addDisposer, isAlive } from 'mobx-state-tree'\nimport { IAutorunOptions, autorun } from 'mobx'\n\n// get tag from BAM or CRAM feature, where CRAM uses feature.get('tags') and\n// BAM does not\nexport function getTag(feature: Feature, tag: string) {\n const tags = feature.get('tags')\n return tags !== undefined ? tags[tag] : feature.get(tag)\n}\n\n// use fallback alt tag, used in situations where upper case/lower case tags\n// exist e.g. Mm/MM for base modifications\nexport function getTagAlt(feature: Feature, tag: string, alt: string) {\n return getTag(feature, tag) ?? getTag(feature, alt)\n}\n\n// orientation definitions from igv.js, see also\n// https://software.broadinstitute.org/software/igv/interpreting_pair_orientations\nexport const orientationTypes = {\n fr: {\n F1R2: 'LR',\n F2R1: 'LR',\n\n F1F2: 'LL',\n F2F1: 'LL',\n\n R1R2: 'RR',\n R2R1: 'RR',\n\n R1F2: 'RL',\n R2F1: 'RL',\n } as Record<string, string>,\n\n rf: {\n R1F2: 'LR',\n R2F1: 'LR',\n\n R1R2: 'LL',\n R2R1: 'LL',\n\n F1F2: 'RR',\n F2F1: 'RR',\n\n F1R2: 'RL',\n F2R1: 'RL',\n } as Record<string, string>,\n\n ff: {\n F2F1: 'LR',\n R1R2: 'LR',\n\n F2R1: 'LL',\n R1F2: 'LL',\n\n R2F1: 'RR',\n F1R2: 'RR',\n\n R2R1: 'RL',\n F1F2: 'RL',\n } as Record<string, string>,\n}\n\nexport const pairMap = {\n LR: 'color_pair_lr',\n LL: 'color_pair_ll',\n RR: 'color_pair_rr',\n RL: 'color_pair_rl',\n} as const\n\nexport function getColorWGBS(strand: number, base: string) {\n if (strand === 1) {\n if (base === 'C') {\n return '#f00'\n }\n if (base === 'T') {\n return '#00f'\n }\n } else if (strand === -1) {\n if (base === 'G') {\n return '#f00'\n }\n if (base === 'A') {\n return '#00f'\n }\n }\n return '#888'\n}\n\n// fetches region sequence augmenting by +/- 1bp for CpG on either side of\n// requested region\nexport async function fetchSequence(\n region: AugmentedRegion,\n adapter: BaseFeatureDataAdapter,\n) {\n const { start, end, originalRefName, refName } = region\n\n const feats = await firstValueFrom(\n adapter\n .getFeatures({\n ...region,\n refName: originalRefName || refName,\n end: end + 1,\n start: Math.max(0, start - 1),\n })\n .pipe(toArray()),\n )\n return feats[0]?.get('seq')\n}\n\n// has to check underlying C-G (aka CpG) on the reference sequence\nexport function shouldFetchReferenceSequence(type?: string) {\n return type === 'methylation'\n}\n\n// adapted from IGV\n// https://github.com/igvteam/igv/blob/e803e3af2d8c9ea049961dfd4628146bdde9a574/src/main/java/org/broad/igv/sam/mods/BaseModificationColors.java#L27\nexport const modificationColors = {\n m: 'rgb(255,0,0)',\n h: 'rgb(11, 132, 165)',\n o: 'rgb(111, 78, 129)',\n f: 'rgb(246, 200, 95)',\n c: 'rgb(157, 216, 102)',\n g: 'rgb(255, 160, 86)',\n e: 'rgb(141, 221, 208)',\n b: 'rgb(202, 71, 47)',\n} as Record<string, string>\n\ntype DisplayModel = IAnyStateTreeNode & { setError: (arg: unknown) => void }\n\nexport function createAutorun(\n self: DisplayModel,\n cb: () => Promise<void>,\n opts?: IAutorunOptions,\n) {\n addDisposer(\n self,\n autorun(async () => {\n try {\n await cb()\n } catch (e) {\n if (isAlive(self)) {\n self.setError(e)\n }\n }\n }, opts),\n )\n}\nexport function randomColor() {\n return `hsl(${Math.random() * 200}, 50%, 50%)`\n}\n","import {\n dedupe,\n Feature,\n getContainingTrack,\n getContainingView,\n getSession,\n} from '@jbrowse/core/util'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\nimport { LinearArcDisplayModel } from './model'\n\ntype LGV = LinearGenomeViewModel\n\nexport interface ReducedFeature {\n name: string\n strand: number\n refName: string\n start: number\n end: number\n id: string\n flags: number\n tlen: number\n pair_orientation: string\n next_ref?: string\n next_pos?: number\n clipPos: number\n SA?: string\n}\n\nexport interface ChainStats {\n max: number\n min: number\n upper: number\n lower: number\n}\n\nexport interface ChainData {\n chains: ReducedFeature[][]\n stats?: ChainStats\n}\n\nexport async function fetchChains(self: LinearArcDisplayModel) {\n // @ts-expect-error\n const { rpcSessionId: sessionId } = getContainingTrack(self)\n const { rpcManager } = getSession(self)\n const view = getContainingView(self) as LGV\n\n if (!view.initialized || self.error || self.regionTooLarge) {\n return\n }\n\n self.setLoading(true)\n const ret = (await rpcManager.call(sessionId, 'CoreGetFeatures', {\n sessionId,\n regions: view.staticBlocks.contentBlocks,\n adapterConfig: self.adapterConfig,\n })) as Feature[]\n\n self.setFeatures(dedupe(ret, r => r.id()))\n self.setLoading(false)\n}\n"],"names":["doAfterAttach","self","cb","addDisposer","autorun","async","e","isAlive","setError","delay","createAutorun","rpcSessionId","sessionId","getContainingTrack","rpcManager","getSession","view","getContainingView","initialized","error","regionTooLarge","setLoading","ret","call","regions","staticBlocks","contentBlocks","adapterConfig","setFeatures","dedupe","r","id","fetchChains"],"sourceRoot":""} |