jbrowse-plugin-graphgenomeviewer 8.4.0 → 8.6.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.
Files changed (132) hide show
  1. package/dist/chunks/{AddTrackWorkflow-JAIB6H2T.js → AddTrackWorkflow-IOPTETLH.js} +2 -2
  2. package/dist/chunks/AddTrackWorkflow-IOPTETLH.js.map +7 -0
  3. package/dist/chunks/{ChooseSamplesDialog-LO7FKFSS.js → ChooseSamplesDialog-7RI573UO.js} +2 -2
  4. package/dist/chunks/{ChooseSamplesDialog-LO7FKFSS.js.map → ChooseSamplesDialog-7RI573UO.js.map} +1 -1
  5. package/dist/chunks/{ChooseWalksDialog-JJSOVCEU.js → ChooseWalksDialog-4LDYDQH2.js} +2 -2
  6. package/dist/chunks/{ChooseWalksDialog-JJSOVCEU.js.map → ChooseWalksDialog-4LDYDQH2.js.map} +1 -1
  7. package/dist/chunks/{GbzBaseSyntenyAdapter-CJQVZJPA.js → GbzBaseSyntenyAdapter-67NMRHWZ.js} +2 -2
  8. package/dist/chunks/{GraphGenomeView-EM7KNQHB.js → GraphGenomeView-RD2XGX6D.js} +2 -2
  9. package/dist/chunks/GraphTrackSettingsDialog-R3XOY32L.js +4 -0
  10. package/dist/chunks/{GraphTrackSettingsDialog-GTQ6Z2HA.js.map → GraphTrackSettingsDialog-R3XOY32L.js.map} +3 -3
  11. package/dist/chunks/HighlightColorDialog-AKPIC56I.js +2 -0
  12. package/dist/chunks/{HighlightColorDialog-KNJFIFLO.js.map → HighlightColorDialog-AKPIC56I.js.map} +2 -2
  13. package/dist/chunks/{LinearGraphDisplay-APDIIF7F.js → LinearGraphDisplay-RRAXTQFC.js} +2 -2
  14. package/dist/chunks/LinearGraphDisplay-RRAXTQFC.js.map +7 -0
  15. package/dist/chunks/{MinigraphBubbleAdapter-QEC37MYN.js → MinigraphBubbleAdapter-2YTXBZYS.js} +2 -2
  16. package/dist/chunks/{RgfaTabixAdapter-ZGXDNU43.js → RgfaTabixAdapter-RCGS6YVM.js} +2 -2
  17. package/dist/chunks/{TrackWarningsDialog-4YDIV2FN.js → TrackWarningsDialog-23WL6FPV.js} +2 -2
  18. package/dist/chunks/{TrackWarningsDialog-4YDIV2FN.js.map → TrackWarningsDialog-23WL6FPV.js.map} +1 -1
  19. package/dist/chunks/{WalkFormsAdapter-QYFYWQJD.js → WalkFormsAdapter-3M5A4JL3.js} +2 -2
  20. package/dist/chunks/WalkTabixSyntenyAdapter-576RE5OE.js +2 -0
  21. package/dist/chunks/WalkTabixSyntenyAdapter-576RE5OE.js.map +7 -0
  22. package/dist/chunks/chunk-4XY7HUQR.js +2 -0
  23. package/dist/chunks/chunk-4XY7HUQR.js.map +7 -0
  24. package/dist/chunks/chunk-6OZGIMZC.js +2 -0
  25. package/dist/chunks/chunk-6OZGIMZC.js.map +7 -0
  26. package/dist/chunks/{chunk-OTBDKJEA.js → chunk-AGUEPVOR.js} +1 -1
  27. package/dist/chunks/{chunk-OTBDKJEA.js.map → chunk-AGUEPVOR.js.map} +1 -1
  28. package/dist/chunks/{chunk-ZEE3HTOT.js → chunk-CGPYVMGQ.js} +2 -2
  29. package/dist/chunks/{chunk-OGQ6OQDN.js → chunk-D6TY2QEG.js} +1 -1
  30. package/dist/chunks/chunk-D6TY2QEG.js.map +7 -0
  31. package/dist/chunks/chunk-DIGIM3XY.js +4 -0
  32. package/dist/chunks/chunk-DIGIM3XY.js.map +7 -0
  33. package/dist/chunks/{chunk-JMBDTNUR.js → chunk-DUU6T2I5.js} +1 -1
  34. package/dist/chunks/chunk-DUU6T2I5.js.map +7 -0
  35. package/dist/chunks/chunk-FLKXKTS2.js +2 -0
  36. package/dist/chunks/chunk-FLKXKTS2.js.map +7 -0
  37. package/dist/chunks/{chunk-PRGG24TK.js → chunk-HRTRECXN.js} +2 -2
  38. package/dist/chunks/{chunk-NIEZKWQV.js → chunk-J2PN6CG3.js} +1 -1
  39. package/dist/chunks/chunk-J2PN6CG3.js.map +7 -0
  40. package/dist/chunks/{chunk-ROZPEXN4.js → chunk-QUDJ7AM3.js} +1 -1
  41. package/dist/chunks/chunk-QUDJ7AM3.js.map +7 -0
  42. package/dist/chunks/{chunk-5Q56NPNH.js → chunk-SVDQVLEU.js} +2 -2
  43. package/dist/chunks/{chunk-5Q56NPNH.js.map → chunk-SVDQVLEU.js.map} +1 -1
  44. package/dist/chunks/{chunk-J5RMHLFJ.js → chunk-TC265JAP.js} +1 -1
  45. package/dist/chunks/chunk-TC265JAP.js.map +7 -0
  46. package/dist/chunks/{chunk-3VGXCEMQ.js → chunk-TMM73K4C.js} +1 -1
  47. package/dist/chunks/chunk-TMM73K4C.js.map +7 -0
  48. package/dist/chunks/{chunk-4LAVXP7J.js → chunk-ULPW4VGT.js} +2 -2
  49. package/dist/chunks/{chunk-KOB7YIMR.js → chunk-V55TK2NP.js} +1 -1
  50. package/dist/chunks/chunk-V55TK2NP.js.map +7 -0
  51. package/dist/chunks/chunk-VNWCN47G.js +3 -0
  52. package/dist/chunks/chunk-VNWCN47G.js.map +7 -0
  53. package/dist/chunks/{chunk-5Z4VIKXZ.js → chunk-WE7DQVXF.js} +1 -1
  54. package/dist/chunks/chunk-WE7DQVXF.js.map +7 -0
  55. package/dist/chunks/{chunk-TL2FTG3H.js → chunk-WE7XHNAH.js} +2 -2
  56. package/dist/chunks/chunk-WE7XHNAH.js.map +7 -0
  57. package/dist/chunks/{chunk-DMLYMYLG.js → chunk-WO644UAC.js} +3 -3
  58. package/dist/chunks/chunk-WO644UAC.js.map +7 -0
  59. package/dist/chunks/{chunk-UWBKGUBZ.js → chunk-X2QGBINE.js} +2 -2
  60. package/dist/chunks/{chunk-UWBKGUBZ.js.map → chunk-X2QGBINE.js.map} +3 -3
  61. package/dist/chunks/chunk-Y7MQVQAS.js +2 -0
  62. package/dist/chunks/chunk-Y7MQVQAS.js.map +7 -0
  63. package/dist/chunks/{executeDiagonalize-MDMQAC5Z.js → executeDiagonalize-HZFFXMG4.js} +2 -2
  64. package/dist/chunks/executeDiagonalize-HZFFXMG4.js.map +7 -0
  65. package/dist/chunks/{renderSvg-H7SROVVQ.js → renderSvg-GF64RZ6B.js} +2 -2
  66. package/dist/chunks/renderSvg-GF64RZ6B.js.map +7 -0
  67. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
  68. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  69. package/package.json +9 -9
  70. package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +16 -10
  71. package/src/GraphGenomeView/components/HighlightColorDialog.tsx +2 -2
  72. package/src/GraphGenomeView/components/HoverLayer.tsx +7 -2
  73. package/src/GraphGenomeView/components/LabelChip.tsx +3 -2
  74. package/src/GraphGenomeView/components/LabelledSelect.tsx +3 -2
  75. package/src/GraphGenomeView/components/Legend.tsx +2 -2
  76. package/src/GraphGenomeView/components/LegendSwatch.tsx +8 -2
  77. package/src/GraphGenomeView/components/PaneContextMenu.tsx +3 -2
  78. package/src/GraphGenomeView/components/PaneLayer.tsx +2 -2
  79. package/src/GraphGenomeView/components/PaneSvg.tsx +6 -0
  80. package/src/GraphGenomeView/components/PickNamesDialog.tsx +3 -2
  81. package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +18 -6
  82. package/src/GraphGenomeView/pane/loadActions.ts +17 -1
  83. package/src/GraphGenomeView/pane/renderingActions.ts +1 -0
  84. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +0 -9
  85. package/src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx +4 -2
  86. package/src/LinearGraphDisplay/model.ts +1 -0
  87. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +6 -10
  88. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +25 -13
  89. package/src/WalkTabixSyntenyAdapter/walkLanes.ts +70 -7
  90. package/src/hoverSync/index.test.tsx +2 -2
  91. package/src/hoverSync/index.tsx +1 -1
  92. package/src/index.ts +2 -2
  93. package/src/panSNAliases/trackAdapterConfig.ts +2 -2
  94. package/src/version.ts +1 -1
  95. package/dist/chunks/AddTrackWorkflow-JAIB6H2T.js.map +0 -7
  96. package/dist/chunks/GraphTrackSettingsDialog-GTQ6Z2HA.js +0 -4
  97. package/dist/chunks/HighlightColorDialog-KNJFIFLO.js +0 -2
  98. package/dist/chunks/LinearGraphDisplay-APDIIF7F.js.map +0 -7
  99. package/dist/chunks/WalkTabixSyntenyAdapter-F4XTB7W4.js +0 -2
  100. package/dist/chunks/WalkTabixSyntenyAdapter-F4XTB7W4.js.map +0 -7
  101. package/dist/chunks/chunk-3ROUAVMP.js +0 -4
  102. package/dist/chunks/chunk-3ROUAVMP.js.map +0 -7
  103. package/dist/chunks/chunk-3VGXCEMQ.js.map +0 -7
  104. package/dist/chunks/chunk-3WG3GF2A.js +0 -2
  105. package/dist/chunks/chunk-3WG3GF2A.js.map +0 -7
  106. package/dist/chunks/chunk-5Z4VIKXZ.js.map +0 -7
  107. package/dist/chunks/chunk-CBKSPAUI.js +0 -2
  108. package/dist/chunks/chunk-CBKSPAUI.js.map +0 -7
  109. package/dist/chunks/chunk-DKYX6XBX.js +0 -2
  110. package/dist/chunks/chunk-DKYX6XBX.js.map +0 -7
  111. package/dist/chunks/chunk-DMLYMYLG.js.map +0 -7
  112. package/dist/chunks/chunk-FUPBKEC2.js +0 -2
  113. package/dist/chunks/chunk-FUPBKEC2.js.map +0 -7
  114. package/dist/chunks/chunk-J5RMHLFJ.js.map +0 -7
  115. package/dist/chunks/chunk-JMBDTNUR.js.map +0 -7
  116. package/dist/chunks/chunk-KOB7YIMR.js.map +0 -7
  117. package/dist/chunks/chunk-NIEZKWQV.js.map +0 -7
  118. package/dist/chunks/chunk-OGQ6OQDN.js.map +0 -7
  119. package/dist/chunks/chunk-PX4IRCTO.js +0 -3
  120. package/dist/chunks/chunk-PX4IRCTO.js.map +0 -7
  121. package/dist/chunks/chunk-ROZPEXN4.js.map +0 -7
  122. package/dist/chunks/chunk-TL2FTG3H.js.map +0 -7
  123. package/dist/chunks/executeDiagonalize-MDMQAC5Z.js.map +0 -7
  124. package/dist/chunks/renderSvg-H7SROVVQ.js.map +0 -7
  125. /package/dist/chunks/{GbzBaseSyntenyAdapter-CJQVZJPA.js.map → GbzBaseSyntenyAdapter-67NMRHWZ.js.map} +0 -0
  126. /package/dist/chunks/{GraphGenomeView-EM7KNQHB.js.map → GraphGenomeView-RD2XGX6D.js.map} +0 -0
  127. /package/dist/chunks/{MinigraphBubbleAdapter-QEC37MYN.js.map → MinigraphBubbleAdapter-2YTXBZYS.js.map} +0 -0
  128. /package/dist/chunks/{RgfaTabixAdapter-ZGXDNU43.js.map → RgfaTabixAdapter-RCGS6YVM.js.map} +0 -0
  129. /package/dist/chunks/{WalkFormsAdapter-QYFYWQJD.js.map → WalkFormsAdapter-3M5A4JL3.js.map} +0 -0
  130. /package/dist/chunks/{chunk-ZEE3HTOT.js.map → chunk-CGPYVMGQ.js.map} +0 -0
  131. /package/dist/chunks/{chunk-PRGG24TK.js.map → chunk-HRTRECXN.js.map} +0 -0
  132. /package/dist/chunks/{chunk-4LAVXP7J.js.map → chunk-ULPW4VGT.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-ZEE3HTOT.js";import"./chunk-3VGXCEMQ.js";import"./chunk-6VNDP3UB.js";import"./chunk-OGQ6OQDN.js";import{d as M,e as P}from"./chunk-3WG3GF2A.js";import{b as w,h as v,j as A,m as x}from"./chunk-J5RMHLFJ.js";import{i as o}from"./chunk-NIEZKWQV.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-5Z4VIKXZ.js";import{b as a,c as f,d as I}from"./chunk-JMBDTNUR.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-JAIB6H2T.js.map
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,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,OAAO,KAAK,CAClC,EACA,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,WAAW,uLACX,YAAY,iBACZ,UAAS,GACX,EACE,KACJL,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOoB,EACP,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,SAAUwB,GAAS,CACjBvB,GAAauB,EAAM,OAAO,KAAK,CACjC,EACF,EACAL,EAACc,EAAA,CACC,QAASpD,EACT,WAAW,kCACX,SAAUF,EAAM,SAChB,SAAUuD,GAAO,CACfvD,EAAM,YAAYuD,CAAG,CACvB,EACA,UAAS,GACX,EACAf,EAACgB,EAAA,CACC,QAAQ,YACR,UAAWvD,EAAQ,OACnB,SAAU,CAACQ,GAAO,CAACY,EAAU,KAAK,GAAK,CAACrB,EAAM,UAAYyB,EAC1D,QAAS,IAAM,CACRE,GAAa,CACpB,EAEC,SAAAF,EAAa,2BAAwB,SACxC,GACF,CAEJ,CAAC,EAEMgC,GAAQ3D",
6
+ "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-CBKSPAUI.js";import"./chunk-NIEZKWQV.js";import"./chunk-5Z4VIKXZ.js";import{b as a,d as s}from"./chunk-JMBDTNUR.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-LO7FKFSS.js.map
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
@@ -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", "PickNamesDialog", "picked", "ChooseSamplesDialog_default"]
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-CBKSPAUI.js";import"./chunk-NIEZKWQV.js";import"./chunk-5Z4VIKXZ.js";import{b as l,d as i}from"./chunk-JMBDTNUR.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-JJSOVCEU.js.map
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", "PickNamesDialog", "c", "l", "name", "picked", "ChooseWalksDialog_default"]
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-5Q56NPNH.js";import{a as te}from"./chunk-ZA5GPTUM.js";import{a as ee}from"./chunk-KOB7YIMR.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-PX4IRCTO.js";import"./chunk-YBLNN5FU.js";import"./chunk-ROZPEXN4.js";import{g as F,h as N,i as C}from"./chunk-CL4PYWKC.js";import"./chunk-OTBDKJEA.js";import"./chunk-3VGXCEMQ.js";import{e as G,h as X,i as Y,j as J}from"./chunk-6VNDP3UB.js";import{a as P}from"./chunk-OGQ6OQDN.js";import"./chunk-3WG3GF2A.js";import{e as _,o as B}from"./chunk-J5RMHLFJ.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-CJQVZJPA.js.map
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-SVDQVLEU.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-VNWCN47G.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-67NMRHWZ.js.map
@@ -1,4 +1,4 @@
1
- import{b as C}from"./chunk-FUPBKEC2.js";import"./chunk-DKYX6XBX.js";import"./chunk-3ROUAVMP.js";import"./chunk-TL2FTG3H.js";import{p as d}from"./chunk-UWBKGUBZ.js";import"./chunk-DMLYMYLG.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-ROZPEXN4.js";import"./chunk-CL4PYWKC.js";import"./chunk-3VGXCEMQ.js";import"./chunk-6VNDP3UB.js";import"./chunk-3WG3GF2A.js";import"./chunk-J5RMHLFJ.js";import{i as L}from"./chunk-NIEZKWQV.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-5Z4VIKXZ.js";import{a as h,b as e,c as r,d as i}from"./chunk-JMBDTNUR.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
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-EM7KNQHB.js.map
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&apos;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,EACxB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ACnBhB,EAASgB,CAAK,EACTL,GACHT,EAAMc,CAAK,CAEf,EACA,YAAaC,GACXd,EAACC,EAAA,CACE,GAAGa,EACJ,MAAM,aACN,YAAalB,EAAM,SAAW,EAAI,kBAAoB,OACtD,UAAW,CACT,GAAGkB,EAAO,UACV,UAAW,CACT,GAAGA,EAAO,UAAU,UACpB,cAAe,wBACjB,CACF,EACF,EAEJ,CAEJ,CAAC,EAGKC,EAA0BpB,EAAS,SAAiC,CACxE,MAAAR,CACF,EAEG,CACD,GAAM,CAAE,QAAA6B,CAAQ,EAAItC,EAAU,EACxB0B,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,ECrKA,SAARO,EAA0C,CAC/C,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",
6
- "names": ["useStyles", "makeStyles", "SUBGRAPH_CONTEXTS", "SubgraphContextSelect", "observer", "model", "classes", "adapter", "walkIndexed", "jsxs", "jsx", "LabelledSelect", "hops", "Typography", "SubgraphContextSelect_default", "useStyles", "makeStyles", "parseHaplotypeList", "text", "name", "sameList", "a", "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", "model", "onClose", "jsxs", "GraphSettingsDialog_default", "jsx", "SubgraphContextSelect_default", "SubgraphHaplotypesField_default"]
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&apos;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,EACr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,CACxE,MAAAR,CACF,EAEG,CACD,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
@@ -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\nfunction 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,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,EAKD,SAASQ,EAAI,CACX,MAAAK,EACA,MAAAJ,EACA,OAAAC,EACA,QAAAI,EACA,SAAAC,CACF,EAMG,CACD,OACEd,EAAAe,EAAA,CACE,UAAAZ,EAACC,EAAA,CAAW,QAAQ,QAAS,SAAAQ,EAAM,EACnCT,EAACa,EAAA,CACC,OAAM,GACN,KAAK,QACL,MAAOR,EACP,UAAW,CACT,OAAQ,CAAE,mBAAoB,CAAE,aAAc,SAASI,CAAK,KAAM,CAAE,CACtE,EACA,SAAU,GAAK,CACbC,EAAQ,EAAE,OAAO,KAAc,CACjC,EAEC,SAAAI,EAAY,IAAIC,GACff,EAACgB,EAAA,CAAuB,MAAOD,EAAE,MAC9B,SAAAA,EAAE,OADUA,EAAE,KAEjB,CACD,EACH,EACAf,EAACa,EAAA,CACC,OAAM,GACN,KAAK,QACL,MAAOP,EACP,UAAW,CACT,OAAQ,CACN,mBAAoB,CAAE,aAAc,eAAeG,CAAK,EAAG,CAC7D,CACF,EACA,SAAU,GAAK,CACbE,EAAS,EAAE,OAAO,KAAe,CACnC,EAEC,SAAAM,EAAa,OACZC,GAAKA,EAAE,QAAU,WAAab,IAAU,WAC1C,EAAE,IAAIa,GACJlB,EAACgB,EAAA,CAAuB,MAAOE,EAAE,MAC9B,SAAAA,EAAE,OADUA,EAAE,KAEjB,CACD,EACH,GACF,CAEJ,CAEA,IAAOC,EAAQ1B",
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,+BACn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BAAoB,CAAE,aAAc,eAAeG,CAAK,EAAG,CAC7D,CACF,EACA,SAAU,GAAK,CACbE,EAAS,EAAE,OAAO,KAAe,CACnC,EAEC,SAAAM,EAAa,OACZC,GAAKA,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-FUPBKEC2.js";import"./chunk-DKYX6XBX.js";import"./chunk-3ROUAVMP.js";import"./chunk-TL2FTG3H.js";import"./chunk-UWBKGUBZ.js";import"./chunk-DMLYMYLG.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-ROZPEXN4.js";import"./chunk-CL4PYWKC.js";import"./chunk-3VGXCEMQ.js";import"./chunk-6VNDP3UB.js";import"./chunk-3WG3GF2A.js";import"./chunk-J5RMHLFJ.js";import"./chunk-NIEZKWQV.js";import"./chunk-5Z4VIKXZ.js";import{b as o,d as t}from"./chunk-JMBDTNUR.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-APDIIF7F.js.map
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
+ }
@@ -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-KOB7YIMR.js";import{E as p,F as u,b,z as m}from"./chunk-PX4IRCTO.js";import"./chunk-YBLNN5FU.js";import"./chunk-ROZPEXN4.js";import"./chunk-CL4PYWKC.js";import"./chunk-OGQ6OQDN.js";import"./chunk-3WG3GF2A.js";import{a as i,o as l}from"./chunk-J5RMHLFJ.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-QEC37MYN.js.map
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-VNWCN47G.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-2YTXBZYS.js.map
@@ -1,2 +1,2 @@
1
- import{a as F}from"./chunk-PRGG24TK.js";import"./chunk-ZA5GPTUM.js";import{a as N}from"./chunk-KOB7YIMR.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-PX4IRCTO.js";import"./chunk-YBLNN5FU.js";import"./chunk-ROZPEXN4.js";import"./chunk-CL4PYWKC.js";import{e as f}from"./chunk-6VNDP3UB.js";import"./chunk-OGQ6OQDN.js";import"./chunk-3WG3GF2A.js";import{a as l,o as m}from"./chunk-J5RMHLFJ.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-ZGXDNU43.js.map
1
+ import{a as F}from"./chunk-HRTRECXN.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-VNWCN47G.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-RCGS6YVM.js.map
@@ -1,2 +1,2 @@
1
- import{H as i,h as o,m as a}from"./chunk-5Z4VIKXZ.js";import{c as r,d as e}from"./chunk-JMBDTNUR.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-4YDIV2FN.js.map
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.18_@emotion+react@11.14.0_@types+react@19.3.0_react@19_0b9c1c4d2b16eef60d202e26c552208a/node_modules/@jbrowse/synteny-core/esm/TrackWarningsDialog.js"],
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-4LAVXP7J.js";import{a as k}from"./chunk-KOB7YIMR.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-PX4IRCTO.js";import"./chunk-YBLNN5FU.js";import"./chunk-ROZPEXN4.js";import"./chunk-CL4PYWKC.js";import"./chunk-OGQ6OQDN.js";import"./chunk-3WG3GF2A.js";import{a as m,o as u}from"./chunk-J5RMHLFJ.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-QYFYWQJD.js.map
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-ULPW4VGT.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-VNWCN47G.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-3M5A4JL3.js.map
@@ -0,0 +1,2 @@
1
+ import{a as ee}from"./chunk-HRTRECXN.js";import{a as V,b as Z,d as q,e as J,f as B,g as Q,h as Y}from"./chunk-SVDQVLEU.js";import"./chunk-ZA5GPTUM.js";import{a as K}from"./chunk-V55TK2NP.js";import{p as L,q as H,r as U}from"./chunk-M2D7NUOY.js";import"./chunk-YBLNN5FU.js";import"./chunk-U6SNNNFV.js";import"./chunk-ELC7POI6.js";import{E as z,F as G,i as X}from"./chunk-VNWCN47G.js";import"./chunk-YBLNN5FU.js";import"./chunk-QUDJ7AM3.js";import{a as E,c as T,d as F,g as x,h as A,i as O}from"./chunk-CL4PYWKC.js";import"./chunk-AGUEPVOR.js";import"./chunk-TMM73K4C.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{o as M}from"./chunk-TC265JAP.js";var ce=50;function fe(r){let o=[];for(let e=0;e<r.length;e++){let[t,a]=r[e],[s,n]=r[e+1]??[];a===n&&a<=ce&&(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),[g,d]=L(n.map(y=>y^1).reverse(),s,o),l=d>c,f=l?g:i,b=Math.max(c,d);if(b<_)return[];let p=e(s),h=e(n),u=y=>l?n.length-1-f[y][0]:f[y][0],k=[];f.forEach(([,y],w)=>{if(w>0){let[v,m]=[u(w-1),u(w)].sort((W,C)=>W-C);I(k,"I",h[m]-h[v+1]),I(k,"D",p[y]-p[f[w-1][1]+1])}I(k,"=",o(s[y]))});let[N,S]=[u(0),u(f.length-1)].sort((y,w)=>y-w);return[{queryStart:h[N],queryEnd:h[S+1],targetStart:p[f[0][1]],targetEnd:p[f.at(-1)[1]+1],strand:l?"-":"+",edits:k,sharedBases:b}]}}function pe(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=pe(t),o.set(t,a)),a};return(t,a)=>{let s=e(a),n=0,i=0;for(let[c,g]of e(t)){let d=s.get(c);d===g?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 ue=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:g}=t(a,s);return i===void 0||Math.min(c,g)<ue?n:[...n,...e(a,s).filter(d=>d.strand!==i)]}}function $({chain:r,target:o,query:e,assemblyName:t,refName:a,mateAssemblyName:s}){let n=fe(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:F(e.name),start:e.hapStart+r.queryStart,end:e.hapStart+r.queryEnd},strand:r.strand,cigar:U(n),matches:n.reduce((i,[c,g])=>i+(c==="="?g: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:g,hapStart:d,ids:l,rev:f,before:b,after:p}=i;if(c===r.name&&g===r.fragStart){let h=d;for(let u=0;u<l.length;u++){let k=t.get(l[u]),N=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 S=n(p)!==n(b)?n(p):u>0!=u<l.length-1?u>0:s!==(f[u]===1);return{skip:r,at:S?h+N:h,strand:S===s?"+":"-"}}h+=N}}}}function oe({crossing:r,refName:o,assemblyName:e,mateAssemblyName:t}){let{skip:a,at:s,strand:n}=r;return le({id:`${a.name}:${a.fragStart}:${a.piece}:skip`,assemblyName:e,refName:o,start:a.refStart,end:a.refEnd,reverse:n==="-",mate:{refName:F(a.name),start:s,end:s,assemblyName:t}})}function me({fragment:r,crossing:o,refName:e,assemblyName:t,mateAssemblyName:a}){let{name:s,fragStart:n,hapStart:i,hapEnd:c}=r;return le({id:`${s}:${n}:${i}:crossing`,assemblyName:t,refName:e,start:o.refStart,end:o.refEnd,reverse:o.reverse,mate:{refName:F(s),start:i,end:c,assemblyName:a}})}function le({id:r,assemblyName:o,refName:e,start:t,end:a,reverse:s,mate:n}){return new V({uniqueId:r,assemblyName:o,refName:e,start:t,end:a,type:"deletion",strand:s?-1:1,syntenyId:r,spansWindow:!0,mate:n})}var j=({name:r})=>T(r)??r,D=class extends Z{constructor(){super(...arguments);this.walks=new ee(z(this,["walksLocation"],["walksIndex"]),this);this.refNames=new G(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=A(this,a),n=O(this);return{hasCoarseTier:!1,anchorAssemblyName:a,lanes:t.filter(i=>i!==s&&E(i)!==s).map(i=>({name:B(n,i),label:i,group:E(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=X(a,e);return M(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 g=new Set(c.map(d=>d.skip));n=n.filter(d=>!g.has(d))}return s}async sideCrossings(e,t,a,s){let{signal:n}=s,{chunk:i}=await this.walks.reader.header({signal:n}),c=l=>a==="leave"?l.refStart-1:l.refEnd,g=new Map;for(let l of t){let f=c(l),b=Math.floor(f/i),p=g.get(b);p?(p.group.push(l),p.start=Math.min(p.start,f),p.end=Math.max(p.end,f+1)):g.set(b,{group:[l],start:f,end:f+1})}return(await Promise.all([...g.values()].map(async({group:l,start:f,end:b})=>{let p=new Set(l.map(u=>u.name)),h=u=>p.has(u);try{let{graph:u,fragments:k}=await this.walks.reader.cut(e,{start:f,end:b},{...this.walks.budgets(),signal:n,keep:h,expand:h,context:0,contained:!0,links:!1});return l.map(N=>ie(N,e,k,u.nodes,a))}catch(u){if(n?.aborted)throw u;return[]}}))).flat().filter(l=>l!==void 0)}async anchorFeatures(e,t,a){let s=a.haplotypes?.length?a.haplotypes.map(m=>A(this,m)):void 0,n=A(this,a.targetAssemblyName),i=n===void 0?s:s===void 0||s.some(m=>x(n,m)||x(m,n))?[n]:[];if(i?.length===0)return[];let{start:c,end:g}=t,d=`Reading walks ${t.refName}:${c.toLocaleString()}-${g.toLocaleString()}`,{graph:l,fragments:f,skips:b}=await this.laneWalks(e,t,i,a,d),p=({name:m})=>i===void 0?0:i.findIndex(W=>x(m,W)),h=new Set(f.map(j)),u=await M(d,a.statusCallback,()=>this.skipCrossings(e,b.filter(m=>p(m)>=0&&!h.has(j(m))&&m.refStart<=c&&m.refEnd>=g),a)),k=re(l.nodes),N=O(this),S=m=>B(N,j(m)),y=f.filter(m=>m.name===e),w=f.filter(m=>m.name!==e&&p(m)>=0).map(m=>({rank:p(m),features:m.crossing?[me({fragment:m,crossing:m.crossing,assemblyName:t.assemblyName,refName:t.refName,mateAssemblyName:S(m)})]:y.flatMap(W=>k(m,W).map(C=>$({chain:C,target:W,query:m,assemblyName:t.assemblyName,refName:t.refName,mateAssemblyName:S(m)})))})),v=u.map(m=>({rank:p(m.skip),features:[oe({crossing:m,refName:t.refName,assemblyName:t.assemblyName,mateAssemblyName:S(m.skip)})]}));return[...w,...v].sort((m,W)=>m.rank-W.rank).flatMap(m=>m.features)}async pairFeatures(e,t,a,s){let n=a.map(l=>({pair:l,featurePrefix:A(this,l.queryAssemblyName),matePrefix:A(this,l.targetAssemblyName)})),{graph:i,fragments:c}=await this.laneWalks(e,t,n.flatMap(l=>[l.featurePrefix,l.matePrefix]),s,J(a)),g=se(i.nodes),d=l=>c.filter(f=>x(f.name,l));return n.flatMap(({pair:l,featurePrefix:f,matePrefix:b})=>d(f).flatMap(p=>d(b).flatMap(h=>g(h,p).map(u=>$({chain:u,target:p,query:h,assemblyName:l.queryAssemblyName,refName:F(p.name),mateAssemblyName:l.targetAssemblyName})))))}getFeatures(e,t={}){return K(async a=>{let s=e.assemblyName===this.anchor?await this.refNames.resolve(e,t):void 0;if(s!==void 0){let n=q(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{D as default};
2
+ //# sourceMappingURL=WalkTabixSyntenyAdapter-576RE5OE.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/WalkTabixSyntenyAdapter/walkLanes.ts", "../../src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts"],
4
+ "sourcesContent": ["import { weightedLcs } from '@gmod/gbz-base/lcs'\nimport { pairAlignments, pairCigar } from '@gmod/gbz-base/pairAlignment'\nimport { panSNContig } from '@jbrowse/bandage-core/pansn'\n\nimport SyntenyFeature from '../synteny/SyntenyFeature.ts'\nimport { matchFeature } from '../synteny/matchFeature.ts'\n\nimport type { PairChain, PairEdit } from '@gmod/gbz-base/pairAlignment'\nimport type {\n WalkCrossing,\n WalkFragment,\n WalkNode,\n WalkSkip,\n WalkStop,\n} from '@jbrowse/graph-walks'\n\n// The longest bubble with equal bases on both sides that is written as\n// mismatches; a longer one stays an insertion and a deletion\nconst BALANCED_BUBBLE_MAX_BP = 50\n\n/**\n * A chain's edits with each short balanced bubble as `X`. The walks carry no\n * bases, so two walks differ wherever they leave a shared node, and a SNP is\n * one base inserted and one deleted until it is read as the mismatch it is.\n */\nexport function bubblesAsMismatches(edits: PairEdit[]) {\n const out: PairEdit[] = []\n for (let i = 0; i < edits.length; i++) {\n const [op, len] = edits[i]!\n const [nextOp, nextLen] = edits[i + 1] ?? []\n if (\n len === nextLen &&\n len <= BALANCED_BUBBLE_MAX_BP &&\n ((op === 'I' && nextOp === 'D') || (op === 'D' && nextOp === 'I'))\n ) {\n out.push(['X', len])\n i++\n } else {\n out.push([op, len])\n }\n }\n return out\n}\n\n// A walk's steps as the handles gbz-base reads, 2 * id + reversed\nfunction handlesOf(fragment: WalkFragment) {\n return Array.from(fragment.ids, (id, i) => 2 * id + fragment.rev[i]!)\n}\n\nfunction nodeLength(nodes: Map<number, WalkNode>, id: number) {\n const node = nodes.get(id)\n return node === undefined ? 0 : node.end - node.start\n}\n\n/**\n * Aligns one walk fragment to another on the nodes both visit, from node\n * lengths alone: the fragments' steps as the handles gbz-base's chainer reads,\n * and a stand-in sequence of each node's length.\n */\nexport function walkAligner(nodes: Map<number, WalkNode>) {\n const standIn = new Map<number, string>()\n const sequenceOf = (id: number) => {\n const length = nodeLength(nodes, id)\n let sequence = standIn.get(length)\n if (sequence === undefined) {\n sequence = 'N'.repeat(length)\n standIn.set(length, sequence)\n }\n return sequence\n }\n const handles = new Map<WalkFragment, number[]>()\n const cachedHandles = (fragment: WalkFragment) => {\n let steps = handles.get(fragment)\n if (steps === undefined) {\n steps = handlesOf(fragment)\n handles.set(fragment, steps)\n }\n return steps\n }\n return (query: WalkFragment, target: WalkFragment) =>\n pairAlignments({\n query: cachedHandles(query),\n target: cachedHandles(target),\n sequenceOf,\n bases: false,\n })\n}\n\n// The fewest bases on shared nodes a record against the reference keeps,\n// gbz-base's floor for a pair record\nconst MIN_MATCH_BP = 100\n\nfunction appendEdit(edits: PairEdit[], op: PairEdit[0], len: number) {\n const last = edits.at(-1)\n if (len > 0) {\n if (last?.[0] === op) {\n last[1] += len\n } else {\n edits.push([op, len])\n }\n }\n}\n\n/**\n * Aligns a haplotype's walk fragment to the reference's as gbz-base aligns a\n * walk to its reference path: the heaviest common subsequence of their steps,\n * each node weighing its length, read in whichever direction shares more. A\n * pair chain leaves out every node either walk passes twice, which is the\n * whole of a collapsed copy-number array (amylase, KIV-2); the subsequence\n * matches one pass over it, and the other copies are insertions.\n */\nexport function referenceAligner(nodes: Map<number, WalkNode>) {\n const lengthOf = (handle: number) => nodeLength(nodes, handle >> 1)\n const offsets = (handles: number[]) => {\n const out = new Float64Array(handles.length + 1)\n handles.forEach((handle, i) => {\n out[i + 1] = out[i]! + lengthOf(handle)\n })\n return out\n }\n\n return (query: WalkFragment, target: WalkFragment): PairChain[] => {\n const ref = handlesOf(target)\n const hap = handlesOf(query)\n const [same, sameWeight] = weightedLcs(hap, ref, lengthOf)\n const [turned, turnedWeight] = weightedLcs(\n hap.map(handle => handle ^ 1).reverse(),\n ref,\n lengthOf,\n )\n const reverse = turnedWeight > sameWeight\n const pairs = reverse ? turned : same\n const sharedBases = Math.max(sameWeight, turnedWeight)\n if (sharedBases < MIN_MATCH_BP) {\n return []\n }\n const refAt = offsets(ref)\n const hapAt = offsets(hap)\n // a pair's haplotype step, counted along the haplotype\n const stepOf = (k: number) =>\n reverse ? hap.length - 1 - pairs[k]![0] : pairs[k]![0]\n const edits: PairEdit[] = []\n pairs.forEach(([, r], k) => {\n if (k > 0) {\n const [lo, hi] = [stepOf(k - 1), stepOf(k)].sort((x, y) => x - y)\n appendEdit(edits, 'I', hapAt[hi!]! - hapAt[lo! + 1]!)\n appendEdit(edits, 'D', refAt[r]! - refAt[pairs[k - 1]![1] + 1]!)\n }\n appendEdit(edits, '=', lengthOf(ref[r]!))\n })\n const [lo, hi] = [stepOf(0), stepOf(pairs.length - 1)].sort((x, y) => x - y)\n return [\n {\n queryStart: hapAt[lo!]!,\n queryEnd: hapAt[hi! + 1]!,\n targetStart: refAt[pairs[0]![1]]!,\n targetEnd: refAt[pairs.at(-1)![1] + 1]!,\n strand: reverse ? '-' : '+',\n edits,\n sharedBases,\n },\n ]\n }\n}\n\n// Each node a walk visits once, with the direction it passes it\nfunction singleVisits(fragment: WalkFragment) {\n const rev = new Map<number, number>()\n const twice = new Set<number>()\n fragment.ids.forEach((id, i) => {\n if (rev.has(id)) {\n twice.add(id)\n } else {\n rev.set(id, fragment.rev[i]!)\n }\n })\n for (const id of twice) {\n rev.delete(id)\n }\n return rev\n}\n\n// The bases on singly visited nodes two walks pass the same way and the\n// opposite way\nfunction directionShares(nodes: Map<number, WalkNode>) {\n const visits = new Map<WalkFragment, Map<number, number>>()\n const visitsOf = (fragment: WalkFragment) => {\n let found = visits.get(fragment)\n if (found === undefined) {\n found = singleVisits(fragment)\n visits.set(fragment, found)\n }\n return found\n }\n return (query: WalkFragment, target: WalkFragment) => {\n const theirs = visitsOf(target)\n let same = 0\n let opposite = 0\n for (const [id, rev] of visitsOf(query)) {\n const other = theirs.get(id)\n if (other === rev) {\n same += nodeLength(nodes, id)\n } else if (other !== undefined) {\n opposite += nodeLength(nodes, id)\n }\n }\n return { same, opposite }\n }\n}\n\n/**\n * Aligns one lane's walk fragment to another's. The weighted subsequence\n * (`referenceAligner`) is the fast route and matches through copy-number\n * arrays, but it reads one direction per pair, so an inversion between the\n * lanes comes out as an insertion beside a deletion. A pair sharing 100 bp\n * (MIN_MATCH_BP) or more of singly visited nodes in each direction goes to\n * pair chaining (`walkAligner`) instead, which answers the inverted stretch as\n * a reverse-strand record of its own. Chaining leaves out every node a walk\n * passes twice, so counting singly visited nodes misses no inversion it could\n * draw.\n */\nexport function lanePairAligner(nodes: Map<number, WalkNode>) {\n const subsequence = referenceAligner(nodes)\n const chained = walkAligner(nodes)\n const shares = directionShares(nodes)\n return (query: WalkFragment, target: WalkFragment) => {\n const { same, opposite } = shares(query, target)\n return same >= MIN_MATCH_BP && opposite >= MIN_MATCH_BP\n ? chained(query, target)\n : subsequence(query, target)\n }\n}\n\n// The multi-way display's SPLIT_AT_GAP_BP, under which a turned stretch names\n// no inversion there\nconst TURNED_MIN_BP = 10_000\n\n/**\n * Aligns a haplotype's walk fragment to the reference's as `referenceAligner`\n * does, then adds the stretches it reads the other way. A walk sharing\n * TURNED_MIN_BP or more of singly visited nodes in each direction is chained\n * too, and the chained records on the strand the subsequence did not take are\n * its turned stretches. The subsequence record stays, so a copy-number array,\n * which chaining leaves out, still matches one pass alike in every lane.\n */\nexport function anchorAligner(nodes: Map<number, WalkNode>) {\n const subsequence = referenceAligner(nodes)\n const chained = walkAligner(nodes)\n const shares = directionShares(nodes)\n return (query: WalkFragment, target: WalkFragment) => {\n const records = subsequence(query, target)\n const taken = records[0]?.strand\n const { same, opposite } = shares(query, target)\n return taken === undefined || Math.min(same, opposite) < TURNED_MIN_BP\n ? records\n : [\n ...records,\n ...chained(query, target).filter(chain => chain.strand !== taken),\n ]\n }\n}\n\n/**\n * One record of a walk aligned to another, with its short balanced bubbles as\n * mismatches\n */\nexport function chainFeature({\n chain,\n target,\n query,\n assemblyName,\n refName,\n mateAssemblyName,\n}: {\n chain: PairChain\n target: WalkFragment\n query: WalkFragment\n assemblyName: string\n refName: string\n mateAssemblyName: string\n}) {\n const edits = bubblesAsMismatches(chain.edits)\n return matchFeature({\n target: {\n name: target.name,\n assemblyName,\n refName,\n start: target.hapStart + chain.targetStart,\n end: target.hapStart + chain.targetEnd,\n },\n query: {\n name: query.name,\n assemblyName: mateAssemblyName,\n refName: panSNContig(query.name),\n start: query.hapStart + chain.queryStart,\n end: query.hapStart + chain.queryEnd,\n },\n strand: chain.strand,\n cigar: pairCigar(edits),\n matches: edits.reduce((sum, [op, n]) => sum + (op === '=' ? n : 0), 0),\n columns: edits.reduce((sum, [, n]) => sum + n, 0),\n })\n}\n\n/** The point on a haplotype's contig where it crosses a skipped stretch */\nexport interface SkipCrossing {\n skip: WalkSkip\n at: number\n strand: '+' | '-'\n}\n\n/**\n * The reference node either side of a skipped stretch: the one a haplotype\n * leaves, ending at `refStart`, or the one it rejoins, starting at `refEnd`\n */\nexport type SkipSide = 'leave' | 'rejoin'\n\n/**\n * Where a haplotype that skips the window crosses its deletion, from a cut\n * over the reference node on one `side` of it. The jump lies on whichever end\n * of the walk's fragment goes on to a chunk across the stretch; with neither\n * or both, on the end the fragment's other steps leave free, and failing that\n * on the end the node's own direction points to. A walk that passes the node\n * inverted between two forward steps still crosses after it.\n */\nexport function skipCrossing(\n skip: WalkSkip,\n refName: string,\n fragments: WalkFragment[],\n nodes: Map<number, WalkNode>,\n side: SkipSide,\n): SkipCrossing | undefined {\n const leaving = side === 'leave'\n const across = (stop: WalkStop) =>\n stop.kind === 'elsewhere' &&\n (leaving\n ? stop.chunk.start >= skip.refStart\n : stop.chunk.start < skip.refStart)\n for (const fragment of fragments) {\n const { name, fragStart, hapStart, ids, rev, before, after } = fragment\n if (name === skip.name && fragStart === skip.fragStart) {\n let at = hapStart\n for (let i = 0; i < ids.length; i++) {\n const node = nodes.get(ids[i]!)\n const length = node === undefined ? 0 : node.end - node.start\n if (\n node?.rank === 0 &&\n node.refName === refName &&\n (leaving ? node.end === skip.refStart : node.start === skip.refEnd)\n ) {\n const jumpsAfter =\n across(after) !== across(before)\n ? across(after)\n : i > 0 !== i < ids.length - 1\n ? i > 0\n : leaving !== (rev[i] === 1)\n return {\n skip,\n at: jumpsAfter ? at + length : at,\n strand: jumpsAfter === leaving ? '+' : '-',\n }\n }\n at += length\n }\n }\n }\n return undefined\n}\n\n/**\n * A haplotype whose deletion spans the whole window, as the record a\n * multi-way display lifts out as a deletion: `spansWindow`, the skipped\n * stretch whole so its length heads the lane, and the crossing as its mate.\n * The record carries no CIGAR and no identity, so no ramp or identity filter\n * reads it as an alignment.\n */\nexport function skipFeature({\n crossing,\n refName,\n assemblyName,\n mateAssemblyName,\n}: {\n crossing: SkipCrossing\n refName: string\n assemblyName: string\n mateAssemblyName: string\n}) {\n const { skip, at, strand } = crossing\n return windowDeletion({\n id: `${skip.name}:${skip.fragStart}:${skip.piece}:skip`,\n assemblyName,\n refName,\n start: skip.refStart,\n end: skip.refEnd,\n reverse: strand === '-',\n mate: {\n refName: panSNContig(skip.name),\n start: at,\n end: at,\n assemblyName: mateAssemblyName,\n },\n })\n}\n\n/**\n * A haplotype that leaves the reference before the window and rejoins after\n * it, through steps of its own, as the same record as a skip's, its mate the\n * haplotype's bp between the two reference steps\n */\nexport function crossingFeature({\n fragment,\n crossing,\n refName,\n assemblyName,\n mateAssemblyName,\n}: {\n fragment: WalkFragment\n crossing: WalkCrossing\n refName: string\n assemblyName: string\n mateAssemblyName: string\n}) {\n const { name, fragStart, hapStart, hapEnd } = fragment\n return windowDeletion({\n id: `${name}:${fragStart}:${hapStart}:crossing`,\n assemblyName,\n refName,\n start: crossing.refStart,\n end: crossing.refEnd,\n reverse: crossing.reverse,\n mate: {\n refName: panSNContig(name),\n start: hapStart,\n end: hapEnd,\n assemblyName: mateAssemblyName,\n },\n })\n}\n\nfunction windowDeletion({\n id,\n assemblyName,\n refName,\n start,\n end,\n reverse,\n mate,\n}: {\n id: string\n assemblyName: string\n refName: string\n start: number\n end: number\n reverse: boolean\n mate: { refName: string; start: number; end: number; assemblyName: string }\n}) {\n return new SyntenyFeature({\n uniqueId: id,\n assemblyName,\n refName,\n start,\n end,\n type: 'deletion',\n strand: reverse ? -1 : 1,\n syntenyId: id,\n spansWindow: true,\n mate,\n })\n}\n", "import {\n assemblyByPanSNPrefix,\n panSNContig,\n panSNHaplotype,\n panSNMatchesPrefix,\n panSNSample,\n resolvePanSNPrefix,\n} from '@jbrowse/bandage-core/pansn'\nimport { updateStatus } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport { walksKept } from '@jbrowse/graph-walks'\n\nimport {\n anchorAligner,\n chainFeature,\n crossingFeature,\n lanePairAligner,\n skipCrossing,\n skipFeature,\n} from './walkLanes.ts'\nimport { WalkIndex } from '../RgfaTabixAdapter/walkReader.ts'\nimport { PanSNRefNames, openTabixSlot } from '../panSNTabix.ts'\nimport { ComparativeAdapterBase } from '../synteny/ComparativeAdapterBase.ts'\nimport {\n laneAssemblyName,\n lanePairsStatus,\n requestedPairs,\n} from '../synteny/lanePairs.ts'\nimport { laneZoomNotice } from '../synteny/laneZoomNotice.ts'\n\nimport type { WalkTabixSyntenyAdapterConfig } from './configSchema.ts'\nimport type { SkipCrossing, SkipSide } from './walkLanes.ts'\nimport type { SubgraphAdapterOptions } from '../GetSubgraph.ts'\nimport type { LaneFeatureOptions, LanePair } from '../synteny/lanePairs.ts'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { Region } from '@jbrowse/core/util/types'\nimport type { WalkSkip } from '@jbrowse/graph-walks'\n\nconst haplotypeOf = ({ name }: { name: string }) => panSNHaplotype(name) ?? name\n\nexport default class WalkTabixSyntenyAdapter extends ComparativeAdapterBase<WalkTabixSyntenyAdapterConfig> {\n private readonly walks: WalkIndex = new WalkIndex(\n openTabixSlot(this, ['walksLocation'], ['walksIndex']),\n this,\n )\n private readonly refNames: PanSNRefNames = new PanSNRefNames(\n this.walks.file,\n this,\n )\n\n private get anchor() {\n const anchor = this.getConf('assemblyNames')[0]\n if (anchor === undefined) {\n throw new Error(\n 'WalkTabixSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as',\n )\n }\n return anchor\n }\n\n /**\n * The haplotypes the walk file's header names, `sample#haplotype` in byte\n * order, or undefined when it names none\n */\n async getHaplotypeNames(opts: BaseOptions = {}) {\n return this.walks.haplotypeNames(opts)\n }\n\n /**\n * `lanes` is every haplotype the header names but the anchor's own,\n * declared up front so the display can offer the whole graph's haplotypes\n * before a fetch has placed any of them\n */\n async getHeader(opts: BaseOptions = {}) {\n const { haplotypes } = await this.walks.reader.header(opts)\n const { anchor } = this\n const anchorPrefix = resolvePanSNPrefix(this, anchor)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n return {\n hasCoarseTier: false,\n anchorAssemblyName: anchor,\n lanes: haplotypes\n .filter(\n prefix =>\n prefix !== anchorPrefix && panSNSample(prefix) !== anchorPrefix,\n )\n .map(prefix => ({\n name: laneAssemblyName(asmByPrefix, prefix),\n label: prefix,\n group: panSNSample(prefix),\n })),\n }\n }\n\n // A lane's contigs are named only in its walk rows, so only the anchor's\n // are listed\n async getRefNames(opts: BaseOptions = {}) {\n const { assemblyName } = opts\n return assemblyName === undefined || assemblyName === this.anchor\n ? this.refNames.assemblyRefNames({ ...opts, assemblyName: this.anchor })\n : []\n }\n\n /**\n * The graph display's cut of the window, as RgfaTabixAdapter cuts a\n * walk-indexed graph: the reference walk first, then the walks `haplotypes`\n * asks for, and the nodes and links they visit\n */\n async getSubgraph(region: Region, opts: SubgraphAdapterOptions = {}) {\n const refName = await this.refNames.resolveForCut(region, {\n signal: opts.signal,\n })\n return this.walks.subgraph(refName, region, opts)\n }\n\n // The window's walks for the haplotypes named and the reference, with no\n // link read; a window past a budget fails as a zoom-in notice for lanes.\n // Named lanes come back in full where format 5 abridged them: an abridged\n // walk is two reference steps, which drew 15 of the HPRC MHC launch's 32\n // lanes empty.\n private async laneWalks(\n refName: string,\n region: Region,\n prefixes: string[] | undefined,\n opts: LaneFeatureOptions,\n status: string,\n ) {\n const keep = walksKept(prefixes, refName)\n return updateStatus(status, opts.statusCallback, () =>\n this.walks.reader\n .cut(refName, region, {\n ...this.walks.budgets(),\n signal: opts.signal,\n keep,\n expand: keep,\n links: false,\n })\n .catch((error: unknown) => {\n throw laneZoomNotice(error, region.end - region.start)\n }),\n )\n }\n\n /**\n * Where each skipping haplotype crosses its deletion, read from contained\n * cuts over the reference node it leaves, one cut per chunk those nodes\n * fall in, and for any that cut misses, over the node it rejoins. A cut\n * that fails drops only its own haplotypes' crossings.\n */\n private async skipCrossings(\n refName: string,\n skips: WalkSkip[],\n opts: LaneFeatureOptions,\n ) {\n const found: SkipCrossing[] = []\n let missed = skips\n for (const side of ['leave', 'rejoin'] as const) {\n const crossings = await this.sideCrossings(refName, missed, side, opts)\n for (const crossing of crossings) {\n found.push(crossing)\n }\n const placed = new Set(crossings.map(crossing => crossing.skip))\n missed = missed.filter(skip => !placed.has(skip))\n }\n return found\n }\n\n private async sideCrossings(\n refName: string,\n skips: WalkSkip[],\n side: SkipSide,\n opts: LaneFeatureOptions,\n ) {\n const { signal } = opts\n const { chunk } = await this.walks.reader.header({ signal })\n const boundary = (skip: WalkSkip) =>\n side === 'leave' ? skip.refStart - 1 : skip.refEnd\n const byChunk = new Map<\n number,\n { group: WalkSkip[]; start: number; end: number }\n >()\n for (const skip of skips) {\n const at = boundary(skip)\n const cs = Math.floor(at / chunk)\n const held = byChunk.get(cs)\n if (held) {\n held.group.push(skip)\n held.start = Math.min(held.start, at)\n held.end = Math.max(held.end, at + 1)\n } else {\n byChunk.set(cs, { group: [skip], start: at, end: at + 1 })\n }\n }\n const found = await Promise.all(\n [...byChunk.values()].map(async ({ group, start, end }) => {\n const names = new Set(group.map(skip => skip.name))\n const keep = (name: string) => names.has(name)\n try {\n const { graph, fragments } = await this.walks.reader.cut(\n refName,\n { start, end },\n {\n ...this.walks.budgets(),\n signal,\n keep,\n expand: keep,\n context: 0,\n contained: true,\n links: false,\n },\n )\n return group.map(skip =>\n skipCrossing(skip, refName, fragments, graph.nodes, side),\n )\n } catch (error) {\n if (signal?.aborted) {\n throw error\n }\n return []\n }\n }),\n )\n return found.flat().filter(crossing => crossing !== undefined)\n }\n\n /**\n * One record per stretch a haplotype's walk shares with the reference's,\n * on the reference with the haplotype as its mate. A haplotype whose\n * deletion spans the window, with no walk there on any contig, is one\n * `spansWindow` record of the skipped stretch, as is one that crosses the\n * window through steps of its own, its mate those steps' bp.\n */\n private async anchorFeatures(\n refName: string,\n region: Region,\n opts: LaneFeatureOptions,\n ) {\n const wanted = opts.haplotypes?.length\n ? opts.haplotypes.map(lane => resolvePanSNPrefix(this, lane))\n : undefined\n const target = resolvePanSNPrefix(this, opts.targetAssemblyName)\n const prefixes =\n target === undefined\n ? wanted\n : wanted === undefined ||\n wanted.some(\n prefix =>\n panSNMatchesPrefix(target, prefix) ||\n panSNMatchesPrefix(prefix, target),\n )\n ? [target]\n : []\n if (prefixes?.length === 0) {\n return []\n }\n const { start, end } = region\n const status = `Reading walks ${region.refName}:${start.toLocaleString()}-${end.toLocaleString()}`\n const { graph, fragments, skips } = await this.laneWalks(\n refName,\n region,\n prefixes,\n opts,\n status,\n )\n // lanes come back in the order the fetch names them, which is the order\n // the display stacks lanes of equal weight in\n const rank = ({ name }: { name: string }) =>\n prefixes === undefined\n ? 0\n : prefixes.findIndex(prefix => panSNMatchesPrefix(name, prefix))\n // NA19036#1 skips the IGL locus on one contig and walks it on another\n const walking = new Set(fragments.map(haplotypeOf))\n const crossings = await updateStatus(status, opts.statusCallback, () =>\n this.skipCrossings(\n refName,\n skips.filter(\n skip =>\n rank(skip) >= 0 &&\n !walking.has(haplotypeOf(skip)) &&\n skip.refStart <= start &&\n skip.refEnd >= end,\n ),\n opts,\n ),\n )\n const align = anchorAligner(graph.nodes)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n const laneOf = (walk: { name: string }) =>\n laneAssemblyName(asmByPrefix, haplotypeOf(walk))\n const references = fragments.filter(f => f.name === refName)\n const walked = fragments\n .filter(fragment => fragment.name !== refName && rank(fragment) >= 0)\n .map(query => ({\n rank: rank(query),\n features: query.crossing\n ? [\n crossingFeature({\n fragment: query,\n crossing: query.crossing,\n assemblyName: region.assemblyName,\n refName: region.refName,\n mateAssemblyName: laneOf(query),\n }),\n ]\n : references.flatMap(reference =>\n align(query, reference).map(chain =>\n chainFeature({\n chain,\n target: reference,\n query,\n assemblyName: region.assemblyName,\n refName: region.refName,\n mateAssemblyName: laneOf(query),\n }),\n ),\n ),\n }))\n const skipped = crossings.map(crossing => ({\n rank: rank(crossing.skip),\n features: [\n skipFeature({\n crossing,\n refName: region.refName,\n assemblyName: region.assemblyName,\n mateAssemblyName: laneOf(crossing.skip),\n }),\n ],\n }))\n return [...walked, ...skipped]\n .sort((a, b) => a.rank - b.rank)\n .flatMap(lane => lane.features)\n }\n\n /**\n * Each pair's two lanes read out of the anchor window, all pairs in one\n * read, and each walk of a pair's query lane aligned to each walk of its\n * target lane. A pair's records sit on its query lane's contigs, the lane\n * the display draws on top.\n */\n private async pairFeatures(\n refName: string,\n region: Region,\n pairs: LanePair[],\n opts: LaneFeatureOptions,\n ) {\n const sides = pairs.map(pair => ({\n pair,\n featurePrefix: resolvePanSNPrefix(this, pair.queryAssemblyName),\n matePrefix: resolvePanSNPrefix(this, pair.targetAssemblyName),\n }))\n const { graph, fragments } = await this.laneWalks(\n refName,\n region,\n sides.flatMap(side => [side.featurePrefix, side.matePrefix]),\n opts,\n lanePairsStatus(pairs),\n )\n const align = lanePairAligner(graph.nodes)\n const walksOf = (prefix: string) =>\n fragments.filter(f => panSNMatchesPrefix(f.name, prefix))\n return sides.flatMap(({ pair, featurePrefix, matePrefix }) =>\n walksOf(featurePrefix).flatMap(target =>\n walksOf(matePrefix).flatMap(query =>\n align(query, target).map(chain =>\n chainFeature({\n chain,\n target,\n query,\n assemblyName: pair.queryAssemblyName,\n refName: panSNContig(target.name),\n mateAssemblyName: pair.targetAssemblyName,\n }),\n ),\n ),\n ),\n )\n }\n\n // The files are filed under the reference alone, so a window on a\n // haplotype lane has no answer: a lane pair is read inside the anchor's\n getFeatures(region: Region, opts: LaneFeatureOptions = {}) {\n return ObservableCreate<Feature>(async observer => {\n const refName =\n region.assemblyName === this.anchor\n ? await this.refNames.resolve(region, opts)\n : undefined\n if (refName !== undefined) {\n const pairs = requestedPairs(opts)\n const features =\n pairs.length > 0\n ? await this.pairFeatures(refName, region, pairs, opts)\n : await this.anchorFeatures(refName, region, opts)\n for (const feature of features) {\n observer.next(feature)\n }\n }\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BBLE_MAX_BP", "bubblesAsMismatches", "edits", "out", "i", "op", "len", "nextOp", "nextLen", "handlesOf", "fragment", "id", "nodeLength", "nodes", "node", "walkAligner", "standIn", "sequenceOf", "length", "sequence", "handles", "cachedHandles", "steps", "query", "target", "pairAlignments", "MIN_MATCH_BP", "appendEdit", "last", "referenceAligner", "lengthOf", "handle", "offsets", "ref", "hap", "same", "sameWeight", "weightedLcs", "turned", "turnedWeight", "reverse", "pairs", "sharedBases", "refAt", "hapAt", "stepOf", "k", "r", "lo", "hi", "x", "y", "singleVisits", "rev", "twice", "directionShares", "visits", "visitsOf", "found", "theirs", "opposite", "other", "lanePairAligner", "subsequence", "chained", "shares", "TURNED_MIN_BP", "anchorAligner", "records", "taken", "chain", "chainFeature", "assemblyName", "refName", "mateAssemblyName", "matchFeature", "panSNContig", "pairCigar", "sum", "n", "skipCrossing", "skip", "fragments", "side", "leaving", "across", "stop", "name", "fragStart", "hapStart", "ids", "before", "after", "at", "jumpsAfter", "skipFeature", "crossing", "strand", "windowDeletion", "crossingFeature", "hapEnd", "start", "end", "mate", "SyntenyFeature", "haplotypeOf", "name", "panSNHaplotype", "WalkTabixSyntenyAdapter", "ComparativeAdapterBase", "WalkIndex", "openTabixSlot", "PanSNRefNames", "anchor", "opts", "haplotypes", "anchorPrefix", "resolvePanSNPrefix", "asmByPrefix", "assemblyByPanSNPrefix", "prefix", "panSNSample", "laneAssemblyName", "assemblyName", "region", "refName", "prefixes", "status", "keep", "walksKept", "updateStatus", "error", "laneZoomNotice", "skips", "found", "missed", "side", "crossings", "crossing", "placed", "skip", "signal", "chunk", "boundary", "byChunk", "at", "cs", "held", "group", "start", "end", "names", "graph", "fragments", "skipCrossing", "wanted", "lane", "target", "panSNMatchesPrefix", "rank", "walking", "align", "anchorAligner", "laneOf", "walk", "references", "f", "walked", "fragment", "query", "crossingFeature", "reference", "chain", "chainFeature", "skipped", "skipFeature", "a", "b", "pairs", "sides", "pair", "lanePairsStatus", "lanePairAligner", "walksOf", "featurePrefix", "matePrefix", "panSNContig", "ObservableCreate", "observer", "requestedPairs", "features", "feature"]
7
+ }