Mercurial > repos > fubar > jbrowse2
view x/static/js/4345.0a9072cc.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/4345.0a9072cc.chunk.js","mappings":"mMAGO,SAASA,EAAgBC,EAAkBC,GAChD,MAAMC,EAAMD,GAAME,EAAAA,EAAAA,GAAcF,QAAOG,EACjCC,EAAQL,EAAQM,IAAI,SAC1B,IAAIC,EAAMP,EAAQM,IAAI,OACtB,MAAME,EAASR,EAAQM,IAAI,UACrBG,EAAOT,EAAQM,IAAI,QAQnBI,EAAUV,EAAQM,IAAI,WAE5B,IAAIK,EACAC,EAAU,EACVC,EAAY,EACZC,EAAgB,EAChBC,EAAgB,EAKpB,GADwB,CAAC,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,QAC7CC,MAAKC,GAAKhB,GAAKiB,WAAWD,KAAK,CAGjD,MAAME,EAAOnB,EAAQM,IAAI,QACnBc,EAAID,GAAME,MAAM,IAAMd,EAC5BI,EAAcQ,GAAMG,OAAO,IAAMZ,EACjCE,EAAUQ,EACVP,EAAYO,EAAI,EAGhBb,EAAMF,EAAQ,CAChB,MAAO,GAAIH,GAAKqB,aAAc,CAC5B,MAAMC,EAAetB,EAAIqB,aAAaE,MAAM,KAC5CV,EAAsC,SAAtBb,EAAIwB,cAA2B,GAAK,EACpDZ,EAA6B,SAAbZ,EAAIyB,MAAmB,EAAI,EAC3Cf,GAAWY,EAAa,GACxBX,GAAaW,EAAa,GAAM,EAChCb,EAAca,EAAa,EAC7B,CAEA,MAAO,CACLI,GAAI,CACFlB,UACAL,QACAE,MACAC,SACAO,iBAEFc,GAAIpB,GAAQ,CACVC,QAASC,GAAe,UACxBJ,IAAKK,EACLP,MAAOQ,EACPE,cAAeD,GAGrB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C,EAAAA,cAAC4C,EAAAA,EAAI,CAAC3E,MAAOA,EAAOkD,WAAW,KAIvC,C","sources":["../../../plugins/arc/src/LinearPairedArcDisplay/components/util.ts","../../../plugins/arc/src/LinearPairedArcDisplay/components/Arcs.tsx","../../../plugins/arc/src/LinearPairedArcDisplay/renderSvg.tsx"],"sourcesContent":["import { parseBreakend } from '@gmod/vcf'\nimport { Feature, assembleLocString } from '@jbrowse/core/util'\n\nexport function makeFeaturePair(feature: Feature, alt?: string) {\n const bnd = alt ? parseBreakend(alt) : undefined\n const start = feature.get('start')\n let end = feature.get('end')\n const strand = feature.get('strand')\n const mate = feature.get('mate') as\n | {\n refName: string\n start: number\n end: number\n mateDirection?: number\n }\n | undefined\n const refName = feature.get('refName')\n\n let mateRefName: string | undefined\n let mateEnd = 0\n let mateStart = 0\n let joinDirection = 0\n let mateDirection = 0\n\n // one sided bracket used, because there could be <INS:ME> and we just check\n // startswith below\n const symbolicAlleles = ['<TRA', '<DEL', '<INV', '<INS', '<DUP', '<CNV']\n if (symbolicAlleles.some(a => alt?.startsWith(a))) {\n // END is defined to be a single value, not an array. CHR2 not defined in\n // VCF spec, but should be similar\n const info = feature.get('INFO')\n const e = info?.END?.[0] ?? end\n mateRefName = info?.CHR2?.[0] ?? refName\n mateEnd = e\n mateStart = e - 1\n // re-adjust the arc to be from start to end of feature by re-assigning end\n // to the 'mate'\n end = start + 1\n } else if (bnd?.MatePosition) {\n const matePosition = bnd.MatePosition.split(':')\n mateDirection = bnd.MateDirection === 'left' ? 1 : -1\n joinDirection = bnd.Join === 'left' ? -1 : 1\n mateEnd = +matePosition[1]!\n mateStart = +matePosition[1]! - 1\n mateRefName = matePosition[0]\n }\n\n return {\n k1: {\n refName,\n start,\n end,\n strand,\n mateDirection,\n },\n k2: mate ?? {\n refName: mateRefName || 'unknown',\n end: mateEnd,\n start: mateStart,\n mateDirection: joinDirection,\n },\n }\n}\n\nexport function makeSummary(feature: Feature, alt?: string) {\n const { k1, k2 } = makeFeaturePair(feature, alt)\n return [\n feature.get('name'),\n feature.get('id'),\n assembleLocString(k1),\n assembleLocString(k2),\n feature.get('INFO')?.SVTYPE,\n alt,\n ]\n .filter(f => !!f)\n .join(' - ')\n}\n","import React, { lazy, Suspense, useRef, useState } from 'react'\nimport { observer } from 'mobx-react'\nimport {\n AbstractSessionModel,\n Feature,\n getContainingView,\n getSession,\n getStrokeProps,\n} from '@jbrowse/core/util'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\nimport { Assembly } from '@jbrowse/core/assemblyManager/assembly'\nimport { getConf } from '@jbrowse/core/configuration'\n\n// local\nimport { LinearArcDisplayModel } from '../model'\nimport { makeFeaturePair, makeSummary } from './util'\n\nconst ArcTooltip = lazy(() => import('../../ArcTooltip'))\n\ntype LGV = LinearGenomeViewModel\n\nconst Arc = observer(function ({\n model,\n feature,\n alt,\n assembly,\n view,\n}: {\n feature: Feature\n alt?: string\n model: LinearArcDisplayModel\n assembly: Assembly\n session: AbstractSessionModel\n view: LinearGenomeViewModel\n}) {\n const [mouseOvered, setMouseOvered] = useState(false)\n const { height } = model\n const { k1, k2 } = makeFeaturePair(feature, alt)\n const ref = useRef<SVGPathElement>(null)\n const c = getConf(model, 'color', { feature, alt })\n const ra1 = assembly.getCanonicalRefName(k1.refName) || k1.refName\n const ra2 = assembly.getCanonicalRefName(k2.refName) || k2.refName\n const p1 = k1.start\n const p2 = k2.start\n const r1 = view.bpToPx({ refName: ra1, coord: p1 })?.offsetPx\n const r2 = view.bpToPx({ refName: ra2, coord: p2 })?.offsetPx\n\n if (r1 !== undefined && r2 !== undefined) {\n const radius = (r2 - r1) / 2\n const absrad = Math.abs(radius)\n const destY = Math.min(height, absrad)\n const p1 = r1 - view.offsetPx\n const p2 = r2 - view.offsetPx\n const left = p1\n const right = p2\n const col = mouseOvered ? 'black' : c\n const sw = 3\n\n return absrad > 1 ? (\n <>\n <path\n d={`M ${left} 0 C ${left} ${destY}, ${right} ${destY}, ${right} 0`}\n ref={ref}\n {...getStrokeProps(col)}\n strokeWidth={sw}\n onMouseOut={() => {\n setMouseOvered(false)\n }}\n onMouseOver={() => {\n setMouseOvered(true)\n }}\n onClick={() => {\n model.selectFeature(feature)\n }}\n fill=\"none\"\n pointerEvents=\"stroke\"\n />\n {k1.mateDirection ? (\n <line\n {...getStrokeProps(col)}\n strokeWidth={sw}\n onMouseOut={() => {\n setMouseOvered(false)\n }}\n onMouseOver={() => {\n setMouseOvered(true)\n }}\n onClick={() => {\n model.selectFeature(feature)\n }}\n x1={left}\n x2={left + k1.mateDirection * 20}\n y1={1.5}\n y2={1.5}\n />\n ) : null}\n {k2.mateDirection ? (\n <line\n {...getStrokeProps(col)}\n strokeWidth={sw}\n onMouseOut={() => {\n setMouseOvered(false)\n }}\n onMouseOver={() => {\n setMouseOvered(true)\n }}\n onClick={() => {\n model.selectFeature(feature)\n }}\n x1={right}\n x2={right + k2.mateDirection * 20}\n y1={1.5}\n y2={1.5}\n />\n ) : null}\n {mouseOvered ? (\n <Suspense fallback={null}>\n <ArcTooltip contents={makeSummary(feature, alt)} />\n </Suspense>\n ) : null}\n </>\n ) : null\n }\n return null\n})\n\nconst Wrapper = observer(function ({\n model,\n exportSVG,\n children,\n}: {\n model: LinearArcDisplayModel\n exportSVG?: boolean\n children: React.ReactNode\n}) {\n const { height } = model\n const view = getContainingView(model) as LGV\n const width = Math.round(view.dynamicBlocks.totalWidthPx)\n return exportSVG ? (\n children\n ) : (\n <svg width={width} height={height}>\n {children}\n </svg>\n )\n})\n\nconst Arcs = observer(function ({\n model,\n exportSVG,\n}: {\n model: LinearArcDisplayModel\n exportSVG?: boolean\n}) {\n const view = getContainingView(model) as LGV\n const session = getSession(model)\n const { assemblyManager } = session\n const { features } = model\n const assembly = assemblyManager.get(view.assemblyNames[0]!)\n\n return assembly ? (\n <Wrapper model={model} exportSVG={exportSVG}>\n {features?.map(f => {\n const alts = f.get('ALT') as string[] | undefined\n return (\n alts?.map(a => (\n <Arc\n key={`${f.id()}-${a}`}\n session={session}\n feature={f}\n alt={a}\n view={view}\n model={model}\n assembly={assembly}\n />\n )) ?? (\n <Arc\n key={f.id()}\n session={session}\n feature={f}\n view={view}\n model={model}\n assembly={assembly}\n />\n )\n )\n })}\n </Wrapper>\n ) : null\n})\n\nexport default Arcs\n","import React from 'react'\nimport { getContainingView, when } from '@jbrowse/core/util'\n\n// locals\nimport { LinearArcDisplayModel } from './model'\nimport Arcs from './components/Arcs'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nexport async function renderArcSvg(\n model: LinearArcDisplayModel,\n _opts: {\n rasterizeLayers?: boolean\n },\n) {\n await when(() => !model.loading)\n\n const view = getContainingView(model) as LinearGenomeViewModel\n const width = view.dynamicBlocks.totalWidthPx\n const height = model.height\n const clipid = `arc-${model.id}`\n return (\n <>\n <defs>\n <clipPath id={clipid}>\n <rect x={0} y={0} width={width} height={height} />\n </clipPath>\n </defs>\n <g clipPath={`url(#${clipid})`}>\n <Arcs model={model} exportSVG={true} />\n </g>\n </>\n )\n}\n"],"names":["makeFeaturePair","feature","alt","bnd","parseBreakend","undefined","start","get","end","strand","mate","refName","mateRefName","mateEnd","mateStart","joinDirection","mateDirection","some","a","startsWith","info","e","END","CHR2","MatePosition","matePosition","split","MateDirection","Join","k1","k2","makeSummary","assembleLocString","SVTYPE","filter","f","join","ArcTooltip","lazy","Arc","observer","model","assembly","view","mouseOvered","setMouseOvered","useState","height","ref","useRef","c","getConf","ra1","getCanonicalRefName","ra2","p1","p2","r1","bpToPx","coord","offsetPx","r2","radius","absrad","Math","abs","destY","min","left","right","col","sw","React","_extends","d","getStrokeProps","strokeWidth","onMouseOut","onMouseOver","onClick","selectFeature","fill","pointerEvents","x1","x2","y1","y2","Suspense","fallback","contents","Wrapper","exportSVG","children","getContainingView","width","round","dynamicBlocks","totalWidthPx","session","getSession","assemblyManager","features","assemblyNames","map","alts","key","id","async","renderArcSvg","_opts","when","loading","clipid","x","y","clipPath","Arcs"],"sourceRoot":""}