jbrowse-plugin-graphgenomeviewer 8.7.1 → 8.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AddTrackWorkflow-FANMD3WB.js +2 -0
- package/dist/chunks/{AddTrackWorkflow-IOPTETLH.js.map → AddTrackWorkflow-FANMD3WB.js.map} +2 -2
- package/dist/chunks/{GraphGenomeView-M4EGRLX4.js → GraphGenomeView-YRHBZFKL.js} +2 -2
- package/dist/chunks/{GraphTrackSettingsDialog-ZNZWUEN3.js → GraphTrackSettingsDialog-HBLIHBB5.js} +2 -2
- package/dist/chunks/{LinearGraphDisplay-7ESV6SY2.js → LinearGraphDisplay-KD7PNZMQ.js} +2 -2
- package/dist/chunks/{chunk-DQC5K7EW.js → chunk-5WIUEMTH.js} +2 -2
- package/dist/chunks/chunk-LPUQPLW7.js +2 -0
- package/dist/chunks/chunk-LPUQPLW7.js.map +7 -0
- package/dist/chunks/chunk-PXYYKSGK.js +2 -0
- package/dist/chunks/chunk-PXYYKSGK.js.map +7 -0
- package/dist/chunks/chunk-T7LVVBTT.js +2 -0
- package/dist/chunks/chunk-T7LVVBTT.js.map +7 -0
- package/dist/chunks/chunk-TFV57AXQ.js +3 -0
- package/dist/chunks/chunk-TFV57AXQ.js.map +7 -0
- package/dist/chunks/{chunk-6V6OOEYK.js → chunk-TUYN7C3O.js} +2 -2
- package/dist/chunks/chunk-WWF7N6AP.js +4 -0
- package/dist/chunks/chunk-WWF7N6AP.js.map +7 -0
- package/dist/chunks/{chunk-HC2YPYTO.js → chunk-Y5Q3XQOP.js} +2 -2
- package/dist/chunks/{chunk-HC2YPYTO.js.map → chunk-Y5Q3XQOP.js.map} +2 -2
- package/dist/chunks/{renderSvg-PEQY7XLR.js → renderSvg-UFS2CN6Z.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +1 -1
- package/src/GraphAddTrackWorkflow/AddTrackWorkflow.test.tsx +7 -5
- package/src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx +2 -2
- package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +13 -6
- package/src/GraphGenomeView/components/GraphSettingsDialog.test.tsx +1 -1
- package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +2 -2
- package/src/GraphGenomeView/pane/graphViews.ts +5 -0
- package/src/GraphGenomeView/pane/launchActions.ts +4 -2
- package/src/GraphGenomeView/pane/loadActions.ts +1 -1
- package/src/GraphGenomeView/pane/paneBase.ts +0 -4
- package/src/GraphGenomeView/pane/settingActions.ts +1 -1
- package/src/GraphGenomeView/viewModel.ts +6 -1
- package/src/GraphTrack/GraphTrack.test.ts +68 -0
- package/src/GraphTrack/index.ts +8 -5
- package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +55 -3
- package/src/LinearGraphDisplay/configSchema.ts +15 -2
- package/src/LinearGraphDisplay/model.ts +1 -5
- package/src/RgfaTabixAdapter/index.ts +3 -2
- package/src/graphTrackDefaults/graphTrackDefaults.test.ts +80 -3
- package/src/graphTrackDefaults/guessAdapter.ts +62 -0
- package/src/graphTrackDefaults/index.ts +16 -51
- package/src/panSNAliases/panSNAliases.test.ts +40 -6
- package/src/panSNAliases/trackAdapterConfig.ts +49 -10
- package/src/version.ts +1 -1
- package/dist/chunks/AddTrackWorkflow-IOPTETLH.js +0 -2
- package/dist/chunks/chunk-64OSFJLE.js +0 -2
- package/dist/chunks/chunk-64OSFJLE.js.map +0 -7
- package/dist/chunks/chunk-CGPYVMGQ.js +0 -2
- package/dist/chunks/chunk-CGPYVMGQ.js.map +0 -7
- package/dist/chunks/chunk-MKW7A2MK.js +0 -4
- package/dist/chunks/chunk-MKW7A2MK.js.map +0 -7
- package/dist/chunks/chunk-S7DQGZX2.js +0 -2
- package/dist/chunks/chunk-S7DQGZX2.js.map +0 -7
- package/dist/chunks/chunk-W4Y2JUP7.js +0 -3
- package/dist/chunks/chunk-W4Y2JUP7.js.map +0 -7
- /package/dist/chunks/{GraphGenomeView-M4EGRLX4.js.map → GraphGenomeView-YRHBZFKL.js.map} +0 -0
- /package/dist/chunks/{GraphTrackSettingsDialog-ZNZWUEN3.js.map → GraphTrackSettingsDialog-HBLIHBB5.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-7ESV6SY2.js.map → LinearGraphDisplay-KD7PNZMQ.js.map} +0 -0
- /package/dist/chunks/{chunk-DQC5K7EW.js.map → chunk-5WIUEMTH.js.map} +0 -0
- /package/dist/chunks/{chunk-6V6OOEYK.js.map → chunk-TUYN7C3O.js.map} +0 -0
- /package/dist/chunks/{renderSvg-PEQY7XLR.js.map → renderSvg-UFS2CN6Z.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as J,c as D,d as V,e as X,f as q,h as K}from"./chunk-T7LVVBTT.js";import"./chunk-TMM73K4C.js";import"./chunk-6VNDP3UB.js";import"./chunk-D6TY2QEG.js";import{d as M,e as P}from"./chunk-FLKXKTS2.js";import{b as w,h as R,j as v,m as x}from"./chunk-TC265JAP.js";import{i as o}from"./chunk-J2PN6CG3.js";import{A as O,B as j,C as z,F as d,a as H,f as E,g as c,o as B,s as N,t as W,u as _}from"./chunk-WE7DQVXF.js";import{b as a,c as f,d as I}from"./chunk-DUU6T2I5.js";var n=JBrowseExports["@jbrowse/core/util/tss-react"],oe=s=>n!=null&&s in Object(n)?n[s]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+s+"' from '@jbrowse/core/util/tss-react' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:s});var Q=oe("makeStyles"),ie=n&&n.__esModule?n.default:n;var se=Q()(s=>({paper:{margin:s.spacing(),padding:s.spacing()},field:{marginTop:s.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),re=["RgfaTabixAdapter","WalkTabixSyntenyAdapter","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],ne=I(function({model:t}){let{classes:i}=se(),y=v(t),h=M(t),[r,U]=o("RgfaTabixAdapter"),[l,Y]=o(),[k,G]=o(),[T,Z]=o(),m=r==="GbzBaseSyntenyAdapter",u=r==="WalkTabixSyntenyAdapter",[C,$]=o(""),[S,ee]=o(""),[b,ae]=o("Pangenome graph"),[A,g]=o(),[F,L]=o(!1);async function te(){if(!l||!t.assembly)return;g(void 0),L(!0);let e=r==="RgfaTabixAdapter"?await J(l,R(t).pluginManager):void 0;if(L(!1),!(!P(t)||!t.assembly))try{let p=b.trim();w({model:t,session:y,conf:K({choice:r,loc:l,indexLoc:k,readsLoc:m?T:void 0,manifest:e,assembly:t.assembly,sample:C,haplotypes:u?q(S):void 0,trackId:x({name:p}),name:p})})}catch(p){g(p)}}return f(O,{className:i.paper,children:[A?a(E,{error:A}):null,f(N,{children:[a(_,{children:"File type"}),a(z,{value:r,onChange:e=>{U(e.target.value),G(void 0),g(void 0)},children:re.map(e=>a(W,{value:e,control:a(j,{}),label:D[e]},e))})]}),a(c,{location:l,name:V[r],rootModel:h,setLocation:Y}),a(c,{location:k,name:X[r],rootModel:h,setLocation:G}),m?a(c,{location:T,name:"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)",rootModel:h,setLocation:Z}):null,a(d,{className:i.field,value:C,onChange:e=>{$(e.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:m?"Optional. The graph's sample for this assembly, e.g. GRCh38 where the assembly is hg38; leave blank when they share a name or the graph has one reference sample":u?"Optional. The PanSN sample this assembly is in the graph; blank takes it from the file name, GRCh38 in chr22.GRCh38.walks.bed.gz":"Optional. The PanSN prefix the graph gives this assembly, e.g. GRCh38 for HPRC's GRCh38#0#chr1; leave blank when the graph's stable names are bare",placeholder:"GRCh38",fullWidth:!0}),u?a(d,{className:i.field,value:S,onChange:e=>{ee(e.target.value)},label:"Haplotypes",slotProps:{htmlInput:{"data-testid":"graph-haplotypes-input"}},helperText:"Optional. The haplotypes the track cuts for until you pick others in its menu, as PanSN names separated by commas (HG002#1, or HG002 for both); blank is every haplotype in the file",placeholder:"HG002, HG00733",fullWidth:!0}):null,a(d,{className:i.field,value:b,label:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:e=>{ae(e.target.value)}}),a(H,{session:y,helperText:"Select assembly to add track to",selected:t.assembly,onChange:e=>{t.setAssembly(e)},fullWidth:!0}),a(B,{variant:"contained",className:i.submit,disabled:!l||!b.trim()||!t.assembly||F,onClick:()=>{te()},children:F?"Reading graph.json\u2026":"Submit"})]})}),ye=ne;export{ye as default};
|
|
2
|
+
//# sourceMappingURL=AddTrackWorkflow-FANMD3WB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["jbrowse-host:@jbrowse/core/util/tss-react", "../../src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx"],
|
|
4
|
-
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/util/tss-react\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/tss-react\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport {\n addTrackFromWidget,\n getEnv,\n getSession,\n makeTrackId,\n} from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot, isAlive } from '@jbrowse/mobx-state-tree'\nimport {\n Button,\n FormControl,\n FormControlLabel,\n FormLabel,\n Paper,\n Radio,\n RadioGroup,\n TextField,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n GRAPH_FILE_FIELDS,\n GRAPH_FILE_LABELS,\n GRAPH_INDEX_FIELDS,\n buildTrackConfig,\n parseHaplotypes,\n} from './buildTrackConfig'\nimport { readGraphManifest } from './graphManifest'\n\nimport type { GraphFileChoice } from './buildTrackConfig'\nimport type {\n AbstractRootModel,\n AddTrackWorkflowModel,\n FileLocation,\n} from '@jbrowse/core/util'\n\nconst useStyles = makeStyles()(theme => ({\n paper: {\n margin: theme.spacing(),\n padding: theme.spacing(),\n },\n field: {\n marginTop: theme.spacing(2),\n },\n submit: {\n marginTop: 25,\n marginBottom: 100,\n display: 'block',\n },\n}))\n\nconst CHOICES: GraphFileChoice[] = [\n 'RgfaTabixAdapter',\n '
|
|
5
|
-
"mappings": "udAAA,IAAMA,EAAO,eAAe,8BAA8B,EACpDC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MAAM,kCAAoCA,EAAO,8IAA6J,CAC1N,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAGC,IAAMC,EAA6BC,GAAK,YAAY,EACpDC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,EC0BxD,IAAMC,GAAYC,EAAW,EAAEC,IAAU,CACvC,MAAO,CACL,OAAQA,EAAM,QAAQ,EACtB,QAASA,EAAM,QAAQ,CACzB,EACA,MAAO,CACL,UAAWA,EAAM,QAAQ,CAAC,CAC5B,EACA,OAAQ,CACN,UAAW,GACX,aAAc,IACd,QAAS,OACX,CACF,EAAE,EAEIC,GAA6B,CACjC,mBACA,
|
|
4
|
+
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/util/tss-react\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/tss-react\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport {\n addTrackFromWidget,\n getEnv,\n getSession,\n makeTrackId,\n} from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot, isAlive } from '@jbrowse/mobx-state-tree'\nimport {\n Button,\n FormControl,\n FormControlLabel,\n FormLabel,\n Paper,\n Radio,\n RadioGroup,\n TextField,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n GRAPH_FILE_FIELDS,\n GRAPH_FILE_LABELS,\n GRAPH_INDEX_FIELDS,\n buildTrackConfig,\n parseHaplotypes,\n} from './buildTrackConfig'\nimport { readGraphManifest } from './graphManifest'\n\nimport type { GraphFileChoice } from './buildTrackConfig'\nimport type {\n AbstractRootModel,\n AddTrackWorkflowModel,\n FileLocation,\n} from '@jbrowse/core/util'\n\nconst useStyles = makeStyles()(theme => ({\n paper: {\n margin: theme.spacing(),\n padding: theme.spacing(),\n },\n field: {\n marginTop: theme.spacing(2),\n },\n submit: {\n marginTop: 25,\n marginBottom: 100,\n display: 'block',\n },\n}))\n\nconst CHOICES: GraphFileChoice[] = [\n 'RgfaTabixAdapter',\n 'WalkTabixSyntenyAdapter',\n 'GbzBaseSyntenyAdapter',\n 'MinigraphBubbleAdapter',\n]\n\nconst GraphAddTrackWidget = observer(function GraphAddTrackWidget({\n model,\n}: {\n model: AddTrackWorkflowModel\n}) {\n const { classes } = useStyles()\n const session = getSession(model)\n const rootModel = getRoot<AbstractRootModel>(model)\n const [choice, setChoice] = useState<GraphFileChoice>('RgfaTabixAdapter')\n const [loc, setLoc] = useState<FileLocation>()\n const [indexLoc, setIndexLoc] = useState<FileLocation>()\n const [readsLoc, setReadsLoc] = useState<FileLocation>()\n const gbz = choice === 'GbzBaseSyntenyAdapter'\n const walks = choice === 'WalkTabixSyntenyAdapter'\n const [sample, setSample] = useState('')\n const [haplotypes, setHaplotypes] = useState('')\n const [trackName, setTrackName] = useState('Pangenome graph')\n const [error, setError] = useState<unknown>()\n const [submitting, setSubmitting] = useState(false)\n\n async function handleSubmit() {\n if (!loc || !model.assembly) {\n return\n }\n setError(undefined)\n setSubmitting(true)\n const manifest =\n choice === 'RgfaTabixAdapter'\n ? await readGraphManifest(loc, getEnv(model).pluginManager)\n : undefined\n setSubmitting(false)\n if (!isAlive(model) || !model.assembly) {\n return\n }\n try {\n const name = trackName.trim()\n addTrackFromWidget({\n model,\n session,\n conf: buildTrackConfig({\n choice,\n loc,\n indexLoc,\n readsLoc: gbz ? readsLoc : undefined,\n manifest,\n assembly: model.assembly,\n sample,\n haplotypes: walks ? parseHaplotypes(haplotypes) : undefined,\n trackId: makeTrackId({ name }),\n name,\n }),\n })\n } catch (e) {\n setError(e)\n }\n }\n\n return (\n <Paper className={classes.paper}>\n {error ? <ErrorMessage error={error} /> : null}\n <FormControl>\n <FormLabel>File type</FormLabel>\n <RadioGroup\n value={choice}\n onChange={event => {\n setChoice(event.target.value as GraphFileChoice)\n setIndexLoc(undefined)\n setError(undefined)\n }}\n >\n {CHOICES.map(option => (\n <FormControlLabel\n key={option}\n value={option}\n control={<Radio />}\n label={GRAPH_FILE_LABELS[option]}\n />\n ))}\n </RadioGroup>\n </FormControl>\n <FileSelector\n location={loc}\n name={GRAPH_FILE_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setLoc}\n />\n <FileSelector\n location={indexLoc}\n name={GRAPH_INDEX_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setIndexLoc}\n />\n {gbz ? (\n <FileSelector\n location={readsLoc}\n name=\"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)\"\n rootModel={rootModel}\n setLocation={setReadsLoc}\n />\n ) : null}\n <TextField\n className={classes.field}\n value={sample}\n onChange={event => {\n setSample(event.target.value)\n }}\n label=\"Sample name in the graph\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-sample-input' } }}\n helperText={\n gbz\n ? \"Optional. The graph's sample for this assembly, e.g. GRCh38 where the assembly is hg38; leave blank when they share a name or the graph has one reference sample\"\n : walks\n ? 'Optional. The PanSN sample this assembly is in the graph; blank takes it from the file name, GRCh38 in chr22.GRCh38.walks.bed.gz'\n : \"Optional. The PanSN prefix the graph gives this assembly, e.g. GRCh38 for HPRC's GRCh38#0#chr1; leave blank when the graph's stable names are bare\"\n }\n placeholder=\"GRCh38\"\n fullWidth\n />\n {walks ? (\n <TextField\n className={classes.field}\n value={haplotypes}\n onChange={event => {\n setHaplotypes(event.target.value)\n }}\n label=\"Haplotypes\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-input' } }}\n helperText=\"Optional. The haplotypes the track cuts for until you pick others in its menu, as PanSN names separated by commas (HG002#1, or HG002 for both); blank is every haplotype in the file\"\n placeholder=\"HG002, HG00733\"\n fullWidth\n />\n ) : null}\n <TextField\n className={classes.field}\n value={trackName}\n label=\"Track name\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-track-name-input' } }}\n onChange={event => {\n setTrackName(event.target.value)\n }}\n />\n <AssemblySelector\n session={session}\n helperText=\"Select assembly to add track to\"\n selected={model.assembly}\n onChange={arg => {\n model.setAssembly(arg)\n }}\n fullWidth\n />\n <Button\n variant=\"contained\"\n className={classes.submit}\n disabled={!loc || !trackName.trim() || !model.assembly || submitting}\n onClick={() => {\n void handleSubmit()\n }}\n >\n {submitting ? 'Reading graph.json\u2026' : 'Submit'}\n </Button>\n </Paper>\n )\n})\n\nexport default GraphAddTrackWidget\n"],
|
|
5
|
+
"mappings": "udAAA,IAAMA,EA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AAUrC,EACV,KAAK,4FACL,UAAWT,EACX,YAAaU,EACf,EACE,KACJ0B,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOgB,EACP,SAAU4B,GAAS,CACjB3B,EAAU2B,EAAM,OAAO,KAAK,CAC9B,EACA,MAAM,2BACN,UAAW,CAAE,UAAW,CAAE,cAAe,oBAAqB,CAAE,EAChE,WACE9B,EACI,mKACAC,EACE,mIACA,qJAER,YAAY,SACZ,UAAS,GACX,EACCA,EACCwB,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOkB,EACP,SAAU0B,GAAS,CACjBzB,GAAcyB,EAAM,OAAO,KAAK,CAClC,EACA,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,WAAW,uLACX,YAAY,iBACZ,UAAS,GACX,EACE,KACJL,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOoB,EACP,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,SAAUwB,GAAS,CACjBvB,GAAauB,EAAM,OAAO,KAAK,CACjC,EACF,EACAL,EAACc,EAAA,CACC,QAASpD,EACT,WAAW,kCACX,SAAUF,EAAM,SAChB,SAAUuD,GAAO,CACfvD,EAAM,YAAYuD,CAAG,CACvB,EACA,UAAS,GACX,EACAf,EAACgB,EAAA,CACC,QAAQ,YACR,UAAWvD,EAAQ,OACnB,SAAU,CAACQ,GAAO,CAACY,EAAU,KAAK,GAAK,CAACrB,EAAM,UAAYyB,EAC1D,QAAS,IAAM,CACRE,GAAa,CACpB,EAEC,SAAAF,EAAa,2BAAwB,SACxC,GACF,CAEJ,CAAC,EAEMgC,GAAQ3D",
|
|
6
6
|
"names": ["host", "read", "name", "makeStyles", "read", "tss_react_default", "host", "useStyles", "makeStyles", "theme", "CHOICES", "GraphAddTrackWidget", "observer", "model", "classes", "session", "getSession", "rootModel", "getRoot", "choice", "setChoice", "useState", "loc", "setLoc", "indexLoc", "setIndexLoc", "readsLoc", "setReadsLoc", "gbz", "walks", "sample", "setSample", "haplotypes", "setHaplotypes", "trackName", "setTrackName", "error", "setError", "submitting", "setSubmitting", "handleSubmit", "manifest", "readGraphManifest", "getEnv", "isAlive", "name", "addTrackFromWidget", "buildTrackConfig", "parseHaplotypes", "makeTrackId", "e", "jsxs", "Paper", "jsx", "ErrorMessage", "FormControl", "FormLabel", "RadioGroup", "event", "option", "FormControlLabel", "Radio", "GRAPH_FILE_LABELS", "FileSelector", "GRAPH_FILE_FIELDS", "GRAPH_INDEX_FIELDS", "TextField", "AssemblySelector", "arg", "Button", "AddTrackWorkflow_default"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-TUYN7C3O.js";import"./chunk-Y5Q3XQOP.js";import"./chunk-5WIUEMTH.js";import"./chunk-WWF7N6AP.js";import{s as d}from"./chunk-LPUQPLW7.js";import"./chunk-TFV57AXQ.js";import"./chunk-T3FHGWNW.js";import"./chunk-PXYYKSGK.js";import"./chunk-46O3IEW3.js";import"./chunk-G6NFDDMN.js";import"./chunk-VPZZ6XMM.js";import"./chunk-YBLNN5FU.js";import"./chunk-5TT5TG4Q.js";import"./chunk-WJHTNDTQ.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-2FG67WIZ.js";import"./chunk-TMM73K4C.js";import"./chunk-6VNDP3UB.js";import"./chunk-FLKXKTS2.js";import"./chunk-TC265JAP.js";import{i as L}from"./chunk-J2PN6CG3.js";import{A as l,F as G,H as p,e as s,j as v,o as n,x as y}from"./chunk-WE7DQVXF.js";import{a as h,b as e,c as r,d as i}from"./chunk-DUU6T2I5.js";var N=d()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}}),S=i(function({model:a}){let{classes:t}=N();return!a.error&&!a.loadCanceled?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[e(v,{variant:"h6",message:a.statusMessage||void 0}),a.canCancelLoad?e(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{a.cancelLoad()},children:"Cancel"}):null]}),e(y,{variant:"indeterminate"})]}):a.error?e(l,{className:t.paper,children:e(s,{error:a.error,onReset:()=>{a.retryLoad()}})}):e(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[e(p,{variant:"h6",children:"Loading canceled"}),e(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{a.retryLoad()},children:"Retry"})]})})}),f=S;var T=`H VN:Z:1.0
|
|
2
2
|
S 1 ACGT
|
|
3
3
|
S 2 GGCC
|
|
4
4
|
S 3 TTAA
|
|
@@ -7,4 +7,4 @@ L 1 + 2 + 0M
|
|
|
7
7
|
L 1 + 3 + 0M
|
|
8
8
|
L 2 + 4 + 0M
|
|
9
9
|
L 3 + 4 + 0M`,E=d()({column:{display:"flex",flexDirection:"column",gap:8},rowEnd:{display:"flex",gap:8,alignItems:"flex-end"},rowCenter:{display:"flex",gap:8,alignItems:"center"},flex1:{flex:1},paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto"},header:{marginBottom:12},footer:{marginTop:12,display:"flex",justifyContent:"flex-end"}}),F=i(function({model:a}){let{classes:t}=E(),[m,w]=L("");function u(){let o=m.trim();o&&a.openGfaLocation({uri:o,locationType:"UriLocation"})}function M(o){let c=o.target.files?.[0];o.target.value="",c&&a.loadGFAFile(c,c.name)}return r(l,{className:t.paper,children:[e("div",{className:t.header,children:e(p,{variant:"h6",children:"Load a GFA graph"})}),r("div",{className:t.column,children:[r("div",{className:t.rowCenter,children:[r(n,{variant:"outlined",component:"label",size:"small",children:["Choose file",e("input",{type:"file",accept:".gfa,.gfa1,.gfa2,.gz",hidden:!0,onChange:o=>{M(o)}})]}),e(p,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),r("div",{className:t.rowEnd,children:[e(G,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:m,onChange:o=>{w(o.target.value)},onKeyDown:o=>{o.key==="Enter"&&u()},className:t.flex1}),e(n,{variant:"contained",onClick:()=>{u()},disabled:!m.trim(),children:"Open"})]})]}),e("div",{className:t.footer,children:e(n,{size:"small",onClick:()=>{a.loadGFA(T,"Example graph")},children:"Load 4-node example"})}),a.error?e(s,{error:a.error}):null]})}),x=F;var B=i(function({model:a}){return a.hasGraph?e(C,{model:a}):a.canRetryLoad?e(f,{model:a}):r(h,{children:[a.isLoading?e(f,{model:a}):null,e("div",{hidden:a.isLoading,children:e(x,{model:a})})]})}),q=B;export{q as default};
|
|
10
|
-
//# sourceMappingURL=GraphGenomeView-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-YRHBZFKL.js.map
|
package/dist/chunks/{GraphTrackSettingsDialog-ZNZWUEN3.js → GraphTrackSettingsDialog-HBLIHBB5.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as G,b as L}from"./chunk-
|
|
1
|
+
import{a as G,b as L}from"./chunk-Y5Q3XQOP.js";import{e as v,f as x,s as f}from"./chunk-LPUQPLW7.js";import"./chunk-PXYYKSGK.js";import"./chunk-46O3IEW3.js";import"./chunk-WJHTNDTQ.js";import"./chunk-QUDJ7AM3.js";import"./chunk-2FG67WIZ.js";import"./chunk-TMM73K4C.js";import"./chunk-6VNDP3UB.js";import{h as g,i as d}from"./chunk-J2PN6CG3.js";import{F as y,H as h,n as H}from"./chunk-WE7DQVXF.js";import{b as p,c as i,d as s}from"./chunk-DUU6T2I5.js";var k=f()({section:{marginBottom:24}}),w=[{value:"0",label:"None"},{value:"1",label:"1 hop"},{value:"2",label:"2 hops"}],F=s(function({model:t}){let{classes:o}=k(),e=t.sourceAdapter;return e?.type==="RgfaTabixAdapter"&&!v(e)?i("div",{className:o.section,children:[p(G,{label:"Graph context",sx:{minWidth:200},value:String(t.subgraphContext),options:w,testId:"graph-context-select",onChange:n=>{t.setSubgraphContext(Number(n)),t.recut()}}),p(h,{variant:"caption",component:"div",color:"text.secondary",children:"How far the cut follows links out of the region. At none, a detour that leaves the window draws as two stubs. No effect on gfa-to-tabix's default anchored index."})]}):null}),M=F;var I=f()({section:{marginBottom:24}});function A(a){return a.split(/[\s,]+/).filter(t=>t!=="")}var N=(a,t)=>a.join(`
|
|
2
2
|
`)===t.join(`
|
|
3
3
|
`);function P(a,t){let o=a.cutHaplotypes??[],[e,n]=d(o);return N(o,e)||(n(o),t()),r=>{N(r,o)||(n(r),a.setSubgraphHaplotypes(r),a.recut())}}var D=s(function({model:t}){let[o,e]=d(t.cutHaplotypes?.join(", ")??""),n=P(t,()=>{e(t.cutHaplotypes?.join(", ")??"")}),r=()=>{n(A(o))};return p(y,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:o,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:c=>{e(c.target.value)},onBlur:()=>{r()},onKeyDown:c=>{c.key==="Enter"&&r()}})}),B=s(function({model:t,names:o}){let[e,n]=d(t.cutHaplotypes??[]),r=g(e),c=g(""),[b,S]=d(!1),C=P(t,()=>{r.current=t.cutHaplotypes??[],n(r.current)});return p(H,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:o,value:e,open:b,onOpen:()=>{S(!0)},onInputChange:(u,l)=>{c.current=l},onClose:(u,l)=>{S(!1);let m=c.current.trim();l==="blur"&&m&&!r.current.includes(m)&&(r.current=[...r.current,m],n(r.current)),C(r.current)},onChange:(u,l)=>{r.current=l,n(l),b||C(l)},renderInput:u=>p(y,{...u,label:"Haplotypes",placeholder:e.length===0?"every haplotype":void 0,slotProps:{...u.slotProps,htmlInput:{...u.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),O=s(function({model:t}){let{classes:o}=I(),e=t.haplotypeNames,n=t.sourceAdapter;return n&&x(n)?i("div",{className:o.section,children:[e?p(B,{model:t,names:e}):p(D,{model:t}),i(h,{variant:"caption",component:"div",color:"text.secondary",children:[e?`Which of the graph's ${e.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`:"Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas."," ","Empty is every haplotype."]})]}):null}),T=O;var ot=s(function({model:t,onClose:o}){return i(L,{model:t,onClose:o,children:[p(M,{model:t}),p(T,{model:t})]})});export{ot as default};
|
|
4
|
-
//# sourceMappingURL=GraphTrackSettingsDialog-
|
|
4
|
+
//# sourceMappingURL=GraphTrackSettingsDialog-HBLIHBB5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=LinearGraphDisplay-
|
|
1
|
+
import{a,b as i}from"./chunk-TUYN7C3O.js";import"./chunk-Y5Q3XQOP.js";import"./chunk-5WIUEMTH.js";import"./chunk-WWF7N6AP.js";import"./chunk-LPUQPLW7.js";import"./chunk-TFV57AXQ.js";import"./chunk-T3FHGWNW.js";import"./chunk-PXYYKSGK.js";import"./chunk-46O3IEW3.js";import"./chunk-G6NFDDMN.js";import"./chunk-VPZZ6XMM.js";import"./chunk-YBLNN5FU.js";import"./chunk-5TT5TG4Q.js";import"./chunk-WJHTNDTQ.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-2FG67WIZ.js";import"./chunk-TMM73K4C.js";import"./chunk-6VNDP3UB.js";import"./chunk-FLKXKTS2.js";import"./chunk-TC265JAP.js";import"./chunk-J2PN6CG3.js";import"./chunk-WE7DQVXF.js";import{b as o,d as t}from"./chunk-DUU6T2I5.js";var e=JBrowseExports["@jbrowse/display-kit/DisplayChrome"];var s=e&&e.__esModule?e.default:e;var p=t(function({model:r}){return o(s,{model:r,factory:a,testid:"linear-graph-display","data-layout":r.chosenLayoutMode,"data-cut-tier":r.cutTier,"data-recuts":r.recuts,"data-node-count":r.hasGraph?r.nodeCount:void 0,"data-loading":r.isLoading?"":void 0,style:{width:r.paneWidth,height:r.height,overflow:"hidden"},children:n=>o(i,{model:r,handle:n})})}),c=p;export{c as default};
|
|
2
|
+
//# sourceMappingURL=LinearGraphDisplay-KD7PNZMQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Aa as Ye,Cb as ue,D as $e,Db as de,E as Ke,F as Xe,G as Ue,Ia as P,Ib as Qe,J as Fe,Ja as se,Kb as W,Lb as be,Mb as fe,Oa as ze,Pa as ie,Qb as et,Sa as Ve,Sb as tt,Ub as nt,Va as qe,Wa as le,Wb as he,_a as ce,_b as rt,a as Se,b as X,dc as ot,eb as je,f as Q,g as ee,jc as at,lc as st,mb as Je,ob as pe,r as Ie,rb as Ze,s as Be,t as We,u as oe,w as Ge,x as De,y as He}from"./chunk-W4Y2JUP7.js";import{D as ae,f as Oe,m as A,p as re,q as Ae,r as I}from"./chunk-T3FHGWNW.js";import{A as Ee,E as ne,T as ve,U as Ne,Z as Te,m as T,o as F,p as te,x as _e}from"./chunk-46O3IEW3.js";import{b as _,c as B}from"./chunk-G6NFDDMN.js";import{c as Z}from"./chunk-VPZZ6XMM.js";import{e as K}from"./chunk-FLKXKTS2.js";import{b as Pe,d as L,e as Le,f as Me,g as U,h as Ce}from"./chunk-J2PN6CG3.js";import{a as v,b as p,c as m,d as g}from"./chunk-DUU6T2I5.js";var Et="data-pans-with-drawing";function it(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var M=g(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return p("svg",{style:{...it(n,r),userSelect:a?"none":void 0},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Et]:""}:{},children:i})}),lt=g(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return p("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),C=g(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ce(null);return Le(()=>{if(r)return Se(()=>{let s=i.current,u=s?.getContext("2d");if(s&&u){let c=t.paneWidth,d=t.canvasHeight;Ye(st());let b=Qe(s,c,d);u.setTransform(b,0,0,b,0,0),u.clearRect(0,0,c,d),a(u,b)}})},[t,r,a]),p("canvas",{ref:i,"data-testid":r?o:void 0,style:{...it(n),display:r?"block":"none"}})});var Ot=g(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*et;return p(M,{model:t,zIndex:2,testId:"graph-bubble-halos",children:p(lt,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&_(a.bubble,r))).map(a=>p("path",{d:a.path,fill:"none",stroke:P[a.kind],strokeOpacity:r&&_(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},B(a.bubble)))})})}),Kn=Ot;var ct=["#d4735e","#d8a94a","#c98aa4"],vt="#e6e6e6",Nt="#555",Tt="bold 11px sans-serif";var ge=e=>ct[e]??vt;function Y(e){let t=String.fromCharCode(65+e%26);return e<26?t:Y(Math.floor(e/26)-1)+t}var z=ct.length;function pt(e,t,n){e.font=Tt,e.textAlign="center",e.textBaseline="middle";for(let{row:r,start:o,bp:a,block:i}of t){let s=n.x(o),u=n.x(o+a)-s,c=n.rowCentre(r)-n.barPx/2;e.fillStyle=ge(i),e.fillRect(s,c,u,n.barPx),e.strokeStyle=Nt,e.lineWidth=1,e.strokeRect(s+.5,c+.5,u-1,n.barPx-1),u>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(Y(i),s+u/2,n.rowCentre(r)))}}var R=18,ke=32,bt="rgba(160, 160, 160, 0.45)",It="#18181c",Bt=6,ft=7,Wt="#b8b8c0",V=Be-4,Gt="rgba(119, 119, 119, 0.85)",Dt=15,ut=10;function j(e){return e.kind==="fill"?e.width??R:R}var me=e=>e.length>1?3:4;function G(e){switch(e.kind){case"fill":return e.height??8;case"bands":return me(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"blank":return 0}}function Gr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,j(n.swatch)):t,0)}function Dr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(G(n.swatch))+3):t,Dt)}var y=e=>[{offset:0,color:e}];function q(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:y(t),width:ut,height:ut,edged:!0}}}function dt(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}function Ht(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(r=>_(r.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:P[n.kind]}:{kind:"blank"},closesBubble:!0}]}function $t(e){let t=e.walkLift?void 0:e.referenceRampDomain;if(!t)return[];let n=Math.round(t.start),r=Math.round(t.end);return[{key:"ramp",label:`position on ${e.graph?Z(e.graph):"reference"}`,swatch:{kind:"fill",stops:A,width:ke},under:`${n.toLocaleString("en-US")}-${r.toLocaleString("en-US")} (${ne(r-n)})`},...e.referenceRampDrawsOffReference?[q("off",I,"off the reference")]:[]]}function Kt(e){let t=e.walkLift;if(t)return t.walks.map(o=>ae(o.encoding));if(e.effectiveColorScheme==="reference-position")return[A];let n=e.referenceStripBlocks.map(o=>o.colors[0]).filter((o,a,i)=>o!==i[a-1]),r=Math.min(Bt,n.length);return[r===0?y(re):Array.from({length:r},(o,a)=>({offset:r>1?a/(r-1):0,color:n[r>1?Math.round(a*(n.length-1)/(r-1)):0]}))]}function Xt(e){if(!e.referenceStripShown)return[];let t=(e.walkLift?.walks.length??0)>1;return[{key:"strip",label:`reference${t?", a row per walk":""}`,swatch:{kind:"bands",bands:Kt(e)}},...e.referenceStripFaded?[q("strip-faded",re,e.walkLift?`reference not on ${t?"that row's walk":e.liftedWalksLabel}`:"reference outside the open bubble")]:[],...e.referenceStripOverhangs?[{key:"overhang",label:"graph runs past this edge",swatch:{kind:"overhang"}}]:[]]}function Ut(e){let t=new Map;for(let n of e.bubbleHalos)if(!n.whole){let r=P[n.kind],o=t.get(r)??new Set;o.add(se[n.kind]),t.set(r,o)}return[...t].map(([n,r])=>{let o=[...r].join(" or ");return{key:`halo-${n}`,label:o===se.superbubble?o:`${o} bubble`,swatch:{kind:"halo",color:n}}})}function ht(e){let{graph:t}=e;return t&&Ee(e.deletions,e.walkLift).length>0?[{key:"deletion",label:_e(Z(t)),swatch:{kind:"line",color:e.walkLift?bt:It,dashed:!0}}]:[]}function we(e,t,n,r){return{key:e,label:t,swatch:{kind:"fill",stops:y(r),width:ke,height:n}}}var Ft=e=>e>=10?Math.round(e):Math.round(e*10)/10;function Yt(e){let{graph:t,contigThickness:n,depthRange:r}=e;if(!t||!e.drawsNodes||e.walkRowBars)return[];if(e.nodeWidth==="frequency"){let c=t.nodes.some(d=>d.frequency!==void 0);return ve(n).map(({label:d,widthPx:b})=>we(`width-${d}`,c?`AF ${d}`:`${d} of haplotypes`,b,I))}if(e.nodeWidth!=="depth"||!r||r.min===r.max)return[];let o=t.paths?.length??0,a=o>0,i=[...new Set([r.max,r.mean,r.min].map(a?Math.round:Ft))],s=i[0]>o,u=c=>s?`${c.toLocaleString("en-US")} walk pass${c===1?"":"es"}`:`${c.toLocaleString("en-US")} walk${c===1?"":"s"}`;return i.map(c=>we(`width-${c}`,a?u(c):`depth ${c.toLocaleString("en-US")}`,Ne({depth:c},n,"depth",r.mean),I))}function zt(e){let t=e.busiestLink;return!e.drawsNodes||e.walkRowBars||e.linkWidth!=="walks"||t===0?[]:(t>1?[t,1]:[1]).map(r=>we(`link-width-${r}`,`${r.toLocaleString("en-US")} walk${r===1?"":"s"}`,e.connectorThickness*Te(r,t,"walks"),Gt))}function Vt(e){return e.genePins.some(t=>t.exonsByNode.length>0)?[{key:"exon",label:"exon",swatch:{kind:"outline",color:W,stroke:2,radius:5,height:8}}]:[]}function qt(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function jt(e){return e.pathLegend.map(({name:t,label:n,color:r})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:r}}))}function E(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:ft,square:!0}}}function Jt(e){let{roles:t,haplotypeTube:n,bundled:r,values:o,logWidths:a,foldBp:i,forwardReads:s,reverseReads:u,substitution:c,insertion:d,deletion:b}=e.tubeMapKeys,h=e.readsShown,l=[];if(o){l.push(E("value-reference",y(pe),"reference"));for(let{value:f,color:w}of o)l.push(E(`value-${f}`,y(w),f))}return t&&l.push(E("ref",y(pe),"reference"),E("hap",y(n),r?"shared route, \xD7n haplotypes":"haplotype")),s&&l.push(E("fwd",dt(Q),"read on the forward strand")),u&&l.push(E("rev",dt(ee),"read on the reverse strand")),h&&h.shown<h.total&&l.push({key:"sampled",label:`${h.shown.toLocaleString("en-US")} of ${h.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),c&&l.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),d&&l.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),b&&l.push(E("del",y("grey"),"read deletion")),i!==void 0&&l.push({key:"tube-fold",label:`haplotype variant < ${ne(i)}`,swatch:{kind:"tick",color:qe(),height:ft,backing:Wt}}),a&&l.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),l}function Zt(e){return e.kind==="gene"?{kind:"outline",color:Ie,stroke:1.5,radius:0,height:V}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?A:y(e.fill),height:e.kind==="gap"?e.px:V}}function Qt(e){let t=new Set(e.sharedBlocks?.map(r=>r.block)),n=r=>({kind:"fill",stops:y(ge(r)),height:V});return[...[...t].filter(r=>r<z).sort((r,o)=>r-o).map(r=>({key:`block-${r}`,label:`${Y(r)}: off the reference, walked by several rows`,swatch:n(r)})),...[...t].some(r=>r>=z)?[{key:"block-more",label:"more shared blocks",swatch:n(z)}]:[]]}function en(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(o=>o.call??[]),r=(o,a,i)=>({key:o,label:i,swatch:{kind:"tick",color:a,height:V}});return[...$e(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation}).map(o=>({key:`rows-${o.label}`,label:o.label,swatch:o.note?void 0:Zt(o.swatch)})),...Qt(e),...n.some(o=>o.spanningReads!==0)?[r("call",Ke,"allele length called for this walk")]:[],...n.some(o=>o.spanningReads===0)?[r("unbacked",Xe,"called with no read spanning it")]:[],...n.some(o=>o.agrees===!1)?[r("disagrees",Ue,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function tn(e,t){let n=rt(t,e.walkReference);return{key:`walk-${t.name}`,strong:e.walkLabel(t.name),label:n.delta+n.gaps+n.reversed,swatch:{kind:"fill",stops:ae(t.encoding),width:n.shades?ke:R},under:n.scale,title:n.hover,walk:t}}function gt(e,t){return[...e.liftPaintsOffReference?[q("lift-off",I,"off the reference")]:[],q("faded",bt,t)]}function nn(e){let t=e.walkLift;if(!t||e.facetPanels)return[];let n=t.walks.map(o=>tn(e,o)),r=e.graph?he(e.graph,t,e.liftedWalksLabel):`not on ${e.liftedWalksLabel}`;return[...n,...gt(e,r)]}function Hr(e){let{graph:t,facetPanels:n}=e;if(!t||!n)return[];let r=new Set(n.map(o=>he(t,o,"the panel's walk")));return[...gt(e,r.size===1?[...r][0]:"not on the panel's walk"),...ht(e)]}function $r(e){let t=[{testid:"graph-open-bubble-legend",rows:Ht(e)},{testid:"graph-ramp-legend",rows:$t(e),group:"Color"},{testid:"graph-walk-readout",rows:nn(e),group:"Walks"},{testid:"graph-width-legend",rows:Yt(e),group:"Node thickness"},{testid:"graph-link-width-legend",rows:zt(e),group:"Link thickness"},{testid:"graph-halo-legend",rows:Ut(e),group:"Marks"},{testid:"graph-deletion-legend",rows:ht(e),group:"Marks"},{testid:"graph-gene-legend",rows:Vt(e),group:"Marks"},{testid:"graph-path-legend",rows:jt(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:Jt(e),group:"Tube map"},{testid:"graph-walk-rows-legend",rows:en(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:Xt(e),group:"Top strip"},{testid:"graph-fold-legend",rows:qt(e)}].filter(o=>o.rows.length>0);if(new Set(t.flatMap(o=>o.group??[])).size<2)return t;let r=new Set;return t.map((o,a)=>{let{group:i}=o;return i?r.has(i)?o:(r.add(i),{...o,heading:i}):a===0?o:{...o,spaced:!0}})}function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function wt(e,t){if(typeof e=="string")return e;let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return Pe(e.tag,n,e.children.map(wt))}function N(){return Me().replaceAll(/[^\w-]/g,"")}function D({el:e}){return wt(e,0)}var on="rgba(0, 0, 0, 0.28)";function kt({id:e,x:t,y:n,stops:r,width:o,height:a,square:i,edged:s}){let u=s?.5:0,c=d=>p("rect",{x:t+u,y:n+u,width:o-u*2,height:a-u*2,rx:i?0:2,fill:d,stroke:s?on:void 0});return r.length>1?m(v,{children:[p("defs",{children:p("linearGradient",{id:e,children:r.map((d,b)=>p("stop",{offset:d.offset,stopColor:d.color},b))})}),c(`url(#${e})`)]}):c(r[0].color)}function an({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let o=G(e);return p(kt,{id:n,x:t,y:-5-o/2,stops:e.stops,width:j(e),height:o,square:e.square,edged:e.edged})}case"bands":{let o=me(e.bands),a=-5-G(e)/2;return p(v,{children:e.bands.map((i,s)=>p(kt,{id:`${n}-${s}`,x:t,y:a+s*o,stops:i,width:R,height:o,square:!0},s))})}case"line":return e.dashed?p("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):p("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return p("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let o=e.stroke/2;return p("rect",{x:t+o,y:-5-e.height/2+o,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-o),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return p("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"glyph":return p("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let o=-5-e.height/2;return m(v,{children:[e.backing?p("rect",{x:t,y:o,width:R,height:e.height,fill:e.backing}):null,p("rect",{x:t+R/2-1,y:o,width:2,height:e.height,fill:e.color})]})}case"bracket":return p("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:ze()});case"blank":return null}}var qr=g(function({swatch:t}){let n=N(),r=G(t);return p("svg",{width:j(t),height:r,overflow:"visible",style:{flex:"none"},children:p("g",{transform:`translate(0 ${r/2+5})`,children:p(an,{swatch:t,x:0,id:n})})})});var Zr={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Qr={display:"flex",alignItems:"center",gap:5},eo={color:"#666"},sn="#6b7479",to=4,no={color:sn,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};var ln=g(function({model:t}){let n=`exon-outline-${N()}`,r=U(()=>X(()=>{let{genePins:b,walkLift:h}=t,l=h?void 0:t.openBubbleFocus,f=l?b.map(w=>({...w,exonsByNode:w.exonsByNode.filter(k=>l.nodeIds.has(k.nodeId))})):b;return be(f,t.nodeInk.halfWidthPx,h)}),[t]),{scaleX:o,scaleY:a,translateX:i,translateY:s,paneWidth:u,canvasHeight:c}=t,d=fe(r.get(),{id:n,width:u,height:c,transform:`translate(${i} ${s}) scale(${o} ${a})`});return d?p(M,{model:t,zIndex:2,testId:"graph-gene-pins",children:p(D,{el:d})}):null}),po=ln;function mt(e,t,n){return{x:e-n/2,y:t-T-F+2,width:n,height:T+F*2-2}}function Rt(e,t,n){let r=mt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var J=g(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:u,dimmed:c,title:d,testId:b,onClick:h,onHover:l}){return m("g",{style:{pointerEvents:h||l?"auto":"none",cursor:h?"pointer":void 0,opacity:c?.35:1},"data-testid":b,onClick:h,onMouseEnter:()=>{l?.(!0)},onMouseLeave:()=>{l?.(!1)},...h&&{role:"button",tabIndex:0,"aria-label":(d??o).replaceAll(`
|
|
1
|
+
import{Aa as Ye,Cb as ue,D as $e,Db as de,E as Ke,F as Xe,G as Ue,Ia as P,Ib as Qe,J as Fe,Ja as se,Kb as W,Lb as be,Mb as fe,Oa as ze,Pa as ie,Qb as et,Sa as Ve,Sb as tt,Ub as nt,Va as qe,Wa as le,Wb as he,_a as ce,_b as rt,a as Se,b as X,dc as ot,eb as je,f as Q,g as ee,jc as at,lc as st,mb as Je,ob as pe,r as Ie,rb as Ze,s as Be,t as We,u as oe,w as Ge,x as De,y as He}from"./chunk-TFV57AXQ.js";import{D as ae,f as Oe,m as A,p as re,q as Ae,r as I}from"./chunk-T3FHGWNW.js";import{A as Ee,E as ne,T as ve,U as Ne,Z as Te,m as T,o as F,p as te,x as _e}from"./chunk-46O3IEW3.js";import{b as _,c as B}from"./chunk-G6NFDDMN.js";import{c as Z}from"./chunk-VPZZ6XMM.js";import{e as K}from"./chunk-FLKXKTS2.js";import{b as Pe,d as L,e as Le,f as Me,g as U,h as Ce}from"./chunk-J2PN6CG3.js";import{a as v,b as p,c as m,d as g}from"./chunk-DUU6T2I5.js";var Et="data-pans-with-drawing";function it(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var M=g(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return p("svg",{style:{...it(n,r),userSelect:a?"none":void 0},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Et]:""}:{},children:i})}),lt=g(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return p("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),C=g(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ce(null);return Le(()=>{if(r)return Se(()=>{let s=i.current,u=s?.getContext("2d");if(s&&u){let c=t.paneWidth,d=t.canvasHeight;Ye(st());let b=Qe(s,c,d);u.setTransform(b,0,0,b,0,0),u.clearRect(0,0,c,d),a(u,b)}})},[t,r,a]),p("canvas",{ref:i,"data-testid":r?o:void 0,style:{...it(n),display:r?"block":"none"}})});var Ot=g(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*et;return p(M,{model:t,zIndex:2,testId:"graph-bubble-halos",children:p(lt,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&_(a.bubble,r))).map(a=>p("path",{d:a.path,fill:"none",stroke:P[a.kind],strokeOpacity:r&&_(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},B(a.bubble)))})})}),Kn=Ot;var ct=["#d4735e","#d8a94a","#c98aa4"],vt="#e6e6e6",Nt="#555",Tt="bold 11px sans-serif";var ge=e=>ct[e]??vt;function Y(e){let t=String.fromCharCode(65+e%26);return e<26?t:Y(Math.floor(e/26)-1)+t}var z=ct.length;function pt(e,t,n){e.font=Tt,e.textAlign="center",e.textBaseline="middle";for(let{row:r,start:o,bp:a,block:i}of t){let s=n.x(o),u=n.x(o+a)-s,c=n.rowCentre(r)-n.barPx/2;e.fillStyle=ge(i),e.fillRect(s,c,u,n.barPx),e.strokeStyle=Nt,e.lineWidth=1,e.strokeRect(s+.5,c+.5,u-1,n.barPx-1),u>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(Y(i),s+u/2,n.rowCentre(r)))}}var R=18,ke=32,bt="rgba(160, 160, 160, 0.45)",It="#18181c",Bt=6,ft=7,Wt="#b8b8c0",V=Be-4,Gt="rgba(119, 119, 119, 0.85)",Dt=15,ut=10;function j(e){return e.kind==="fill"?e.width??R:R}var me=e=>e.length>1?3:4;function G(e){switch(e.kind){case"fill":return e.height??8;case"bands":return me(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"blank":return 0}}function Gr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,j(n.swatch)):t,0)}function Dr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(G(n.swatch))+3):t,Dt)}var y=e=>[{offset:0,color:e}];function q(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:y(t),width:ut,height:ut,edged:!0}}}function dt(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}function Ht(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(r=>_(r.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:P[n.kind]}:{kind:"blank"},closesBubble:!0}]}function $t(e){let t=e.walkLift?void 0:e.referenceRampDomain;if(!t)return[];let n=Math.round(t.start),r=Math.round(t.end);return[{key:"ramp",label:`position on ${e.graph?Z(e.graph):"reference"}`,swatch:{kind:"fill",stops:A,width:ke},under:`${n.toLocaleString("en-US")}-${r.toLocaleString("en-US")} (${ne(r-n)})`},...e.referenceRampDrawsOffReference?[q("off",I,"off the reference")]:[]]}function Kt(e){let t=e.walkLift;if(t)return t.walks.map(o=>ae(o.encoding));if(e.effectiveColorScheme==="reference-position")return[A];let n=e.referenceStripBlocks.map(o=>o.colors[0]).filter((o,a,i)=>o!==i[a-1]),r=Math.min(Bt,n.length);return[r===0?y(re):Array.from({length:r},(o,a)=>({offset:r>1?a/(r-1):0,color:n[r>1?Math.round(a*(n.length-1)/(r-1)):0]}))]}function Xt(e){if(!e.referenceStripShown)return[];let t=(e.walkLift?.walks.length??0)>1;return[{key:"strip",label:`reference${t?", a row per walk":""}`,swatch:{kind:"bands",bands:Kt(e)}},...e.referenceStripFaded?[q("strip-faded",re,e.walkLift?`reference not on ${t?"that row's walk":e.liftedWalksLabel}`:"reference outside the open bubble")]:[],...e.referenceStripOverhangs?[{key:"overhang",label:"graph runs past this edge",swatch:{kind:"overhang"}}]:[]]}function Ut(e){let t=new Map;for(let n of e.bubbleHalos)if(!n.whole){let r=P[n.kind],o=t.get(r)??new Set;o.add(se[n.kind]),t.set(r,o)}return[...t].map(([n,r])=>{let o=[...r].join(" or ");return{key:`halo-${n}`,label:o===se.superbubble?o:`${o} bubble`,swatch:{kind:"halo",color:n}}})}function ht(e){let{graph:t}=e;return t&&Ee(e.deletions,e.walkLift).length>0?[{key:"deletion",label:_e(Z(t)),swatch:{kind:"line",color:e.walkLift?bt:It,dashed:!0}}]:[]}function we(e,t,n,r){return{key:e,label:t,swatch:{kind:"fill",stops:y(r),width:ke,height:n}}}var Ft=e=>e>=10?Math.round(e):Math.round(e*10)/10;function Yt(e){let{graph:t,contigThickness:n,depthRange:r}=e;if(!t||!e.drawsNodes||e.walkRowBars)return[];if(e.nodeWidth==="frequency"){let c=t.nodes.some(d=>d.frequency!==void 0);return ve(n).map(({label:d,widthPx:b})=>we(`width-${d}`,c?`AF ${d}`:`${d} of haplotypes`,b,I))}if(e.nodeWidth!=="depth"||!r||r.min===r.max)return[];let o=t.paths?.length??0,a=o>0,i=[...new Set([r.max,r.mean,r.min].map(a?Math.round:Ft))],s=i[0]>o,u=c=>s?`${c.toLocaleString("en-US")} walk pass${c===1?"":"es"}`:`${c.toLocaleString("en-US")} walk${c===1?"":"s"}`;return i.map(c=>we(`width-${c}`,a?u(c):`depth ${c.toLocaleString("en-US")}`,Ne({depth:c},n,"depth",r.mean),I))}function zt(e){let t=e.busiestLink;return!e.drawsNodes||e.walkRowBars||e.linkWidth!=="walks"||t===0?[]:(t>1?[t,1]:[1]).map(r=>we(`link-width-${r}`,`${r.toLocaleString("en-US")} walk${r===1?"":"s"}`,e.connectorThickness*Te(r,t,"walks"),Gt))}function Vt(e){return e.genePins.some(t=>t.exonsByNode.length>0)?[{key:"exon",label:"exon",swatch:{kind:"outline",color:W,stroke:2,radius:5,height:8}}]:[]}function qt(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function jt(e){return e.pathLegend.map(({name:t,label:n,color:r})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:r}}))}function E(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:ft,square:!0}}}function Jt(e){let{roles:t,haplotypeTube:n,bundled:r,values:o,logWidths:a,foldBp:i,forwardReads:s,reverseReads:u,substitution:c,insertion:d,deletion:b}=e.tubeMapKeys,h=e.readsShown,l=[];if(o){l.push(E("value-reference",y(pe),"reference"));for(let{value:f,color:w}of o)l.push(E(`value-${f}`,y(w),f))}return t&&l.push(E("ref",y(pe),"reference"),E("hap",y(n),r?"shared route, \xD7n haplotypes":"haplotype")),s&&l.push(E("fwd",dt(Q),"read on the forward strand")),u&&l.push(E("rev",dt(ee),"read on the reverse strand")),h&&h.shown<h.total&&l.push({key:"sampled",label:`${h.shown.toLocaleString("en-US")} of ${h.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),c&&l.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),d&&l.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),b&&l.push(E("del",y("grey"),"read deletion")),i!==void 0&&l.push({key:"tube-fold",label:`haplotype variant < ${ne(i)}`,swatch:{kind:"tick",color:qe(),height:ft,backing:Wt}}),a&&l.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),l}function Zt(e){return e.kind==="gene"?{kind:"outline",color:Ie,stroke:1.5,radius:0,height:V}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?A:y(e.fill),height:e.kind==="gap"?e.px:V}}function Qt(e){let t=new Set(e.sharedBlocks?.map(r=>r.block)),n=r=>({kind:"fill",stops:y(ge(r)),height:V});return[...[...t].filter(r=>r<z).sort((r,o)=>r-o).map(r=>({key:`block-${r}`,label:`${Y(r)}: off the reference, walked by several rows`,swatch:n(r)})),...[...t].some(r=>r>=z)?[{key:"block-more",label:"more shared blocks",swatch:n(z)}]:[]]}function en(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(o=>o.call??[]),r=(o,a,i)=>({key:o,label:i,swatch:{kind:"tick",color:a,height:V}});return[...$e(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation}).map(o=>({key:`rows-${o.label}`,label:o.label,swatch:o.note?void 0:Zt(o.swatch)})),...Qt(e),...n.some(o=>o.spanningReads!==0)?[r("call",Ke,"allele length called for this walk")]:[],...n.some(o=>o.spanningReads===0)?[r("unbacked",Xe,"called with no read spanning it")]:[],...n.some(o=>o.agrees===!1)?[r("disagrees",Ue,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function tn(e,t){let n=rt(t,e.walkReference);return{key:`walk-${t.name}`,strong:e.walkLabel(t.name),label:n.delta+n.gaps+n.reversed,swatch:{kind:"fill",stops:ae(t.encoding),width:n.shades?ke:R},under:n.scale,title:n.hover,walk:t}}function gt(e,t){return[...e.liftPaintsOffReference?[q("lift-off",I,"off the reference")]:[],q("faded",bt,t)]}function nn(e){let t=e.walkLift;if(!t||e.facetPanels)return[];let n=t.walks.map(o=>tn(e,o)),r=e.graph?he(e.graph,t,e.liftedWalksLabel):`not on ${e.liftedWalksLabel}`;return[...n,...gt(e,r)]}function Hr(e){let{graph:t,facetPanels:n}=e;if(!t||!n)return[];let r=new Set(n.map(o=>he(t,o,"the panel's walk")));return[...gt(e,r.size===1?[...r][0]:"not on the panel's walk"),...ht(e)]}function $r(e){let t=[{testid:"graph-open-bubble-legend",rows:Ht(e)},{testid:"graph-ramp-legend",rows:$t(e),group:"Color"},{testid:"graph-walk-readout",rows:nn(e),group:"Walks"},{testid:"graph-width-legend",rows:Yt(e),group:"Node thickness"},{testid:"graph-link-width-legend",rows:zt(e),group:"Link thickness"},{testid:"graph-halo-legend",rows:Ut(e),group:"Marks"},{testid:"graph-deletion-legend",rows:ht(e),group:"Marks"},{testid:"graph-gene-legend",rows:Vt(e),group:"Marks"},{testid:"graph-path-legend",rows:jt(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:Jt(e),group:"Tube map"},{testid:"graph-walk-rows-legend",rows:en(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:Xt(e),group:"Top strip"},{testid:"graph-fold-legend",rows:qt(e)}].filter(o=>o.rows.length>0);if(new Set(t.flatMap(o=>o.group??[])).size<2)return t;let r=new Set;return t.map((o,a)=>{let{group:i}=o;return i?r.has(i)?o:(r.add(i),{...o,heading:i}):a===0?o:{...o,spaced:!0}})}function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function wt(e,t){if(typeof e=="string")return e;let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return Pe(e.tag,n,e.children.map(wt))}function N(){return Me().replaceAll(/[^\w-]/g,"")}function D({el:e}){return wt(e,0)}var on="rgba(0, 0, 0, 0.28)";function kt({id:e,x:t,y:n,stops:r,width:o,height:a,square:i,edged:s}){let u=s?.5:0,c=d=>p("rect",{x:t+u,y:n+u,width:o-u*2,height:a-u*2,rx:i?0:2,fill:d,stroke:s?on:void 0});return r.length>1?m(v,{children:[p("defs",{children:p("linearGradient",{id:e,children:r.map((d,b)=>p("stop",{offset:d.offset,stopColor:d.color},b))})}),c(`url(#${e})`)]}):c(r[0].color)}function an({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let o=G(e);return p(kt,{id:n,x:t,y:-5-o/2,stops:e.stops,width:j(e),height:o,square:e.square,edged:e.edged})}case"bands":{let o=me(e.bands),a=-5-G(e)/2;return p(v,{children:e.bands.map((i,s)=>p(kt,{id:`${n}-${s}`,x:t,y:a+s*o,stops:i,width:R,height:o,square:!0},s))})}case"line":return e.dashed?p("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):p("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return p("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let o=e.stroke/2;return p("rect",{x:t+o,y:-5-e.height/2+o,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-o),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return p("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"glyph":return p("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let o=-5-e.height/2;return m(v,{children:[e.backing?p("rect",{x:t,y:o,width:R,height:e.height,fill:e.backing}):null,p("rect",{x:t+R/2-1,y:o,width:2,height:e.height,fill:e.color})]})}case"bracket":return p("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:ze()});case"blank":return null}}var qr=g(function({swatch:t}){let n=N(),r=G(t);return p("svg",{width:j(t),height:r,overflow:"visible",style:{flex:"none"},children:p("g",{transform:`translate(0 ${r/2+5})`,children:p(an,{swatch:t,x:0,id:n})})})});var Zr={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Qr={display:"flex",alignItems:"center",gap:5},eo={color:"#666"},sn="#6b7479",to=4,no={color:sn,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};var ln=g(function({model:t}){let n=`exon-outline-${N()}`,r=U(()=>X(()=>{let{genePins:b,walkLift:h}=t,l=h?void 0:t.openBubbleFocus,f=l?b.map(w=>({...w,exonsByNode:w.exonsByNode.filter(k=>l.nodeIds.has(k.nodeId))})):b;return be(f,t.nodeInk.halfWidthPx,h)}),[t]),{scaleX:o,scaleY:a,translateX:i,translateY:s,paneWidth:u,canvasHeight:c}=t,d=fe(r.get(),{id:n,width:u,height:c,transform:`translate(${i} ${s}) scale(${o} ${a})`});return d?p(M,{model:t,zIndex:2,testId:"graph-gene-pins",children:p(D,{el:d})}):null}),po=ln;function mt(e,t,n){return{x:e-n/2,y:t-T-F+2,width:n,height:T+F*2-2}}function Rt(e,t,n){let r=mt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var J=g(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:u,dimmed:c,title:d,testId:b,onClick:h,onHover:l}){return m("g",{style:{pointerEvents:h||l?"auto":"none",cursor:h?"pointer":void 0,opacity:c?.35:1},"data-testid":b,onClick:h,onMouseEnter:()=>{l?.(!0)},onMouseLeave:()=>{l?.(!1)},...h&&{role:"button",tabIndex:0,"aria-label":(d??o).replaceAll(`
|
|
2
2
|
`,", "),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h())},onFocus:()=>{l?.(!0)},onBlur:()=>{l?.(!1)}},children:[d?p("title",{children:d}):null,p("rect",{...mt(t,n,r),rx:3,fill:"rgba(255,255,255,0.85)",stroke:s,strokeWidth:1}),m("text",{x:t,y:n,fontSize:T,fontFamily:"sans-serif",fontStyle:u?"italic":void 0,fontWeight:u?600:void 0,fill:i,textAnchor:"middle",children:[o,a?p("tspan",{fontStyle:"normal",fontWeight:"normal",children:a}):null]})]})});var xt="#1c1c22",Re=9,xe=3;function To({genes:e},t,n){let r=e.find(i=>Rt(i,t,n))?.item;if(!r)return;let{gene:o}=r,a=tt(r);return{label:o.name,readout:`${o.refName}:${o.start.toLocaleString()}-${o.end.toLocaleString()}${a?`, ${a} in the cut`:""}`}}var cn=g(function({model:t}){let{bubbles:n,genes:r,ticks:o}=t.overlayLabels;if(n.length+r.length+o.length===0)return null;let{scaleY:a,translateY:i,contigThickness:s,hoveredBubble:u}=t,c=u?o.find(l=>_(l.item.bubble,u)):void 0,d=l=>o[Number(l.getAttribute("data-tick"))],b=l=>t.bubbleFaded(l),h=l=>t.bubbleIsOpen(l.bubble);return m(M,{model:t,zIndex:3,testId:"graph-label-layer",pansWithDrawing:!0,children:[p("g",{"data-testid":"graph-bubble-ticks",onClick:l=>{let f=d(l.target);f&&t.toggleBubble(f.item.bubble)},onMouseOver:l=>{let f=d(l.target);f&&t.setHoveredBubble(f.item.bubble)},onMouseOut:()=>{K(t)&&t.setHoveredBubble(null)},onFocus:l=>{let f=d(l.target);f&&t.setHoveredBubble(f.item.bubble)},onBlur:()=>{K(t)&&t.setHoveredBubble(null)},onKeyDown:l=>{let f=d(l.target);f&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.toggleBubble(f.item.bubble))},children:o.map(({item:l,x:f,y:w},k)=>p("rect",{"data-tick":k,role:"button",tabIndex:0,"aria-label":`${l.label}, ${h(l)?"close":"open"} bubble`,x:f-xe/2,y:w-Re,width:xe,height:Re,rx:xe/2,fill:P[l.kind],opacity:b(l)?.35:1,style:{pointerEvents:"all",cursor:"pointer"}},B(l.bubble)))}),r.map(({item:l,x:f,y:w,w:k,text:x})=>{let{gene:S}=l,{y1:H,y2:$}=nt({y:w},l.at.y*a+i,s);return m("g",{children:[p("line",{x1:f,x2:f,y1:H,y2:$,stroke:xt,strokeWidth:.8,strokeOpacity:.6}),p(J,{x:f,y:w,w:k,text:S.name,note:x.slice(S.name.length)||void 0,color:xt,edge:W,italic:!0,testId:"graph-gene-pin-label"})]},`${S.name}-${S.start}`)}),n.map(({item:l,x:f,y:w,w:k,text:x})=>p(J,{x:f,y:w,w:k,text:x,color:P[l.kind],dimmed:b(l),title:`${l.label}
|
|
3
3
|
${l.bubble.segmentCount} segments${l.bubble.covering?"":h(l)?" \xB7 click to close":" \xB7 click to open"}`,testId:"graph-bubble-halo-label",onClick:l.bubble.covering?void 0:()=>{t.toggleBubble(l.bubble)},onHover:S=>{K(t)&&t.setHoveredBubble(S?l.bubble:null)}},B(l.bubble))),c?p(J,{x:c.x,y:c.y-Re-4,w:te(c.item.label),text:c.item.label,color:P[c.item.kind],testId:"graph-bubble-tick-label"}):null]})}),Ao=cn;function pn(e,t,{lit:n,dpr:r}){let o=t.hostBpFrame;o&&at(e,t.referenceStripBlocks,o,{width:t.paneWidth,lit:n,dpr:r})}var un=g(function({model:t}){let n=L((r,o)=>{pn(r,t,{lit:t.referenceStripLit,dpr:o})},[t]);return p(C,{model:t,zIndex:5,shown:t.referenceStripShown,testId:"graph-reference-strip",paint:n})}),$o=un;var dn=.45;function bn(e,t,{highlightNode:n}){let r=t.tubeMapPicture,o=t.tubeMapFrame;if(!r||!o)return;let a=t.paneWidth,i=t.tubeMapPanelViews;if(i){fn(e,t,i,n);return}let s={...o,width:a,highlightNode:n,tubeColors:t.tubeMapTubeColors,nodeColors:t.tubeMapNodeColors};ce(e,r,s);let u=t.layoutResult?.tubeMap;u&&(ue(e,r,u.graph,s),de(e,u,s)),le(e,t.tubeMapDeviations,s),Ve(e,t.tubeMapConnectors,t.connectorZoneBottom,s);let{bounds:c}=r;ot(e,t.tubeMapGenes,s,o.y(c.minY)-2);let d=t.tubeMapRulerBoxes;d&&ie(e,d,s,o.y(c.maxY)+4,t.layoutResult?.referenceAxis)}function fn(e,t,n,r){let o=t.paneWidth;for(let s of n){if(s.bottom<0||s.titleTop>t.canvasHeight)continue;let u={...s.frame,width:o,highlightNode:r,tubeColors:s.tubeColors,nodeColors:s.nodeColors};ce(e,s.picture,u),ue(e,s.picture,s.panel.result.tubeMap.graph,u),de(e,s.panel.result.tubeMap,u),e.globalAlpha=dn,le(e,s.deviations,u),e.globalAlpha=1,e.strokeStyle="rgba(0,0,0,0.15)",e.lineWidth=1,e.beginPath(),e.moveTo(0,Math.round(s.titleTop)+.5),e.lineTo(o,Math.round(s.titleTop)+.5),e.stroke(),e.font=Ze,e.textAlign="left",e.textBaseline="top",e.fillStyle="rgba(0,0,0,0.85)",e.fillText(s.label,6,s.titleTop+4)}let a=n.at(-1),i=t.tubeMapPanelRulerBoxes;a&&i&&ie(e,i,{...a.frame,width:o},a.bottom+4,!0)}var hn=g(function({model:t}){let n=L(r=>{bn(r,t,{highlightNode:t.selectedNode})},[t]);return p(C,{model:t,zIndex:1,shown:!!t.tubeMapPicture,testId:"graph-tube-map",paint:n})}),Qo=hn;var O=JBrowseExports["@jbrowse/render-core/marks"],gn=e=>O!=null&&e in Object(O)?O[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/render-core/marks' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var yt=gn("spanMark");var na=O&&O.__esModule?O.default:O;var wn=["bars","gaps","hairlines"],St=e=>(e.match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi)??[]).map(Number);function Pt(e){if(e.startsWith("#")){let o=Number.parseInt(e.slice(1),16);return[o>>16&255,o>>8&255,o&255]}let[t=0,n=0,r=0]=St(e);return e.startsWith("hsl")?Ae(t,n/100,r/100).map(o=>o*255):[t,n,r]}var Lt=([e,t,n])=>Oe(Math.round(e),Math.round(t),Math.round(n),255),Mt=e=>Lt(Pt(e));function kn(){let e=new Map;return t=>{let n=e.get(t);return n===void 0&&(n=Mt(t),e.set(t,n)),n}}function mn(e,t,n,r=Mt){let o=e.start+e.bp,a=He(e,t);if("fill"in a)return[[e.start,o,r(a.fill)]];let i=a.stops.map(Pt),s=a.stops.map(b=>St(b)[0]),u=Math.abs(s.at(-1)-s[0]),c=Math.max(1,Math.min(Math.ceil(e.bp*n),Math.ceil(u),e.bp)),d=[];for(let b=0;b<c;b++){let h=(b+.5)/c*(i.length-1),l=Math.min(Math.floor(h),i.length-2),f=i[l],w=i[l+1],k=h-l;d.push([Math.round(e.start+e.bp*b/c),Math.round(e.start+e.bp*(b+1)/c),Lt([0,1,2].map(x=>f[x]+(w[x]-f[x])*k))])}return d}function ye(e){return{x:new Uint32Array(e),x2:new Uint32Array(e),row:new Uint32Array(e),color:new Uint32Array(e),count:0}}function Rn(e,t,n){return{x:e.x.subarray(t,n),x2:e.x2.subarray(t,n),row:e.row.subarray(t,n),color:e.color.subarray(t,n),count:n-t}}var xn=e=>e.gap?De(e.cause).px===oe?"hairlines":"gaps":"bars";function Ct(e,t,n){let r=kn(),o=e.map(c=>Fe(c.runs,t).map(d=>({kind:xn(d),pieces:mn(d,n,t,r)}))),a={bars:0,gaps:0,hairlines:0};for(let c of o)for(let d of c)a[d.kind]+=d.pieces.length;let i={bars:ye(a.bars),gaps:ye(a.gaps),hairlines:ye(a.hairlines)},s={bars:new Uint32Array(e.length+1),gaps:new Uint32Array(e.length+1),hairlines:new Uint32Array(e.length+1)},u=1;return o.forEach((c,d)=>{for(let b of c){let h=i[b.kind];for(let[l,f,w]of b.pieces){let k=h.count++;h.x[k]=l,h.x2[k]=f,h.row[k]=d,h.color[k]=w,u=Math.max(u,f)}}for(let b of wn)s[b][d+1]=i[b].count}),{...i,barRows:s.bars,gapRows:s.gaps,hairlineRows:s.hairlines,longest:u}}function _t(e,t,n){let{longest:r}=t,o={start:0,end:r,screenStartPx:n.origin*n.scaleX+n.translateX,screenEndPx:(n.origin+r)*n.scaleX+n.translateX,reversed:!1,displayedRegionIndex:0},a={canvasWidth:n.width,canvasHeight:n.height},i=n.rowPx*n.scaleY;for(let{first:s,count:u,rowY:c}of n.blocks){let d=i/2-n.translateY-(c-s*n.rowPx)*n.scaleY,b=(c-n.rowPx/2)*n.scaleY+n.translateY;if(!(b>n.height||b+u*i<0))for(let[h,l,f]of[[t.bars,t.barRows,n.barPx],[t.gaps,t.gapRows,Math.min(We,n.barPx)],[t.hairlines,t.hairlineRows,Math.min(oe,n.barPx)]])yt.paintBlock(e,Rn(h,l[s],l[s+u]),o,a,{rowHeight:i,rowProportion:f/i,minWidthPx:1,seamPx:0,scrollTop:d})}}var yn=g(function({model:t}){let n=U(()=>X(()=>t.walkRowBars?Ct(t.walkRowList,t.scaleX,t.referenceRampDomain):void 0),[t]),r=L(o=>{let a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch,u=n.get();!a||!i||!s||!u||_t(o,u,{...t.screenTransform,width:t.paneWidth,height:t.canvasHeight,rowPx:s.rowPx,barPx:s.barPx,origin:a.origin,blocks:i.blocks(a.rows.length+1)})},[t,n]);return p(C,{model:t,zIndex:3,testId:"graph-walk-rows-spans",paint:r})}),Sn="rgba(160, 196, 232, 0.55)",Pn="rgba(160, 140, 220, 0.55)",Ln=g(function({model:t}){let n=L(r=>{let o=t.walkRowRibbons,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:u,scaleY:c,translateX:d,translateY:b}=t.screenTransform,h=f=>(a.origin+f)*u+d,l=s.barPx/2;for(let{row:f,a0:w,a1:k,b0:x,b1:S}of o){let H=i.rowY(f)*c+b+l,$=i.rowY(f+1)*c+b-l;r.fillStyle=x>S?Pn:Sn,r.beginPath(),r.moveTo(h(w),H),r.lineTo(h(k),H),r.lineTo(h(S),$),r.lineTo(h(x),$),r.closePath(),r.fill()}},[t]);return p(C,{model:t,zIndex:2,testId:"graph-walk-rows-ribbons",paint:n})}),Mn=g(function({model:t}){let n=L(r=>{let o=t.sharedBlocks,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:u,scaleY:c,translateX:d,translateY:b}=t.screenTransform;pt(r,o,{x:h=>(a.origin+h)*u+d,rowCentre:h=>i.rowY(h)*c+b,barPx:s.barPx})},[t]);return p(C,{model:t,zIndex:3,testId:"graph-walk-rows-blocks",paint:n})}),Cn=g(function({model:t}){let n=t.walkRowBars,r=t.walkRowPlacement,o=t.walkRowPitch;if(!n||!r||!o||!t.hoveredWalkRowText)return null;let a=t.walkRowList,i=a.findIndex(c=>c.name===t.hoveredWalkRow),s=a[i];if(!s)return null;let u=t.toScreen({x:n.origin,y:r.rowY(i)});return p("rect",{"data-testid":"graph-walk-row-hovered",x:u.x-2,y:u.y-o.rowPx/2-1,width:Ge(s)*t.scaleX+4,height:o.rowPx+2,fill:"none",stroke:"#111",strokeWidth:1})}),_n=g(function({model:t,vector:n=!1}){let r=N(),o=t.walkRowBars,a=t.walkRowPlacement,i=t.walkRowPitch;if(!o||!a||!i)return null;let{paneWidth:s,canvasHeight:u}=t,c={...t.screenTransform,width:s,height:u,...i,bars:n};return m(v,{children:[n||!t.walkRowRibbons?null:p(Ln,{model:t}),n?null:p(yn,{model:t}),n||!t.sharedBlocks?null:p(Mn,{model:t}),m(M,{model:t,zIndex:3,overflow:"visible",testId:"graph-walk-rows",children:[Je(o,t.walkRowGroups?.sections??[],a.rowY,c,{ramp:t.referenceRampDomain,rowGenes:t.walkRowGenes,idPrefix:r}).map((d,b)=>p(D,{el:d},b)),a.headers.map(d=>p("text",{x:10,y:t.toScreen({x:0,y:d.top}).y+je-4,fontFamily:"sans-serif",fontSize:11,fontWeight:"bold",fill:"#333","data-testid":"graph-walk-section",children:d.title},d.key)),p(Cn,{model:t})]})]})}),ka=_n;export{Et as a,it as b,M as c,Kn as d,N as e,D as f,j as g,Gr as h,Dr as i,Zt as j,tn as k,Hr as l,$r as m,an as n,qr as o,Zr as p,Qr as q,eo as r,sn as s,to as t,no as u,po as v,To as w,Ao as x,pn as y,$o as z,bn as A,Qo as B,ka as C};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-5WIUEMTH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as D}from"./chunk-PXYYKSGK.js";import{d as x}from"./chunk-QUDJ7AM3.js";import{a as w,d as P}from"./chunk-TMM73K4C.js";import{f as B}from"./chunk-6VNDP3UB.js";var g;function N(){return g??(g=import("./bandage-layout-UZEOCKMS.js").then(e=>e.default()).catch(e=>{throw g=void 0,e})),g}async function E(e){return(await N()).computeLayout(e.graph,e.options)}var G=[{value:"fmmm",label:"Bandage (FMMM)",description:"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm."},{value:"stress",label:"Stress",description:"Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference."}],V=G.map(e=>e.value);var Y=async e=>{let n=performance.now();return{result:e.options.engine==="stress"?D(e):await E(e),duration:performance.now()-n}};function K(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function we(e){let n=w(e).slice(1);return n.length>0?n:void 0}function $(e){return e.type==="WalkTabixSyntenyAdapter"||e.type==="RgfaTabixAdapter"&&(typeof e.walksUri=="string"&&e.walksUri!==""||B(e.walksLocation))}function Ne(e){return e.type==="GbzBaseSyntenyAdapter"||$(e)}function Ee(e){let{defaultHaplotypes:n}=e;return $(e)&&K(n)&&n.length>0?n:void 0}function Re(e){return w(e)[0]}function Le(e){return P(e).adapter}function Se(e,n){return e===void 0||e===n?void 0:`The graph is cut on its reference, ${e}: open it from a view of ${e}`}function i(e,n){return typeof e.get=="function"?e.get(n):e[n]}function b(e,n){return e.find(t=>t.trackId===n)}function h(e){return`${e.trackId} ${e.name??""}`}var J=new Set(["BedAdapter","BedTabixAdapter","BigBedAdapter","VcfAdapter","VcfTabixAdapter"]),S=/repeat|tandem|\bstr\b|vntr|trf|trgt|vamos|expansion|microsat/i;function ot(e,n){let t=n?b(e,n):void 0;return t||e.filter(o=>J.has(o.adapterType)).find(o=>S.test(h(o)))}var v=/^\w+=[^;]*(;\w+=[^;]*)*$/;function W(e){let n=i(e,"name");if(!(typeof n!="string"||!v.test(n)))return Object.fromEntries(n.split(";").map(t=>{let r=t.indexOf("=");return[t.slice(0,r),t.slice(r+1)]}))}function d(e,n){let t=i(e,n);return t!==void 0?t:i(e,"INFO")?.[n]??W(e)?.[n]}var U=["RUS","MOTIFS","RU","motifs","motif","sequence","consensus"],z=["RUL","period","PERIOD","consensusSize","unit","unitLength"],X=["TRID","REPID","VARID","ID","name","id"];function k(e,n){for(let t of n){let r=d(e,t),o=String((Array.isArray(r)?r[0]:r)??"").split(",")[0].trim();if(o!==""&&o!==".")return o}}var H=/^[ACGTURYSWKMBDHVN]+$/i;function Q(e){let n=Number(k(e,z));if(Number.isFinite(n)&&n>0)return Math.round(n);let t=k(e,U);return t&&H.test(t)?t.length:void 0}function m(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(t=>{let r=t===""||t===null||t===void 0?NaN:Number(t);return Number.isFinite(r)?r:void 0})}function L(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(t=>{let r=String(t??"").trim();return r===""||r==="."?void 0:r})}var R="<CNV:TR>";function q(e){let n=L(i(e,"ALT"));if(!n.includes(R))return;let t=m(d(e,"RN")),r=L(d(e,"RUS")),o=m(d(e,"RUL")),s=m(d(e,"RUC")),a=m(d(e,"RB")),c=0;return n.map((u,f)=>{let p=t[f]??(u===R?1:0),y=0,_=0;for(let C=0;C<p;C++,c++){let A=r[c],I=o[c]??(A&&H.test(A)?A.length:void 0),O=s[c],M=a[c]??(I&&O!==void 0?Math.round(I*O):void 0);M!==void 0&&(y+=M,_++)}return u===R&&p>0&&_===p?y:void 0})}function Z(e,n,t){let r=e?.includes("|");return(e??"").split(/[/|]/).flatMap((o,s)=>{let a=o===""?NaN:Number(o),c=a>0?n[a-1]:t;return!Number.isInteger(a)||c===void 0?[]:[{bp:c,...r?{haplotype:s+1}:{}}]})}function ee(e,n,t){let r=i(e,"samples"),o={};for(let[s,a]of Object.entries(r??{})){let c=m(a.SD),u=m(a.AL).flatMap((p,y)=>p!==void 0&&p>0?[c[y]===void 0?{bp:p}:{bp:p,spanningReads:c[y]}]:[]),f=u.length>0||!n?u:Z(L(a.GT)[0],n,t);f.length>0&&(o[s]=f)}return Object.keys(o).length>0?o:void 0}function te(e,n){let t=d(e,"start"),r=d(e,"end"),o=m(d(e,"SVLEN"))[0];return n&&o!==void 0?{start:t+1,end:t+1+o}:{start:t,end:r}}function st(e){let n=[];for(let t of e){let r=q(t),{start:o,end:s}=te(t,r!==void 0),a=Q(t);if(!(s>o)||a===void 0)continue;let c=d(t,"refName"),u=k(t,U),f=k(t,X);n.push({key:`${c}:${o}-${s}`,name:(f&&!v.test(f)?f:void 0)??(u&&u.length<=12?`(${u})n`:`${c}:${(o+1).toLocaleString("en-US")}-${s.toLocaleString("en-US")}`),refName:c,start:o,end:s,unit:a,motif:u,calls:ee(t,r,s-o)})}return n.sort((t,r)=>t.start-r.start)}function T(e){let n=[];for(let t of[...e].sort((r,o)=>r.start-o.start)){let r=n.at(-1);r&&t.start<=r.end?r.end=Math.max(r.end,t.end):n.push({...t})}return n}function F(e){let n=[],t=new Map;for(let r of[...e].sort((o,s)=>o.start-s.start)){let o=`${r.refName} ${r.strand} ${r.name}`,s=t.get(o);if(s&&r.start<s.end)s.end=Math.max(s.end,r.end),s.exons=T([...s.exons,...r.exons]);else{let a={...r,exons:T(r.exons)};n.push(a),t.set(o,a)}}return n}var ne=new Set(["Gff3TabixAdapter","Gff3Adapter","BedTabixAdapter","BedAdapter","GtfTabixAdapter","GtfAdapter","BigBedAdapter","NCListAdapter"]),re=/gene|refseq|gencode|ensembl|annotation/i,oe=new Set(["BedTabixAdapter","BedAdapter"]);function yt(e,n){let t=n?b(e,n):void 0;if(t)return t;let r=e.filter(o=>ne.has(o.adapterType)&&!S.test(h(o)));return r.find(o=>re.test(h(o)))??r.find(o=>!oe.has(o.adapterType))}var se=/\bTEs?\b|transpos/i;function Tt(e){return e&&se.test(h(e))?"TE":"gene"}function bt(e,n){let t=e.tracks?.find(r=>x(r.configuration,"trackId")===n)?.displays[0];return t?x(t.configuration,"filter")??[]:[]}var ie=new Set(["chromosome","region","contig","supercontig","scaffold"]),ae=new Set(["exon","CDS","five_prime_UTR","three_prime_UTR","UTR"]);function j(e,n){let t=i(e,"type");typeof t=="string"&&ae.has(t)&&n.push({start:i(e,"start"),end:i(e,"end")});let r=i(e,"subfeatures");for(let o of r??[])j(o,n)}function kt(e){let n=[];for(let t of e){let r=i(t,"gene_name")??i(t,"name")??i(t,"gene")??i(t,"gene_id"),o=i(t,"start"),s=i(t,"end");if(!r||!(s>o)||ie.has(i(t,"type")))continue;let a=[];j(t,a),n.push({name:r,refName:i(t,"refName"),start:o,end:s,strand:i(t,"strand")??0,exons:a.length?T(a):[{start:o,end:s}]})}return F(n)}var l=JBrowseExports["tss-react/mui"],ce=e=>l!=null&&e in Object(l)?l[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from 'tss-react/mui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var xt=ce("makeStyles"),wt=l&&l.__esModule?l.default:l;export{G as a,V as b,Y as c,we as d,$ as e,Ne as f,Ee as g,Re as h,Le as i,Se as j,J as k,ot as l,st as m,ne as n,yt as o,Tt as p,bt as q,kt as r,xt as s};
|
|
2
|
+
//# sourceMappingURL=chunk-LPUQPLW7.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+graph-fmmm-layout@1.0.2/node_modules/@jbrowse/graph-fmmm-layout/esm/loadFmmm.js", "../../node_modules/.pnpm/@jbrowse+graph-fmmm-layout@1.0.2/node_modules/@jbrowse/graph-fmmm-layout/esm/fmmmLayout.js", "../../node_modules/.pnpm/@jbrowse+bandage-core@12.6.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-CO6RGQAD.js", "../../src/graphTrackConfig.ts", "../../src/GraphGenomeView/trackFeatures.ts", "../../src/GraphGenomeView/repeats/repeatFeatures.ts", "../../node_modules/.pnpm/@jbrowse+bandage-core@12.6.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-EQDQ7P4Y.js", "../../src/GraphGenomeView/genes/geneFeatures.ts", "jbrowse-host:tss-react/mui"],
|
|
4
|
+
"sourcesContent": ["let cached;\nexport function loadFmmm() {\n cached !== null && cached !== void 0 ? cached : (cached = import('./bandage-layout.js')\n .then(mod => mod.default())\n .catch((e) => {\n cached = undefined;\n throw e;\n }));\n return cached;\n}\n", "import { loadFmmm } from \"./loadFmmm.js\";\nexport async function fmmmLayout(request) {\n const engine = await loadFmmm();\n return engine.computeLayout(request.graph, request.options);\n}\n", "// src/layoutEngines.ts\nimport { fmmmLayout } from \"@jbrowse/graph-fmmm-layout\";\nimport { stressLayout } from \"@jbrowse/graph-stress-layout\";\nvar LAYOUT_ENGINES = [\n {\n value: \"fmmm\",\n label: \"Bandage (FMMM)\",\n description: \"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm.\"\n },\n {\n value: \"stress\",\n label: \"Stress\",\n description: \"Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference.\"\n }\n];\nvar LAYOUT_ENGINE_VALUES = LAYOUT_ENGINES.map((e) => e.value);\nfunction isLayoutEngineKind(value) {\n return LAYOUT_ENGINE_VALUES.includes(value);\n}\nvar layoutEngine = async (request) => {\n const start = performance.now();\n const result = request.options.engine === \"stress\" ? stressLayout(request) : await fmmmLayout(request);\n return { result, duration: performance.now() - start };\n};\n\nexport {\n LAYOUT_ENGINES,\n LAYOUT_ENGINE_VALUES,\n isLayoutEngineKind,\n layoutEngine\n};\n", "import {\n getConfAssemblyNamesOrNone,\n toTrackConfigEntry,\n} from '@jbrowse/core/util/tracks'\n\nimport { snapshotNamesFile } from './locationName.ts'\n\nimport type { AnyTrackConfig } from '@jbrowse/core/configuration'\n\nfunction isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every(item => typeof item === 'string')\n}\n\n// The assemblies the track names after its reference, which is what core's\n// MultiWaySyntenyDisplay opens a lane-declaring source on.\nexport function trackLanes(track: AnyTrackConfig) {\n const lanes = getConfAssemblyNamesOrNone(track).slice(1)\n return lanes.length > 0 ? lanes : undefined\n}\n\n// Whether a track names a walk file, by the `walksUri` shorthand as written\n// or the location it expands to: an rGFA track may, and a\n// WalkTabixSyntenyAdapter one does\nexport function walkIndexed(adapterConfig: Record<string, unknown>) {\n return (\n adapterConfig.type === 'WalkTabixSyntenyAdapter' ||\n (adapterConfig.type === 'RgfaTabixAdapter' &&\n ((typeof adapterConfig.walksUri === 'string' &&\n adapterConfig.walksUri !== '') ||\n snapshotNamesFile(adapterConfig.walksLocation)))\n )\n}\n\n// Whether a track's cut reads `haplotypes`: a GBZ cut does, and so does an\n// rGFA one with a walk file\nexport function cutsByHaplotype(adapterConfig: Record<string, unknown>) {\n return (\n adapterConfig.type === 'GbzBaseSyntenyAdapter' || walkIndexed(adapterConfig)\n )\n}\n\n// The haplotypes a walk-indexed track's config names to cut for until the\n// user picks others\nexport function configHaplotypes(adapterConfig: Record<string, unknown>) {\n const { defaultHaplotypes } = adapterConfig\n return walkIndexed(adapterConfig) &&\n isStringArray(defaultHaplotypes) &&\n defaultHaplotypes.length > 0\n ? defaultHaplotypes\n : undefined\n}\n\n// A graph is cut on the first assembly its track names, the rule\n// GbzBaseSyntenyAdapter states for its anchor. Every other assembly the track\n// names holds its sequence as rank>0 alleles off that reference's backbone, so\n// a window on one has no reference coordinates to frame the cut by.\nexport function graphReferenceAssembly(track: AnyTrackConfig) {\n return getConfAssemblyNamesOrNone(track)[0]\n}\n\n// A track's adapter config, from a live node or a session's frozen entry\nexport function trackAdapterSnapshot(track: AnyTrackConfig) {\n return toTrackConfigEntry(track).adapter as Record<string, unknown>\n}\n\nexport function offReferenceProblem(\n referenceAssembly: string | undefined,\n assemblyName: string,\n) {\n return referenceAssembly === undefined || referenceAssembly === assemblyName\n ? undefined\n : `The graph is cut on its reference, ${referenceAssembly}: open it from a view of ${referenceAssembly}`\n}\n", "import type { Feature } from '@jbrowse/core/util'\n\nexport type FeatureLike = Feature | Record<string, unknown>\n\nexport function ownField(f: FeatureLike, name: string): unknown {\n return typeof (f as Feature).get === 'function'\n ? (f as Feature).get(name)\n : (f as Record<string, unknown>)[name]\n}\n\nexport interface TrackChoice {\n trackId: string\n name?: string\n adapterType: string\n}\n\nexport function namedTrack<T extends TrackChoice>(tracks: T[], named: string) {\n return tracks.find(t => t.trackId === named)\n}\n\n// what a track-name hint such as /repeat|tandem/ is matched against\nexport function trackLabel(t: TrackChoice) {\n return `${t.trackId} ${t.name ?? ''}`\n}\n", "import { namedTrack, ownField, trackLabel } from '../trackFeatures'\n\nimport type { FeatureLike, TrackChoice } from '../trackFeatures'\n\nexport interface RepeatCall {\n bp: number\n // TRGT's `SD`. Zero means the allele is a copy of the one the reads did\n // support, so its length states nothing about a second haplotype; absent\n // where the genotyper writes no such field.\n spanningReads?: number\n // the PanSN haplotype a phased genotype puts this allele on\n haplotype?: number\n}\n\n// A tandem repeat array as the walk rows need it: its span on the reference,\n// which is what the bars measure between, and its unit length, which is what\n// they tile by. Read off whatever repeat annotation the session has, since the\n// tools all state the same two facts under different names: VCF 4.5's\n// `<CNV:TR>` allele gives `RUL` and `RUS` (one entry per repeat sequence,\n// grouped by `RN`), UCSC simpleRepeat and TRF give `period` and the consensus\n// `sequence`, TRGT gives `MOTIFS` and `TRID`, ExpansionHunter `RU` and `REPID`,\n// HipSTR and GangSTR `PERIOD`, vamos its `motifs`. A VCF record's INFO is\n// searched as well as its top level, and a list's first entry is the unit the\n// bars tile by: for a compound array that is the first repeat sequence, which\n// is the expanding one at every such locus in the common catalogues.\nexport interface RepeatArray {\n key: string\n name: string\n refName: string\n start: number\n end: number\n unit: number\n motif?: string\n // Each sample's genotyped alleles, from a genotyper's per-sample `AL`\n // (TRGT) or a genotype over VCF 4.5 <CNV:TR> alleles; absent from a\n // catalogue.\n calls?: Record<string, RepeatCall[]>\n}\n\nexport const REPEAT_ADAPTER_TYPES = new Set([\n 'BedAdapter',\n 'BedTabixAdapter',\n 'BigBedAdapter',\n 'VcfAdapter',\n 'VcfTabixAdapter',\n])\n\nexport const REPEAT_TRACK_HINT =\n /repeat|tandem|\\bstr\\b|vntr|trf|trgt|vamos|expansion|microsat/i\n\nexport function pickRepeatTrack<T extends TrackChoice>(\n tracks: T[],\n named: string,\n) {\n const chosen = named ? namedTrack(tracks, named) : undefined\n if (chosen) {\n return chosen\n }\n const candidates = tracks.filter(t => REPEAT_ADAPTER_TYPES.has(t.adapterType))\n return candidates.find(t => REPEAT_TRACK_HINT.test(trackLabel(t)))\n}\n\n// A TRGT repeat catalogue is a BED whose name column packs the record:\n// `ID=HTT;MOTIFS=CAG,CCG;STRUC=(CAG)nCAACAG(CCG)n`. Read as fields when it\n// has that shape.\nconst PACKED_NAME = /^\\w+=[^;]*(;\\w+=[^;]*)*$/\n\nfunction packedName(f: FeatureLike) {\n const name = ownField(f, 'name')\n if (typeof name !== 'string' || !PACKED_NAME.test(name)) {\n return undefined\n }\n return Object.fromEntries(\n name.split(';').map(pair => {\n const i = pair.indexOf('=')\n return [pair.slice(0, i), pair.slice(i + 1)]\n }),\n )\n}\n\n// A field at the feature's top level, in a VCF record's INFO, or in a packed\n// name column, in that order.\nfunction field(f: FeatureLike, name: string): unknown {\n const top = ownField(f, name)\n if (top !== undefined) {\n return top\n }\n const info = ownField(f, 'INFO') as Record<string, unknown> | undefined\n return info?.[name] ?? packedName(f)?.[name]\n}\n\nconst MOTIF_FIELDS = [\n 'RUS',\n 'MOTIFS',\n 'RU',\n 'motifs',\n 'motif',\n 'sequence',\n 'consensus',\n]\nconst PERIOD_FIELDS = [\n 'RUL',\n 'period',\n 'PERIOD',\n 'consensusSize',\n 'unit',\n 'unitLength',\n]\nconst NAME_FIELDS = ['TRID', 'REPID', 'VARID', 'ID', 'name', 'id']\n\n// The first entry of a list-valued field, whether it arrived parsed or as\n// the comma-joined text a VCF INFO or a BED column holds; VCF's missing \".\"\n// counts as absent.\nfunction first(f: FeatureLike, names: string[]) {\n for (const name of names) {\n const value = field(f, name)\n const one = String((Array.isArray(value) ? value[0] : value) ?? '')\n .split(',')[0]!\n .trim()\n if (one !== '' && one !== '.') {\n return one\n }\n }\n return undefined\n}\n\nconst IUPAC = /^[ACGTURYSWKMBDHVN]+$/i\n\n// The unit in bp: a stated period, else the length of the first motif.\nexport function repeatUnitOf(f: FeatureLike) {\n const period = Number(first(f, PERIOD_FIELDS))\n if (Number.isFinite(period) && period > 0) {\n return Math.round(period)\n }\n const motif = first(f, MOTIF_FIELDS)\n return motif && IUPAC.test(motif) ? motif.length : undefined\n}\n\n// A per-sample list field, parsed or as the comma-joined text a VCF column\n// holds. A missing entry stays missing: read as 0, an absent `SD` would make\n// every allele of every genotyper that writes no such field unspanned.\nfunction numbers(value: unknown) {\n const raw: unknown[] = Array.isArray(value)\n ? value\n : String(value ?? '').split(',')\n return raw.map(one => {\n const n =\n one === '' || one === null || one === undefined ? NaN : Number(one)\n return Number.isFinite(n) ? n : undefined\n })\n}\n\nfunction strings(value: unknown) {\n const raw: unknown[] = Array.isArray(value)\n ? value\n : String(value ?? '').split(',')\n return raw.map(one => {\n const text = String(one ?? '').trim()\n return text === '' || text === '.' ? undefined : text\n })\n}\n\nconst TANDEM_REPEAT = '<CNV:TR>'\n\n// Each ALT allele's length, off VCF 4.5's flattened list-of-lists: RN says how\n// many RUS/RUL/RUC/RB entries each allele takes, and the allele's bases are\n// its runs' RB, or unit length times count where RB is missing. An allele that\n// is not <CNV:TR>, or has a run stating neither, has none.\nfunction tandemAlleleBp(f: FeatureLike) {\n const alts = strings(ownField(f, 'ALT'))\n if (!alts.includes(TANDEM_REPEAT)) {\n return undefined\n }\n const rn = numbers(field(f, 'RN'))\n const rus = strings(field(f, 'RUS'))\n const rul = numbers(field(f, 'RUL'))\n const ruc = numbers(field(f, 'RUC'))\n const rb = numbers(field(f, 'RB'))\n let k = 0\n return alts.map((alt, i) => {\n const n = rn[i] ?? (alt === TANDEM_REPEAT ? 1 : 0)\n let bp = 0\n let known = 0\n for (let j = 0; j < n; j++, k++) {\n const motif = rus[k]\n const unitLength =\n rul[k] ?? (motif && IUPAC.test(motif) ? motif.length : undefined)\n const count = ruc[k]\n const runBp =\n rb[k] ??\n (unitLength && count !== undefined\n ? Math.round(unitLength * count)\n : undefined)\n if (runBp !== undefined) {\n bp += runBp\n known++\n }\n }\n return alt === TANDEM_REPEAT && n > 0 && known === n ? bp : undefined\n })\n}\n\n// A sample's alleles through its genotype: 0 is the reference's, an index\n// past it the ALT allele's. A phased genotype's k-th allele is PanSN\n// haplotype k, the order vg deconstruct writes an assembly's haplotypes in.\nfunction genotyped(\n gt: string | undefined,\n alleleBp: (number | undefined)[],\n referenceBp: number,\n) {\n const phased = gt?.includes('|')\n return (gt ?? '').split(/[/|]/).flatMap((index, k): RepeatCall[] => {\n const i = index === '' ? NaN : Number(index)\n const bp = i > 0 ? alleleBp[i - 1] : referenceBp\n if (!Number.isInteger(i) || bp === undefined) {\n return []\n }\n return [{ bp, ...(phased ? { haplotype: k + 1 } : {}) }]\n })\n}\n\nfunction callsOf(\n f: FeatureLike,\n alleleBp: (number | undefined)[] | undefined,\n referenceBp: number,\n) {\n const samples = ownField(f, 'samples') as\n Record<string, Record<string, unknown>> | undefined\n const called: Record<string, RepeatCall[]> = {}\n for (const [sample, fields] of Object.entries(samples ?? {})) {\n const reads = numbers(fields.SD)\n const lengths = numbers(fields.AL).flatMap((bp, i) =>\n bp !== undefined && bp > 0\n ? [reads[i] === undefined ? { bp } : { bp, spanningReads: reads[i] }]\n : [],\n )\n const calls =\n lengths.length > 0 || !alleleBp\n ? lengths\n : genotyped(strings(fields.GT)[0], alleleBp, referenceBp)\n if (calls.length > 0) {\n called[sample] = calls\n }\n }\n return Object.keys(called).length > 0 ? called : undefined\n}\n\n// A <CNV:TR> record's POS is the base before the array and SVLEN the\n// reference allele's length, while a VCF feature starts at that padding base.\nfunction spanOf(f: FeatureLike, tandem: boolean) {\n const start = field(f, 'start') as number\n const end = field(f, 'end') as number\n const svlen = numbers(field(f, 'SVLEN'))[0]\n return tandem && svlen !== undefined\n ? { start: start + 1, end: start + 1 + svlen }\n : { start, end }\n}\n\nexport function repeatArraysFrom(features: FeatureLike[]): RepeatArray[] {\n const arrays: RepeatArray[] = []\n for (const f of features) {\n const alleleBp = tandemAlleleBp(f)\n const { start, end } = spanOf(f, alleleBp !== undefined)\n const unit = repeatUnitOf(f)\n if (!(end > start) || unit === undefined) {\n continue\n }\n const refName = field(f, 'refName') as string\n const motif = first(f, MOTIF_FIELDS)\n const stated = first(f, NAME_FIELDS)\n arrays.push({\n key: `${refName}:${start}-${end}`,\n name:\n (stated && !PACKED_NAME.test(stated) ? stated : undefined) ??\n (motif && motif.length <= 12\n ? `(${motif})n`\n : `${refName}:${(start + 1).toLocaleString('en-US')}-${end.toLocaleString('en-US')}`),\n refName,\n start,\n end,\n unit,\n motif,\n calls: callsOf(f, alleleBp, end - start),\n })\n }\n return arrays.sort((a, b) => a.start - b.start)\n}\n", "// src/genes/geneFiles.ts\nvar GENE_TYPE = /(gene|gene_segment|RNA|transcript)$/i;\nvar isGene = (type) => GENE_TYPE.test(type) || type === \"CDS\" || type === \"exon\";\nfunction mergedIntervals(intervals) {\n const out = [];\n for (const iv of [...intervals].sort((a, b) => a.start - b.start)) {\n const last = out.at(-1);\n if (last && iv.start <= last.end) {\n last.end = Math.max(last.end, iv.end);\n } else {\n out.push({ ...iv });\n }\n }\n return out;\n}\nfunction strandOf(s) {\n return s === \"+\" ? 1 : s === \"-\" ? -1 : 0;\n}\nfunction unescape(value) {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\nfunction attributes(column) {\n const out = /* @__PURE__ */ new Map();\n for (const pair of column.split(\";\")) {\n const eq = pair.indexOf(\"=\");\n if (eq > 0) {\n out.set(pair.slice(0, eq).trim(), unescape(pair.slice(eq + 1).trim()));\n }\n }\n return out;\n}\nfunction gff3Row(line) {\n const cols = line.split(\"\t\");\n const start = Number(cols[3]);\n const end = Number(cols[4]);\n if (cols.length < 9 || !Number.isInteger(start) || !Number.isInteger(end)) {\n return void 0;\n }\n return {\n refName: cols[0],\n type: cols[2],\n start: start - 1,\n end,\n strand: strandOf(cols[6]),\n attrs: attributes(cols[8])\n };\n}\nfunction genesFromGff3Lines(lines) {\n const rows = [];\n for (const line of lines) {\n if (line.startsWith(\"##FASTA\")) {\n break;\n }\n const row = line.startsWith(\"#\") ? void 0 : gff3Row(line);\n if (row) {\n rows.push(row);\n }\n }\n const parentOf = /* @__PURE__ */ new Map();\n for (const { attrs } of rows) {\n const id = attrs.get(\"ID\");\n const parent = attrs.get(\"Parent\")?.split(\",\")[0];\n if (id && parent) {\n parentOf.set(id, parent);\n }\n }\n const rootOf = (row) => {\n let id = row.attrs.get(\"Parent\")?.split(\",\")[0] ?? row.attrs.get(\"ID\");\n if (!id) {\n return row.attrs.get(\"gene_id\");\n }\n const seen = /* @__PURE__ */ new Set();\n while (id && parentOf.has(id) && !seen.has(id)) {\n seen.add(id);\n id = parentOf.get(id);\n }\n return id;\n };\n const groups = /* @__PURE__ */ new Map();\n rows.forEach((row, i) => {\n const root = rootOf(row) ?? `#${i}`;\n const key = `${row.refName}\t${root}`;\n const group = groups.get(key) ?? groups.set(key, { rows: [] }).get(key);\n group.rows.push(row);\n if (!row.attrs.has(\"Parent\") && !group.top) {\n group.top = row;\n }\n });\n const genes = [];\n for (const [key, { top, rows: rows2 }] of groups) {\n if (top && !isGene(top.type)) {\n continue;\n }\n const first = top ?? rows2[0];\n const start = top?.start ?? Math.min(...rows2.map((r) => r.start));\n const end = top?.end ?? Math.max(...rows2.map((r) => r.end));\n const a = first.attrs;\n const spans = (type) => rows2.filter((r) => r.type === type).map((r) => ({ start: r.start, end: r.end }));\n const exons = spans(\"exon\");\n const coding = spans(\"CDS\");\n const transcribed = rows2.some(\n (r) => r !== top && r.type !== \"exon\" && r.type !== \"CDS\"\n );\n genes.push({\n name: a.get(\"Name\") ?? a.get(\"gene_name\") ?? a.get(\"gene\") ?? a.get(\"gene_id\") ?? key.split(\"\t\")[1],\n refName: first.refName,\n start,\n end,\n strand: first.strand,\n // A range read holds only the rows over its window, so a gene with\n // transcripts but no exon or CDS there is intronic in it. Only a gene\n // with no transcripts, as a bacterium's gene and CDS, is one exon.\n exons: exons.length ? mergedIntervals(exons) : transcribed ? mergedIntervals(coding) : [{ start, end }]\n });\n }\n return genes;\n}\nfunction mergeOverlappingByName(genes) {\n const out = [];\n const open = /* @__PURE__ */ new Map();\n for (const g of [...genes].sort((a, b) => a.start - b.start)) {\n const key = `${g.refName}\t${g.strand}\t${g.name}`;\n const last = open.get(key);\n if (last && g.start < last.end) {\n last.end = Math.max(last.end, g.end);\n last.exons = mergedIntervals([...last.exons, ...g.exons]);\n } else {\n const gene = { ...g, exons: mergedIntervals(g.exons) };\n out.push(gene);\n open.set(key, gene);\n }\n }\n return out;\n}\nvar BED_HEADER = /^(#|track\\s|browser\\s)/;\nfunction genesFromBed(text) {\n const rows = [];\n for (const line of text.split(\"\\n\")) {\n const cols = line.replace(/\\r$/, \"\").split(\"\t\");\n const start = Number(cols[1]);\n const end = Number(cols[2]);\n if (BED_HEADER.test(line) || cols.length < 3 || !Number.isInteger(start) || !(end > start)) {\n continue;\n }\n const refName = cols[0];\n const name = cols[3] && cols[3] !== \".\" ? cols[3] : `${refName}:${start + 1}-${end}`;\n const sizes = cols[10]?.split(\",\").filter((s) => s !== \"\").map(Number);\n const starts = cols[11]?.split(\",\").filter((s) => s !== \"\").map(Number);\n const blocks = sizes?.length && sizes.length === starts?.length ? sizes.map((size, i) => ({\n start: start + starts[i],\n end: start + starts[i] + size\n })) : [{ start, end }];\n rows.push({\n name,\n refName,\n start,\n end,\n strand: strandOf(cols[5]),\n exons: blocks\n });\n }\n return mergeOverlappingByName(rows);\n}\nfunction sniffedFormat(text) {\n const first = text.split(\"\\n\", 1e3).find((l) => l.trim() !== \"\" && !BED_HEADER.test(l));\n const cols = first?.split(\"\t\") ?? [];\n return /^\\d+$/.test(cols[1] ?? \"\") && /^\\d+$/.test(cols[2] ?? \"\") ? \"bed\" : \"gff3\";\n}\nfunction genesFromText(text, format = sniffedFormat(text)) {\n return format === \"bed\" ? genesFromBed(text) : genesFromGff3Lines(text.split(/\\r?\\n/));\n}\n\nexport {\n mergedIntervals,\n genesFromGff3Lines,\n mergeOverlappingByName,\n genesFromBed,\n genesFromText\n};\n", "import {\n mergeOverlappingByName,\n mergedIntervals,\n} from '@jbrowse/bandage-core/genes/geneFiles'\nimport { readConfObject } from '@jbrowse/core/configuration'\n\nimport { REPEAT_TRACK_HINT } from '../repeats/repeatFeatures'\nimport { namedTrack, ownField, trackLabel } from '../trackFeatures'\n\nimport type { FeatureLike, TrackChoice } from '../trackFeatures'\nimport type { GeneModel } from '@jbrowse/bandage-core/genes/genePins'\nimport type { AnyConfigurationModel } from '@jbrowse/core/configuration'\n\n// The adapters whose tracks hold gene models, in the order the session's\n// tracks are searched when no track is named.\nexport const GENE_ADAPTER_TYPES = new Set([\n 'Gff3TabixAdapter',\n 'Gff3Adapter',\n 'BedTabixAdapter',\n 'BedAdapter',\n 'GtfTabixAdapter',\n 'GtfAdapter',\n 'BigBedAdapter',\n 'NCListAdapter',\n])\n\nconst GENE_TRACK_HINT = /gene|refseq|gencode|ensembl|annotation/i\n\n// A BED track is as often peaks or repeats as genes, so one counts only where\n// its name says it is annotation\nconst BED_ADAPTER_TYPES = new Set(['BedTabixAdapter', 'BedAdapter'])\n\n// Which of the session's tracks to read genes from: the named one while the\n// assembly has it (a saved pick can name a track since removed), else the\n// first gene-bearing track on the assembly whose name says it is annotation,\n// else the first non-BED gene-bearing track. A track whose name says repeats is\n// never picked unnamed, as \"RepeatMasker annotation\" would be.\nexport function pickGeneTrack<T extends TrackChoice>(\n tracks: T[],\n named: string,\n) {\n const chosen = named ? namedTrack(tracks, named) : undefined\n if (chosen) {\n return chosen\n }\n const candidates = tracks.filter(\n t =>\n GENE_ADAPTER_TYPES.has(t.adapterType) &&\n !REPEAT_TRACK_HINT.test(trackLabel(t)),\n )\n return (\n candidates.find(t => GENE_TRACK_HINT.test(trackLabel(t))) ??\n candidates.find(t => !BED_ADAPTER_TYPES.has(t.adapterType))\n )\n}\n\nconst TE_TRACK_HINT = /\\bTEs?\\b|transpos/i\n\n// What a walk row's boxes are, for the key: TEs where the annotation track's\n// name says so, else genes\nexport function annotationNoun(track: TrackChoice | undefined) {\n return track && TE_TRACK_HINT.test(trackLabel(track)) ? 'TE' : 'gene'\n}\n\ninterface LaneView {\n tracks?: readonly {\n configuration: AnyConfigurationModel\n displays: readonly { configuration: AnyConfigurationModel }[]\n }[]\n}\n\n// The `filter` of the gene track's lane in the view the graph is drawn in, so\n// the chips name what the lane draws. None where the view shows no such lane,\n// or has no tracks, as a graph genome view of its own.\nexport function laneFilters(view: object, trackId: string | undefined) {\n const lane = (view as LaneView).tracks?.find(\n t => readConfObject(t.configuration, 'trackId') === trackId,\n )?.displays[0]\n return lane\n ? ((readConfObject(lane.configuration, 'filter') as string[] | undefined) ??\n [])\n : []\n}\n\n// Records spanning a whole sequence, the types the GFF3 adapter declines to\n// widen a fetch for. RefSeq opens every molecule with a `region` named\n// ANONYMOUS.\nconst WHOLE_SEQUENCE_TYPES = new Set([\n 'chromosome',\n 'region',\n 'contig',\n 'supercontig',\n 'scaffold',\n])\n\n// JBrowse's BED parser splits a coding BED12 block into CDS and UTR parts and\n// keeps `exon` for non-coding ones, so all of them are exon\nconst EXON_PARTS = new Set([\n 'exon',\n 'CDS',\n 'five_prime_UTR',\n 'three_prime_UTR',\n 'UTR',\n])\n\nfunction exonsOf(f: FeatureLike, into: { start: number; end: number }[]) {\n const type = ownField(f, 'type')\n if (typeof type === 'string' && EXON_PARTS.has(type)) {\n into.push({\n start: ownField(f, 'start') as number,\n end: ownField(f, 'end') as number,\n })\n }\n const children = ownField(f, 'subfeatures') as FeatureLike[] | undefined\n for (const child of children ?? []) {\n exonsOf(child, into)\n }\n}\n\n// Genes from a track's features: every top-level feature but a whole-sequence\n// record, named by the first of gene_name, name, gene and gene_id it carries,\n// with the exons found anywhere under it merged. A feature with no exons is one exon,\n// its whole span. A BED track gives one feature per transcript, so a name's\n// overlapping features merge, while its copies down the contig stay apart.\n// UCSC's ncbiRefSeq.gff gene records carry their symbol only as gene_id. A\n// feature with none of those names is left out: its raw ID, RefSeq's\n// `id-NC_000913.3:1978503..1979270`, only restates where it is.\nexport function geneModelsFrom(features: FeatureLike[]): GeneModel[] {\n const genes: GeneModel[] = []\n for (const f of features) {\n const name =\n (ownField(f, 'gene_name') as string | undefined) ??\n (ownField(f, 'name') as string | undefined) ??\n (ownField(f, 'gene') as string | undefined) ??\n (ownField(f, 'gene_id') as string | undefined)\n const start = ownField(f, 'start') as number\n const end = ownField(f, 'end') as number\n if (\n !name ||\n !(end > start) ||\n WHOLE_SEQUENCE_TYPES.has(ownField(f, 'type') as string)\n ) {\n continue\n }\n const exons: { start: number; end: number }[] = []\n exonsOf(f, exons)\n genes.push({\n name,\n refName: ownField(f, 'refName') as string,\n start,\n end,\n strand: (ownField(f, 'strand') as number | undefined) ?? 0,\n exons: exons.length ? mergedIntervals(exons) : [{ start, end }],\n })\n }\n return mergeOverlappingByName(genes)\n}\n", "const host = JBrowseExports[\"tss-react/mui\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"tss-react/mui\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host"],
|
|
5
|
+
"mappings": "uKAAA,IAAIA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,CACT,KAAAC,EACA,QAASN,EAASH,EAAG,SAAS,EAC9B,MAAAU,EACA,IAAAC,EACA,OAASR,EAASH,EAAG,QAAQ,GAA4B,EACzD,MAAOY,EAAM,OAASC,EAAgBD,CAAK,EAAI,CAAC,CAAE,MAAAF,EAAO,IAAAC,CAAI,CAAC,CAChE,CAAC,CACH,CACA,OAAOG,EAAuBN,CAAK,CACrC,CC5JA,IAAMO,EAAO,eAAe,eAAe,EACrCC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MAAM,kCAAoCA,EAAO,+HAA8I,CAC3M,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAGC,IAAMC,GAA6BC,GAAK,YAAY,EACpDC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA",
|
|
6
|
+
"names": ["cached", "loadFmmm", "mod", "fmmmLayout", "request", "loadFmmm", "LAYOUT_ENGINES", "LAYOUT_ENGINE_VALUES", "layoutEngine", "request", "start", "stressLayout", "fmmmLayout", "isStringArray", "value", "item", "trackLanes", "track", "lanes", "getConfAssemblyNamesOrNone", "walkIndexed", "adapterConfig", "snapshotNamesFile", "cutsByHaplotype", "configHaplotypes", "defaultHaplotypes", "graphReferenceAssembly", "trackAdapterSnapshot", "toTrackConfigEntry", "offReferenceProblem", "referenceAssembly", "assemblyName", "ownField", "f", "name", "namedTrack", "tracks", "named", "trackLabel", "t", "REPEAT_ADAPTER_TYPES", "REPEAT_TRACK_HINT", "pickRepeatTrack", "tracks", "named", "chosen", "namedTrack", "t", "trackLabel", "PACKED_NAME", "packedName", "f", "name", "ownField", "pair", "i", "field", "top", "MOTIF_FIELDS", "PERIOD_FIELDS", "NAME_FIELDS", "first", "names", "value", "one", "IUPAC", "repeatUnitOf", "period", "motif", "numbers", "n", "strings", "text", "TANDEM_REPEAT", "tandemAlleleBp", "alts", "rn", "rus", "rul", "ruc", "rb", "k", "alt", "bp", "known", "j", "unitLength", "count", "runBp", "genotyped", "gt", "alleleBp", "referenceBp", "phased", "index", "callsOf", "samples", "called", "sample", "fields", "reads", "lengths", "calls", "spanOf", "tandem", "start", "end", "svlen", "repeatArraysFrom", "features", "arrays", "unit", "refName", "stated", "a", "b", "mergedIntervals", "intervals", "out", "iv", "a", "b", "last", "mergeOverlappingByName", "genes", "out", "open", "g", "a", "b", "key", "last", "mergedIntervals", "gene", "GENE_ADAPTER_TYPES", "GENE_TRACK_HINT", "BED_ADAPTER_TYPES", "pickGeneTrack", "tracks", "named", "chosen", "namedTrack", "candidates", "t", "REPEAT_TRACK_HINT", "trackLabel", "TE_TRACK_HINT", "annotationNoun", "track", "laneFilters", "view", "trackId", "lane", "readConfObject", "WHOLE_SEQUENCE_TYPES", "EXON_PARTS", "exonsOf", "f", "into", "type", "ownField", "children", "child", "geneModelsFrom", "features", "genes", "name", "start", "end", "exons", "mergedIntervals", "mergeOverlappingByName", "host", "read", "name", "makeStyles", "read", "mui_default", "host"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var et=40,vt=500,it=5;function Jt(o,t){return Math.max(o.nodeLengthPerMegabase*t/1e6,o.minimumNodeLength)}function Lt(o,t=it){let e=o.nodes.reduce((i,r)=>i+r.length,0)/1e6,s=Math.max(o.nodes.length*et,vt);return{nodeLengthPerMegabase:e>0?s/e:1e4,minimumNodeLength:Math.max(it,t),edgeLength:5,nodeSegmentLength:20}}var tt={power:1,effect:1};function Et(o){return o.power===1&&o.effect===1}function kt(o,t){let n=o.nodes.length,e=o.nodes.reduce((r,l)=>r+l.length,0),s=n>0?e/n:0,i=n>0?Math.max(n*et,vt)/n:et;return r=>{if(s<=0)return i;let l=(r/s)**t.power;return Math.max(i*((l-1)*t.effect+1),it)}}var bt=1e3,Pt={law:tt,minNodeLength:0};function Nn(o,t=Pt){let{law:n,minNodeLength:e}=t,s=Lt(o,e);if(Et(n))return{nodes:o.nodes,opts:s};let i=kt(o,n);return{nodes:o.nodes.map(r=>({...r,length:Math.round(i(r.length)*bt)})),opts:{...s,nodeLengthPerMegabase:1e6/bt,minimumNodeLength:it}}}function bn(o,t=Pt){if(Et(t.law)){let n=Lt(o,t.minNodeLength);return e=>Jt(n,e)}return kt(o,t.law)}var ft=[{value:"auto",label:"Proportional",description:"Bandage's own scale: a node draws proportional to its length, so a 1 bp allele is a speck.",law:tt,minNodeFactor:0},{value:"open",label:"Open bubbles",description:"Give every allele a drawn length, so a bubble reads as two arms rather than a knot.",law:tt,minNodeFactor:2.5},{value:"wide",label:"Wide bubbles",description:"As open, spread further. Best on a window of a dozen bubbles.",law:tt,minNodeFactor:10},{value:"compress",label:"Compress lengths",description:"Pull the longest and shortest nodes towards the graph\u2019s mean, so a cut spanning kb and bp fits one pane.",law:{power:.5,effect:.5},minNodeFactor:0}],Zt=ft.map(o=>o.value);function Xt(o){let t=ft.find(n=>n.value===o);return{law:t?.law??tt,minNodeLength:(t?.minNodeFactor??0)*et}}var Gt="\0deletion:";var St=25*Math.PI/180,_t=.25,It=150,Yt=[0,-.35,.35,-.7,.7,-1.05,1.05,-1.4,1.4],ut=[0,1];function Ot(o){return o?0:1}function lt(o,t){let n=t.x-o.x,e=t.y-o.y,s=Math.hypot(n,e)||1;return{x:n/s,y:e/s}}function yt(o,t,n){return{x:o.x+(t.x-o.x)*n,y:o.y+(t.y-o.y)*n}}function Ut(o){let t=0,n=0;for(let e of o)t+=e.x,n+=e.y;return{x:t/o.length,y:n/o.length}}function Ht(o){let t=new Float64Array(o.length);for(let n=1;n<o.length;n++)t[n]=t[n-1]+Math.hypot(o[n].x-o[n-1].x,o[n].y-o[n-1].y);return t}function Ct(o){var t;return(t=Ht(o)[o.length-1])!==null&&t!==void 0?t:0}var ct=new Map;function tn(o){let t=ct.get(o);if(t!==void 0)return t;let n=nn(o);return ct.size>1e4&&ct.clear(),ct.set(o,n),n}function nn(o){let t=1e-6,n=2*Math.PI-1e-6;for(let e=0;e<60;e++){let s=(t+n)/2;s/(2*Math.sin(s/2))<o?t=s:n=s}return(t+n)/2}function en(o,t){if(o<1e-9)return Math.PI*t;let n=(o*o/4+t*t)/(2*t),e=2*Math.asin(Math.min(1,o/(2*n)));return n*(t>n?2*Math.PI-e:e)}function dt(o,t,n,e){let s=t-2*n,i=o<1e-9?2*Math.PI:tn(s/o),r=s/i,l=Math.cos(i/2),d=o/2,a=e+n-r*l;return{at:c=>{if(c<=n)return{u:0,v:e+c};if(c>=t-n)return{u:o,v:e+t-c};let h=(c-n)/r-i/2;return{u:d+r*Math.sin(h),v:a+r*Math.cos(h)}},apex:e+n+r*(1-l),length:t}}function Tt(o,t,n){if(!n)return o;let e=Math.cos(n),s=Math.sin(n);return{...o,at:i=>{let{u:r,v:l}=o.at(i),d=r-t/2;return{u:t/2+d*e-l*s,v:d*s+l*e}}}}function on(o){for(let t=0;t<=32;t++)if(o.at(o.length*t/32).v<-1e-6)return!0;return!1}function Ft(o,t,n,e,s){return{at:i=>({u:o+n*i,v:t+e*i}),apex:t+Math.max(0,e)*s,length:s}}var ot=class{constructor(t,n,e=!1){var s;this.pts=t,this.normals=n,this.straight=e,this.arc=Ht(t),this.total=(s=this.arc[t.length-1])!==null&&s!==void 0?s:0}segment(t){let{arc:n}=this,e=1,s=n.length-1;for(;e<s;){let i=e+s>>1;n[i]<t?e=i+1:s=i}return e}fraction(t,n){let e=this.arc[t]-this.arc[t-1];return e>0?(n-this.arc[t-1])/e:0}pointAt(t){let{pts:n}=this,e=n.length-1;if(e===0)return{...n[0]};if(t<=0){let i=lt(n[0],n[1]);return{x:n[0].x+i.x*t,y:n[0].y+i.y*t}}if(t>=this.total){let i=lt(n[e-1],n[e]),r=t-this.total;return{x:n[e].x+i.x*r,y:n[e].y+i.y*r}}let s=this.segment(t);return yt(n[s-1],n[s],this.fraction(s,t))}normalAt(t){let{normals:n}=this;if(n.length===1||t<=0)return n[0];if(t>=this.total)return n[n.length-1];let e=this.segment(t),{x:s,y:i}=yt(n[e-1],n[e],this.fraction(e,t)),r=Math.hypot(s,i)||1;return{x:s/r,y:i/r}}};function sn(o,t){let n=Ut(o);return o.map((e,s)=>{let i=lt(o[Math.max(0,s-1)],o[Math.min(o.length-1,s+1)]),r={x:-i.y,y:i.x},l=e.x-n.x,d=e.y-n.y,a=Math.hypot(l,d),c=r.x*l+r.y*d,h=t[s],f=a>1e-9&&Math.abs(c)>.3*a?Math.sign(c):Math.sign(r.x*h.x+r.y*h.y)||1;return{x:r.x*f,y:r.y*f}})}function gt(o,t,n,e,s){let i=Math.min(s,Math.max(e.length/24,.5)),r=[],l=[];for(let d=0;d<=e.length+1e-9;d+=i){let{u:a,v:c}=e.at(Math.min(d,e.length)),h=o.pointAt(t+a),f=o.normalAt(t+a),u=f.x*n,x=f.y*n;r.push({x:h.x+u*c,y:h.y+x*c}),l.push({x:u,y:x})}return{pts:r,refs:l}}var Rt=5,rn=10.5/2;function pt(o,t,n,e,s,i){let r=s,l=gt(o,t,n,e(r),i);if(o.straight)return l;for(let d=0;d<6;d++){let a=Ct(l.pts);if(!(a>0)||Math.abs(a/s-1)<.001)break;r*=s/a,l=gt(o,t,n,e(r),i)}return l}function at(o,t){return Array.from({length:t},(n,e)=>o+e*15/2)}function Bt(o){if(o.length===0)return 1/0;let t=1/0,n=-1/0;for(let e of o)t=Math.min(t,e.point.x),n=Math.max(n,e.point.x);return n-t}function Dt(o,t){return o*73856093^t*19349663}var ht=class{constructor(t){this.c=t,this.grid=new Map;let{ids:n,first:e,count:s,per:i,seedX:r,seedY:l,backbone:d}=t,a=n.length;this.points=Array.from({length:a},()=>{}),this.params=Array.from({length:a},()=>{}),this.curves=Array.from({length:a},()=>{}),this.links=t.links.map((f,u)=>f.map(x=>x.filter(([M])=>M!==u))),this.route=n.map(f=>f.startsWith(Gt));let c=1/0,h=-1/0;for(let f=0;f<a;f++){let u=e[f];!d[u]||Number.isNaN(r[u])||(c=Math.min(c,r[u]),h=Math.max(h,r[u]+i[f]*(s[f]-1)))}this.backbone=new ot([{x:c,y:0},{x:h,y:0}],[{x:0,y:1},{x:0,y:1}],!0),this.backboneCentroid={x:(c+h)/2,y:0};for(let f=0;f<a;f++){let u=e[f];if(!d[u]||Number.isNaN(r[u]))continue;let x=[],M=[];for(let v=0;v<s[f];v++){let U=r[u]+v*i[f];x.push({x:U,y:l[u]}),M.push(U-c)}this.points[f]=x,this.params[f]=M,this.curves[f]=this.backbone,this.occupy(x,this.backbone)}}static hasBackbone(t){for(let n=0;n<t.ids.length;n++){let e=t.first[n];if(t.backbone[e]&&!Number.isNaN(t.seedX[e]))return!0}return!1}run(){let t=[];for(let e=0;e<this.points.length;e++)this.points[e]||t.push(e);let n=this.componentsOf(t).map(e=>({members:e,anchors:this.anchorsOf(e)})).filter(e=>e.anchors.length).map(e=>({members:e.members,span:Bt(e.anchors),drawn:e.members.reduce((s,i)=>s+this.drawn(i),0),feet:e.anchors.map(s=>`${s.point.x},${s.point.y}`).sort().join(" ")})).sort((e,s)=>e.span-s.span||(e.feet===s.feet?s.drawn-e.drawn:e.drawn-s.drawn));for(let e of n)this.placePiece(e.members,this.backboneCentroid)}write(t,n){let{first:e}=this.c;this.points.forEach((s,i)=>{s?.forEach((r,l)=>{t[e[i]+l]=r.x,n[e[i]+l]=r.y})})}drawn(t){return this.c.per[t]*(this.c.count[t]-1)}endIndex(t,n){return n?this.c.count[t]-1:0}occupy(t,n){for(let e of t){let s=Dt(Math.floor(e.x/10.5),Math.floor(e.y/10.5)),i=this.grid.get(s),r={x:e.x,y:e.y,curve:n};i?i.push(r):this.grid.set(s,[r])}}violations(t,n,e,s){var i;let r=0;for(let l of t){if(e.some(c=>Math.hypot(l.x-c.x,l.y-c.y)<15))continue;let d=Math.floor(l.x/10.5),a=Math.floor(l.y/10.5);for(let c=d-1;c<=d+1;c++)for(let h=a-1;h<=a+1;h++)for(let f of(i=this.grid.get(Dt(c,h)))!==null&&i!==void 0?i:[])if(f.curve!==n&&Math.hypot(l.x-f.x,l.y-f.y)<10.5&&(r++,r>=s))return r}return r}choose(t,n,e){let s,i=1/0;for(let r of t){let l=this.violations(r(rn).pts,n,e,i);if(l===0)return r(Rt);l<i&&(i=l,s=r)}return s(Rt)}anchorsOf(t){let n=new Set(t),e=[];for(let s of t)for(let i of ut)for(let[r,l]of this.links[s][i]){let d=this.points[r];if(n.has(r)||!d)continue;let a=this.endIndex(r,l);e.push({u:s,uSide:i,v:r,vSide:l,point:d[a],curve:this.curves[r],t:this.params[r][a]})}return e}componentsOf(t){let n=new Set(t),e=new Set,s=[];for(let i of t){if(e.has(i))continue;let r=[i];e.add(i);for(let l of r)for(let d of ut)for(let[a]of this.links[l][d])n.has(a)&&!e.has(a)&&(e.add(a),r.push(a));s.push(r)}return s}spinePath(t,n,e,s,i){let r=new Set(t),l=(u,x)=>u*2+x,d=(u,x)=>u===s&&Ot(x)===i,a=new Map([[l(n,e),-1]]),c=[[n,e]],h=[n,e];for(let[u,x]of c){if(h=[u,x],s!==void 0&&d(u,x))break;for(let[M,v]of this.links[u][Ot(x)])!r.has(M)||a.has(l(M,v))||(a.set(l(M,v),l(u,x)),c.push([M,v]))}if(s!==void 0&&!d(h[0],h[1]))return;let f=[];for(let u=l(h[0],h[1]);u!==-1;u=a.get(u))f.push({k:u>>1,enter:u&1});return f.reverse()}loosePath(t,n,e){let s=new Set(t),i=new Map([[n,-1]]),r=new Map([[n,0]]),l=[n];for(let a of l){if(a===e)break;for(let c of ut)for(let[h,f]of this.links[a][c])!s.has(h)||i.has(h)||(i.set(h,a),r.set(h,f),l.push(h))}let d=[];for(let a=e;a!==-1;a=i.get(a))d.push({k:a,enter:r.get(a)});return d.reverse()}spineLength(t){let{link:n}=this.c;return t.reduce((e,{k:s})=>e+this.drawn(s)+n,n)}layAlong(t,n,e,s){let{count:i,per:r,link:l}=this.c,d=e,a=[];for(let{k:c,enter:h}of t){let f=s??r[c],u=[],x=[];for(let M=0;M<i[c];M++)u.push(n.pointAt(d+M*f)),x.push(d+M*f);h===1&&(u.reverse(),x.reverse()),this.points[c]=u,this.params[c]=x,this.curves[c]=n,a.push(...u),d+=f*(i[c]-1)+l}return a}arcCandidates(t,n,e,s,i){let r=(i-s)/2-1e-6,l=i>2*s?Yt:[0],d=[];for(let a of at(0,8))for(let c of l)for(let h=0;h<=16;h++){let f=r*h/16,u=Tt(dt(s,i,f,a),s,c);h<16&&u.apex<12||on(u)||d.push(x=>pt(t,n,e,M=>Tt(dt(s,M,Math.min(f,(M-s)/2-1e-6),a),s,c),i,x))}return d}placePiece(t,n){var e;let{count:s,link:i}=this.c,r=this.anchorsOf(t);if(r.length===0)return;let l=t.every(m=>this.route[m]),d=r.every(m=>m.curve===r[0].curve)?r[0].curve:void 0,a,c,h,f;if(d)r.sort((m,F)=>m.t-F.t),a=d,c=r[0].t,h=r[r.length-1].t,f=a===this.backbone&&l?-1:1;else{r.sort((q,J)=>q.point.x-J.point.x||q.point.y-J.point.y);let m=r[0].point,F=r[r.length-1].point,W=Math.hypot(F.x-m.x,F.y-m.y),B=W>1e-9?lt(m,F):{x:1,y:0},D={x:-B.y,y:B.x},H=yt(m,F,.5);f=r.some(q=>q.curve===this.backbone)?(l?-1:1)*(Math.sign(D.y)||1):(H.x-n.x)*D.x+(H.y-n.y)*D.y>=0?1:-1,a=new ot([m,F],[D,D],!0),c=0,h=W}let u=r[0],x=r[r.length-1],M=h-c,v=r.length===1||u.u===x.u&&u.uSide===x.uSide&&M<1e-9,U=[u.point,x.point],b=m=>this.choose(m,d,U),A,g,L=i,w;if(v){A=this.spinePath(t,u.u,u.uSide);let m=this.spineLength(A),F=u.vSide?Math.max(0,s[u.v]-2):Math.min(1,s[u.v]-1),B=(u.t>=this.params[u.v][F]?1:-1)*Math.cos(St),D=Math.sin(St);g=b(at(0,12).map(H=>q=>pt(a,c,f,J=>Ft(0,H,B,D,J),m,q)))}else{A=(e=this.spinePath(t,u.u,u.uSide,x.u,x.uSide))!==null&&e!==void 0?e:this.loosePath(t,u.u,x.u);let m=this.spineLength(A);if(l){let F=Math.max(12,Math.min(_t*M,It));g=b(at(F,12).map(B=>D=>gt(a,c,f,dt(M,en(M,B),0,0),D)));let W=Ct(g.pts);w=Math.max(.001,(W-2*i)/(s[A[0].k]-1))}else if(m>M+1e-6)g=b(this.arcCandidates(a,c,f,M,m));else{let F=m-2*i,W=Math.max(12,Math.min(_t*(M-F),It));g=b(at(W,12).map(B=>D=>pt(a,c,f,H=>Ft(M/2-H/2,B,1,0,H),F,D))),L=0}}let E=new ot(g.pts,sn(g.pts,g.refs)),O=this.layAlong(A,E,L,w);this.occupy(O,E);let _=Ut(O),R=t.filter(m=>!this.points[m]),T=this.componentsOf(R).map(m=>({members:m,span:Bt(this.anchorsOf(m))})).sort((m,F)=>m.span-F.span);for(let m of T)this.placePiece(m.members,_)}};function xt(o){let t=new Float64Array(o.n).fill(NaN),n=new Float64Array(o.n).fill(NaN);if(ht.hasBackbone(o)){let e=new ht(o);e.run(),e.write(t,n)}return{X:t,Y:n}}var cn=[{walks:2,iterations:15},{walks:4,iterations:30},{walks:8,iterations:60},{walks:12,iterations:90},{walks:16,iterations:120}],an=20,ln=3,mt=.3,hn=2,fn=200,un=.1,dn=.5,pn=o=>{var t;return((t=o.stable)===null||t===void 0?void 0:t.rank)===0};function Wt(o,t){let n=t.at(-1);return(o==="+"||o==="-")&&(n==="+"||n==="-")&&o!==n}function yn(o){let t=Math.imul(o,2654435761)>>>0||1;return()=>(t^=t<<13,t>>>=0,t^=t>>>17,t^=t<<5,t>>>=0,t/4294967296)}function z(o,t){return typeof o=="number"&&Number.isFinite(o)?o:t}function Mt(o,t){return Math.max(z(o.nodeLengthPerMegabase,1e3)*t/1e6,z(o.minimumNodeLength,1))}function qt(o){let{nodes:t,edges:n}=o.graph,e=o.options,s=z(e.nodeSegmentLength,1),i=z(e.edgeLength,1),r=t.map(w=>w.id),l=new Int32Array(t.length),d=new Int32Array(t.length),a=new Float64Array(t.length),c=0;t.forEach((w,E)=>{let O=Mt(e,w.length),_=Math.max(1,Math.ceil(O/s));l[E]=c,d[E]=_+1,a[E]=O/_,c+=_+1});let h=new Int32Array(c),f=new Int32Array(c),u=new Float64Array(c).fill(NaN),x=new Float64Array(c).fill(NaN),M=new Uint8Array(c),v=Array.from({length:c},()=>[]);t.forEach((w,E)=>{let O=typeof w.x=="number"&&typeof w.y=="number",_=pn(w)?1:0;for(let R=0;R<d[E];R++){let T=l[E]+R;h[T]=E,f[T]=R,M[T]=_,O&&(u[T]=w.x+R*a[E],x[T]=w.y),R>0&&(v[T-1].push([T,a[E]]),v[T].push([T-1,a[E]]))}});let U=new Map(r.map((w,E)=>[w,E])),b=t.map(()=>[[],[]]);for(let w of n){let E=U.get(w.from),O=U.get(w.to);if(E===void 0||O===void 0||E===O&&d[E]<=2)continue;let _=Wt(w.fromStrand,w.from)?0:1,R=Wt(w.toStrand,w.to)?1:0,T=l[E]+(_?d[E]-1:0),m=l[O]+(R?d[O]-1:0);v[T].push([m,i]),v[m].push([T,i]),b[E][_].push([O,R]),b[O][R].push([E,_])}let A=new Int32Array(c+1);for(let w=0;w<c;w++)A[w+1]=A[w]+v[w].length;let g=new Int32Array(A[c]),L=new Float64Array(A[c]);for(let w=0;w<c;w++)v[w].forEach(([E,O],_)=>{g[A[w]+_]=E,L[A[w]+_]=O});return{ids:r,first:l,count:d,per:a,links:b,chainOf:h,indexOf:f,seedX:u,seedY:x,backbone:M,off:A,nb:g,wt:L,n:c,link:i}}function gn(o){let{n:t,off:n,nb:e}=o,s=new Int32Array(t).fill(-1),i=[];for(let r=0;r<t;r++){if(s[r]>=0)continue;let l=[r];s[r]=i.length;for(let d of l)for(let a=n[d];a<n[d+1];a++){let c=e[a];s[c]<0&&(s[c]=i.length,l.push(c))}i.push(l)}return{comp:s,members:i}}function xn(o,t={}){var n,e,s;let i=qt(o),{n:r,off:l,nb:d,wt:a,seedX:c,seedY:h,first:f,count:u,per:x,link:M}=i,v=o.options,U=cn[Math.max(0,Math.min(4,z((n=t.quality)!==null&&n!==void 0?n:v.quality,2)))],b=z((e=t.componentSeparation)!==null&&e!==void 0?e:v.componentSeparation,15),A=yn(z((s=t.seed)!==null&&s!==void 0?s:v.seed,1)),g=new Float64Array(r),L=new Float64Array(r),w={};if(r===0)return{nodePositions:w};let{comp:E,members:O}=gn(i),_=1/0,R=0;for(let p=0;p<d.length;p++)_=Math.min(_,a[p]),R+=a[p];R/=2;let T=!1;for(let p=0;p<r;p++)if(!Number.isNaN(c[p])){T=!0;break}let m=T?xt(i):void 0,F=Math.sqrt(r)*20;for(let p=0;p<r;p++)m&&!Number.isNaN(m.X[p])?(g[p]=m.X[p],L[p]=m.Y[p]):T&&!Number.isNaN(c[p])?(g[p]=c[p]+A()-.5,L[p]=h[p]+A()-.5):(g[p]=A()*F,L[p]=A()*F);let W=O.map(p=>m!==void 0&&p.every(N=>!Number.isNaN(m.X[N]))),B=[],D=!0;for(let p=0;p<r;p++)W[E[p]]||(B.push(p),D&&(D=!Number.isNaN(c[p])));let H=Math.max(R/4,_*10),q=H*H,J=un*_*_,{walks:Kt,iterations:st}=U,Vt=Math.log(q/J)/Math.max(1,st-1),wt=Math.log(_),jt=Math.log(H),At=(p,N,y,k)=>{let S=k/(y*y);S>1&&(S=1);let P=g[p]-g[N],I=L[p]-L[N],V=Math.sqrt(P*P+I*I)||1e-9,G=S*(V-y)/(2*V),j=G*P,C=G*I;g[p]=g[p]-j,L[p]=L[p]-C,g[N]=g[N]+j,L[N]=L[N]+C},nt=0,zt=(p,N)=>{let y=i.chainOf[p],k=i.indexOf[p],S=A()<.5?-1:1,P=N;for(let I=0;I<fn;I++){let V=u[y],G=x[y],j=(S>0?V-1-k:k)*G;if(P<=j){let Q=Math.round(P/G);return nt=N-P+Q*G,f[y]+k+S*Q}P-=j;let C=i.links[y][S>0?1:0];if(C.length===0)return nt=N-P,f[y]+(S>0?V-1:0);let[X,$]=C[Math.floor(A()*C.length)];if(P-=M,y=X,S=$===0?1:-1,k=$===0?0:u[X]-1,P<=0)return nt=N-P,f[y]+k}return-1},Nt=(p,N)=>{for(let y=l[p];y<l[p+1];y++){let k=d[y];k>p&&At(p,k,a[y],N)}},Z=Int32Array.from(B),$t=D?Math.floor(dn*st):0;for(let p=B.length?$t:st;p<st;p++){let N=q*Math.exp(-Vt*p);for(let y=Z.length-1;y>0;y--){let k=Math.floor(A()*(y+1)),S=Z[y];Z[y]=Z[k],Z[k]=S}for(let y of Z){Nt(y,N);for(let k=0;k<Kt;k++){let S=Math.exp(wt+A()*(jt-wt)),P=zt(y,S);P>=0&&P!==y&&nt>0&&At(y,P,nt,N)}}}let K=ln*M,Qt=(p,N)=>Math.floor(p/K)*73856093^Math.floor(N/K)*19349663;for(let p=0;p<(B.length?an:0);p++){let N=new Map;for(let y of B){let k=Qt(g[y],L[y]),S=N.get(k);S?S.push(y):N.set(k,[y])}for(let y of B){let k=Math.floor(g[y]/K),S=Math.floor(L[y]/K);for(let P=k-1;P<=k+1;P++)for(let I=S-1;I<=S+1;I++){let V=N.get(P*73856093^I*19349663);if(V)for(let G of V){if(G<=y)continue;let j=!1;for(let Y=l[y];Y<l[y+1];Y++)if(d[Y]===G){j=!0;break}if(j)continue;let C=g[y]-g[G],X=L[y]-L[G],$=Math.sqrt(C*C+X*X);if($>=K)continue;let Q,rt;if($>1e-6){let Y=mt*(K-$)/(2*$);Q=Y*C,rt=Y*X}else Q=mt*K*(A()-.5),rt=mt*K*(A()-.5);g[y]=g[y]+Q,L[y]=L[y]+rt,g[G]=g[G]-Q,L[G]=L[G]-rt}}}for(let y of B)Nt(y,1/0)}for(let p=0;p<u.length;p++){let N=f[p],y=u[p];if(!(y<3)){for(let k=0;k<hn;k++){let S=g.slice(N,N+y),P=L.slice(N,N+y);for(let I=1;I+1<y;I++)g[N+I]=.5*S[I]+.25*(S[I-1]+S[I+1]),L[N+I]=.5*P[I]+.25*(P[I-1]+P[I+1])}mn(g,L,N,y,x[p])}}wn(E,O,g,L,T,b);for(let p=0;p<i.ids.length;p++){let N=[];for(let y=0;y<u[p];y++)N.push({x:g[f[p]+y],y:L[f[p]+y]});w[i.ids[p]]=N}return{nodePositions:w}}function mn(o,t,n,e,s){Mn(o,t,n,e,s*(e-1));let i=new Float64Array(e);for(let c=1;c<e;c++)i[c]=i[c-1]+Math.hypot(o[n+c]-o[n+c-1],t[n+c]-t[n+c-1]);if(!i[e-1])return;let r=i[e-1],l=o.slice(n,n+e),d=t.slice(n,n+e),a=1;for(let c=1;c+1<e;c++){let h=r*c/(e-1);for(;a<e-1&&i[a]<h;)a++;let f=i[a]-i[a-1],u=f>0?(h-i[a-1])/f:0;o[n+c]=l[a-1]+(l[a]-l[a-1])*u,t[n+c]=d[a-1]+(d[a]-d[a-1])*u}}function Mn(o,t,n,e,s){let i=n+e-1,r=o[n],l=t[n],d=Math.hypot(o[i]-r,t[i]-l),a=d>1e-9?(o[i]-r)/d:1,c=d>1e-9?(t[i]-l)/d:0,h=new Float64Array(e),f=new Float64Array(e),u=!0;for(let b=0;b<e;b++){let A=o[n+b]-r,g=t[n+b]-l;h[b]=A*a+g*c,f[b]=g*a-A*c,u&&(u=Math.abs(f[b])<1e-6)}let x=b=>{let A=0;for(let g=1;g<e;g++)A+=Math.hypot(h[g]-h[g-1],b*(f[g]-f[g-1]));return A};if(u||x(1)>=s)return;let M=1,v=2;for(;x(v)<s&&v<1e6;)M=v,v*=2;for(let b=0;b<40;b++){let A=(M+v)/2;x(A)<s?M=A:v=A}let U=(M+v)/2;for(let b=1;b+1<e;b++)o[n+b]=r+h[b]*a-U*f[b]*c,t[n+b]=l+h[b]*c+U*f[b]*a}function wn(o,t,n,e,s,i){if(!s)for(let h of t)An(n,e,h);if(t.length<2)return;let r=new Float64Array(t.length).fill(1/0),l=new Float64Array(t.length).fill(1/0),d=new Float64Array(t.length).fill(-1/0);for(let h=0;h<n.length;h++){let f=o[h];r[f]=Math.min(r[f],n[h]),l[f]=Math.min(l[f],e[h]),d[f]=Math.max(d[f],e[h])}let a=new Float64Array(t.length),c=0;for(let h=0;h<t.length;h++)a[h]=c-l[h],c+=d[h]-l[h]+i;for(let h=0;h<n.length;h++){let f=o[h];n[h]=n[h]-r[f],e[h]=e[h]+a[f]}}function An(o,t,n){if(n.length<3)return;let e=0,s=0;for(let h of n)e+=o[h],s+=t[h];e/=n.length,s/=n.length;let i=0,r=0,l=0;for(let h of n){let f=o[h]-e,u=t[h]-s;i+=f*f,r+=u*u,l+=f*u}let d=-.5*Math.atan2(2*l,i-r),a=Math.cos(d),c=Math.sin(d);for(let h of n){let f=o[h]-e,u=t[h]-s;o[h]=e+a*f-c*u,t[h]=s+c*f+a*u}}export{Gt as a,xn as b,Jt as c,Nn as d,bn as e,ft as f,Zt as g,Xt as h};
|
|
2
|
+
//# sourceMappingURL=chunk-PXYYKSGK.js.map
|