jbrowse-plugin-graphgenomeviewer 9.1.0 → 10.0.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 (287) hide show
  1. package/README.md +5 -0
  2. package/dist/chunks/AddTrackWorkflow-W7XIQ5F3.js +2 -0
  3. package/dist/chunks/{AddTrackWorkflow-NKX57TBD.js.map → AddTrackWorkflow-W7XIQ5F3.js.map} +1 -1
  4. package/dist/chunks/{ChooseSamplesDialog-7RI573UO.js → ChooseSamplesDialog-5PTJ6ZDV.js} +2 -2
  5. package/dist/chunks/{ChooseWalksDialog-4LDYDQH2.js → ChooseWalksDialog-DN6J7FGD.js} +2 -2
  6. package/dist/chunks/GbzBaseSyntenyAdapter-JMYDJODG.js +9 -0
  7. package/dist/chunks/{GbzBaseSyntenyAdapter-V5WC3WDU.js.map → GbzBaseSyntenyAdapter-JMYDJODG.js.map} +4 -4
  8. package/dist/chunks/GraphGenomeView-YWPL7SG6.js +10 -0
  9. package/dist/chunks/GraphGenomeView-YWPL7SG6.js.map +7 -0
  10. package/dist/chunks/GraphSettingsDialog-TW6UZMWK.js +2 -0
  11. package/dist/chunks/HighlightColorDialog-EHUV75LC.js +2 -0
  12. package/dist/chunks/{HighlightColorDialog-4IZ7TVKH.js.map → HighlightColorDialog-EHUV75LC.js.map} +1 -1
  13. package/dist/chunks/LinearGraphDisplay-QXKYX5H2.js +2 -0
  14. package/dist/chunks/{LinearGraphDisplay-KTRPJ7TC.js.map → LinearGraphDisplay-QXKYX5H2.js.map} +1 -1
  15. package/dist/chunks/MinigraphBubbleAdapter-N5BOXD7U.js +2 -0
  16. package/dist/chunks/{MinigraphBubbleAdapter-AQQKKQB7.js.map → MinigraphBubbleAdapter-N5BOXD7U.js.map} +1 -1
  17. package/dist/chunks/RgfaTabixAdapter-FZZ7W2HN.js +2 -0
  18. package/dist/chunks/{RgfaTabixAdapter-6KXWQZIB.js.map → RgfaTabixAdapter-FZZ7W2HN.js.map} +1 -1
  19. package/dist/chunks/{TrackWarningsDialog-V5YSUFRO.js → TrackWarningsDialog-HXJSVKII.js} +2 -2
  20. package/dist/chunks/WalkFormsAdapter-TZW5UBRI.js +2 -0
  21. package/dist/chunks/WalkFormsAdapter-TZW5UBRI.js.map +7 -0
  22. package/dist/chunks/WalkTabixSyntenyAdapter-XM7HBNJA.js +2 -0
  23. package/dist/chunks/WalkTabixSyntenyAdapter-XM7HBNJA.js.map +7 -0
  24. package/dist/chunks/chunk-3GK5ZBUB.js +2 -0
  25. package/dist/chunks/chunk-3GK5ZBUB.js.map +7 -0
  26. package/dist/chunks/chunk-4HKASMM4.js +2 -0
  27. package/dist/chunks/chunk-4HKASMM4.js.map +7 -0
  28. package/dist/chunks/chunk-4RZCYOCW.js +2 -0
  29. package/dist/chunks/chunk-4RZCYOCW.js.map +7 -0
  30. package/dist/chunks/{chunk-6OZGIMZC.js → chunk-5IZ6O334.js} +2 -2
  31. package/dist/chunks/{chunk-TC265JAP.js → chunk-5L276I7O.js} +2 -2
  32. package/dist/chunks/{chunk-TC265JAP.js.map → chunk-5L276I7O.js.map} +2 -2
  33. package/dist/chunks/chunk-6HGDLU7H.js +9 -0
  34. package/dist/chunks/chunk-6HGDLU7H.js.map +7 -0
  35. package/dist/chunks/chunk-6TXZQA6S.js +2 -0
  36. package/dist/chunks/chunk-6TXZQA6S.js.map +7 -0
  37. package/dist/chunks/chunk-AVUNIRM5.js +5 -0
  38. package/dist/chunks/chunk-AVUNIRM5.js.map +7 -0
  39. package/dist/chunks/chunk-CTQBRAQH.js +6 -0
  40. package/dist/chunks/chunk-CTQBRAQH.js.map +7 -0
  41. package/dist/chunks/chunk-D3QZGLZ3.js +2 -0
  42. package/dist/chunks/chunk-D3QZGLZ3.js.map +7 -0
  43. package/dist/chunks/chunk-D7BAG2VJ.js +2 -0
  44. package/dist/chunks/chunk-D7BAG2VJ.js.map +7 -0
  45. package/dist/chunks/chunk-G6DZANDH.js +2 -0
  46. package/dist/chunks/chunk-G6DZANDH.js.map +7 -0
  47. package/dist/chunks/{chunk-WE7DQVXF.js → chunk-H42TSPVA.js} +2 -2
  48. package/dist/chunks/{chunk-WE7DQVXF.js.map → chunk-H42TSPVA.js.map} +2 -2
  49. package/dist/chunks/chunk-H5PFNYKH.js +2 -0
  50. package/dist/chunks/chunk-H5PFNYKH.js.map +7 -0
  51. package/dist/chunks/chunk-HTVBMX7V.js +2 -0
  52. package/dist/chunks/chunk-HTVBMX7V.js.map +7 -0
  53. package/dist/chunks/chunk-IK5G3JHR.js +2 -0
  54. package/dist/chunks/chunk-IK5G3JHR.js.map +7 -0
  55. package/dist/chunks/chunk-JLIDLLZG.js +2 -0
  56. package/dist/chunks/chunk-JLIDLLZG.js.map +7 -0
  57. package/dist/chunks/chunk-JM4W4PKP.js +2 -0
  58. package/dist/chunks/{chunk-3CTVGI6C.js.map → chunk-JM4W4PKP.js.map} +3 -3
  59. package/dist/chunks/chunk-JWIFJIPZ.js +2 -0
  60. package/dist/chunks/chunk-JWIFJIPZ.js.map +7 -0
  61. package/dist/chunks/chunk-LRBNBP2K.js +4 -0
  62. package/dist/chunks/chunk-LRBNBP2K.js.map +7 -0
  63. package/dist/chunks/chunk-MYJVR2OX.js +2 -0
  64. package/dist/chunks/chunk-MYJVR2OX.js.map +7 -0
  65. package/dist/chunks/chunk-NDWP2KNR.js +5 -0
  66. package/dist/chunks/chunk-NDWP2KNR.js.map +7 -0
  67. package/dist/chunks/chunk-NLHJYXCS.js +4 -0
  68. package/dist/chunks/{chunk-4YSZIJBZ.js.map → chunk-NLHJYXCS.js.map} +4 -4
  69. package/dist/chunks/{chunk-MSAVT4CG.js → chunk-NTXLYTF6.js} +1 -1
  70. package/dist/chunks/{chunk-MSAVT4CG.js.map → chunk-NTXLYTF6.js.map} +1 -1
  71. package/dist/chunks/chunk-OIGMGVI6.js +4 -0
  72. package/dist/chunks/{chunk-2TMRTF2T.js.map → chunk-OIGMGVI6.js.map} +3 -3
  73. package/dist/chunks/chunk-OP2PTYDR.js +2 -0
  74. package/dist/chunks/chunk-OP2PTYDR.js.map +7 -0
  75. package/dist/chunks/chunk-RQSCKHNS.js +2 -0
  76. package/dist/chunks/chunk-RQSCKHNS.js.map +7 -0
  77. package/dist/chunks/chunk-WBJPOKQT.js +3 -0
  78. package/dist/chunks/chunk-WBJPOKQT.js.map +7 -0
  79. package/dist/chunks/chunk-ZLQEXXMV.js +2 -0
  80. package/dist/chunks/chunk-ZLQEXXMV.js.map +7 -0
  81. package/dist/chunks/{executeDiagonalize-ZMW5BLEJ.js → executeDiagonalize-XP4MNCTJ.js} +2 -2
  82. package/dist/chunks/renderSvg-X3BRMJX3.js +2 -0
  83. package/dist/chunks/renderSvg-X3BRMJX3.js.map +7 -0
  84. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -8
  85. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  86. package/package.json +3 -3
  87. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +5 -3
  88. package/src/GbzBaseSyntenyAdapter/configSchema.ts +2 -1
  89. package/src/GetSubgraph.ts +3 -6
  90. package/src/GraphAddTrackWorkflow/walkReference.test.ts +1 -1
  91. package/src/GraphGenomeView/components/BubbleHalos.tsx +2 -2
  92. package/src/GraphGenomeView/components/EdgeMarksOverlay.tsx +52 -0
  93. package/src/GraphGenomeView/components/FacetPanels.test.tsx +2 -1
  94. package/src/GraphGenomeView/components/FacetPanels.tsx +6 -2
  95. package/src/GraphGenomeView/components/GenePins.tsx +2 -27
  96. package/src/GraphGenomeView/components/GraphCanvas.test.tsx +10 -0
  97. package/src/GraphGenomeView/components/GraphCanvas.tsx +31 -57
  98. package/src/GraphGenomeView/components/GraphGenomeView.test.tsx +4 -3
  99. package/src/GraphGenomeView/components/GraphTrackPicker.tsx +136 -0
  100. package/src/GraphGenomeView/components/HoverLayer.tsx +1 -1
  101. package/src/GraphGenomeView/components/HoverTooltip.test.tsx +94 -0
  102. package/src/GraphGenomeView/components/HoverTooltip.tsx +54 -28
  103. package/src/GraphGenomeView/components/ImportForm.test.tsx +112 -1
  104. package/src/GraphGenomeView/components/ImportForm.tsx +45 -5
  105. package/src/GraphGenomeView/components/LabelChip.tsx +3 -1
  106. package/src/GraphGenomeView/components/LabelLayer.test.tsx +72 -0
  107. package/src/GraphGenomeView/components/LabelLayer.tsx +86 -28
  108. package/src/GraphGenomeView/components/Legend.test.tsx +73 -0
  109. package/src/GraphGenomeView/components/Legend.tsx +28 -4
  110. package/src/GraphGenomeView/components/LegendSwatch.tsx +56 -4
  111. package/src/GraphGenomeView/components/Legends.settle.test.tsx +117 -0
  112. package/src/GraphGenomeView/components/PaneContextMenu.test.tsx +70 -0
  113. package/src/GraphGenomeView/components/PaneContextMenu.tsx +5 -6
  114. package/src/GraphGenomeView/components/PaneLayer.tsx +2 -1
  115. package/src/GraphGenomeView/components/PaneSvg.tsx +64 -64
  116. package/src/GraphGenomeView/components/PassBars.tsx +32 -0
  117. package/src/GraphGenomeView/components/WalkRowsOverlay.test.tsx +2 -1
  118. package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +10 -4
  119. package/src/GraphGenomeView/components/WalkStrip.test.tsx +47 -1
  120. package/src/GraphGenomeView/components/WalkStrip.tsx +26 -11
  121. package/src/GraphGenomeView/components/legendStyles.ts +11 -2
  122. package/src/GraphGenomeView/components/usePaneGestures.test.tsx +185 -1
  123. package/src/GraphGenomeView/components/usePaneGestures.ts +17 -7
  124. package/src/GraphGenomeView/graphLayers.test.ts +9 -0
  125. package/src/GraphGenomeView/graphLayers.ts +10 -0
  126. package/src/GraphGenomeView/graphTrackChoices.test.ts +69 -0
  127. package/src/GraphGenomeView/graphTrackChoices.ts +75 -0
  128. package/src/GraphGenomeView/host.test.ts +76 -1
  129. package/src/GraphGenomeView/host.ts +49 -0
  130. package/src/GraphGenomeView/legendSections.test.ts +211 -111
  131. package/src/GraphGenomeView/legendSections.ts +267 -284
  132. package/src/GraphGenomeView/model.color.test.ts +179 -1
  133. package/src/GraphGenomeView/model.fit.test.ts +122 -50
  134. package/src/GraphGenomeView/model.fold.test.ts +197 -0
  135. package/src/GraphGenomeView/model.geneNames.test.ts +371 -0
  136. package/src/GraphGenomeView/model.labelRuns.test.ts +425 -0
  137. package/src/GraphGenomeView/model.launch.test.ts +39 -1
  138. package/src/GraphGenomeView/model.load.test.ts +5 -5
  139. package/src/GraphGenomeView/model.passes.test.tsx +121 -0
  140. package/src/GraphGenomeView/model.ts +212 -13
  141. package/src/GraphGenomeView/model.walkRows.test.ts +237 -8
  142. package/src/GraphGenomeView/modelTestSupport.ts +1 -0
  143. package/src/GraphGenomeView/pane/fitViews.ts +349 -79
  144. package/src/GraphGenomeView/pane/graphViews.ts +248 -83
  145. package/src/GraphGenomeView/pane/hostViews.ts +17 -3
  146. package/src/GraphGenomeView/pane/launchActions.ts +41 -3
  147. package/src/GraphGenomeView/pane/loadActions.ts +231 -130
  148. package/src/GraphGenomeView/pane/paneBase.ts +28 -0
  149. package/src/GraphGenomeView/pane/renderingActions.ts +90 -25
  150. package/src/GraphGenomeView/pane/settingActions.ts +55 -4
  151. package/src/GraphGenomeView/pane/tubeMapViews.ts +6 -2
  152. package/src/GraphGenomeView/pane/walkRowViews.ts +32 -7
  153. package/src/GraphGenomeView/readoutMeasure.ts +25 -0
  154. package/src/GraphGenomeView/skipStrokes.test.ts +226 -0
  155. package/src/GraphGenomeView/subgraphLoad.test.ts +185 -18
  156. package/src/GraphGenomeView/tubeMapPanels.test.ts +29 -5
  157. package/src/GraphGenomeView/tubeMapPanels.ts +22 -12
  158. package/src/GraphGenomeView/unloadedWalks.test.ts +92 -0
  159. package/src/GraphGenomeView/unloadedWalks.ts +53 -0
  160. package/src/GraphGenomeView/viewModel.ts +23 -4
  161. package/src/GraphGenomeView/walkRowGroups.test.ts +64 -0
  162. package/src/GraphGenomeView/walkRowGroups.ts +15 -21
  163. package/src/GraphGenomeView/walkRowSpans.test.ts +95 -10
  164. package/src/GraphGenomeView/walkRowSpans.ts +104 -36
  165. package/src/GraphGenomeView/walkRowsCut.ts +1 -0
  166. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +1178 -52
  167. package/src/LinearGraphDisplay/configSchema.ts +19 -9
  168. package/src/LinearGraphDisplay/model.ts +202 -27
  169. package/src/RgfaTabixAdapter/configSchema.ts +4 -4
  170. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/build.sh +3 -3
  171. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.walks.gz +0 -0
  172. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.walks.gz.idx +1 -1
  173. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.walks.gz +0 -0
  174. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.walks.gz.idx +1 -1
  175. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.walks.gz +0 -0
  176. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.walks.gz.idx +1 -1
  177. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.walks.gz +0 -0
  178. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.walks.gz.idx +1 -1
  179. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.walks.gz +0 -0
  180. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.walks.gz.idx +1 -1
  181. package/src/RgfaTabixAdapter/test_data/walks8/rejoin.GRCh38.walks.gz +0 -0
  182. package/src/RgfaTabixAdapter/test_data/walks8/rejoin.GRCh38.walks.gz.idx +3 -0
  183. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.walks.gz +0 -0
  184. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.walks.gz.idx +1 -1
  185. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.walks.gz +0 -0
  186. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.walks.gz.idx +1 -1
  187. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipinv.GRCh38.walks.gz +0 -0
  188. package/src/RgfaTabixAdapter/test_data/walks8/skipinv.GRCh38.walks.gz.idx +3 -0
  189. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.walks.gz +0 -0
  190. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.walks.gz.idx +1 -1
  191. package/src/RgfaTabixAdapter/walkCut.ts +12 -5
  192. package/src/RgfaTabixAdapter/walkFiles.test.ts +13 -33
  193. package/src/RgfaTabixAdapter/walkReader.ts +10 -29
  194. package/src/WalkFormsAdapter/WalkFormsAdapter.test.ts +2 -21
  195. package/src/WalkFormsAdapter/WalkFormsAdapter.ts +7 -18
  196. package/src/WalkFormsAdapter/configSchema.ts +13 -12
  197. package/src/WalkFormsAdapter/formRows.test.ts +3 -4
  198. package/src/WalkFormsAdapter/formRows.ts +2 -19
  199. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +35 -1
  200. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +44 -14
  201. package/src/WalkTabixSyntenyAdapter/configSchema.ts +7 -4
  202. package/src/WalkTabixSyntenyAdapter/gbzParity.test.ts +2 -2
  203. package/src/WalkTabixSyntenyAdapter/test_data/lane_colors.tsv +5 -0
  204. package/src/graphTrackConfig.ts +7 -0
  205. package/src/graphTrackDefaults/index.ts +1 -7
  206. package/src/graphTrackReach.ts +21 -0
  207. package/src/hoverSync/rowWalks.test.ts +10 -6
  208. package/src/hoverSync/rowWalks.ts +5 -7
  209. package/src/launchFromGraph/contributors.test.ts +27 -0
  210. package/src/launchFromGraph/contributors.ts +9 -1
  211. package/src/launchFromGraph/launchFromGraph.test.ts +31 -0
  212. package/src/launchFromGraph/launchFromGraph.ts +32 -0
  213. package/src/launchFromGraph/linearViewTarget.ts +1 -0
  214. package/src/nodeLimitError.ts +8 -0
  215. package/src/panSNAliases/panSNAliases.test.ts +2 -2
  216. package/src/synteny/sheetColors.ts +37 -0
  217. package/src/version.ts +1 -1
  218. package/dist/chunks/AddTrackWorkflow-NKX57TBD.js +0 -2
  219. package/dist/chunks/GbzBaseSyntenyAdapter-V5WC3WDU.js +0 -9
  220. package/dist/chunks/GraphGenomeView-XPSOKJYF.js +0 -10
  221. package/dist/chunks/GraphGenomeView-XPSOKJYF.js.map +0 -7
  222. package/dist/chunks/GraphSettingsDialog-GXZGESAF.js +0 -2
  223. package/dist/chunks/HighlightColorDialog-4IZ7TVKH.js +0 -2
  224. package/dist/chunks/LinearGraphDisplay-KTRPJ7TC.js +0 -2
  225. package/dist/chunks/MinigraphBubbleAdapter-AQQKKQB7.js +0 -2
  226. package/dist/chunks/RgfaTabixAdapter-6KXWQZIB.js +0 -2
  227. package/dist/chunks/WalkFormsAdapter-XUL6CPR2.js +0 -2
  228. package/dist/chunks/WalkFormsAdapter-XUL6CPR2.js.map +0 -7
  229. package/dist/chunks/WalkTabixSyntenyAdapter-V5TDUHFA.js +0 -2
  230. package/dist/chunks/WalkTabixSyntenyAdapter-V5TDUHFA.js.map +0 -7
  231. package/dist/chunks/chunk-2JCLWDPA.js +0 -2
  232. package/dist/chunks/chunk-2JCLWDPA.js.map +0 -7
  233. package/dist/chunks/chunk-2TMRTF2T.js +0 -4
  234. package/dist/chunks/chunk-3CTVGI6C.js +0 -2
  235. package/dist/chunks/chunk-4QUWP4KD.js +0 -2
  236. package/dist/chunks/chunk-4QUWP4KD.js.map +0 -7
  237. package/dist/chunks/chunk-4YSZIJBZ.js +0 -4
  238. package/dist/chunks/chunk-54ZVDV3O.js +0 -2
  239. package/dist/chunks/chunk-54ZVDV3O.js.map +0 -7
  240. package/dist/chunks/chunk-5DK3PP4N.js +0 -2
  241. package/dist/chunks/chunk-5DK3PP4N.js.map +0 -7
  242. package/dist/chunks/chunk-GH6WRWYC.js +0 -2
  243. package/dist/chunks/chunk-GH6WRWYC.js.map +0 -7
  244. package/dist/chunks/chunk-I2GHOE2S.js +0 -4
  245. package/dist/chunks/chunk-I2GHOE2S.js.map +0 -7
  246. package/dist/chunks/chunk-IAB4ZGCR.js +0 -3
  247. package/dist/chunks/chunk-IAB4ZGCR.js.map +0 -7
  248. package/dist/chunks/chunk-JH7I3SYQ.js +0 -2
  249. package/dist/chunks/chunk-JH7I3SYQ.js.map +0 -7
  250. package/dist/chunks/chunk-N4H4SII4.js +0 -2
  251. package/dist/chunks/chunk-N4H4SII4.js.map +0 -7
  252. package/dist/chunks/chunk-P5SI66S3.js +0 -2
  253. package/dist/chunks/chunk-P5SI66S3.js.map +0 -7
  254. package/dist/chunks/chunk-RSNSHOEE.js +0 -3
  255. package/dist/chunks/chunk-RSNSHOEE.js.map +0 -7
  256. package/dist/chunks/chunk-TBC7SPZD.js +0 -6
  257. package/dist/chunks/chunk-TBC7SPZD.js.map +0 -7
  258. package/dist/chunks/chunk-VPKTQAAQ.js +0 -3
  259. package/dist/chunks/chunk-VPKTQAAQ.js.map +0 -7
  260. package/dist/chunks/chunk-WCFLR4AJ.js +0 -2
  261. package/dist/chunks/chunk-WCFLR4AJ.js.map +0 -7
  262. package/dist/chunks/chunk-X67CQRA4.js +0 -2
  263. package/dist/chunks/chunk-X67CQRA4.js.map +0 -7
  264. package/dist/chunks/chunk-XZU7RJUH.js +0 -2
  265. package/dist/chunks/chunk-XZU7RJUH.js.map +0 -7
  266. package/dist/chunks/chunk-ZV6BRYEP.js +0 -4
  267. package/dist/chunks/chunk-ZV6BRYEP.js.map +0 -7
  268. package/dist/chunks/renderSvg-7DAEH3FR.js +0 -2
  269. package/dist/chunks/renderSvg-7DAEH3FR.js.map +0 -7
  270. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz +0 -0
  271. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz.idx +0 -3
  272. package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz.idx +0 -3
  273. /package/dist/chunks/{ChooseSamplesDialog-7RI573UO.js.map → ChooseSamplesDialog-5PTJ6ZDV.js.map} +0 -0
  274. /package/dist/chunks/{ChooseWalksDialog-4LDYDQH2.js.map → ChooseWalksDialog-DN6J7FGD.js.map} +0 -0
  275. /package/dist/chunks/{GraphSettingsDialog-GXZGESAF.js.map → GraphSettingsDialog-TW6UZMWK.js.map} +0 -0
  276. /package/dist/chunks/{TrackWarningsDialog-V5YSUFRO.js.map → TrackWarningsDialog-HXJSVKII.js.map} +0 -0
  277. /package/dist/chunks/{chunk-6OZGIMZC.js.map → chunk-5IZ6O334.js.map} +0 -0
  278. /package/dist/chunks/{executeDiagonalize-ZMW5BLEJ.js.map → executeDiagonalize-XP4MNCTJ.js.map} +0 -0
  279. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.gfa +0 -0
  280. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.gfa +0 -0
  281. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.gfa +0 -0
  282. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.gfa +0 -0
  283. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.gfa +0 -0
  284. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.gfa +0 -0
  285. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.gfa +0 -0
  286. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipinv.GRCh38.gfa +0 -0
  287. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.gfa +0 -0
