jbrowse-plugin-graphgenomeviewer 8.4.0 → 8.5.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-JAIB6H2T.js → AddTrackWorkflow-IOPTETLH.js} +2 -2
- package/dist/chunks/AddTrackWorkflow-IOPTETLH.js.map +7 -0
- package/dist/chunks/{ChooseSamplesDialog-LO7FKFSS.js → ChooseSamplesDialog-7RI573UO.js} +2 -2
- package/dist/chunks/{ChooseSamplesDialog-LO7FKFSS.js.map → ChooseSamplesDialog-7RI573UO.js.map} +1 -1
- package/dist/chunks/{ChooseWalksDialog-JJSOVCEU.js → ChooseWalksDialog-4LDYDQH2.js} +2 -2
- package/dist/chunks/{ChooseWalksDialog-JJSOVCEU.js.map → ChooseWalksDialog-4LDYDQH2.js.map} +1 -1
- package/dist/chunks/{GbzBaseSyntenyAdapter-CJQVZJPA.js → GbzBaseSyntenyAdapter-W5W2JTWJ.js} +2 -2
- package/dist/chunks/{GraphGenomeView-EM7KNQHB.js → GraphGenomeView-RD2XGX6D.js} +2 -2
- package/dist/chunks/GraphTrackSettingsDialog-R3XOY32L.js +4 -0
- package/dist/chunks/{GraphTrackSettingsDialog-GTQ6Z2HA.js.map → GraphTrackSettingsDialog-R3XOY32L.js.map} +3 -3
- package/dist/chunks/HighlightColorDialog-AKPIC56I.js +2 -0
- package/dist/chunks/{HighlightColorDialog-KNJFIFLO.js.map → HighlightColorDialog-AKPIC56I.js.map} +2 -2
- package/dist/chunks/{LinearGraphDisplay-APDIIF7F.js → LinearGraphDisplay-RRAXTQFC.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-RRAXTQFC.js.map +7 -0
- package/dist/chunks/{MinigraphBubbleAdapter-QEC37MYN.js → MinigraphBubbleAdapter-NWINKWTS.js} +2 -2
- package/dist/chunks/{RgfaTabixAdapter-ZGXDNU43.js → RgfaTabixAdapter-N44KY4YC.js} +2 -2
- package/dist/chunks/{TrackWarningsDialog-4YDIV2FN.js → TrackWarningsDialog-23WL6FPV.js} +2 -2
- package/dist/chunks/{TrackWarningsDialog-4YDIV2FN.js.map → TrackWarningsDialog-23WL6FPV.js.map} +1 -1
- package/dist/chunks/{WalkFormsAdapter-QYFYWQJD.js → WalkFormsAdapter-VDL5XWSU.js} +2 -2
- package/dist/chunks/{WalkTabixSyntenyAdapter-F4XTB7W4.js → WalkTabixSyntenyAdapter-RGJWOHJG.js} +2 -2
- package/dist/chunks/chunk-4XY7HUQR.js +2 -0
- package/dist/chunks/chunk-4XY7HUQR.js.map +7 -0
- package/dist/chunks/chunk-6OZGIMZC.js +2 -0
- package/dist/chunks/chunk-6OZGIMZC.js.map +7 -0
- package/dist/chunks/{chunk-OTBDKJEA.js → chunk-AGUEPVOR.js} +1 -1
- package/dist/chunks/{chunk-OTBDKJEA.js.map → chunk-AGUEPVOR.js.map} +1 -1
- package/dist/chunks/{chunk-ZEE3HTOT.js → chunk-CGPYVMGQ.js} +2 -2
- package/dist/chunks/{chunk-OGQ6OQDN.js → chunk-D6TY2QEG.js} +1 -1
- package/dist/chunks/chunk-D6TY2QEG.js.map +7 -0
- package/dist/chunks/chunk-DIGIM3XY.js +4 -0
- package/dist/chunks/chunk-DIGIM3XY.js.map +7 -0
- package/dist/chunks/{chunk-5Q56NPNH.js → chunk-DRI5R7M7.js} +2 -2
- package/dist/chunks/{chunk-5Q56NPNH.js.map → chunk-DRI5R7M7.js.map} +1 -1
- package/dist/chunks/{chunk-JMBDTNUR.js → chunk-DUU6T2I5.js} +1 -1
- package/dist/chunks/chunk-DUU6T2I5.js.map +7 -0
- package/dist/chunks/chunk-FLKXKTS2.js +2 -0
- package/dist/chunks/chunk-FLKXKTS2.js.map +7 -0
- package/dist/chunks/{chunk-NIEZKWQV.js → chunk-J2PN6CG3.js} +1 -1
- package/dist/chunks/chunk-J2PN6CG3.js.map +7 -0
- package/dist/chunks/{chunk-ROZPEXN4.js → chunk-QUDJ7AM3.js} +1 -1
- package/dist/chunks/chunk-QUDJ7AM3.js.map +7 -0
- package/dist/chunks/{chunk-J5RMHLFJ.js → chunk-TC265JAP.js} +1 -1
- package/dist/chunks/chunk-TC265JAP.js.map +7 -0
- package/dist/chunks/{chunk-3VGXCEMQ.js → chunk-TMM73K4C.js} +1 -1
- package/dist/chunks/chunk-TMM73K4C.js.map +7 -0
- package/dist/chunks/{chunk-KOB7YIMR.js → chunk-V55TK2NP.js} +1 -1
- package/dist/chunks/chunk-V55TK2NP.js.map +7 -0
- package/dist/chunks/{chunk-5Z4VIKXZ.js → chunk-WE7DQVXF.js} +1 -1
- package/dist/chunks/chunk-WE7DQVXF.js.map +7 -0
- package/dist/chunks/{chunk-TL2FTG3H.js → chunk-WE7XHNAH.js} +2 -2
- package/dist/chunks/chunk-WE7XHNAH.js.map +7 -0
- package/dist/chunks/{chunk-DMLYMYLG.js → chunk-WO644UAC.js} +3 -3
- package/dist/chunks/chunk-WO644UAC.js.map +7 -0
- package/dist/chunks/{chunk-UWBKGUBZ.js → chunk-X2QGBINE.js} +2 -2
- package/dist/chunks/{chunk-UWBKGUBZ.js.map → chunk-X2QGBINE.js.map} +3 -3
- package/dist/chunks/chunk-Y7MQVQAS.js +2 -0
- package/dist/chunks/chunk-Y7MQVQAS.js.map +7 -0
- package/dist/chunks/{chunk-4LAVXP7J.js → chunk-YTTNQYSM.js} +2 -2
- package/dist/chunks/{chunk-PRGG24TK.js → chunk-YVYWV36O.js} +2 -2
- package/dist/chunks/{chunk-PX4IRCTO.js → chunk-ZT2SESHC.js} +2 -2
- package/dist/chunks/chunk-ZT2SESHC.js.map +7 -0
- package/dist/chunks/{executeDiagonalize-MDMQAC5Z.js → executeDiagonalize-HZFFXMG4.js} +2 -2
- package/dist/chunks/executeDiagonalize-HZFFXMG4.js.map +7 -0
- package/dist/chunks/{renderSvg-H7SROVVQ.js → renderSvg-GF64RZ6B.js} +2 -2
- package/dist/chunks/renderSvg-GF64RZ6B.js.map +7 -0
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +8 -8
- package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +16 -10
- package/src/GraphGenomeView/components/HighlightColorDialog.tsx +2 -2
- package/src/GraphGenomeView/components/HoverLayer.tsx +7 -2
- package/src/GraphGenomeView/components/LabelChip.tsx +3 -2
- package/src/GraphGenomeView/components/LabelledSelect.tsx +3 -2
- package/src/GraphGenomeView/components/Legend.tsx +2 -2
- package/src/GraphGenomeView/components/LegendSwatch.tsx +8 -2
- package/src/GraphGenomeView/components/PaneContextMenu.tsx +3 -2
- package/src/GraphGenomeView/components/PaneLayer.tsx +2 -2
- package/src/GraphGenomeView/components/PaneSvg.tsx +6 -0
- package/src/GraphGenomeView/components/PickNamesDialog.tsx +3 -2
- package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +18 -6
- package/src/GraphGenomeView/pane/loadActions.ts +17 -1
- package/src/GraphGenomeView/pane/renderingActions.ts +1 -0
- package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +0 -9
- package/src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx +4 -2
- package/src/LinearGraphDisplay/model.ts +1 -0
- package/src/hoverSync/index.test.tsx +2 -2
- package/src/hoverSync/index.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/panSNAliases/trackAdapterConfig.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/chunks/AddTrackWorkflow-JAIB6H2T.js.map +0 -7
- package/dist/chunks/GraphTrackSettingsDialog-GTQ6Z2HA.js +0 -4
- package/dist/chunks/HighlightColorDialog-KNJFIFLO.js +0 -2
- package/dist/chunks/LinearGraphDisplay-APDIIF7F.js.map +0 -7
- package/dist/chunks/chunk-3ROUAVMP.js +0 -4
- package/dist/chunks/chunk-3ROUAVMP.js.map +0 -7
- package/dist/chunks/chunk-3VGXCEMQ.js.map +0 -7
- package/dist/chunks/chunk-3WG3GF2A.js +0 -2
- package/dist/chunks/chunk-3WG3GF2A.js.map +0 -7
- package/dist/chunks/chunk-5Z4VIKXZ.js.map +0 -7
- package/dist/chunks/chunk-CBKSPAUI.js +0 -2
- package/dist/chunks/chunk-CBKSPAUI.js.map +0 -7
- package/dist/chunks/chunk-DKYX6XBX.js +0 -2
- package/dist/chunks/chunk-DKYX6XBX.js.map +0 -7
- package/dist/chunks/chunk-DMLYMYLG.js.map +0 -7
- package/dist/chunks/chunk-FUPBKEC2.js +0 -2
- package/dist/chunks/chunk-FUPBKEC2.js.map +0 -7
- package/dist/chunks/chunk-J5RMHLFJ.js.map +0 -7
- package/dist/chunks/chunk-JMBDTNUR.js.map +0 -7
- package/dist/chunks/chunk-KOB7YIMR.js.map +0 -7
- package/dist/chunks/chunk-NIEZKWQV.js.map +0 -7
- package/dist/chunks/chunk-OGQ6OQDN.js.map +0 -7
- package/dist/chunks/chunk-PX4IRCTO.js.map +0 -7
- package/dist/chunks/chunk-ROZPEXN4.js.map +0 -7
- package/dist/chunks/chunk-TL2FTG3H.js.map +0 -7
- package/dist/chunks/executeDiagonalize-MDMQAC5Z.js.map +0 -7
- package/dist/chunks/renderSvg-H7SROVVQ.js.map +0 -7
- /package/dist/chunks/{GbzBaseSyntenyAdapter-CJQVZJPA.js.map → GbzBaseSyntenyAdapter-W5W2JTWJ.js.map} +0 -0
- /package/dist/chunks/{GraphGenomeView-EM7KNQHB.js.map → GraphGenomeView-RD2XGX6D.js.map} +0 -0
- /package/dist/chunks/{MinigraphBubbleAdapter-QEC37MYN.js.map → MinigraphBubbleAdapter-NWINKWTS.js.map} +0 -0
- /package/dist/chunks/{RgfaTabixAdapter-ZGXDNU43.js.map → RgfaTabixAdapter-N44KY4YC.js.map} +0 -0
- /package/dist/chunks/{WalkFormsAdapter-QYFYWQJD.js.map → WalkFormsAdapter-VDL5XWSU.js.map} +0 -0
- /package/dist/chunks/{WalkTabixSyntenyAdapter-F4XTB7W4.js.map → WalkTabixSyntenyAdapter-RGJWOHJG.js.map} +0 -0
- /package/dist/chunks/{chunk-ZEE3HTOT.js.map → chunk-CGPYVMGQ.js.map} +0 -0
- /package/dist/chunks/{chunk-4LAVXP7J.js.map → chunk-YTTNQYSM.js.map} +0 -0
- /package/dist/chunks/{chunk-PRGG24TK.js.map → chunk-YVYWV36O.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as J,c as D,d as V,e as X,f as q,h as K}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=AddTrackWorkflow-
|
|
1
|
+
import{b as J,c as D,d as V,e as X,f as q,h as K}from"./chunk-CGPYVMGQ.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 v,j as A,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 h,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","RgfaTabixWalks","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],ne=I(function({model:t}){let{classes:i}=se(),y=A(t),d=M(t),[r,U]=o("RgfaTabixAdapter"),[l,Y]=o(),[k,G]=o(),[T,Z]=o(),m=r==="GbzBaseSyntenyAdapter",u=r==="RgfaTabixWalks",[C,$]=o(""),[R,ee]=o(""),[b,ae]=o("Pangenome graph"),[S,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,v(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(R):void 0,trackId:x({name:p}),name:p})})}catch(p){g(p)}}return f(O,{className:i.paper,children:[S?a(E,{error:S}):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:d,setLocation:Y}),a(c,{location:k,name:X[r],rootModel:d,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:d,setLocation:Z}):null,a(h,{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(h,{className:i.field,value:R,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(h,{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-IOPTETLH.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 'RgfaTabixWalks',\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 === 'RgfaTabixWalks'\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,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,iBACA,wBACA,wBACF,EAEMC,GAAsBC,EAAS,SAA6B,CAChE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIP,GAAU,EACxBQ,EAAUC,EAAWH,CAAK,EAC1BI,EAAYC,EAA2BL,C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ACAL,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
|
+
"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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=ChooseSamplesDialog-
|
|
1
|
+
import{a as i}from"./chunk-6OZGIMZC.js";import"./chunk-J2PN6CG3.js";import"./chunk-WE7DQVXF.js";import{b as a,d as s}from"./chunk-DUU6T2I5.js";var t=s(function({model:o,onClose:p}){let{samples:l}=o.walkRowSampleChoices;return a(i,{title:"Choose samples",label:"Samples",testId:"graph-choose-samples",caption:`${l.length.toLocaleString()} samples in this cut. Their walks show in pairs, in the order picked.`,options:l,initial:o.walkRowSamples??[],confirmLabel:e=>e.length>0?"Show these samples":"Show every sample",onPick:e=>{o.setWalkRowSamples(e.length>0?e:void 0)},onClose:p})}),h=t;export{h as default};
|
|
2
|
+
//# sourceMappingURL=ChooseSamplesDialog-7RI573UO.js.map
|
package/dist/chunks/{ChooseSamplesDialog-LO7FKFSS.js.map → ChooseSamplesDialog-7RI573UO.js.map}
RENAMED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/ChooseSamplesDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import { observer } from 'mobx-react'\n\nimport PickNamesDialog from './PickNamesDialog'\n\nimport type { GraphPaneModel } from '../model'\n\ntype SamplePicker = Pick<\n GraphPaneModel,\n 'walkRowSampleChoices' | 'walkRowSamples' | 'setWalkRowSamples'\n>\n\n// Which samples' walks walk rows show\nconst ChooseSamplesDialog = observer(function ChooseSamplesDialog({\n model,\n onClose,\n}: {\n model: SamplePicker\n onClose: () => void\n}) {\n const { samples } = model.walkRowSampleChoices\n return (\n <PickNamesDialog\n title=\"Choose samples\"\n label=\"Samples\"\n testId=\"graph-choose-samples\"\n caption={`${samples.length.toLocaleString()} samples in this cut. Their walks show in pairs, in the order picked.`}\n options={samples}\n initial={model.walkRowSamples ?? []}\n confirmLabel={picked =>\n picked.length > 0 ? 'Show these samples' : 'Show every sample'\n }\n onPick={picked => {\n model.setWalkRowSamples(picked.length > 0 ? picked : undefined)\n }}\n onClose={onClose}\n />\n )\n})\n\nexport default ChooseSamplesDialog\n"],
|
|
5
5
|
"mappings": "+IAYA,IAAMA,EAAsBC,EAAS,SAA6B,CAChE,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIF,EAAM,qBAC1B,OACEG,EAACC,EAAA,CACC,MAAM,iBACN,MAAM,UACN,OAAO,uBACP,QAAS,GAAGF,EAAQ,OAAO,eAAe,CAAC,wEAC3C,QAASA,EACT,QAASF,EAAM,gBAAkB,CAAC,EAClC,aAAcK,GACZA,EAAO,OAAS,EAAI,qBAAuB,oBAE7C,OAAQA,GAAU,CAChBL,EAAM,kBAAkBK,EAAO,OAAS,EAAIA,EAAS,MAAS,CAChE,EACA,QAASJ,EACX,CAEJ,CAAC,EAEMK,EAAQR",
|
|
6
|
-
"names": ["ChooseSamplesDialog", "observer", "model", "onClose", "samples", "jsx", "
|
|
6
|
+
"names": ["ChooseSamplesDialog", "observer", "model", "onClose", "samples", "jsx", "PickNamesDialog_default", "picked", "ChooseSamplesDialog_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=ChooseWalksDialog-
|
|
1
|
+
import{a as t}from"./chunk-6OZGIMZC.js";import"./chunk-J2PN6CG3.js";import"./chunk-WE7DQVXF.js";import{b as l,d as i}from"./chunk-DUU6T2I5.js";var h=i(function({model:o,onClose:s}){let{walkChoices:a}=o;return l(t,{title:"Choose haplotypes",label:"Haplotypes",testId:"graph-choose-walks",caption:`${a.length.toLocaleString()} haplotypes in this cut. The ones picked are highlighted in this order, and the rest fades.`,options:a.map(e=>e.name),initial:o.walkLayers.map(e=>e.walk),optionLabel:e=>o.walkLabel(e),confirmLabel:e=>e.length>0?"Highlight these":"Clear highlights",onPick:e=>{o.liftAmongChoices(e)},onClose:s})}),k=h;export{k as default};
|
|
2
|
+
//# sourceMappingURL=ChooseWalksDialog-4LDYDQH2.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/ChooseWalksDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import { observer } from 'mobx-react'\n\nimport PickNamesDialog from './PickNamesDialog'\n\nimport type { GraphPaneModel } from '../model'\n\ntype WalkPicker = Pick<\n GraphPaneModel,\n 'walkChoices' | 'walkLayers' | 'walkLabel' | 'liftAmongChoices'\n>\n\n// Which haplotypes to highlight, for a graph with more walks than a menu can\n// list\nconst ChooseWalksDialog = observer(function ChooseWalksDialog({\n model,\n onClose,\n}: {\n model: WalkPicker\n onClose: () => void\n}) {\n const { walkChoices } = model\n return (\n <PickNamesDialog\n title=\"Choose haplotypes\"\n label=\"Haplotypes\"\n testId=\"graph-choose-walks\"\n caption={`${walkChoices.length.toLocaleString()} haplotypes in this cut. The ones picked are highlighted in this order, and the rest fades.`}\n options={walkChoices.map(c => c.name)}\n initial={model.walkLayers.map(l => l.walk)}\n optionLabel={name => model.walkLabel(name)}\n confirmLabel={picked =>\n picked.length > 0 ? 'Highlight these' : 'Clear highlights'\n }\n onPick={picked => {\n model.liftAmongChoices(picked)\n }}\n onClose={onClose}\n />\n )\n})\n\nexport default ChooseWalksDialog\n"],
|
|
5
5
|
"mappings": "+IAaA,IAAMA,EAAoBC,EAAS,SAA2B,CAC5D,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,GAAM,CAAE,YAAAC,CAAY,EAAIF,EACxB,OACEG,EAACC,EAAA,CACC,MAAM,oBACN,MAAM,aACN,OAAO,qBACP,QAAS,GAAGF,EAAY,OAAO,eAAe,CAAC,8FAC/C,QAASA,EAAY,IAAIG,GAAKA,EAAE,IAAI,EACpC,QAASL,EAAM,WAAW,IAAIM,GAAKA,EAAE,IAAI,EACzC,YAAaC,GAAQP,EAAM,UAAUO,CAAI,EACzC,aAAcC,GACZA,EAAO,OAAS,EAAI,kBAAoB,mBAE1C,OAAQA,GAAU,CAChBR,EAAM,iBAAiBQ,CAAM,CAC/B,EACA,QAASP,EACX,CAEJ,CAAC,EAEMQ,EAAQX",
|
|
6
|
-
"names": ["ChooseWalksDialog", "observer", "model", "onClose", "walkChoices", "jsx", "
|
|
6
|
+
"names": ["ChooseWalksDialog", "observer", "model", "onClose", "walkChoices", "jsx", "PickNamesDialog_default", "c", "l", "name", "picked", "ChooseWalksDialog_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ne,b as ae,c as ue,d as re,e as oe,f as O,g as ie,h as se}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=GbzBaseSyntenyAdapter-
|
|
1
|
+
import{a as ne,b as ae,c as ue,d as re,e as oe,f as O,g as ie,h as se}from"./chunk-DRI5R7M7.js";import{a as te}from"./chunk-ZA5GPTUM.js";import{a as ee}from"./chunk-V55TK2NP.js";import{a as Q,b as D,c as Z,d as u,e as k,f as M,g as j,h as $,i as W,k as U}from"./chunk-XLVKVQJB.js";import"./chunk-M2D7NUOY.js";import{h as z,i as E}from"./chunk-E23AOQPE.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import{E as V,a as K,c as L}from"./chunk-ZT2SESHC.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import{g as F,h as N,i as C}from"./chunk-CL4PYWKC.js";import"./chunk-AGUEPVOR.js";import"./chunk-TMM73K4C.js";import{e as G,h as X,i as Y,j as J}from"./chunk-6VNDP3UB.js";import{a as P}from"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{e as _,o as B}from"./chunk-TC265JAP.js";function A(n){let i=/\.gbz\.db$/i;return i.test(n)?n.replace(i,".haplotype-index.db"):void 0}function ge(n){return Y(n)&&A(X(n))?J(n,i=>A(i)):void 0}function ye(n){return n instanceof Error&&(/\bHTTP 40[34]\b/.test(n.message)||n.code==="ENOENT")}async function ce(n,i){let e=ge(n);if(!e)return{};try{return await P(e,i).stat(),{location:e}}catch(t){return ye(t)?{}:{unreadable:String(t)}}}var be=5e3,we=50*2**20,H=class extends Error{constructor(e){super(`this GAF is ${(e/2**20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`);this.name="UnindexedGafTooLargeError"}};function xe(n,i){if(n.length<=i)return n;let e=n.length/i;return Array.from({length:i},(t,a)=>n[Math.floor(a*e)])}var pe=(n,i)=>n.path.some(e=>i.has(e.name)),v=class{constructor(i,e){this.file=i;this.tabix=e;this.whole=L({setup:async({signal:i})=>{let{size:e}=await this.file.stat();if(e>we)throw new H(e);let t=await this.file.readFile({signal:i}),a=new TextDecoder().decode(t[0]===31&&t[1]===139?await K(t):t);return E(a)}})}async readIndexed(i,e,t){let a=1/0,r=-1/0;for(let s of e){let c=Number(s);Number.isInteger(c)&&(a=Math.min(a,c),r=Math.max(r,c))}let o=[];return a<=r&&await i.getLines("{node}",a,r+1,{signal:t,lineCallback:s=>{let c=z(s);c&&pe(c,e)&&o.push(c)}}),o}async readsOver(i,{signal:e}={}){let t=this.tabix?await this.readIndexed(this.tabix,i,e):(await this.whole({signal:e})).filter(a=>pe(a,i));return{records:xe(t,be),total:t.length}}};var I=class extends Error{constructor(e){super(e===void 0?"no haplotype index is set, so the walks cannot be named; build one with gbz-haplotype-index (cargo install gbz-haplotype-index) and set it as haplotypeIndexLocation":`the haplotype index beside the graph database could not be checked (${e}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`);this.name="NoHaplotypeIndexError"}},q=class extends Error{constructor(e,t){super(`the graph is cut on its reference, ${t}; a window on ${e} has no reference coordinates to cut at. Open the graph from a ${t} view, and find this haplotype's lane there`);this.name="HaplotypeWindowError"}};function Se(n,i){return`${u(n)}#${n.contig}@${i.start.node}.${i.start.offset}`}function Ne({alignment:n,assemblyName:i,refName:e,lane:t}){let{refStart:a,refEnd:r,strand:o,cigar:s}=n;if(!(r<=a)){let{name:c,hapStart:p,hapEnd:l}=n,f=Se(c,n),g={uniqueId:f,assemblyName:i,refName:e,start:a,end:r,type:"match",strand:o==="-"?-1:1,CIGAR:s,syntenyId:f,mate:{refName:c.contig,start:p,end:l,assemblyName:t}};return new ne(g)}}function Pe({pair:n,lane:i,mateLane:e}){return se({target:{name:`${u(n.target)}#${n.target.contig}`,assemblyName:i,refName:n.target.contig,start:n.targetStart,end:n.targetEnd},query:{name:`${u(n.query)}#${n.query.contig}`,assemblyName:e,refName:n.query.contig,start:n.queryStart,end:n.queryEnd},strand:n.strand,cigar:n.cigar,matches:n.matches,columns:n.columns})}var Le=12e4;function Re(n,i){let e=new Map;for(let a of n)for(let{name:r,start:o,end:s}of a.walkSpans()){let c=u(r);if(i.has(c)){let p=`${c}#${r.contig}`,l=e.get(p);l?l.push([o,s]):e.set(p,[[o,s]])}}let t=0;for(let a of e.values()){a.sort((r,o)=>r[0]-o[0]);for(let r=1;r<a.length;r++){let o=a[r][0]-a[r-1][1];o>0&&o<=Le&&(t=Math.max(t,o))}}return t}function fe(n,i){return n instanceof Z&&(n.message=`Zoom in to about ${_(n.fitsBp)} to see ${i}`),n}var le=(n,i,e)=>ie(fe(W(n,i,e)??n,"lanes"),e),me=n=>({...n,start:Math.floor(n.start),end:Math.ceil(n.end)}),T=class extends ae{constructor(){super(...arguments);this.graph=L({label:"Opening pangenome database",setup:async()=>{let e=this.getConf("gbzDbLocation"),t=this.getConf("haplotypeIndexLocation"),a=G(t)?{location:t}:await ce(e,this.pluginManager),r=a.location,o=await D.open({source:P(e,this.pluginManager),haplotypeIndex:r?P(r,this.pluginManager):void 0}),s=this.getConf("assemblyNames")[0];if(s===void 0)throw new Error("GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");let c=await M(o),p=j({configured:this.getConf("referenceSample"),anchorPrefix:N(this,s),referenceSamples:c});return{db:o,anchor:s,referenceSample:p,referenceSamples:c,unreadableIndex:a.unreadable}}});this.gaf=L({label:"Opening reads",setup:async()=>{let e=this.getConf("readsLocation"),t=this.getConf(["readsIndex","location"]);return G(e)?new v(P(e,this.pluginManager),G(t)?V(this,["readsLocation"],["readsIndex"]):void 0):void 0}})}async referenceQuery(e,t){let{db:a,referenceSample:r}=await this.graph(t);return $(a,r,e)}async getHaplotypes(e={}){let{db:t,referenceSamples:a}=await this.graph(e),r=new Map;for(let o of await t.paths()){let s=u(o.name),c=r.get(s);c?c.contigs.includes(o.name.contig)||c.contigs.push(o.name.contig):r.set(s,{prefix:s,sample:o.name.sample,haplotype:o.name.haplotype,contigs:[o.name.contig],isReference:a.includes(o.name.sample)})}return[...r.values()]}async getHeader(e={}){let{anchor:t,referenceSample:a}=await this.graph(e),r=C(this),o=[];for(let s of await this.getHaplotypes(e))s.sample!==a&&o.push({name:O(r,s.prefix),label:s.prefix,group:s.sample});return{hasCoarseTier:!1,anchorAssemblyName:t,lanes:o}}async getRefNames(e={}){let{db:t,anchor:a,referenceSample:r}=await this.graph(e),{assemblyName:o}=e,s=o===a?void 0:N(this,o),c=(await t.paths()).filter(p=>o===a?p.isIndexed&&p.name.sample===r:F(u(p.name),s)).map(p=>p.name.contig);return[...new Set(c)]}keepPredicate(e,t){let a=e===void 0||e.length===0?void 0:e.map(r=>N(this,r));return a===void 0&&t===void 0?void 0:r=>k(r,a)&&(t===void 0||F(u(r),t))}async getSubgraph(e,t={}){let{signal:a}=t,{db:r,anchor:o,referenceSample:s,unreadableIndex:c}=await this.graph({signal:a}),{assemblyName:p,refName:l,start:f,end:g}=me(e);if(p!==o)throw new q(p,o);let y=await this.referenceQuery(l,{signal:a});if(!y)throw new Error(`${s} has no indexed path ${l} in this graph`);let b=this.keepPredicate(t.haplotypes);if(b!==void 0&&!r.hasHaplotypeIndex)throw new I(c);let d=await U(r,y,f,g,{context:this.getConf("context"),snarls:t.snarls??this.getConf("subgraphSnarls"),limit:this.getConf("nodeLimit"),signal:t.signal,keep:b}).catch(w=>{throw fe(w,"the graph")});return typeof d=="string"?d:te(d,{start:f,end:g},t.walkRows)}async getReads(e,t={}){let a=await this.gaf(t);return a?a.readsOver(new Set(e),t):{records:[],total:0}}async laneHaplotypes(e,t){let a=N(this,e);return(await this.getHaplotypes(t)).filter(r=>F(r.prefix,a))}async anchorFeatures(e,t){let{db:a}=await this.graph(t),{assemblyName:r,refName:o,start:s,end:c}=e,p=N(this,t.targetAssemblyName),l=C(this),f=this.keepPredicate(t.haplotypes,p),g=await this.referenceQuery(o,t),y=this.getConf("nodeLimit");return(g?await B(`Reading graph ${o}:${s.toLocaleString()}-${c.toLocaleString()}`,t.statusCallback,()=>a.getAlignments({path:g,start:s,end:c,context:this.getConf("context"),haplotypes:"all",limit:y,signal:t.signal,keep:f}).catch(d=>{throw le(d,y,c-s)})):[]).flatMap(d=>{let w=d.resolved?Ne({alignment:d,assemblyName:r,refName:o,lane:O(l,u(d.name))}):void 0;return w===void 0?[]:[w]})}async pairFeatures(e,t,a){let{db:r}=await this.graph(a),{refName:o,start:s,end:c}=e,l=(await Promise.all(t.map(async m=>({pair:m,featureSide:await this.laneHaplotypes(m.queryAssemblyName,a),mateSide:await this.laneHaplotypes(m.targetAssemblyName,a)})))).filter(({featureSide:m,mateSide:h})=>m.length>0&&h.length>0),f=new Set(l.flatMap(({featureSide:m,mateSide:h})=>[...m,...h].map(u))),g=await this.referenceQuery(o,a),y=this.getConf("nodeLimit"),b=this.getConf("context"),d=(m,h)=>r.getSubgraphs({path:m,start:s,end:c,context:h,snarls:this.getConf("subgraphSnarls"),haplotypes:"all",limit:y,signal:a.signal,keep:x=>f.has(u(x))}),w=async m=>{let h=await d(m,b).catch(S=>{throw le(S,y,c-s)}),x=Re(h,f),R=Math.ceil(x/2)+2e3;return x>0&&R>b?d(m,R).catch(S=>{if(S instanceof Q)return h;throw S}):h};return(g&&l.length>0?await B(oe(t),a.statusCallback,()=>w(g)):[]).flatMap(m=>l.flatMap(({pair:h,featureSide:x,mateSide:R})=>x.flatMap(S=>R.flatMap(de=>m.pairAlignments({target:S,query:de,bases:!1}).map(he=>Pe({pair:he,lane:h.queryAssemblyName,mateLane:h.targetAssemblyName}))))))}getFeatures(e,t={}){let a=me(e);return ee(async r=>{let{db:o,anchor:s,unreadableIndex:c}=await this.graph(t);if(!o.hasHaplotypeIndex)throw new I(c);if(a.assemblyName===s){let p=re(t),l=p.length>0?await this.pairFeatures(a,p,t):await this.anchorFeatures(a,t);for(let f of l)r.next(f)}r.complete()},t.signal)}};export{I as NoHaplotypeIndexError,ue as PairTargetError,T as default,Re as widestWalkGap};
|
|
2
|
+
//# sourceMappingURL=GbzBaseSyntenyAdapter-W5W2JTWJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-Y7MQVQAS.js";import"./chunk-4XY7HUQR.js";import"./chunk-DIGIM3XY.js";import"./chunk-WE7XHNAH.js";import{p as d}from"./chunk-X2QGBINE.js";import"./chunk-WO644UAC.js";import"./chunk-4DQWDJG7.js";import"./chunk-UC2NHZ7E.js";import"./chunk-OPWSPSAE.js";import"./chunk-W5HHWDGZ.js";import"./chunk-E23AOQPE.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.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-RD2XGX6D.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as G,b as L}from"./chunk-4XY7HUQR.js";import{b as v,c as x,p as f}from"./chunk-X2QGBINE.js";import"./chunk-UC2NHZ7E.js";import"./chunk-OPWSPSAE.js";import"./chunk-ELC7POI6.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.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
|
+
`)===t.join(`
|
|
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-R3XOY32L.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGraphDisplay/components/SubgraphContextSelect.tsx", "../../src/LinearGraphDisplay/components/SubgraphHaplotypesField.tsx", "../../src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from '../../GraphGenomeView/components/LabelledSelect'\nimport { walkIndexed } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\n// Only an rGFA cut from segment rows reads hops: a GBZ cut widens by its\n// adapter's bp `context`, and a walk-indexed cut follows its walks.\n// Hops past the region's own segments, each costing a tabix query per\n// off-reference segment already reached. One is the default: at none a single\n// detour draws as two unrelated stubs, which is a wrong picture of the graph\n// rather than a cheaper one. Two exists for a graph whose alleles have alleles\n// (HPRC's amylase window keeps growing at 2, the E. coli paa locus does not), and\n// it stops there because a frontier is still not a bubble decomposition. Cut an\n// exact slice with gfatools when that is what is wanted.\nconst SUBGRAPH_CONTEXTS = [\n { value: '0', label: 'None' },\n { value: '1', label: '1 hop' },\n { value: '2', label: '2 hops' },\n]\n\nconst SubgraphContextSelect = observer(function SubgraphContextSelect({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n const adapter = model.sourceAdapter\n return adapter?.type === 'RgfaTabixAdapter' && !walkIndexed(adapter) ? (\n <div className={classes.section}>\n <LabelledSelect\n label=\"Graph context\"\n sx={{ minWidth: 200 }}\n value={String(model.subgraphContext)}\n options={SUBGRAPH_CONTEXTS}\n testId=\"graph-context-select\"\n onChange={hops => {\n model.setSubgraphContext(Number(hops))\n model.recut()\n }}\n />\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n How far the cut follows links out of the region. At none, a detour that\n leaves the window draws as two stubs. No effect on gfa-to-tabix's\n default anchored index.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphContextSelect\n", "import { useRef, useState } from 'react'\n\nimport { Autocomplete, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { cutsByHaplotype } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\nfunction parseHaplotypeList(text: string) {\n return text.split(/[\\s,]+/).filter(name => name !== '')\n}\n\nconst sameList = (a: readonly string[], b: readonly string[]) =>\n a.join('\\n') === b.join('\\n')\n\n// The cut's set, and the last one this field saw: an outside change (a\n// restored session, a launch) resets the draft, while the field's own apply\n// records what it set first, so it keeps its focus and draft\nfunction useCutHaplotypes(model: LinearGraphCutModel, reset: () => void) {\n const current = model.cutHaplotypes ?? []\n const [seen, setSeen] = useState(current)\n if (!sameList(current, seen)) {\n setSeen(current)\n reset()\n }\n return (haplotypes: string[]) => {\n if (!sameList(haplotypes, current)) {\n setSeen(haplotypes)\n model.setSubgraphHaplotypes(haplotypes)\n model.recut()\n }\n }\n}\n\nconst HaplotypeListField = observer(function HaplotypeListField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes?.join(', ') ?? '')\n const setCut = useCutHaplotypes(model, () => {\n setDraft(model.cutHaplotypes?.join(', ') ?? '')\n })\n const apply = () => {\n setCut(parseHaplotypeList(draft))\n }\n return (\n <TextField\n fullWidth\n label=\"Haplotypes\"\n placeholder=\"every haplotype\"\n value={draft}\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-field' } }}\n onChange={e => {\n setDraft(e.target.value)\n }}\n onBlur={() => {\n apply()\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n apply()\n }\n }}\n />\n )\n})\n\n// The haplotypes a walk-indexed graph's header names, searched as typed. A\n// typed prefix the list lacks (HG002 for both haplotypes) is kept too, on\n// Enter or when the field loses focus. The set applies when the list closes\n// or, with the list closed, as it changes. Not MUI's `autoSelect`: in a\n// multiple select its blur toggles the highlighted option, so a pick made by\n// keyboard was dropped again on Tab.\nconst HaplotypePickField = observer(function HaplotypePickField({\n model,\n names,\n}: {\n model: LinearGraphCutModel\n names: string[]\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes ?? [])\n const draftRef = useRef(draft)\n const typed = useRef('')\n const [open, setOpen] = useState(false)\n const apply = useCutHaplotypes(model, () => {\n draftRef.current = model.cutHaplotypes ?? []\n setDraft(draftRef.current)\n })\n return (\n <Autocomplete\n multiple\n freeSolo\n disableCloseOnSelect\n options={names}\n value={draft}\n open={open}\n onOpen={() => {\n setOpen(true)\n }}\n onInputChange={(_, text) => {\n typed.current = text\n }}\n onClose={(_, reason) => {\n setOpen(false)\n const text = typed.current.trim()\n if (reason === 'blur' && text && !draftRef.current.includes(text)) {\n draftRef.current = [...draftRef.current, text]\n setDraft(draftRef.current)\n }\n apply(draftRef.current)\n }}\n onChange={(_, value) => {\n draftRef.current = value\n setDraft(value)\n if (!open) {\n apply(value)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n label=\"Haplotypes\"\n placeholder={draft.length === 0 ? 'every haplotype' : undefined}\n slotProps={{\n ...params.slotProps,\n htmlInput: {\n ...params.slotProps.htmlInput,\n 'data-testid': 'graph-haplotypes-field',\n },\n }}\n />\n )}\n />\n )\n})\n\n// Only a GBZ cut and a walk-indexed rGFA cut read the set\nconst SubgraphHaplotypesField = observer(function SubgraphHaplotypesField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n const names = model.haplotypeNames\n const adapter = model.sourceAdapter\n return adapter && cutsByHaplotype(adapter) ? (\n <div className={classes.section}>\n {names ? (\n <HaplotypePickField model={model} names={names} />\n ) : (\n <HaplotypeListField model={model} />\n )}\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n {names\n ? `Which of the graph's ${names.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`\n : 'Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas.'}{' '}\n Empty is every haplotype.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphHaplotypesField\n", "import SubgraphContextSelect from './SubgraphContextSelect'\nimport SubgraphHaplotypesField from './SubgraphHaplotypesField'\nimport GraphSettingsDialog from '../../GraphGenomeView/components/GraphSettingsDialog'\n\nimport type { LinearGraphCutModel } from '../model'\n\nexport default function GraphTrackSettingsDialog({\n model,\n onClose,\n}: {\n model: LinearGraphCutModel\n onClose: () => void\n}) {\n return (\n <GraphSettingsDialog model={model} onClose={onClose}>\n <SubgraphContextSelect model={model} />\n <SubgraphHaplotypesField model={model} />\n </GraphSettingsDialog>\n )\n}\n"],
|
|
5
|
-
"mappings": "ocASA,IAAMA,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,CACF,CAAC,EAWKC,EAAoB,CACxB,CAAE,MAAO,IAAK,MAAO,MAAO,EAC5B,CAAE,MAAO,IAAK,MAAO,OAAQ,EAC7B,CAAE,MAAO,IAAK,MAAO,QAAS,CAChC,EAEMC,EAAwBC,EAAS,SAA+B,CACpE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIN,EAAU,EACxBO,EAAUF,EAAM,cACtB,OAAOE,GAAS,OAAS,oBAAsB,CAACC,EAAYD,CAAO,EACjEE,EAAC,OAAI,UAAWH,EAAQ,QACtB,UAAAI,EAACC,EAAA,CACC,MAAM,gBACN,GAAI,CAAE,SAAU,GAAI,EACpB,MAAO,OAAON,EAAM,eAAe,EACnC,QAASH,EACT,OAAO,uBACP,SAAUU,GAAQ,CAChBP,EAAM,mBAAmB,OAAOO,CAAI,CAAC,EACrCP,EAAM,MAAM,CACd,EACF,EACAK,EAACG,EAAA,CAAW,QAAQ,UAAU,UAAU,MAAM,MAAM,iBAAiB,6KAIrE,GACF,EACE,IACN,CAAC,EAEMC,EAAQX,ECjDf,IAAMY,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,CACF,CAAC,EAED,SAASC,EAAmBC,EAAc,CACxC,OAAOA,EAAK,MAAM,QAAQ,EAAE,OAAOC,GAAQA,IAAS,EAAE,CACxD,CAEA,IAAMC,EAAW,
|
|
6
|
-
"names": ["useStyles", "makeStyles", "SUBGRAPH_CONTEXTS", "SubgraphContextSelect", "observer", "model", "classes", "adapter", "walkIndexed", "jsxs", "jsx", "
|
|
4
|
+
"sourcesContent": ["import { Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from '../../GraphGenomeView/components/LabelledSelect'\nimport { walkIndexed } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\n// Only an rGFA cut from segment rows reads hops: a GBZ cut widens by its\n// adapter's bp `context`, and a walk-indexed cut follows its walks.\n// Hops past the region's own segments, each costing a tabix query per\n// off-reference segment already reached. One is the default: at none a single\n// detour draws as two unrelated stubs, which is a wrong picture of the graph\n// rather than a cheaper one. Two exists for a graph whose alleles have alleles\n// (HPRC's amylase window keeps growing at 2, the E. coli paa locus does not), and\n// it stops there because a frontier is still not a bubble decomposition. Cut an\n// exact slice with gfatools when that is what is wanted.\nconst SUBGRAPH_CONTEXTS = [\n { value: '0', label: 'None' },\n { value: '1', label: '1 hop' },\n { value: '2', label: '2 hops' },\n]\n\nconst SubgraphContextSelect = observer(function SubgraphContextSelect({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n const adapter = model.sourceAdapter\n return adapter?.type === 'RgfaTabixAdapter' && !walkIndexed(adapter) ? (\n <div className={classes.section}>\n <LabelledSelect\n label=\"Graph context\"\n sx={{ minWidth: 200 }}\n value={String(model.subgraphContext)}\n options={SUBGRAPH_CONTEXTS}\n testId=\"graph-context-select\"\n onChange={hops => {\n model.setSubgraphContext(Number(hops))\n model.recut()\n }}\n />\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n How far the cut follows links out of the region. At none, a detour that\n leaves the window draws as two stubs. No effect on gfa-to-tabix's\n default anchored index.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphContextSelect\n", "import { useRef, useState } from 'react'\n\nimport { Autocomplete, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { cutsByHaplotype } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\nfunction parseHaplotypeList(text: string) {\n return text.split(/[\\s,]+/).filter(name => name !== '')\n}\n\nconst sameList = (a: readonly string[], b: readonly string[]) =>\n a.join('\\n') === b.join('\\n')\n\n// The cut's set, and the last one this field saw: an outside change (a\n// restored session, a launch) resets the draft, while the field's own apply\n// records what it set first, so it keeps its focus and draft\nfunction useCutHaplotypes(model: LinearGraphCutModel, reset: () => void) {\n const current = model.cutHaplotypes ?? []\n const [seen, setSeen] = useState(current)\n if (!sameList(current, seen)) {\n setSeen(current)\n reset()\n }\n return (haplotypes: string[]) => {\n if (!sameList(haplotypes, current)) {\n setSeen(haplotypes)\n model.setSubgraphHaplotypes(haplotypes)\n model.recut()\n }\n }\n}\n\nconst HaplotypeListField = observer(function HaplotypeListField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes?.join(', ') ?? '')\n const setCut = useCutHaplotypes(model, () => {\n setDraft(model.cutHaplotypes?.join(', ') ?? '')\n })\n const apply = () => {\n setCut(parseHaplotypeList(draft))\n }\n return (\n <TextField\n fullWidth\n label=\"Haplotypes\"\n placeholder=\"every haplotype\"\n value={draft}\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-field' } }}\n onChange={e => {\n setDraft(e.target.value)\n }}\n onBlur={() => {\n apply()\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n apply()\n }\n }}\n />\n )\n})\n\n// The haplotypes a walk-indexed graph's header names, searched as typed. A\n// typed prefix the list lacks (HG002 for both haplotypes) is kept too, on\n// Enter or when the field loses focus. The set applies when the list closes\n// or, with the list closed, as it changes. Not MUI's `autoSelect`: in a\n// multiple select its blur toggles the highlighted option, so a pick made by\n// keyboard was dropped again on Tab.\nconst HaplotypePickField = observer(function HaplotypePickField({\n model,\n names,\n}: {\n model: LinearGraphCutModel\n names: string[]\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes ?? [])\n const draftRef = useRef(draft)\n const typed = useRef('')\n const [open, setOpen] = useState(false)\n const apply = useCutHaplotypes(model, () => {\n draftRef.current = model.cutHaplotypes ?? []\n setDraft(draftRef.current)\n })\n return (\n <Autocomplete\n multiple\n freeSolo\n disableCloseOnSelect\n options={names}\n value={draft}\n open={open}\n onOpen={() => {\n setOpen(true)\n }}\n onInputChange={(_, text) => {\n typed.current = text\n }}\n onClose={(_, reason) => {\n setOpen(false)\n const text = typed.current.trim()\n if (reason === 'blur' && text && !draftRef.current.includes(text)) {\n draftRef.current = [...draftRef.current, text]\n setDraft(draftRef.current)\n }\n apply(draftRef.current)\n }}\n onChange={(_, value) => {\n draftRef.current = value\n setDraft(value)\n if (!open) {\n apply(value)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n label=\"Haplotypes\"\n placeholder={draft.length === 0 ? 'every haplotype' : undefined}\n slotProps={{\n ...params.slotProps,\n htmlInput: {\n ...params.slotProps.htmlInput,\n 'data-testid': 'graph-haplotypes-field',\n },\n }}\n />\n )}\n />\n )\n})\n\n// Only a GBZ cut and a walk-indexed rGFA cut read the set\nconst SubgraphHaplotypesField = observer(function SubgraphHaplotypesField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n const names = model.haplotypeNames\n const adapter = model.sourceAdapter\n return adapter && cutsByHaplotype(adapter) ? (\n <div className={classes.section}>\n {names ? (\n <HaplotypePickField model={model} names={names} />\n ) : (\n <HaplotypeListField model={model} />\n )}\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n {names\n ? `Which of the graph's ${names.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`\n : 'Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas.'}{' '}\n Empty is every haplotype.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphHaplotypesField\n", "import { observer } from 'mobx-react'\n\nimport SubgraphContextSelect from './SubgraphContextSelect'\nimport SubgraphHaplotypesField from './SubgraphHaplotypesField'\nimport GraphSettingsDialog from '../../GraphGenomeView/components/GraphSettingsDialog'\n\nimport type { LinearGraphCutModel } from '../model'\n\nexport default observer(function GraphTrackSettingsDialog({\n model,\n onClose,\n}: {\n model: LinearGraphCutModel\n onClose: () => void\n}) {\n return (\n <GraphSettingsDialog model={model} onClose={onClose}>\n <SubgraphContextSelect model={model} />\n <SubgraphHaplotypesField model={model} />\n </GraphSettingsDialog>\n )\n})\n"],
|
|
5
|
+
"mappings": "ocASA,IAAMA,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,CACF,CAAC,EAWKC,EAAoB,CACxB,CAAE,MAAO,IAAK,MAAO,MAAO,EAC5B,CAAE,MAAO,IAAK,MAAO,OAAQ,EAC7B,CAAE,MAAO,IAAK,MAAO,QAAS,CAChC,EAEMC,EAAwBC,EAAS,SAA+B,CACpE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIN,EAAU,EACxBO,EAAUF,EAAM,cACtB,OAAOE,GAAS,OAAS,oBAAsB,CAACC,EAAYD,CAAO,EACjEE,EAAC,OAAI,UAAWH,EAAQ,QACtB,UAAAI,EAACC,EAAA,CACC,MAAM,gBACN,GAAI,CAAE,SAAU,GAAI,EACpB,MAAO,OAAON,EAAM,eAAe,EACnC,QAASH,EACT,OAAO,uBACP,SAAUU,GAAQ,CAChBP,EAAM,mBAAmB,OAAOO,CAAI,CAAC,EACrCP,EAAM,MAAM,CACd,EACF,EAC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D,GAAM,CAAE,QAAA6B,CAAQ,EAAIrC,EAAU,EACxByB,EAAQjB,EAAM,eACd8B,EAAU9B,EAAM,cACtB,OAAO8B,GAAWC,EAAgBD,CAAO,EACvCE,EAAC,OAAI,UAAWH,EAAQ,QACrB,UAAAZ,EACCJ,EAACG,EAAA,CAAmB,MAAOhB,EAAO,MAAOiB,EAAO,EAEhDJ,EAACN,EAAA,CAAmB,MAAOP,EAAO,EAEpCgC,EAACC,EAAA,CAAW,QAAQ,UAAU,UAAU,MAAM,MAAM,iBACjD,UAAAhB,EACG,wBAAwBA,EAAM,OAAO,eAAe,CAAC,0DACrD,sHAAuH,IAAI,6BAEjI,GACF,EACE,IACN,CAAC,EAEMiB,EAAQN,ECnKf,IAAOO,GAAQC,EAAS,SAAkC,CACxD,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,OACEC,EAACC,EAAA,CAAoB,MAAOH,EAAO,QAASC,EAC1C,UAAAG,EAACC,EAAA,CAAsB,MAAOL,EAAO,EACrCI,EAACE,EAAA,CAAwB,MAAON,EAAO,GACzC,CAEJ,CAAC",
|
|
6
|
+
"names": ["useStyles", "makeStyles", "SUBGRAPH_CONTEXTS", "SubgraphContextSelect", "observer", "model", "classes", "adapter", "walkIndexed", "jsxs", "jsx", "LabelledSelect_default", "hops", "Typography", "SubgraphContextSelect_default", "useStyles", "makeStyles", "parseHaplotypeList", "text", "name", "sameList", "b", "useCutHaplotypes", "model", "reset", "current", "seen", "setSeen", "useState", "haplotypes", "HaplotypeListField", "observer", "draft", "setDraft", "setCut", "apply", "jsx", "TextField", "e", "HaplotypePickField", "names", "draftRef", "useRef", "typed", "open", "setOpen", "Autocomplete", "_", "reason", "value", "params", "SubgraphHaplotypesField", "classes", "adapter", "cutsByHaplotype", "jsxs", "Typography", "SubgraphHaplotypesField_default", "GraphTrackSettingsDialog_default", "observer", "model", "onClose", "jsxs", "GraphSettingsDialog_default", "jsx", "SubgraphContextSelect_default", "SubgraphHaplotypesField_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{x as v,y as C}from"./chunk-4DQWDJG7.js";import"./chunk-OPWSPSAE.js";import"./chunk-ELC7POI6.js";import"./chunk-CL4PYWKC.js";import{F as h,H as r,d as m,o as y,q as c,r as d,z as g}from"./chunk-WE7DQVXF.js";import{a as u,b as l,c as p,d as s}from"./chunk-DUU6T2I5.js";var f=s(function({model:o,onClose:t}){return p(m,{open:!0,onClose:t,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(r,{variant:"subtitle2",children:"Haplotype"}),l(r,{variant:"subtitle2",children:"Color by"}),l(r,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(S,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:i=>{o.setWalkColor(a,{field:i})},onScheme:i=>{o.setWalkColor(a,{scheme:i})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:t,children:"Done"})})]})}),S=s(function({label:o,field:t,scheme:a,onField:n,onScheme:i}){return p(u,{children:[l(r,{variant:"body2",children:o}),l(h,{select:!0,size:"small",value:t,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${o} by`}}},onChange:e=>{n(e.target.value)},children:v.map(e=>l(g,{value:e.value,children:e.label},e.value))}),l(h,{select:!0,size:"small",value:a,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${o}`}}},onChange:e=>{i(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||t==="reference").map(e=>l(g,{value:e.value,children:e.label},e.value))})]})}),T=f;export{T as default};
|
|
2
|
+
//# sourceMappingURL=HighlightColorDialog-AKPIC56I.js.map
|
package/dist/chunks/{HighlightColorDialog-KNJFIFLO.js.map → HighlightColorDialog-AKPIC56I.js.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/HighlightColorDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["import { WALK_FIELDS, WALK_SCHEMES } from '@jbrowse/bandage-core/walkEncoding'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n MenuItem,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\ntype HighlightColors = Pick<\n GraphPaneModel,\n 'drawnWalks' | 'walkLabel' | 'setWalkColor'\n>\n\nconst HighlightColorDialog = observer(function HighlightColorDialog({\n model,\n onClose,\n}: {\n model: HighlightColors\n onClose: () => void\n}) {\n return (\n <Dialog open onClose={onClose} title=\"Color highlighted haplotypes\">\n <DialogContent\n sx={{\n display: 'grid',\n gridTemplateColumns: 'auto 1fr 1fr',\n alignItems: 'center',\n gap: 1.5,\n }}\n >\n <Typography variant=\"subtitle2\">Haplotype</Typography>\n <Typography variant=\"subtitle2\">Color by</Typography>\n <Typography variant=\"subtitle2\">Palette</Typography>\n {model.drawnWalks.map(({ name, encoding }) => (\n <Row\n key={name}\n label={model.walkLabel(name)}\n field={encoding.field}\n scheme={encoding.scheme}\n onField={field => {\n model.setWalkColor(name, { field })\n }}\n onScheme={scheme => {\n model.setWalkColor(name, { scheme })\n }}\n />\n ))}\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\ntype Field = (typeof WALK_FIELDS)[number]['value']\ntype Scheme = (typeof WALK_SCHEMES)[number]['value']\n\
|
|
5
|
-
"mappings": "kRAmBA,IAAMA,EAAuBC,EAAS,SAA8B,CAClE,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,OACEC,EAACC,EAAA,CAAO,KAAI,GAAC,QAASF,EAAS,MAAM,+BACnC,UAAAC,EAACE,EAAA,CACC,GAAI,CACF,QAAS,OACT,oBAAqB,eACrB,WAAY,SACZ,IAAK,GACP,EAEA,UAAAC,EAACC,EAAA,CAAW,QAAQ,YAAY,qBAAS,EACzCD,EAACC,EAAA,CAAW,QAAQ,YAAY,oBAAQ,EACxCD,EAACC,EAAA,CAAW,QAAQ,YAAY,mBAAO,EACtCN,EAAM,WAAW,IAAI,CAAC,CAAE,KAAAO,EAAM,SAAAC,CAAS,IACtCH,EAACI,EAAA,CAEC,MAAOT,EAAM,UAAUO,CAAI,EAC3B,MAAOC,EAAS,MAChB,OAAQA,EAAS,OACjB,QAASE,GAAS,CAChBV,EAAM,aAAaO,EAAM,CAAE,MAAAG,CAAM,CAAC,CACpC,EACA,SAAUC,GAAU,CAClBX,EAAM,aAAaO,EAAM,CAAE,OAAAI,CAAO,CAAC,CACrC,GATKJ,CAUP,CACD,GACH,EACAF,EAACO,EAAA,CACC,SAAAP,EAACQ,EAAA,CAAO,QAAQ,YAAY,QAASZ,EAAS,gBAE9C,EACF,GACF,CAEJ,CAAC,
|
|
4
|
+
"sourcesContent": ["import { WALK_FIELDS, WALK_SCHEMES } from '@jbrowse/bandage-core/walkEncoding'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n MenuItem,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\ntype HighlightColors = Pick<\n GraphPaneModel,\n 'drawnWalks' | 'walkLabel' | 'setWalkColor'\n>\n\nconst HighlightColorDialog = observer(function HighlightColorDialog({\n model,\n onClose,\n}: {\n model: HighlightColors\n onClose: () => void\n}) {\n return (\n <Dialog open onClose={onClose} title=\"Color highlighted haplotypes\">\n <DialogContent\n sx={{\n display: 'grid',\n gridTemplateColumns: 'auto 1fr 1fr',\n alignItems: 'center',\n gap: 1.5,\n }}\n >\n <Typography variant=\"subtitle2\">Haplotype</Typography>\n <Typography variant=\"subtitle2\">Color by</Typography>\n <Typography variant=\"subtitle2\">Palette</Typography>\n {model.drawnWalks.map(({ name, encoding }) => (\n <Row\n key={name}\n label={model.walkLabel(name)}\n field={encoding.field}\n scheme={encoding.scheme}\n onField={field => {\n model.setWalkColor(name, { field })\n }}\n onScheme={scheme => {\n model.setWalkColor(name, { scheme })\n }}\n />\n ))}\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\ntype Field = (typeof WALK_FIELDS)[number]['value']\ntype Scheme = (typeof WALK_SCHEMES)[number]['value']\n\nconst Row = observer(function Row({\n label,\n field,\n scheme,\n onField,\n onScheme,\n}: {\n label: string\n field: Field\n scheme: Scheme\n onField: (field: Field) => void\n onScheme: (scheme: Scheme) => void\n}) {\n return (\n <>\n <Typography variant=\"body2\">{label}</Typography>\n <TextField\n select\n size=\"small\"\n value={field}\n slotProps={{\n select: { SelectDisplayProps: { 'aria-label': `Color ${label} by` } },\n }}\n onChange={e => {\n onField(e.target.value as Field)\n }}\n >\n {WALK_FIELDS.map(f => (\n <MenuItem key={f.value} value={f.value}>\n {f.label}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n select\n size=\"small\"\n value={scheme}\n slotProps={{\n select: {\n SelectDisplayProps: { 'aria-label': `Palette for ${label}` },\n },\n }}\n onChange={e => {\n onScheme(e.target.value as Scheme)\n }}\n >\n {WALK_SCHEMES.filter(\n s => s.value !== 'rainbow' || field === 'reference',\n ).map(s => (\n <MenuItem key={s.value} value={s.value}>\n {s.label}\n </MenuItem>\n ))}\n </TextField>\n </>\n )\n})\n\nexport default HighlightColorDialog\n"],
|
|
5
|
+
"mappings": "kRAmBA,IAAMA,EAAuBC,EAAS,SAA8B,CAClE,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,OACEC,EAACC,EAAA,CAAO,KAAI,GAAC,QAASF,EAAS,MAAM,+BACnC,UAAAC,EAACE,EAAA,CACC,GAAI,CACF,QAAS,OACT,oBAAqB,eACrB,WAAY,SACZ,IAAK,GACP,EAEA,UAAAC,EAACC,EAAA,CAAW,QAAQ,YAAY,qBA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A,EAAE,QAAU,WAAab,IAAU,WAC1C,EAAE,IAAIa,GACJlB,EAACgB,EAAA,CAAuB,MAAOE,EAAE,MAC9B,SAAAA,EAAE,OADUA,EAAE,KAEjB,CACD,EACH,GACF,CAEJ,CAAC,EAEMC,EAAQ1B",
|
|
6
6
|
"names": ["HighlightColorDialog", "observer", "model", "onClose", "jsxs", "Dialog", "DialogContent", "jsx", "Typography", "name", "encoding", "Row", "field", "scheme", "DialogActions", "Button", "label", "onField", "onScheme", "Fragment", "TextField", "WALK_FIELDS", "f", "MenuItem", "WALK_SCHEMES", "s", "HighlightColorDialog_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=LinearGraphDisplay-
|
|
1
|
+
import{a,b as i}from"./chunk-Y7MQVQAS.js";import"./chunk-4XY7HUQR.js";import"./chunk-DIGIM3XY.js";import"./chunk-WE7XHNAH.js";import"./chunk-X2QGBINE.js";import"./chunk-WO644UAC.js";import"./chunk-4DQWDJG7.js";import"./chunk-UC2NHZ7E.js";import"./chunk-OPWSPSAE.js";import"./chunk-W5HHWDGZ.js";import"./chunk-E23AOQPE.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.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-RRAXTQFC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["jbrowse-host:@jbrowse/display-kit/DisplayChrome", "../../src/LinearGraphDisplay/components/LinearGraphDisplay.tsx"],
|
|
4
|
+
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/display-kit/DisplayChrome\"]\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/display-kit/DisplayChrome\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "import DisplayChrome from '@jbrowse/display-kit/DisplayChrome'\nimport { observer } from 'mobx-react'\n\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\nimport { createGraphRenderer } from '../../GraphGenomeView/renderer/GraphRenderer'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <DisplayChrome\n model={model}\n factory={createGraphRenderer}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n {handle => <GraphCanvas model={model} handle={handle} />}\n </DisplayChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
|
|
5
|
+
"mappings": "isBAAA,IAAMA,EAAO,eAAe,oCAAoC,EAUhE,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECFxD,IAAMC,EAAqBC,EAAS,SAA4B,CAC9D,MAAAC,CACF,EAEG,CACD,OACEC,EAACC,EAAA,CACC,MAAOF,EACP,QAASG,EACT,OAAO,uBACP,cAAaH,EAAM,iBACnB,gBAAeA,EAAM,QACrB,cAAaA,EAAM,OACnB,kBAAiBA,EAAM,SAAWA,EAAM,UAAY,OACpD,eAAcA,EAAM,UAAY,GAAK,OACrC,MAAO,CACL,MAAOA,EAAM,UACb,OAAQA,EAAM,OACd,SAAU,QACZ,EAEC,SAAAI,GAAUH,EAACI,EAAA,CAAY,MAAOL,EAAO,OAAQI,EAAQ,EACxD,CAEJ,CAAC,EAEME,EAAQR",
|
|
6
|
+
"names": ["host", "DisplayChrome_default", "host", "LinearGraphDisplay", "observer", "model", "jsx", "DisplayChrome_default", "createGraphRenderer", "handle", "GraphCanvas_default", "LinearGraphDisplay_default"]
|
|
7
|
+
}
|
package/dist/chunks/{MinigraphBubbleAdapter-QEC37MYN.js → MinigraphBubbleAdapter-NWINKWTS.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f,d as c,f as d}from"./chunk-W5HHWDGZ.js";import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=MinigraphBubbleAdapter-
|
|
1
|
+
import{a as f,d as c,f as d}from"./chunk-W5HHWDGZ.js";import{a as g}from"./chunk-V55TK2NP.js";import{E as p,F as u,b,z as m}from"./chunk-ZT2SESHC.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{a as i,o as l}from"./chunk-TC265JAP.js";var a=class extends b{constructor(){super(...arguments);this.bubbles=p(this,["bubblesLocation"],["index"]);this.refNames=new u(this.bubbles,this)}static{this.capabilities=["getFeatures","getRefNames"]}async getRefNames(t={}){return this.refNames.assemblyRefNames(t)}async getRegionByteSize(t,s={}){return this.refNames.regionBytes(t,s)}async hasDataForRefName(){return!0}getFeatures(t,s={}){let{signal:n,statusCallback:h}=s;return g(async r=>{let o=await this.refNames.resolveMapped(t,s);o!==void 0&&await l("Downloading bubbles",h,()=>m(this.bubbles,o,t.start,t.end,{signal:n,lineCallback:(N,y)=>{let e=f(N);r.next(new i({uniqueId:`bubble-${y}`,refName:t.refName,start:e.start,end:e.end,name:c(e),description:d(e),type:"bubble",score:e.segmentCount,segmentCount:e.segmentCount,pathCount:e.pathCount,inversion:e.inversion,shortestAlleleLength:e.shortestAlleleLength,longestAlleleLength:e.longestAlleleLength,segments:e.segments,shortestAllele:e.shortestAllele,longestAllele:e.longestAllele}))}})),r.complete()},n)}};export{a as default};
|
|
2
|
+
//# sourceMappingURL=MinigraphBubbleAdapter-NWINKWTS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=RgfaTabixAdapter-
|
|
1
|
+
import{a as F}from"./chunk-YVYWV36O.js";import"./chunk-ZA5GPTUM.js";import{a as N}from"./chunk-V55TK2NP.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import{E as p,F as d,b as h,u,v as w,w as k,x,y as b,z as g}from"./chunk-ZT2SESHC.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.js";import{e as f}from"./chunk-6VNDP3UB.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{a as l,o as m}from"./chunk-TC265JAP.js";var c=class extends h{constructor(){super(...arguments);this.fine=this.openIndex([])}static{this.capabilities=["getFeatures","getRefNames"]}openIndex(e){let t=this.getConf("walksLocation"),n=e.length===0&&f(t)?new F(p(this,["walksLocation"],["walksIndex"]),this):void 0,r=e.length===0?this.getConf("graphLocation"):this.getConf(["coarse","graphLocation"]);if(f(r)){let s=p(this,[...e,"graphLocation"],[...e,"graphIndex"]);return{graph:s,walks:n,refNames:new d(n?.file??s,this)}}let a=p(this,[...e,"segmentsLocation"],[...e,"segmentsIndex"]),i=p(this,[...e,"linksLocation"],[...e,"linksIndex"]);return{segments:a,links:i,walks:n,refNames:new d(n?.file??a,this)}}async getHaplotypeNames(e={}){return this.fine.walks?.haplotypeNames(e)}index(e="fine"){return e==="fine"?this.fine:(this.coarse??=this.openIndex(["coarse"]),this.coarse)}async getRefNames(e={}){return this.fine.refNames.assemblyRefNames(e)}async getRegionByteSize(e,t={}){let{walks:n,refNames:r}=this.fine;return r.regionBytes(e,t,n&&((a,{start:i,end:s})=>n.reader.queryStart(i,{...t,refName:a,end:s})))}async hasDataForRefName(){return!0}getFeatures(e,t={}){return N(async n=>{let r=await this.fine.refNames.resolveMapped(e,t);if(r!==void 0){let{walks:a}=this.fine,i=s=>{n.next(s)};await(a?this.walkFeatures(a,r,e,t,i):this.segmentFeatures(r,e,t,i))}n.complete()},t.signal)}async walkFeatures(e,t,n,r,a){let i=await m("Downloading walks",r.statusCallback,()=>e.referenceNodes(t,n,r));for(let s of i){let o=String(s.id);a(new l({uniqueId:o,refName:n.refName,start:s.start,end:s.end,name:o,type:"segment",rank:0,stableName:s.refName}))}}async segmentRows(e,t,n,r){let a=this.fine;if("graph"in a){let i=k(await a.graph.getHeaderLines({signal:n.signal}));return g(a.graph,e,t.start,t.end,{signal:n.signal,lineCallback:s=>{let o=x(s,i);o?.kind==="N"&&r(o.segment,i.anchored)}})}return g(a.segments,e,t.start,t.end,{signal:n.signal,lineCallback:i=>{let{segment:s,anchored:o}=u(i);r(s,o)}})}async segmentFeatures(e,t,n,r){await m("Downloading segments",n.statusCallback,()=>this.segmentRows(e,t,n,(a,i)=>{if(i&&a.refName!==e)return;let s=w(a);r(new l({uniqueId:a.id,refName:t.refName,start:a.start,end:a.end,name:a.id,type:"segment",rank:a.rank,stableName:a.refName,...s&&{samples:s,sampleCount:s.length}}))}))}async getSubgraph(e,t={}){let{hops:n,signal:r,tier:a}=t,i=this.index(a),s=await i.refNames.resolveForCut(e,{signal:r});return i.walks?i.walks.subgraph(s,e,t):b(i,{refName:s,start:e.start,end:e.end},{hops:n,signal:r})}};export{c as default};
|
|
2
|
+
//# sourceMappingURL=RgfaTabixAdapter-N44KY4YC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{H as i,h as o,m as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=TrackWarningsDialog-
|
|
1
|
+
import{H as i,h as o,m as a}from"./chunk-WE7DQVXF.js";import{c as r,d as e}from"./chunk-DUU6T2I5.js";var u=e(function({model:n,title:s,children:l,handleClose:m}){return r(o,{open:!0,title:s,onClose:()=>{m()},children:[l,n.trackWarnings.flatMap(({name:f,warnings:g},p)=>g.map((t,c)=>r(a,{severity:"warning",style:{marginBottom:8},children:[r(i,{variant:"subtitle2",children:[f,": ",t.message]}),t.effect]},`${p}_${c}`)))]})}),x=u;export{x as default};
|
|
2
|
+
//# sourceMappingURL=TrackWarningsDialog-23WL6FPV.js.map
|
package/dist/chunks/{TrackWarningsDialog-4YDIV2FN.js.map → TrackWarningsDialog-23WL6FPV.js.map}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.19_@emotion+react@11.14.0_@types+react@19.3.0_react@19_eb34fd01d29d05a1c3ac8167d41484d7/node_modules/@jbrowse/synteny-core/esm/TrackWarningsDialog.js"],
|
|
4
4
|
"sourcesContent": ["import { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { InfoDialog } from '@jbrowse/core/ui';\nimport { Alert, Typography } from '@mui/material';\nimport { observer } from 'mobx-react';\n/**\n * The render-warnings report both comparative views open, over the rows\n * `collectTrackWarnings` builds for them. Reads them off the view rather than\n * taking a copy, so a refetch that raises or clears a warning while the dialog\n * is open shows in it.\n *\n * Grouped by track, with the track name leading each row: a stacked view's\n * levels raise the same swapped-assemblies warning verbatim, and so does every\n * overlaid track that hits it, so an ungrouped list repeated one sentence N\n * times without ever naming the file to go fix.\n *\n * Keyed by position \u2014 the message is not an identity, and neither is the track\n * name once one track raises two warnings.\n */\nconst TrackWarningsDialog = observer(function TrackWarningsDialog({ model, title, children, handleClose, }) {\n return (_jsxs(InfoDialog, { open: true, title: title, onClose: () => {\n handleClose();\n }, children: [children, model.trackWarnings.flatMap(({ name, warnings }, i) => warnings.map((w, j) => (_jsxs(Alert\n // eslint-disable-next-line @eslint-react/no-array-index-key -- see above\n , { severity: \"warning\", style: { marginBottom: 8 }, children: [_jsxs(Typography, { variant: \"subtitle2\", children: [name, \": \", w.message] }), w.effect] }, `${i}_${j}`))))] }));\n});\nexport default TrackWarningsDialog;\n"],
|
|
5
5
|
"mappings": "qGAkBA,IAAMA,EAAsBC,EAAS,SAA6B,CAAE,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,YAAAC,CAAa,EAAG,CACxG,OAAQC,EAAMC,EAAY,CAAE,KAAM,GAAM,MAAOJ,EAAO,QAAS,IAAM,CAC7DE,EAAY,CAChB,EAAG,SAAU,CAACD,EAAUF,EAAM,cAAc,QAAQ,CAAC,CAAE,KAAAM,EAAM,SAAAC,CAAS,EAAGC,IAAMD,EAAS,IAAI,CAACE,EAAGC,IAAON,EAAMO,EAEvG,CAAE,SAAU,UAAW,MAAO,CAAE,aAAc,CAAE,EAAG,SAAU,CAACP,EAAMQ,EAAY,CAAE,QAAS,YAAa,SAAU,CAACN,EAAM,KAAMG,EAAE,OAAO,CAAE,CAAC,EAAGA,EAAE,MAAM,CAAE,EAAG,GAAGD,CAAC,IAAIE,CAAC,EAAE,CAAE,CAAC,CAAC,CAAE,CAAC,CAC3L,CAAC,EACMG,EAAQf",
|
|
6
6
|
"names": ["TrackWarningsDialog", "observer", "model", "title", "children", "handleClose", "jsxs", "InfoDialog", "name", "warnings", "i", "w", "j", "Alert", "Typography", "TrackWarningsDialog_default"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as x,b,c as N,d as R,f as c,g as C,h as P,i as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=WalkFormsAdapter-
|
|
1
|
+
import{a as x,b,c as N,d as R,f as c,g as C,h as P,i as T}from"./chunk-YTTNQYSM.js";import{a as k}from"./chunk-V55TK2NP.js";import{E as $,b as l,d as g,e as w,f as h,g as p,k as y,o as B,s as F,t as S}from"./chunk-ZT2SESHC.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import"./chunk-CL4PYWKC.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{a as m,o as u}from"./chunk-TC265JAP.js";var v=r=>`${(r/1e6).toFixed(1)} MB`,O=r=>`${(r/1e6).toFixed(1)} M`;function E(r,f){if(!(r instanceof g))return r;let t=N(f);if(r instanceof F)return new Error(`The pinned window ${t} is too large to read every walk in full for structural forms: its walks take ${O(r.steps)} steps, over the ${O(r.limit)} step budget, and about ${p(r.fitsBp)} of it fits. Pin a narrower window`);let e=`walkByteBudget, ${v(r.limit)}`;return new Error(`The pinned window ${t} is too large to cut for structural forms: ${r.zoomHelps?`about ${p(r.fitsBp)} of it fits in ${e}. Pin a narrower window or raise walkByteBudget`:`its cut fetches ${v(r.bytes??0)}, over ${e}. Raise walkByteBudget`}`)}var L=8,i=new Map;function A(r,f){let t=i.get(r),e=t??f();if(i.delete(r),i.set(r,e),!t){e.catch(()=>{i.get(r)===e&&i.delete(r)});for(let s of i.keys()){if(i.size<=L)break;i.delete(s)}}return e}var d=class extends l{constructor(){super(...arguments);this.reader=new y($(this,["walksLocation"],["walksIndex"]))}static{this.capabilities=["getFeatures","getRefNames"]}async referenceSample(t){let{references:e}=await this.reader.header(t);return e[0]??""}async getRefNames(t={}){let e=await this.reader.referenceSequences(t),s=await this.referenceSample(t),a=e.filter(o=>h(o,s)).map(o=>w(o));return a.length>0?[...new Set(a)]:e}pinned(){let t=x(this.getConf("pinned"));if(!t)throw new Error("WalkFormsAdapter needs `pinned`, the window its forms come from: { refName, start, end }");return t}forms(t){if(!this.formsRead){let e=this.pinned(),s=`${JSON.stringify(this.getConf("walksLocation"))} ${e.refName}:${e.start}-${e.end}`,a=this.getConf("walkByteBudget"),o=A(`${s} ${a}`,()=>u("Cutting walks",t.statusCallback,()=>S(this.reader,e,{byteBudget:a,partial:!1}).catch(n=>{throw E(n,e)}))).then(n=>B(n,{window:e,floorBp:b(this.getConf("floorBp")),exclude:this.getConf("exclude")}));o.catch(()=>{this.formsRead===o&&(this.formsRead=void 0)}),this.formsRead=o}return this.formsRead}maxForms(){return this.getConf("maxForms")}async getSourcesAndWarnings(t={}){let e=await this.forms(t),s=R(this.pinned());return{sources:c(e,this.maxForms()),warnings:C(e,this.maxForms()).map(a=>s+a)}}async getSources(t,e={}){return c(await this.forms(e),this.maxForms())}async onPinnedSequence(t,e){let s=await this.referenceSample(e),[a,o]=await Promise.all([this.reader.sequenceFor(s,t,e),this.reader.sequenceFor(s,this.pinned().refName,e)]);return a!==void 0&&a===o}getFeatures(t,e={}){return k(async s=>{let a=await this.forms(e),o=await this.onPinnedSequence(t.refName,e)?T(a,this.maxForms()).filter(n=>n.start<t.end&&n.end>t.start):[];for(let n of o)s.next(new m({uniqueId:`forms-${a.floorBp}-${n.id}`,refName:t.refName,start:n.start,end:n.end,name:n.name,description:n.description,type:n.type,svType:n.svType,consequence:n.consequence,REF:"N",ALT:[n.alt],INFO:{SVTYPE:[n.svType],SVLEN:[n.mark.delta]},mark:n.mark,genotypes:n.genotypes}));if(o.length===0){let n=Math.floor(t.start);s.next(new m({uniqueId:`forms-reference-${t.refName}-${n}`,refName:t.refName,start:n,end:n+1,REF:"N",ALT:["."],genotypes:P(a,this.maxForms())}))}s.complete()},e.signal)}};export{d as default};
|
|
2
|
+
//# sourceMappingURL=WalkFormsAdapter-VDL5XWSU.js.map
|
package/dist/chunks/{WalkTabixSyntenyAdapter-F4XTB7W4.js → WalkTabixSyntenyAdapter-RGJWOHJG.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=WalkTabixSyntenyAdapter-
|
|
1
|
+
import{a as ee}from"./chunk-YVYWV36O.js";import{a as K,b as V,d as Z,e as J,f as B,g as Q,h as Y}from"./chunk-DRI5R7M7.js";import"./chunk-ZA5GPTUM.js";import{a as G}from"./chunk-V55TK2NP.js";import{p as L,q as H,r as q}from"./chunk-M2D7NUOY.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import{E as X,F as z,i as U}from"./chunk-ZT2SESHC.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import{a as O,c as D,d as A,g as x,h as F,i as E}from"./chunk-CL4PYWKC.js";import"./chunk-AGUEPVOR.js";import"./chunk-TMM73K4C.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{o as v}from"./chunk-TC265JAP.js";var me=50;function le(r){let o=[];for(let e=0;e<r.length;e++){let[t,a]=r[e],[s,n]=r[e+1]??[];a===n&&a<=me&&(t==="I"&&s==="D"||t==="D"&&s==="I")?(o.push(["X",a]),e++):o.push([t,a])}return o}function R(r){return Array.from(r.ids,(o,e)=>2*o+r.rev[e])}function P(r,o){let e=r.get(o);return e===void 0?0:e.end-e.start}function te(r){let o=new Map,e=s=>{let n=P(r,s),i=o.get(n);return i===void 0&&(i="N".repeat(n),o.set(n,i)),i},t=new Map,a=s=>{let n=t.get(s);return n===void 0&&(n=R(s),t.set(s,n)),n};return(s,n)=>H({query:a(s),target:a(n),sequenceOf:e,bases:!1})}var _=100;function I(r,o,e){let t=r.at(-1);e>0&&(t?.[0]===o?t[1]+=e:r.push([o,e]))}function ae(r){let o=t=>P(r,t>>1),e=t=>{let a=new Float64Array(t.length+1);return t.forEach((s,n)=>{a[n+1]=a[n]+o(s)}),a};return(t,a)=>{let s=R(a),n=R(t),[i,c]=L(n,s,o),[h,d]=L(n.map(y=>y^1).reverse(),s,o),m=d>c,p=m?h:i,b=Math.max(c,d);if(b<_)return[];let f=e(s),g=e(n),u=y=>m?n.length-1-p[y][0]:p[y][0],k=[];p.forEach(([,y],N)=>{if(N>0){let[M,l]=[u(N-1),u(N)].sort((w,C)=>w-C);I(k,"I",g[l]-g[M+1]),I(k,"D",f[y]-f[p[N-1][1]+1])}I(k,"=",o(s[y]))});let[S,W]=[u(0),u(p.length-1)].sort((y,N)=>y-N);return[{queryStart:g[S],queryEnd:g[W+1],targetStart:f[p[0][1]],targetEnd:f[p.at(-1)[1]+1],strand:m?"-":"+",edits:k,sharedBases:b}]}}function ce(r){let o=new Map,e=new Set;r.ids.forEach((t,a)=>{o.has(t)?e.add(t):o.set(t,r.rev[a])});for(let t of e)o.delete(t);return o}function ne(r){let o=new Map,e=t=>{let a=o.get(t);return a===void 0&&(a=ce(t),o.set(t,a)),a};return(t,a)=>{let s=e(a),n=0,i=0;for(let[c,h]of e(t)){let d=s.get(c);d===h?n+=P(r,c):d!==void 0&&(i+=P(r,c))}return{same:n,opposite:i}}}function se(r){let o=ae(r),e=te(r),t=ne(r);return(a,s)=>{let{same:n,opposite:i}=t(a,s);return n>=_&&i>=_?e(a,s):o(a,s)}}var pe=1e4;function re(r){let o=ae(r),e=te(r),t=ne(r);return(a,s)=>{let n=o(a,s),i=n[0]?.strand,{same:c,opposite:h}=t(a,s);return i===void 0||Math.min(c,h)<pe?n:[...n,...e(a,s).filter(d=>d.strand!==i)]}}function j({chain:r,target:o,query:e,assemblyName:t,refName:a,mateAssemblyName:s}){let n=le(r.edits);return Y({target:{name:o.name,assemblyName:t,refName:a,start:o.hapStart+r.targetStart,end:o.hapStart+r.targetEnd},query:{name:e.name,assemblyName:s,refName:A(e.name),start:e.hapStart+r.queryStart,end:e.hapStart+r.queryEnd},strand:r.strand,cigar:q(n),matches:n.reduce((i,[c,h])=>i+(c==="="?h:0),0),columns:n.reduce((i,[,c])=>i+c,0)})}function ie(r,o,e,t,a){let s=a==="leave",n=i=>i.kind==="elsewhere"&&(s?i.chunk.start>=r.refStart:i.chunk.start<r.refStart);for(let i of e){let{name:c,fragStart:h,hapStart:d,ids:m,rev:p,before:b,after:f}=i;if(c===r.name&&h===r.fragStart){let g=d;for(let u=0;u<m.length;u++){let k=t.get(m[u]),S=k===void 0?0:k.end-k.start;if(k?.rank===0&&k.refName===o&&(s?k.end===r.refStart:k.start===r.refEnd)){let W=n(f)!==n(b)?n(f):u>0!=u<m.length-1?u>0:s!==(p[u]===1);return{skip:r,at:W?g+S:g,strand:W===s?"+":"-"}}g+=S}}}}function oe({crossing:r,refName:o,assemblyName:e,mateAssemblyName:t}){let{skip:a,at:s,strand:n}=r,i=`${a.name}:${a.fragStart}:${a.piece}:skip`;return new K({uniqueId:i,assemblyName:e,refName:o,start:a.refStart,end:a.refEnd,type:"deletion",strand:n==="-"?-1:1,syntenyId:i,spansWindow:!0,mate:{refName:A(a.name),start:s,end:s,assemblyName:t}})}var T=({name:r})=>D(r)??r,$=class extends V{constructor(){super(...arguments);this.walks=new ee(X(this,["walksLocation"],["walksIndex"]),this);this.refNames=new z(this.walks.file,this)}get anchor(){let e=this.getConf("assemblyNames")[0];if(e===void 0)throw new Error("WalkTabixSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");return e}async getHaplotypeNames(e={}){return this.walks.haplotypeNames(e)}async getHeader(e={}){let{haplotypes:t}=await this.walks.reader.header(e),{anchor:a}=this,s=F(this,a),n=E(this);return{hasCoarseTier:!1,anchorAssemblyName:a,lanes:t.filter(i=>i!==s&&O(i)!==s).map(i=>({name:B(n,i),label:i,group:O(i)}))}}async getRefNames(e={}){let{assemblyName:t}=e;return t===void 0||t===this.anchor?this.refNames.assemblyRefNames({...e,assemblyName:this.anchor}):[]}async getSubgraph(e,t={}){let a=await this.refNames.resolveForCut(e,{signal:t.signal});return this.walks.subgraph(a,e,t)}async laneWalks(e,t,a,s,n){let i=U(a,e);return v(n,s.statusCallback,()=>this.walks.reader.cut(e,t,{...this.walks.budgets(),signal:s.signal,keep:i,expand:i,links:!1}).catch(c=>{throw Q(c,t.end-t.start)}))}async skipCrossings(e,t,a){let s=[],n=t;for(let i of["leave","rejoin"]){let c=await this.sideCrossings(e,n,i,a);for(let d of c)s.push(d);let h=new Set(c.map(d=>d.skip));n=n.filter(d=>!h.has(d))}return s}async sideCrossings(e,t,a,s){let{signal:n}=s,{chunk:i}=await this.walks.reader.header({signal:n}),c=m=>a==="leave"?m.refStart-1:m.refEnd,h=new Map;for(let m of t){let p=c(m),b=Math.floor(p/i),f=h.get(b);f?(f.group.push(m),f.start=Math.min(f.start,p),f.end=Math.max(f.end,p+1)):h.set(b,{group:[m],start:p,end:p+1})}return(await Promise.all([...h.values()].map(async({group:m,start:p,end:b})=>{let f=new Set(m.map(u=>u.name)),g=u=>f.has(u);try{let{graph:u,fragments:k}=await this.walks.reader.cut(e,{start:p,end:b},{...this.walks.budgets(),signal:n,keep:g,expand:g,context:0,contained:!0,links:!1});return m.map(S=>ie(S,e,k,u.nodes,a))}catch(u){if(n?.aborted)throw u;return[]}}))).flat().filter(m=>m!==void 0)}async anchorFeatures(e,t,a){let s=a.haplotypes?.length?a.haplotypes.map(l=>F(this,l)):void 0,n=F(this,a.targetAssemblyName),i=n===void 0?s:s===void 0||s.some(l=>x(n,l)||x(l,n))?[n]:[];if(i?.length===0)return[];let{start:c,end:h}=t,d=`Reading walks ${t.refName}:${c.toLocaleString()}-${h.toLocaleString()}`,{graph:m,fragments:p,skips:b}=await this.laneWalks(e,t,i,a,d),f=({name:l})=>i===void 0?0:i.findIndex(w=>x(l,w)),g=new Set(p.map(T)),u=await v(d,a.statusCallback,()=>this.skipCrossings(e,b.filter(l=>f(l)>=0&&!g.has(T(l))&&l.refStart<=c&&l.refEnd>=h),a)),k=re(m.nodes),S=E(this),W=l=>B(S,T(l)),y=p.filter(l=>l.name===e),N=p.filter(l=>l.name!==e&&f(l)>=0).map(l=>({rank:f(l),features:y.flatMap(w=>k(l,w).map(C=>j({chain:C,target:w,query:l,assemblyName:t.assemblyName,refName:t.refName,mateAssemblyName:W(l)})))})),M=u.map(l=>({rank:f(l.skip),features:[oe({crossing:l,refName:t.refName,assemblyName:t.assemblyName,mateAssemblyName:W(l.skip)})]}));return[...N,...M].sort((l,w)=>l.rank-w.rank).flatMap(l=>l.features)}async pairFeatures(e,t,a,s){let n=a.map(m=>({pair:m,featurePrefix:F(this,m.queryAssemblyName),matePrefix:F(this,m.targetAssemblyName)})),{graph:i,fragments:c}=await this.laneWalks(e,t,n.flatMap(m=>[m.featurePrefix,m.matePrefix]),s,J(a)),h=se(i.nodes),d=m=>c.filter(p=>x(p.name,m));return n.flatMap(({pair:m,featurePrefix:p,matePrefix:b})=>d(p).flatMap(f=>d(b).flatMap(g=>h(g,f).map(u=>j({chain:u,target:f,query:g,assemblyName:m.queryAssemblyName,refName:A(f.name),mateAssemblyName:m.targetAssemblyName})))))}getFeatures(e,t={}){return G(async a=>{let s=e.assemblyName===this.anchor?await this.refNames.resolve(e,t):void 0;if(s!==void 0){let n=Z(t),i=n.length>0?await this.pairFeatures(s,e,n,t):await this.anchorFeatures(s,e,t);for(let c of i)a.next(c)}a.complete()},t.signal)}};export{$ as default};
|
|
2
|
+
//# sourceMappingURL=WalkTabixSyntenyAdapter-RGJWOHJG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as M,l as W,p as F}from"./chunk-X2QGBINE.js";import{b as O,h as B}from"./chunk-UC2NHZ7E.js";import{K as f,Q as A,X as _}from"./chunk-OPWSPSAE.js";import{f as R}from"./chunk-J2PN6CG3.js";import{D as x,E,H as S,d as C,o as T,q as I,r as w,s as L,t as N,w as D,y as G,z as P}from"./chunk-WE7DQVXF.js";import{b as t,c as r,d as s}from"./chunk-DUU6T2I5.js";var k=[{value:0,label:"Fastest"},{value:1,label:"Fast"},{value:2,label:"Default"},{value:3,label:"Fine"},{value:4,label:"Best"}];var U=s(function({label:n,value:e,options:o,testId:p,size:h,sx:a,disabled:m,title:u,shown:b,onChange:H}){let y=R();return r(L,{size:h,sx:a,disabled:m,title:u,children:[t(D,{id:y,shrink:!0,children:n}),t(x,{labelId:y,value:e,label:n,notched:!0,displayEmpty:!0,"data-testid":p,renderValue:i=>b??o.find(Y=>Y.value===i)?.label??i,onChange:i=>{H(i.target.value)},children:o.map(i=>t(P,{value:i.value,disabled:i.disabled,title:i.disabled?void 0:i.description,children:t(G,{primary:i.label,secondary:i.disabled?i.description:void 0})},i.value))})]})});var g=F()({section:{marginBottom:24},group:{marginBottom:16},heading:{marginBottom:8}}),l=s(function({warn:n=!1,children:e}){return t(S,{variant:"caption",component:"div",color:n?"warning.main":"text.secondary",children:e})}),v=s(function({title:n,children:e}){let{classes:o}=g();return r("section",{className:o.group,children:[t(S,{variant:"subtitle1",className:o.heading,children:n}),e]})}),Q=s(function({label:n,checked:e,onChange:o,children:p}){let{classes:h}=g();return r("div",{className:h.section,children:[t(N,{control:t(E,{checked:e,onChange:a=>{o(a.target.checked)}}),label:n}),p]})}),d=s(function({children:n,...e}){let{classes:o}=g();return r("div",{className:o.section,children:[t(U,{sx:{minWidth:200},...e}),n]})}),$=[5e3,2e4,5e4,1e5];function q(c){return[...new Set([...$,c])].sort((n,e)=>n-e).map(n=>({value:String(n),label:n.toLocaleString()}))}var z=s(function({label:n,choices:e,stored:o,auto:p,testId:h,onChange:a,children:m}){return e.length>0?t(d,{label:n,value:e.some(u=>u.trackId===o)?o:"",options:[{value:"",label:`Automatic (${p?.name??"none"})`},...e.map(({trackId:u,name:b})=>({value:u,label:b}))],testId:h,onChange:a,children:m}):null}),K=s(function(n){let{model:e,onClose:o,children:p}=n,{classes:h}=g();return r(C,{open:!0,onClose:o,title:"Graph settings",children:[r(w,{children:[r(v,{title:"Subgraph",children:[p,t(d,{label:"Node limit",value:String(e.maxGraphNodes),options:q(e.maxGraphNodes),testId:"graph-node-limit-select",onChange:a=>{e.setMaxGraphNodes(Number(a))},children:t(l,{children:"The most nodes a layout draws; past it the graph is declined. Walk rows take no limit."})})]}),r(v,{title:"Drawing",children:[e.anchorPaths.length>1?t(d,{label:"Reference path",value:e.activeReferencePath??"",options:e.anchorPaths.map(({name:a})=>({value:a,label:a})),testId:"graph-reference-path-select",onChange:a=>{e.setReferencePath(a),e.recomputeLayout()},children:t(l,{children:"The path the anchored layouts place x along"})}):null,t(d,{label:"Node width",value:e.nodeWidth,options:A,testId:"graph-node-width-select",onChange:a=>{e.setNodeWidth(a)},children:t(l,{children:"Depth as width. In a cut with walks, depth is how many haplotypes carry the node."})}),t(d,{label:"Link width",value:e.linkWidth,options:_,testId:"graph-link-width-select",onChange:a=>{e.setLinkWidth(a)},children:t(l,{children:"Walks as width, so a common route reads heavy and a private one thin."})}),r(Q,{label:"Draw paths",checked:e.drawPaths,onChange:a=>{e.setLayer("paths",a)},children:[t(l,{children:"Color each node by the paths through it, one lane per path"}),e.drawPaths&&!e.effectiveDrawPaths?t(l,{warn:!0,children:e.pathCount>f?`Off: ${e.pathCount.toLocaleString()} paths is past the ${f} this can tell apart`:"Off: this graph states no paths"}):null]}),t(z,{label:"Gene track",choices:e.geneTrackChoices,stored:e.geneTrackId,auto:W(e.geneTrackChoices,""),testId:"graph-gene-track-select",onChange:a=>{e.setGeneTrackId(a)},children:t(l,{children:"Where genes on the backbone come from"})}),t(z,{label:"Repeat track",choices:e.repeatTrackChoices,stored:e.repeatTrackId,auto:M(e.repeatTrackChoices,""),testId:"graph-repeat-track-select",onChange:a=>{e.setRepeatTrackId(a)},children:t(l,{children:"The tandem repeat annotation walk rows measure and tile by"})})]}),r(v,{title:"Force-directed layout",children:[e.hasGraph&&!e.usesLayoutEngine?t("div",{className:h.section,children:t(l,{warn:!0,children:"No effect on the current layout until Layout is Force-directed"})}):null,t(d,{label:"Engine",value:e.layoutEngine,options:O,testId:"graph-layout-engine-select",onChange:a=>{e.setLayoutEngine(a)},children:t(l,{children:"Stress keeps the reference straight, so a zoom keeps the picture; FMMM lets the whole graph settle."})}),t(d,{label:"Layout quality",value:String(e.layoutQuality),options:k.map(a=>({value:String(a.value),label:a.label})),testId:"graph-layout-quality-select",onChange:a=>{e.setLayoutQuality(Number(a))},children:t(l,{children:"The engine's iteration budget; higher is slower"})}),t(d,{label:"Bubble spread",value:e.bubbleSpread,options:B,testId:"graph-bubble-spread-select",onChange:a=>{e.setBubbleSpread(a)},children:t(l,{children:"How far the layout opens a bubble"})}),e.layoutEngine==="stress"?null:t(Q,{label:"Linear layout",checked:e.linearLayout,onChange:a=>{e.setLinearLayout(a)},children:t(l,{children:"Keeps a chain of nodes on one line where it can"})})]})]}),t(I,{children:t(T,{variant:"contained",color:"primary",onClick:o,children:"Close"})})]})}),be=K;export{U as a,be as b};
|
|
2
|
+
//# sourceMappingURL=chunk-4XY7HUQR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@12.5.1/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-K5SIJGAE.js", "../../src/GraphGenomeView/components/LabelledSelect.tsx", "../../src/GraphGenomeView/components/GraphSettingsDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["// src/layoutQualities.ts\nvar LAYOUT_QUALITIES = [\n { value: 0, label: \"Fastest\" },\n { value: 1, label: \"Fast\" },\n { value: 2, label: \"Default\" },\n { value: 3, label: \"Fine\" },\n { value: 4, label: \"Best\" }\n];\n\nexport {\n LAYOUT_QUALITIES\n};\n", "import { useId } from 'react'\n\nimport {\n FormControl,\n InputLabel,\n ListItemText,\n MenuItem,\n Select,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { SxProps } from '@mui/material'\n\ninterface SelectOption<T extends string> {\n value: T\n label: string\n // an option's tooltip, and the reason under a disabled one, whose tooltip\n // cannot open\n description?: string\n disabled?: boolean\n}\n\n// One dropdown with its label tied to it, so a screen reader names the combobox\nexport default observer(function LabelledSelect<T extends string>({\n label,\n value,\n options,\n testId,\n size,\n sx,\n disabled,\n title,\n shown,\n onChange,\n}: {\n label: string\n value: T\n options: readonly SelectOption<T>[]\n testId?: string\n size?: 'small' | 'medium'\n sx?: SxProps\n disabled?: boolean\n title?: string\n // what the closed select reads, when not the picked option's label\n shown?: string\n onChange: (value: T) => void\n}) {\n const labelId = useId()\n return (\n <FormControl size={size} sx={sx} disabled={disabled} title={title}>\n <InputLabel id={labelId} shrink>\n {label}\n </InputLabel>\n <Select\n labelId={labelId}\n value={value}\n label={label}\n notched\n displayEmpty\n data-testid={testId}\n renderValue={picked =>\n shown ?? options.find(o => o.value === picked)?.label ?? picked\n }\n onChange={e => {\n onChange(e.target.value as T)\n }}\n >\n {options.map(o => (\n <MenuItem\n key={o.value}\n value={o.value}\n disabled={o.disabled}\n title={o.disabled ? undefined : o.description}\n >\n <ListItemText\n primary={o.label}\n secondary={o.disabled ? o.description : undefined}\n />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )\n})\n", "import type { ReactNode } from 'react'\n\nimport { BUBBLE_SPREADS } from '@jbrowse/bandage-core/bubbleSpreads'\nimport { EDGE_WIDTHS } from '@jbrowse/bandage-core/edgeWidths'\nimport { LAYOUT_ENGINES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_QUALITIES } from '@jbrowse/bandage-core/layoutQualities'\nimport { NODE_WIDTHS } from '@jbrowse/bandage-core/nodeWidths'\nimport { MAX_PATH_COLORS } from '@jbrowse/bandage-core/pathColors'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n FormControlLabel,\n Switch,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from './LabelledSelect'\nimport { pickGeneTrack } from '../genes/geneFeatures'\nimport { pickRepeatTrack } from '../repeats/repeatFeatures'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n group: {\n marginBottom: 16,\n },\n heading: {\n marginBottom: 8,\n },\n})\n\nconst Caption = observer(function Caption({\n warn = false,\n children,\n}: {\n warn?: boolean\n children: ReactNode\n}) {\n return (\n <Typography\n variant=\"caption\"\n component=\"div\"\n color={warn ? 'warning.main' : 'text.secondary'}\n >\n {children}\n </Typography>\n )\n})\n\nconst Group = observer(function Group({\n title,\n children,\n}: {\n title: string\n children: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <section className={classes.group}>\n <Typography variant=\"subtitle1\" className={classes.heading}>\n {title}\n </Typography>\n {children}\n </section>\n )\n})\n\nconst SettingSwitch = observer(function SettingSwitch({\n label,\n checked,\n onChange,\n children,\n}: {\n label: string\n checked: boolean\n onChange: (checked: boolean) => void\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <FormControlLabel\n control={\n <Switch\n checked={checked}\n onChange={e => {\n onChange(e.target.checked)\n }}\n />\n }\n label={label}\n />\n {children}\n </div>\n )\n})\n\n// one dropdown setting, at the dialog's width, and its caption\nconst SettingSelect = observer(function SettingSelect<T extends string>({\n children,\n ...props\n}: Omit<Parameters<typeof LabelledSelect<T>>[0], 'size' | 'sx'> & {\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <LabelledSelect sx={{ minWidth: 200 }} {...props} />\n {children}\n </div>\n )\n})\n\nconst NODE_LIMITS = [5000, 20_000, 50_000, 100_000]\n\n// the presets, with a limit a session states among them\nfunction nodeLimitOptions(current: number) {\n return [...new Set([...NODE_LIMITS, current])]\n .sort((a, b) => a - b)\n .map(limit => ({ value: String(limit), label: limit.toLocaleString() }))\n}\n\ninterface NamedTrack {\n trackId: string\n name: string\n}\n\n// '' leaves the pick to the heuristic, so a session can go back to it\nconst TrackPickSetting = observer(function TrackPickSetting({\n label,\n choices,\n stored,\n auto,\n testId,\n onChange,\n children,\n}: {\n label: string\n choices: NamedTrack[]\n stored: string\n auto: NamedTrack | undefined\n testId: string\n onChange: (trackId: string) => void\n children: ReactNode\n}) {\n return choices.length > 0 ? (\n <SettingSelect\n label={label}\n value={choices.some(t => t.trackId === stored) ? stored : ''}\n options={[\n { value: '', label: `Automatic (${auto?.name ?? 'none'})` },\n ...choices.map(({ trackId, name }) => ({\n value: trackId,\n label: name,\n })),\n ]}\n testId={testId}\n onChange={onChange}\n >\n {children}\n </SettingSelect>\n ) : null\n})\n\n// Toggles the menus already offer (halos, genes, color) stay out of here.\n// `children` is the host's own part of the subgraph group.\nconst GraphSettingsDialog = observer(function GraphSettingsDialog(props: {\n model: GraphPaneModel\n onClose: () => void\n children?: ReactNode\n}) {\n const { model, onClose, children } = props\n const { classes } = useStyles()\n\n return (\n <Dialog open onClose={onClose} title=\"Graph settings\">\n <DialogContent>\n <Group title=\"Subgraph\">\n {children}\n <SettingSelect\n label=\"Node limit\"\n value={String(model.maxGraphNodes)}\n options={nodeLimitOptions(model.maxGraphNodes)}\n testId=\"graph-node-limit-select\"\n onChange={limit => {\n model.setMaxGraphNodes(Number(limit))\n }}\n >\n <Caption>\n The most nodes a layout draws; past it the graph is declined. Walk\n rows take no limit.\n </Caption>\n </SettingSelect>\n </Group>\n\n <Group title=\"Drawing\">\n {model.anchorPaths.length > 1 ? (\n <SettingSelect\n label=\"Reference path\"\n value={model.activeReferencePath ?? ''}\n options={model.anchorPaths.map(({ name }) => ({\n value: name,\n label: name,\n }))}\n testId=\"graph-reference-path-select\"\n onChange={name => {\n model.setReferencePath(name)\n void model.recomputeLayout()\n }}\n >\n <Caption>The path the anchored layouts place x along</Caption>\n </SettingSelect>\n ) : null}\n\n <SettingSelect\n label=\"Node width\"\n value={model.nodeWidth}\n options={NODE_WIDTHS}\n testId=\"graph-node-width-select\"\n onChange={width => {\n model.setNodeWidth(width)\n }}\n >\n <Caption>\n Depth as width. In a cut with walks, depth is how many haplotypes\n carry the node.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Link width\"\n value={model.linkWidth}\n options={EDGE_WIDTHS}\n testId=\"graph-link-width-select\"\n onChange={links => {\n model.setLinkWidth(links)\n }}\n >\n <Caption>\n Walks as width, so a common route reads heavy and a private one\n thin.\n </Caption>\n </SettingSelect>\n\n <SettingSwitch\n label=\"Draw paths\"\n checked={model.drawPaths}\n onChange={draw => {\n model.setLayer('paths', draw)\n }}\n >\n <Caption>\n Color each node by the paths through it, one lane per path\n </Caption>\n {model.drawPaths && !model.effectiveDrawPaths ? (\n <Caption warn>\n {model.pathCount > MAX_PATH_COLORS\n ? `Off: ${model.pathCount.toLocaleString()} paths is past the ${MAX_PATH_COLORS} this can tell apart`\n : 'Off: this graph states no paths'}\n </Caption>\n ) : null}\n </SettingSwitch>\n\n <TrackPickSetting\n label=\"Gene track\"\n choices={model.geneTrackChoices}\n stored={model.geneTrackId}\n auto={pickGeneTrack(model.geneTrackChoices, '')}\n testId=\"graph-gene-track-select\"\n onChange={trackId => {\n model.setGeneTrackId(trackId)\n }}\n >\n <Caption>Where genes on the backbone come from</Caption>\n </TrackPickSetting>\n\n <TrackPickSetting\n label=\"Repeat track\"\n choices={model.repeatTrackChoices}\n stored={model.repeatTrackId}\n auto={pickRepeatTrack(model.repeatTrackChoices, '')}\n testId=\"graph-repeat-track-select\"\n onChange={trackId => {\n model.setRepeatTrackId(trackId)\n }}\n >\n <Caption>\n The tandem repeat annotation walk rows measure and tile by\n </Caption>\n </TrackPickSetting>\n </Group>\n\n <Group title=\"Force-directed layout\">\n {model.hasGraph && !model.usesLayoutEngine ? (\n <div className={classes.section}>\n <Caption warn>\n No effect on the current layout until Layout is Force-directed\n </Caption>\n </div>\n ) : null}\n\n <SettingSelect\n label=\"Engine\"\n value={model.layoutEngine}\n options={LAYOUT_ENGINES}\n testId=\"graph-layout-engine-select\"\n onChange={engine => {\n model.setLayoutEngine(engine)\n }}\n >\n <Caption>\n Stress keeps the reference straight, so a zoom keeps the picture;\n FMMM lets the whole graph settle.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Layout quality\"\n value={String(model.layoutQuality)}\n options={LAYOUT_QUALITIES.map(q => ({\n value: String(q.value),\n label: q.label,\n }))}\n testId=\"graph-layout-quality-select\"\n onChange={quality => {\n model.setLayoutQuality(Number(quality))\n }}\n >\n <Caption>\n The engine's iteration budget; higher is slower\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Bubble spread\"\n value={model.bubbleSpread}\n options={BUBBLE_SPREADS}\n testId=\"graph-bubble-spread-select\"\n onChange={spread => {\n model.setBubbleSpread(spread)\n }}\n >\n <Caption>How far the layout opens a bubble</Caption>\n </SettingSelect>\n\n {model.layoutEngine === 'stress' ? null : (\n <SettingSwitch\n label=\"Linear layout\"\n checked={model.linearLayout}\n onChange={linear => {\n model.setLinearLayout(linear)\n }}\n >\n <Caption>Keeps a chain of nodes on one line where it can</Caption>\n </SettingSwitch>\n )}\n </Group>\n </DialogContent>\n\n <DialogActions>\n <Button variant=\"contained\" color=\"primary\" onClick={onClose}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default GraphSettingsDialog\n"],
|
|
5
|
+
"mappings": "yWACA,IAAIA,EAAmB,CACrB,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,MAAO,CAC5B,ECgBA,IAAOC,EAAQC,EAAS,SAA0C,CAChE,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,EACA,GAAAC,EACA,SAAAC,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,CACF,EAYG,CACD,IAAMC,EAAUC,EAAM,EACtB,OACEC,EAACC,EAAA,CAAY,KAAMT,EAAM,GAAIC,EAAI,SAAUC,EAA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ClC,MAAO,OAAOA,EAAE,KAAK,EACrB,MAAOA,EAAE,KACX,EAAE,EACF,OAAO,8BACP,SAAUC,GAAW,CACnBhB,EAAM,iBAAiB,OAAOgB,CAAO,CAAC,CACxC,EAEA,SAAA/C,EAACJ,EAAA,CAAQ,2DAET,EACF,EAEAI,EAACa,EAAA,CACC,MAAM,gBACN,MAAOkB,EAAM,aACb,QAASiB,EACT,OAAO,6BACP,SAAUC,GAAU,CAClBlB,EAAM,gBAAgBkB,CAAM,CAC9B,EAEA,SAAAjD,EAACJ,EAAA,CAAQ,6CAAiC,EAC5C,EAECmC,EAAM,eAAiB,SAAW,KACjC/B,EAACM,EAAA,CACC,MAAM,gBACN,QAASyB,EAAM,aACf,SAAUmB,GAAU,CAClBnB,EAAM,gBAAgBmB,CAAM,CAC9B,EAEA,SAAAlD,EAACJ,EAAA,CAAQ,2DAA+C,EAC1D,GAEJ,GACF,EAEAI,EAACmD,EAAA,CACC,SAAAnD,EAACoD,EAAA,CAAO,QAAQ,YAAY,MAAM,UAAU,QAASpB,EAAS,iBAE9D,EACF,GACF,CAEJ,CAAC,EAEMqB,GAAQvB",
|
|
6
|
+
"names": ["LAYOUT_QUALITIES", "LabelledSelect_default", "observer", "label", "value", "options", "testId", "size", "sx", "disabled", "title", "shown", "onChange", "labelId", "useId", "jsxs", "FormControl", "jsx", "InputLabel", "Select", "picked", "o", "e", "MenuItem", "ListItemText", "useStyles", "makeStyles", "Caption", "observer", "warn", "children", "jsx", "Typography", "Group", "title", "classes", "jsxs", "SettingSwitch", "label", "checked", "onChange", "FormControlLabel", "Switch", "e", "SettingSelect", "props", "LabelledSelect_default", "NODE_LIMITS", "nodeLimitOptions", "current", "a", "b", "limit", "TrackPickSetting", "choices", "stored", "auto", "testId", "t", "trackId", "name", "GraphSettingsDialog", "model", "onClose", "Dialog", "DialogContent", "NODE_WIDTHS", "width", "EDGE_WIDTHS", "links", "draw", "MAX_PATH_COLORS", "pickGeneTrack", "pickRepeatTrack", "LAYOUT_ENGINES", "engine", "LAYOUT_QUALITIES", "q", "quality", "BUBBLE_SPREADS", "spread", "linear", "DialogActions", "Button", "GraphSettingsDialog_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as y}from"./chunk-J2PN6CG3.js";import{F as k,H as f,d as s,n as d,o as r,p as g,q as m,r as u}from"./chunk-WE7DQVXF.js";import{b as t,c as i,d as p}from"./chunk-DUU6T2I5.js";var R=p(function({title:C,label:b,caption:h,testId:D,options:l,initial:v,optionLabel:c=o=>o,confirmLabel:x,onPick:A,onClose:n}){let[o,B]=y(()=>v.filter(e=>l.includes(e)));return i(s,{open:!0,onClose:n,title:C,children:[i(u,{children:[t(d,{multiple:!0,disableCloseOnSelect:!0,"data-testid":D,options:l,getOptionLabel:c,value:o,onChange:(e,a)=>{B(a)},renderOption:({key:e,...a},N,{selected:O})=>i("li",{...a,children:[t(g,{size:"small",checked:O}),c(N)]},e),renderInput:e=>t(k,{...e,autoFocus:!0,label:b,placeholder:"type to search"})}),t(f,{variant:"caption",color:"text.secondary",children:h})]}),i(m,{children:[t(r,{onClick:n,children:"Cancel"}),t(r,{variant:"contained",onClick:()=>{A(o),n()},children:x(o)})]})]})});export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6OZGIMZC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/GraphGenomeView/components/PickNamesDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useState } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Autocomplete,\n Button,\n Checkbox,\n DialogActions,\n DialogContent,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\n// A set of names picked by search, in the order picked, committed on confirm\nexport default observer(function PickNamesDialog({\n title,\n label,\n caption,\n testId,\n options,\n initial,\n optionLabel = name => name,\n confirmLabel,\n onPick,\n onClose,\n}: {\n title: string\n label: string\n caption: ReactNode\n testId: string\n options: string[]\n initial: string[]\n optionLabel?: (name: string) => string\n confirmLabel: (picked: string[]) => string\n onPick: (picked: string[]) => void\n onClose: () => void\n}) {\n const [picked, setPicked] = useState(() =>\n initial.filter(name => options.includes(name)),\n )\n return (\n <Dialog open onClose={onClose} title={title}>\n <DialogContent>\n <Autocomplete\n multiple\n disableCloseOnSelect\n data-testid={testId}\n options={options}\n getOptionLabel={optionLabel}\n value={picked}\n onChange={(_, value) => {\n setPicked(value)\n }}\n renderOption={({ key, ...props }, name, { selected }) => (\n <li key={key} {...props}>\n <Checkbox size=\"small\" checked={selected} />\n {optionLabel(name)}\n </li>\n )}\n renderInput={params => (\n <TextField\n {...params}\n autoFocus\n label={label}\n placeholder=\"type to search\"\n />\n )}\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {caption}\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>Cancel</Button>\n <Button\n variant=\"contained\"\n onClick={() => {\n onPick(picked)\n onClose()\n }}\n >\n {confirmLabel(picked)}\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n"],
|
|
5
|
+
"mappings": "uLAgBA,IAAOA,EAAQC,EAAS,SAAyB,CAC/C,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,QAAAC,EACA,QAAAC,EACA,YAAAC,EAAcC,GAAQA,EACtB,aAAAC,EACA,OAAAC,EACA,QAAAC,CACF,EAWG,CACD,GAAM,CAACC,EAAQC,CAAS,EAAIC,EAAS,IACnCR,EAAQ,OAAOE,GAAQH,EAAQ,SAASG,CAAI,CAAC,CAC/C,EACA,OACEO,EAACC,EAAA,CAAO,KAAI,GAAC,QAASL,EAAS,MAAOV,EACpC,UAAAc,EAACE,EAAA,CACC,UAAAC,EAACC,EAAA,CACC,SAAQ,GACR,qBAAoB,GACpB,cAAaf,EACb,QAASC,EACT,eAAgBE,EAChB,MAAOK,EACP,SAAU,CAACQ,EAAGC,IAAU,CACtBR,EAAUQ,CAAK,CACjB,EACA,aAAc,CAAC,CAAE,IAAAC,EAAK,GAAGC,CAAM,EAAGf,EAAM,CAAE,SAAAgB,CAAS,IACjDT,EAAC,MAAc,GAAGQ,EAChB,UAAAL,EAACO,EAAA,CAAS,KAAK,QAAQ,QAASD,EAAU,EACzCjB,EAAYC,CAAI,IAFVc,CAGT,EAEF,YAAaI,GACXR,EAACS,EAAA,CACE,GAAGD,EACJ,UAAS,GACT,MAAOxB,EACP,YAAY,iBACd,EAEJ,EACAgB,EAACU,EAAA,CAAW,QAAQ,UAAU,MAAM,iBACjC,SAAAzB,EACH,GACF,EACAY,EAACc,EAAA,CACC,UAAAX,EAACY,EAAA,CAAO,QAASnB,EAAS,kBAAM,EAChCO,EAACY,EAAA,CACC,QAAQ,YACR,QAAS,IAAM,CACbpB,EAAOE,CAAM,EACbD,EAAQ,CACV,EAEC,SAAAF,EAAaG,CAAM,EACtB,GACF,GACF,CAEJ,CAAC",
|
|
6
|
+
"names": ["PickNamesDialog_default", "observer", "title", "label", "caption", "testId", "options", "initial", "optionLabel", "name", "confirmLabel", "onPick", "onClose", "picked", "setPicked", "useState", "jsxs", "Dialog", "DialogContent", "jsx", "Autocomplete", "_", "value", "key", "props", "selected", "Checkbox", "params", "TextField", "Typography", "DialogActions", "Button"]
|
|
7
|
+
}
|