@@ -1,9 +1,14 @@
1
1
  import { gfaTables } from '@jbrowse/bandage-core/gfa/gfaTables'
2
+ import { layoutEngine } from '@jbrowse/bandage-core/layoutEngines'
2
3
  import { types } from '@jbrowse/mobx-state-tree'
3
4
 
5
+ import { fakeRenderer } from './modelTestSupport'
4
6
  import stateModelFactory from './viewModel'
7
+ import { walkCutFor } from '../RgfaTabixAdapter/walkCut.ts'
5
8
  import { hoverInRegion } from '../hoverSync/lgvHover'
6
9
 
10
+ import type { GraphTables } from '@jbrowse/bandage-core/gfa/graphTables'
11
+ import type { EngineRequest } from '@jbrowse/bandage-core/pipeline'
7
12
  import type { readConfObject } from '@jbrowse/core/configuration'
8
13
 
9
14
  interface MockAssembly {
@@ -127,6 +132,16 @@ function attachedView(snapshot: Record<string, unknown> = {}) {
127
132
  }).view
128
133
  }
129
134
 
135
+ // whether the key names the charcoal the ramp paints off the reference
136
+ const keysOff = (model: ReturnType<typeof createView>) =>
137
+ model.graphKey.some(section =>
138
+ section.entries.some(entry => entry.key === 'off'),
139
+ )
140
+
141
+ // the cut as the adapter hands it over, with the walks it abridged
142
+ const cutOf = (tables: GraphTables) =>
143
+ walkCutFor(tables, { start: 32000000, end: 32001900 }, false)
144
+
130
145
  function answerCutsWith(cut: unknown) {
131
146
  mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
132
147
  method === 'GetSubgraph'
@@ -347,7 +362,7 @@ describe('canceling and retrying', () => {
347
362
  })
348
363
  })
349
364
 
350
- test('lifting an abridged walk cuts again with its name', async () => {
365
+ test('lifting a walk through a run not fetched cuts again with its name', async () => {
351
366
  const tables = gfaTables(
352
367
  [
353
368
  GFA,
@@ -355,11 +370,12 @@ describe('canceling and retrying', () => {
355
370
  'W\tNA20809\t2\tCM094351.1\t31900800\t31903000\t>s1>h1>s3',
356
371
  ].join('\n'),
357
372
  )!
358
- tables.walks.abridgedSteps = Float64Array.from([Number.NaN, 40])
359
- tables.walks.abridgedBp = Float64Array.from([Number.NaN, 9000])
373
+ tables.nodes.placeholders = Uint8Array.from(tables.nodes.names, name =>
374
+ name === 'h1' ? 1 : 0,
375
+ )
360
376
  mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
361
377
  method === 'GetSubgraph'
362
- ? Promise.resolve(tables)
378
+ ? Promise.resolve(cutOf(tables))
363
379
  : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
364
380
  )
365
381
  const model = attachedView()
@@ -379,7 +395,31 @@ describe('canceling and retrying', () => {
379
395
  })
380
396
  })
381
397
 
382
- test("picking a sample in walk rows cuts again with its abridged walk's name", async () => {
398
+ test('lifting a walk whose steps not fetched lie past the window cuts nothing again, since the cut draws it exactly', async () => {
399
+ const tables = gfaTables(
400
+ [
401
+ GFA,
402
+ 'W\tGRCh38\t0\tchr6\t32000000\t32001900\t>s1>s3',
403
+ 'W\tNA20809\t2\tCM094351.1\t31900800\t31903000\t>s1>h1>s3',
404
+ ].join('\n'),
405
+ )!
406
+ tables.walks.abridgedSteps = Float64Array.from([Number.NaN, 40])
407
+ mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
408
+ method === 'GetSubgraph'
409
+ ? Promise.resolve(cutOf(tables))
410
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
411
+ )
412
+ const model = attachedView()
413
+ await vi.waitFor(() => {
414
+ expect(model.hasGraph).toBe(true)
415
+ })
416
+ mockRpcCall.mockClear()
417
+ model.liftWalks(['GRCh38#0#chr6', 'NA20809#2#CM094351.1'])
418
+ expect(model.expandedWalks).toEqual([])
419
+ expect(mockRpcCall).not.toHaveBeenCalled()
420
+ })
421
+
422
+ test('picking a sample in walk rows fetches nothing, since its bar is drawn the same', async () => {
383
423
  const tables = gfaTables(
384
424
  [
385
425
  GFA,
@@ -388,7 +428,6 @@ describe('canceling and retrying', () => {
388
428
  ].join('\n'),
389
429
  )!
390
430
  tables.walks.abridgedSteps = Float64Array.from([Number.NaN, 40])
391
- tables.walks.abridgedBp = Float64Array.from([Number.NaN, 9000])
392
431
  mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
393
432
  method === 'GetSubgraph'
394
433
  ? Promise.resolve(tables)
@@ -400,13 +439,56 @@ describe('canceling and retrying', () => {
400
439
  })
401
440
  mockRpcCall.mockClear()
402
441
  model.setWalkRowSamples(['NA20809'])
403
- expect(model.expandedWalks).toEqual(['NA20809#2#CM094351.1'])
442
+ expect(model.expandedWalks).toEqual([])
443
+ expect(mockRpcCall).not.toHaveBeenCalled()
444
+ })
445
+
446
+ test('a tube map of few haplotypes fetches the nodes of the walks it shows', async () => {
447
+ const tables = gfaTables(
448
+ [
449
+ GFA,
450
+ 'W\tGRCh38\t0\tchr6\t32000000\t32001900\t>s1>s3',
451
+ 'W\tNA20809\t2\tCM094351.1\t31900800\t31903000\t>s1>h1>s3',
452
+ ].join('\n'),
453
+ )!
454
+ tables.nodes.placeholders = Uint8Array.from(tables.nodes.names, name =>
455
+ name === 'h1' ? 1 : 0,
456
+ )
457
+ mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
458
+ method === 'GetSubgraph'
459
+ ? Promise.resolve(cutOf(tables))
460
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
461
+ )
462
+ const model = attachedView({ layoutMode: 'tubemap' })
404
463
  await vi.waitFor(() => {
405
- expect(mockRpcCall).toHaveBeenCalledTimes(1)
464
+ expect(model.expandedWalks).toEqual(['NA20809#2#CM094351.1'])
406
465
  })
407
- expect(mockRpcCall.mock.calls[0]?.[2]).toMatchObject({
408
- opts: { expand: ['NA20809#2#CM094351.1'] },
466
+ })
467
+
468
+ test('turning on ribbons in walk rows reads the routes of the rows they would leave out', async () => {
469
+ const tables = gfaTables(
470
+ [
471
+ GFA,
472
+ 'W\tGRCh38\t0\tchr6\t32000000\t32001900\t>s1>s3',
473
+ 'W\tNA20809\t2\tCM094351.1\t31900800\t31903000\t>s1>h1>s3',
474
+ ].join('\n'),
475
+ )!
476
+ tables.nodes.placeholders = Uint8Array.from(tables.nodes.names, name =>
477
+ name === 'h1' ? 1 : 0,
478
+ )
479
+ tables.walks.abridgedSteps = Float64Array.from([Number.NaN, 40])
480
+ mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
481
+ method === 'GetSubgraph'
482
+ ? Promise.resolve(tables)
483
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
484
+ )
485
+ const model = attachedView({ layoutMode: 'walkrows' })
486
+ await vi.waitFor(() => {
487
+ expect(model.hasGraph).toBe(true)
409
488
  })
489
+ expect(model.expandedWalks).toEqual([])
490
+ model.setLayer('walkRibbons', true)
491
+ expect(model.expandedWalks).toEqual(['NA20809#2#CM094351.1'])
410
492
  })
411
493
 
412
494
  test('a cut option changed on a drawn view cuts again with it', async () => {
@@ -440,7 +522,6 @@ describe('canceling and retrying', () => {
440
522
  })
441
523
  mockRpcCall.mockClear()
442
524
  model.setWalkRowSamples(['NA20809'])
443
- expect(model.cutOptions.expandSamples).toEqual(['NA20809'])
444
525
  expect(mockRpcCall).not.toHaveBeenCalled()
445
526
  })
446
527
 
@@ -658,7 +739,7 @@ describe('reads', () => {
658
739
  const drawn = model.tubeMapPicture!.nodes.map(n => n.name)
659
740
  const h0 = model.graph!.nodes.find(n => n.name === 'h0')!
660
741
  expect(drawn).not.toContain(h0.id)
661
- expect(model.referenceRampDrawsOffReference).toBe(false)
742
+ expect(keysOff(model)).toBe(false)
662
743
  })
663
744
 
664
745
  // a chain of six alleles runs past the flanking walk's reach, which once
@@ -680,14 +761,18 @@ describe('reads', () => {
680
761
 
681
762
  test.each([
682
763
  ['force', true],
683
- ['walkrows', false],
764
+ // a cut with no walks draws no rows, and walk rows fall back to force
765
+ ['walkrows', true],
684
766
  ])(
685
767
  'a %s layout keys deep alleles as off the reference: %s',
686
768
  async (layoutMode, keyed) => {
687
- mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
688
- method === 'GetSubgraph'
689
- ? Promise.resolve(DEEP)
690
- : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
769
+ mockRpcCall.mockImplementation(
770
+ (_sid: unknown, method: string, request: EngineRequest) =>
771
+ method === 'GetSubgraph'
772
+ ? Promise.resolve(DEEP)
773
+ : method === 'GraphComputeLayout'
774
+ ? layoutEngine(request)
775
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
691
776
  )
692
777
  const model = createView({
693
778
  layoutMode,
@@ -696,8 +781,10 @@ describe('reads', () => {
696
781
  loadedRegion: ON_HG38,
697
782
  })
698
783
  await model.load()
784
+ model.startRenderingBackend(fakeRenderer())
785
+ model.setWidth(800)
699
786
 
700
- expect(model.referenceRampDrawsOffReference).toBe(keyed)
787
+ expect(keysOff(model)).toBe(keyed)
701
788
  },
702
789
  )
703
790
 
@@ -888,3 +975,83 @@ describe('reads', () => {
888
975
  )
889
976
  })
890
977
  })
978
+
979
+ describe("a lifted walk's samples sheet colour", () => {
980
+ const SHEET_TRACK = {
981
+ trackId: 'walks',
982
+ assemblyNames: ['hg38'],
983
+ adapter: {
984
+ type: 'WalkTabixSyntenyAdapter',
985
+ assemblyNames: ['hg38'],
986
+ assemblyNameToPanSN: { hg38: 'GRCh38' },
987
+ samplesTsvLocation: { uri: 'samples.tsv', locationType: 'UriLocation' },
988
+ },
989
+ }
990
+ const WALKS = [
991
+ 'H\tVN:Z:1.0',
992
+ 'S\t1\tACGT',
993
+ 'S\t2\tA',
994
+ 'S\t3\tG',
995
+ 'S\t4\tTTGCA',
996
+ 'L\t1\t+\t2\t+\t0M',
997
+ 'L\t1\t+\t3\t+\t0M',
998
+ 'L\t2\t+\t4\t+\t0M',
999
+ 'L\t3\t+\t4\t+\t0M',
1000
+ 'P\tGRCh38#0#chr6\t1+,2+,4+\t*',
1001
+ 'P\tHG002#1#c\t1+,3+,4+\t*',
1002
+ 'P\tHG002#2#c\t1+,2+,4+\t*',
1003
+ 'P\tHG00097#1#c\t1+,3+,4+\t*',
1004
+ ].join('\n')
1005
+
1006
+ async function liftedWith(layers: { walk: string; color?: object }[]) {
1007
+ mockSession.tracks = [SHEET_TRACK]
1008
+ mockRpcCall.mockImplementation((_sid: unknown, method: string) =>
1009
+ method === 'GetSubgraph'
1010
+ ? Promise.resolve(WALKS)
1011
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
1012
+ )
1013
+ mockReadFile.mockResolvedValue(
1014
+ [
1015
+ 'name\tcolor\tassembly',
1016
+ 'HG002#1\t#2a9fd0\t',
1017
+ 'HG002\t#d0302a\t',
1018
+ 'reference\t#555555\thg38',
1019
+ ].join('\n'),
1020
+ )
1021
+ const model = createView({
1022
+ layoutMode: 'force',
1023
+ loadedTrackId: SHEET_TRACK.trackId,
1024
+ loadedRegion: ON_HG38,
1025
+ })
1026
+ await model.load()
1027
+ await model.loadWalkRowSampleTable()
1028
+ model.setWalkLayers(layers)
1029
+ return new Map(
1030
+ model.walkLift?.walks.map(w => [w.name, w.encoding.value]) ?? [],
1031
+ )
1032
+ }
1033
+
1034
+ test('a walk whose layer states no colour takes its haplotype, sample or assembly row colour', async () => {
1035
+ const values = await liftedWith([
1036
+ { walk: 'GRCh38#0#chr6' },
1037
+ { walk: 'HG002#1#c' },
1038
+ { walk: 'HG002#2#c' },
1039
+ { walk: 'HG00097#1#c' },
1040
+ ])
1041
+ expect(Object.fromEntries(values)).toEqual({
1042
+ 'GRCh38#0#chr6': '#555555',
1043
+ 'HG002#1#c': '#2a9fd0',
1044
+ 'HG002#2#c': '#d0302a',
1045
+ 'HG00097#1#c': undefined,
1046
+ })
1047
+ })
1048
+
1049
+ test("a layer's stated colour beats its sheet colour", async () => {
1050
+ const values = await liftedWith([
1051
+ { walk: 'HG002#1#c', color: { scheme: 'purple' } },
1052
+ { walk: 'HG002#2#c', color: { value: '#00ff00' } },
1053
+ ])
1054
+ expect(values.get('HG002#1#c')).toBeUndefined()
1055
+ expect(values.get('HG002#2#c')).toBe('#00ff00')
1056
+ })
1057
+ })
@@ -9,8 +9,8 @@ import {
9
9
  drawSqueezedLengths,
10
10
  graphOfPaths,
11
11
  memberAt,
12
+ panelWalksThrough,
12
13
  tubeMapPanelGroups,
13
- walksThrough,
14
14
  withTubeMapPanels,
15
15
  } from './tubeMapPanels'
16
16
 
@@ -117,13 +117,37 @@ test('one group draws the whole map, unsplit', () => {
117
117
  test("a hovered node's box in each panel, and how many walks pass it", () => {
118
118
  const g = graph()
119
119
  const a = tubeMapReferenceLayout(graphOfPaths(g, ['A#1#c', 'A#2#c']))!
120
+ const node = (id: string) => g.nodes.find(n => n.id === id)!
120
121
  expect(boxOf(a.tubeMap!, '2+')).toBe('2+')
121
- expect(walksThrough(a.tubeMap!.graph, '2+')).toEqual({ here: 1, of: 2 })
122
+ expect(panelWalksThrough(g, node('2+'), a.tubeMap!.graph)).toEqual({
123
+ here: 1,
124
+ of: 2,
125
+ })
122
126
  const b = tubeMapReferenceLayout(graphOfPaths(g, ['B#1#c']))!
123
127
  expect(boxOf(b.tubeMap!, '2+')).toBeUndefined()
124
- const box = boxOf(b.tubeMap!, '3+')!
125
- expect(box).toBeDefined()
126
- expect(walksThrough(b.tubeMap!.graph, box)).toEqual({ here: 0, of: 1 })
128
+ expect(boxOf(b.tubeMap!, '3+')).toBeDefined()
129
+ expect(panelWalksThrough(g, node('3+'), b.tubeMap!.graph)).toEqual({
130
+ here: 0,
131
+ of: 1,
132
+ })
133
+ })
134
+
135
+ // A's second haplotype and C, which no panel shows, reach segment 2 only
136
+ // through a departure's own steps
137
+ test('a panel counts a walk that passes a node only through a departure', () => {
138
+ const g = graph()
139
+ const two = {
140
+ ...g.nodes.find(n => n.id === '2+')!,
141
+ departureVisits: [
142
+ { path: 'A#2#c', sample: 'A', start: 10, strand: '+' as const },
143
+ { path: 'C#1#c', sample: 'C', start: 10, strand: '+' as const },
144
+ ],
145
+ }
146
+ const a = tubeMapReferenceLayout(graphOfPaths(g, ['A#1#c', 'A#2#c']))!
147
+ expect(panelWalksThrough(g, two, a.tubeMap!.graph)).toEqual({
148
+ here: 2,
149
+ of: 2,
150
+ })
127
151
  })
128
152
 
129
153
  test("a merged run's member is the one under the pointer's share of its width", () => {
@@ -2,6 +2,7 @@ import { parsePanSN } from '@jbrowse/bandage-core/alleleProjection/projectAllele
2
2
  import { formatBp } from '@jbrowse/bandage-core/graphLabels'
3
3
  import { pathOrigin } from '@jbrowse/bandage-core/pathAnchoring'
4
4
  import { drawTubeMapHighlight } from '@jbrowse/bandage-core/tubeMap/draw'
5
+ import { walksThrough } from '@jbrowse/bandage-core/walksThrough'
5
6
  import { groupKeyComparator } from '@jbrowse/core/util/groupKeys'
6
7
 
7
8
  import { columnValueOf, groupsByColumn, plural } from './walkRowGroups'
@@ -11,7 +12,11 @@ import type { FacetBy } from '@jbrowse/bandage-core/facetGrid'
11
12
  import type { TubeMapDrawing } from '@jbrowse/bandage-core/layout/tubeMapLayout'
12
13
  import type { TubeMapPicture } from '@jbrowse/bandage-core/tubeMap/draw'
13
14
  import type { TubeMapTransform } from '@jbrowse/bandage-core/tubeMap/frame'
14
- import type { Graph, LayoutResult } from '@jbrowse/bandage-core/types'
15
+ import type {
16
+ Graph,
17
+ GraphNode,
18
+ LayoutResult,
19
+ } from '@jbrowse/bandage-core/types'
15
20
 
16
21
  // A tube map split into small multiples: a panel per sample, or per walk, each
17
22
  // the reference and that group's walks laid out alone, stacked down the pane.
@@ -207,23 +212,28 @@ export function memberAt(
207
212
  return spans.reduce((a, b) => (distance(b) < distance(a) ? b : a)).id
208
213
  }
209
214
 
210
- // How many of a panel's walks pass through `box`, of how many it holds, a
211
- // bundle counting each walk it stands for
212
- export function walksThrough(graph: Graph, box: string) {
215
+ // How many of a panel's walks pass `node` of the graph the panels were laid
216
+ // out from, the cut or its fold, of how many it holds, a bundle counting each
217
+ // walk it stands for
218
+ export function panelWalksThrough(
219
+ laid: Pick<Graph, 'paths'>,
220
+ node: Pick<GraphNode, 'id' | 'departureVisits'>,
221
+ panel: Pick<Graph, 'paths' | 'referencePath'>,
222
+ ) {
213
223
  const all = new Set<string>()
214
- const here = new Set<string>()
215
- for (const p of graph.paths ?? []) {
224
+ for (const p of panel.paths ?? []) {
216
225
  const walk = walkOf(p.name)
217
- if (walk !== graph.referencePath) {
218
- const through = p.nodeIds.includes(box)
226
+ if (walk !== panel.referencePath) {
219
227
  for (const member of p.members ?? [walk]) {
220
- all.add(member)
221
- if (through) {
222
- here.add(member)
223
- }
228
+ all.add(walkOf(member))
224
229
  }
225
230
  }
226
231
  }
232
+ const here = new Set(
233
+ walksThrough(laid, node)
234
+ .map(w => walkOf(w.name))
235
+ .filter(walk => all.has(walk)),
236
+ )
227
237
  return { here: here.size, of: all.size }
228
238
  }
229
239
 
@@ -0,0 +1,92 @@
1
+ import {
2
+ routesNote,
3
+ routesToLoad,
4
+ tubeMapNote,
5
+ tubeMapWalksToLoad,
6
+ } from './unloadedWalks'
7
+ import { EXPAND_NAMED_MAX } from '../GetSubgraph'
8
+
9
+ import type { WalkRow } from '@jbrowse/bandage-core/layout/walkRows'
10
+ import type { Graph } from '@jbrowse/bandage-core/types'
11
+
12
+ const rowOf = (name: string, unloadedBp?: number): WalkRow => ({
13
+ name,
14
+ label: name,
15
+ sample: name,
16
+ bp: 1000,
17
+ offReferenceBp: 0,
18
+ gapBp: 0,
19
+ complete: true,
20
+ runs: [],
21
+ ...(unloadedBp === undefined ? {} : { unloadedBp, abridgedSteps: 40 }),
22
+ })
23
+
24
+ const rows = (n: number) =>
25
+ Array.from({ length: n }, (_, i) => rowOf(`S${i}#1#c`, 500))
26
+
27
+ test('a few compared rows with steps not fetched are fetched whole, and the note says so', () => {
28
+ const compared = [rowOf('A#1#c'), rowOf('B#1#c', 500), rowOf('C#1#c', 20)]
29
+ expect(routesToLoad(compared)).toEqual(['B#1#c', 'C#1#c'])
30
+ expect(routesNote(compared)).toBe('Fetching node-level detail for 2 rows')
31
+ expect(routesNote([rowOf('B#1#c', 500)])).toBe(
32
+ 'Fetching node-level detail for 1 row',
33
+ )
34
+ })
35
+
36
+ test('as many as the limit are still fetched whole', () => {
37
+ expect(routesToLoad(rows(EXPAND_NAMED_MAX))).toHaveLength(EXPAND_NAMED_MAX)
38
+ expect(routesNote(rows(EXPAND_NAMED_MAX))).toBe(
39
+ `Fetching node-level detail for ${EXPAND_NAMED_MAX} rows`,
40
+ )
41
+ })
42
+
43
+ test('more than that are left out, and the note says how many and why', () => {
44
+ const many = rows(EXPAND_NAMED_MAX + 1)
45
+ expect(routesToLoad(many)).toEqual([])
46
+ expect(routesNote(many)).toBe(
47
+ `Leaves out ${EXPAND_NAMED_MAX + 1} rows: node-level detail is fetched for at most ${EXPAND_NAMED_MAX} at a time. Choose up to ${EXPAND_NAMED_MAX} samples under Samples to include them.`,
48
+ )
49
+ })
50
+
51
+ test('rows with every step fetched need nothing', () => {
52
+ expect(routesToLoad([rowOf('A#1#c')])).toEqual([])
53
+ expect(routesNote([rowOf('A#1#c')])).toBeUndefined()
54
+ })
55
+
56
+ // a graph of `n` haplotypes' walks, the first stepping through a placeholder,
57
+ // which the cut's abridged list names
58
+ function graphOf(n: number): Graph {
59
+ return {
60
+ name: 'g',
61
+ nodes: [
62
+ { id: 's1', name: 's1', length: 10, depth: 1 },
63
+ { id: 'p', name: 'p', length: 300, depth: 1, placeholder: true },
64
+ ],
65
+ edges: [],
66
+ paths: Array.from({ length: n }, (_, i) => ({
67
+ name: `S${i}#1#c`,
68
+ sample: `S${i}`,
69
+ haplotype: 1,
70
+ nodeIds: i === 0 ? ['s1', 'p'] : ['s1'],
71
+ })),
72
+ }
73
+ }
74
+
75
+ const abridged = [{ name: 'S0#1#c', bp: 300 }]
76
+
77
+ test('a tube map fetches the nodes of the walks it shows, up to the limit', () => {
78
+ expect(tubeMapWalksToLoad(graphOf(EXPAND_NAMED_MAX), abridged)).toEqual([
79
+ 'S0#1#c',
80
+ ])
81
+ expect(tubeMapWalksToLoad(graphOf(EXPAND_NAMED_MAX + 1), abridged)).toEqual(
82
+ [],
83
+ )
84
+ })
85
+
86
+ test('a tube map says why its boxes stay unfilled only past the limit', () => {
87
+ expect(tubeMapNote(graphOf(EXPAND_NAMED_MAX), abridged)).toBeUndefined()
88
+ expect(tubeMapNote(graphOf(EXPAND_NAMED_MAX + 1), [])).toBeUndefined()
89
+ expect(tubeMapNote(graphOf(EXPAND_NAMED_MAX + 1), abridged)).toBe(
90
+ `Node-level detail is fetched for at most ${EXPAND_NAMED_MAX} haplotypes at a time. Choose ${EXPAND_NAMED_MAX} or fewer under Load in the track menu, or in Graph settings, to see it.`,
91
+ )
92
+ })
@@ -0,0 +1,53 @@
1
+ import { rowsNeedingRoutes } from '@jbrowse/bandage-core/layout/walkRowLinks'
2
+
3
+ import { EXPAND_NAMED_MAX } from '../GetSubgraph'
4
+
5
+ import type { WalkRow } from '@jbrowse/bandage-core/layout/walkRows'
6
+ import type { Graph } from '@jbrowse/bandage-core/types'
7
+ import type { AbridgedWalk } from '@jbrowse/graph-walks'
8
+
9
+ // The walks a tube map fetches the nodes of: every one holding steps not
10
+ // fetched, while it shows few enough haplotypes to fetch them all
11
+ export function tubeMapWalksToLoad(
12
+ graph: Graph | undefined,
13
+ abridged: AbridgedWalk[],
14
+ ) {
15
+ const haplotypes = new Set(
16
+ (graph?.paths ?? []).map(p => `${p.sample}#${p.haplotype}`),
17
+ )
18
+ return haplotypes.size <= EXPAND_NAMED_MAX
19
+ ? abridged.map(walk => walk.name)
20
+ : []
21
+ }
22
+
23
+ // Why a tube map's boxes stay "nodes not shown": it shows more haplotypes
24
+ // than it fetches the nodes of
25
+ export function tubeMapNote(
26
+ graph: Graph | undefined,
27
+ abridged: AbridgedWalk[],
28
+ ) {
29
+ return abridged.length > 0 && tubeMapWalksToLoad(graph, abridged).length === 0
30
+ ? `Node-level detail is fetched for at most ${EXPAND_NAMED_MAX} haplotypes at a time. Choose ${EXPAND_NAMED_MAX} or fewer under Load in the track menu, or in Graph settings, to see it.`
31
+ : undefined
32
+ }
33
+
34
+ // The walks of the rows that ribbons, shared blocks and the shared order
35
+ // leave out, while few enough to fetch whole as a short list of names is
36
+ export function routesToLoad(rows: WalkRow[]) {
37
+ return rowsNeedingRoutes(rows) <= EXPAND_NAMED_MAX
38
+ ? rows.filter(row => rowsNeedingRoutes([row]) > 0).map(row => row.name)
39
+ : []
40
+ }
41
+
42
+ const rowsText = (n: number) => `${n} row${n === 1 ? '' : 's'}`
43
+
44
+ // What happens to those rows, in the walk-row key's words: fetched while few
45
+ // enough, else left out, and how to bring them in
46
+ export function routesNote(rows: WalkRow[]) {
47
+ const n = rowsNeedingRoutes(rows)
48
+ return n === 0
49
+ ? undefined
50
+ : n <= EXPAND_NAMED_MAX
51
+ ? `Fetching node-level detail for ${rowsText(n)}`
52
+ : `Leaves out ${rowsText(n)}: node-level detail is fetched for at most ${EXPAND_NAMED_MAX} at a time. Choose up to ${EXPAND_NAMED_MAX} samples under Samples to include them.`
53
+ }
@@ -1,13 +1,17 @@
1
1
  import { LAYOUT_ENGINE_VALUES } from '@jbrowse/bandage-core/layoutEngines'
2
2
  import { LAYOUT_MODE_VALUES } from '@jbrowse/bandage-core/layoutModes'
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'
4
- import { getSession } from '@jbrowse/core/util'
4
+ import { getSession, isViewContainer } from '@jbrowse/core/util'
5
5
  import { isAlive, types } from '@jbrowse/mobx-state-tree'
6
6
 
7
+ import { graphTrackChoices } from './graphTrackChoices'
7
8
  import { HOVER_HIGHLIGHT_VALUES } from './hoverHighlight'
8
9
  import { lenientMaybeEnum, lenientOptionalEnum } from './lenientEnum'
9
10
  import { GraphPane, fileName, formatSpanBp } from './model'
10
- import { canonicalRegion } from '../launchFromGraph/launchFromGraph'
11
+ import {
12
+ canonicalRegion,
13
+ showTrackInLinearView,
14
+ } from '../launchFromGraph/launchFromGraph'
11
15
 
12
16
  import type { GraphLayers } from './graphLayers'
13
17
  import type { NodeColor } from './nodeColor'
@@ -102,6 +106,10 @@ export default function stateModelFactory() {
102
106
  ? self.sessionTrack(self.loadedTrackId)
103
107
  : undefined
104
108
  },
109
+ // the session's graph tracks the import form offers
110
+ get graphTracks() {
111
+ return graphTrackChoices(getSession(self).tracks)
112
+ },
105
113
  get canRetryLoad() {
106
114
  return (
107
115
  self.gfaLocation !== undefined ||
@@ -119,7 +127,9 @@ export default function stateModelFactory() {
119
127
  }))
120
128
  .actions(self => {
121
129
  const clearPane = self.clearGraph
122
- function loadRegion(region: SubgraphRegion | undefined) {
130
+ function loadRegion(
131
+ region: SubgraphRegion | undefined,
132
+ ): Promise<unknown> | undefined {
123
133
  if (self.gfaLocation) {
124
134
  // a whole file has no assembly to name the view by
125
135
  if (!self.displayName) {
@@ -171,7 +181,7 @@ export default function stateModelFactory() {
171
181
  // The graph keeps the region by the session's names, which hover sync
172
182
  // and launches compare with, so a stated alias resolves first, once
173
183
  // its assembly's refName aliases have loaded.
174
- load(): Promise<void> | undefined {
184
+ load(): Promise<unknown> | undefined {
175
185
  const stated = self.loadedRegion
176
186
  const session = getSession(self)
177
187
  const { assemblyManager } = session
@@ -215,6 +225,15 @@ export default function stateModelFactory() {
215
225
  }
216
226
  }
217
227
  },
228
+ // The form's way to a graph track: the linear view draws it at every
229
+ // zoom, so this view, still empty, gives way to it
230
+ showTrackInLinearView(trackId: string, assembly: string, loc: string) {
231
+ const session = getSession(self)
232
+ showTrackInLinearView({ session, trackId, assembly, loc })
233
+ if (isViewContainer(session)) {
234
+ session.removeView(self)
235
+ }
236
+ },
218
237
  // Here rather than when the rendering backend starts: the canvas only
219
238
  // mounts once there is a graph, so a view whose graph must be fetched
220
239
  // would never fetch it.