jbrowse-plugin-graphgenomeviewer 8.8.2 → 9.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 (194) hide show
  1. package/README.md +6 -6
  2. package/dist/chunks/{AddTrackWorkflow-FANMD3WB.js → AddTrackWorkflow-3PX4I4DX.js} +2 -2
  3. package/dist/chunks/{AddTrackWorkflow-FANMD3WB.js.map → AddTrackWorkflow-3PX4I4DX.js.map} +2 -2
  4. package/dist/chunks/{GbzBaseSyntenyAdapter-NAXISJUH.js → GbzBaseSyntenyAdapter-YUT5RT7G.js} +2 -2
  5. package/dist/chunks/{GbzBaseSyntenyAdapter-NAXISJUH.js.map → GbzBaseSyntenyAdapter-YUT5RT7G.js.map} +2 -2
  6. package/dist/chunks/{GraphGenomeView-PPOVN5LA.js → GraphGenomeView-XFKLX3VQ.js} +2 -2
  7. package/dist/chunks/{GraphTrackSettingsDialog-BRTDTVOJ.js → GraphTrackSettingsDialog-KOYYI2XH.js} +2 -2
  8. package/dist/chunks/{HighlightColorDialog-CGW7J3SK.js → HighlightColorDialog-F4IARMEO.js} +2 -2
  9. package/dist/chunks/LinearGraphDisplay-BZ44C6S3.js +2 -0
  10. package/dist/chunks/MinigraphBubbleAdapter-2KIWDIY7.js +2 -0
  11. package/dist/chunks/MinigraphBubbleAdapter-2KIWDIY7.js.map +7 -0
  12. package/dist/chunks/RgfaTabixAdapter-7QKNUHKX.js +2 -0
  13. package/dist/chunks/RgfaTabixAdapter-7QKNUHKX.js.map +7 -0
  14. package/dist/chunks/{TrackWarningsDialog-23WL6FPV.js → TrackWarningsDialog-V5YSUFRO.js} +1 -1
  15. package/dist/chunks/{TrackWarningsDialog-23WL6FPV.js.map → TrackWarningsDialog-V5YSUFRO.js.map} +1 -1
  16. package/dist/chunks/WalkFormsAdapter-5NDOULY6.js +2 -0
  17. package/dist/chunks/WalkFormsAdapter-5NDOULY6.js.map +7 -0
  18. package/dist/chunks/WalkTabixSyntenyAdapter-KI7ESKKP.js +2 -0
  19. package/dist/chunks/WalkTabixSyntenyAdapter-KI7ESKKP.js.map +7 -0
  20. package/dist/chunks/{chunk-RS274NAD.js → chunk-3HSJ7SAT.js} +2 -2
  21. package/dist/chunks/{chunk-RS274NAD.js.map → chunk-3HSJ7SAT.js.map} +1 -1
  22. package/dist/chunks/chunk-42VF2CSA.js +4 -0
  23. package/dist/chunks/chunk-42VF2CSA.js.map +7 -0
  24. package/dist/chunks/{chunk-LFQFVYNY.js → chunk-47UWMS4O.js} +3 -3
  25. package/dist/chunks/chunk-47UWMS4O.js.map +7 -0
  26. package/dist/chunks/{chunk-MWQGJP3J.js → chunk-7PVPO366.js} +2 -2
  27. package/dist/chunks/{chunk-MWQGJP3J.js.map → chunk-7PVPO366.js.map} +1 -1
  28. package/dist/chunks/{chunk-SKB4GSET.js → chunk-AQSLN3RH.js} +2 -2
  29. package/dist/chunks/{chunk-SKB4GSET.js.map → chunk-AQSLN3RH.js.map} +1 -1
  30. package/dist/chunks/chunk-AXUXLPO3.js +6 -0
  31. package/dist/chunks/chunk-AXUXLPO3.js.map +7 -0
  32. package/dist/chunks/chunk-CJ4VON23.js +2 -0
  33. package/dist/chunks/chunk-CJ4VON23.js.map +7 -0
  34. package/dist/chunks/{chunk-AGUEPVOR.js → chunk-FQI75MV6.js} +1 -1
  35. package/dist/chunks/{chunk-AGUEPVOR.js.map → chunk-FQI75MV6.js.map} +1 -1
  36. package/dist/chunks/{chunk-FM4T47WH.js → chunk-HFBUC6GF.js} +2 -2
  37. package/dist/chunks/{chunk-FM4T47WH.js.map → chunk-HFBUC6GF.js.map} +1 -1
  38. package/dist/chunks/chunk-I2XBA4H7.js +9 -0
  39. package/dist/chunks/{chunk-EFXNCI7R.js.map → chunk-I2XBA4H7.js.map} +4 -4
  40. package/dist/chunks/chunk-KIURR66K.js +3 -0
  41. package/dist/chunks/chunk-KIURR66K.js.map +7 -0
  42. package/dist/chunks/{chunk-CHLLRNBQ.js → chunk-LQSOJR7D.js} +2 -2
  43. package/dist/chunks/{chunk-CHLLRNBQ.js.map → chunk-LQSOJR7D.js.map} +1 -1
  44. package/dist/chunks/chunk-M6YSANSW.js +2 -0
  45. package/dist/chunks/chunk-M6YSANSW.js.map +7 -0
  46. package/dist/chunks/{chunk-ZWHXVFZF.js → chunk-MPUAUZSJ.js} +1 -1
  47. package/dist/chunks/{chunk-ZWHXVFZF.js.map → chunk-MPUAUZSJ.js.map} +1 -1
  48. package/dist/chunks/{chunk-5HDIVUAZ.js → chunk-N4ZFGZDN.js} +2 -2
  49. package/dist/chunks/{chunk-5HDIVUAZ.js.map → chunk-N4ZFGZDN.js.map} +1 -1
  50. package/dist/chunks/{chunk-KBOVZ3GI.js → chunk-OSEQDKL3.js} +1 -1
  51. package/dist/chunks/{chunk-KBOVZ3GI.js.map → chunk-OSEQDKL3.js.map} +1 -1
  52. package/dist/chunks/{chunk-NSQ4VXKR.js → chunk-P76SUZFP.js} +3 -3
  53. package/dist/chunks/{chunk-NSQ4VXKR.js.map → chunk-P76SUZFP.js.map} +3 -3
  54. package/dist/chunks/{chunk-HKGTCZOL.js → chunk-R34FRICP.js} +4 -4
  55. package/dist/chunks/{chunk-HKGTCZOL.js.map → chunk-R34FRICP.js.map} +2 -2
  56. package/dist/chunks/chunk-SXMUGZXP.js +2 -0
  57. package/dist/chunks/chunk-SXMUGZXP.js.map +7 -0
  58. package/dist/chunks/chunk-T7NMFIRW.js +2 -0
  59. package/dist/chunks/chunk-T7NMFIRW.js.map +7 -0
  60. package/dist/chunks/chunk-TLUGH4VW.js +2 -0
  61. package/dist/chunks/{chunk-LKD5NRWR.js → chunk-VAWAASUT.js} +1 -1
  62. package/dist/chunks/{chunk-LKD5NRWR.js.map → chunk-VAWAASUT.js.map} +1 -1
  63. package/dist/chunks/chunk-Y4TLRGAC.js +2 -0
  64. package/dist/chunks/{chunk-EEWEXRY6.js.map → chunk-Y4TLRGAC.js.map} +3 -3
  65. package/dist/chunks/chunk-ZXJRZKWF.js +2 -0
  66. package/dist/chunks/chunk-ZXJRZKWF.js.map +7 -0
  67. package/dist/chunks/{executeDiagonalize-HZFFXMG4.js → executeDiagonalize-ZMW5BLEJ.js} +2 -2
  68. package/dist/chunks/{executeDiagonalize-HZFFXMG4.js.map → executeDiagonalize-ZMW5BLEJ.js.map} +1 -1
  69. package/dist/chunks/{renderSvg-UKXPWKKV.js → renderSvg-DLJTA2B3.js} +2 -2
  70. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
  71. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  72. package/package.json +12 -12
  73. package/src/GraphAddTrackWorkflow/AddTrackWorkflow.test.tsx +4 -7
  74. package/src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx +1 -1
  75. package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +9 -6
  76. package/src/GraphGenomeView/model.test.ts +21 -8
  77. package/src/GraphGenomeView/pane/loadActions.ts +7 -2
  78. package/src/GraphGenomeView/pane/walkRowViews.ts +1 -1
  79. package/src/GraphGenomeView/walkRowGroups.test.ts +14 -3
  80. package/src/GraphGenomeView/walkRowGroups.ts +0 -22
  81. package/src/GraphGenomeView/walkRowsCut.ts +1 -0
  82. package/src/MinigraphBubbleAdapter/MinigraphBubbleAdapter.ts +5 -2
  83. package/src/RgfaTabixAdapter/RgfaTabixAdapter.test.ts +1 -1
  84. package/src/RgfaTabixAdapter/RgfaTabixAdapter.ts +16 -16
  85. package/src/RgfaTabixAdapter/configSchema.ts +16 -12
  86. package/src/RgfaTabixAdapter/test_data/walks7/build.sh +27 -0
  87. package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.gfa +35 -0
  88. package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.walks.gz +0 -0
  89. package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.walks.gz.idx +3 -0
  90. package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.gfa +22 -0
  91. package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.walks.gz +0 -0
  92. package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.walks.gz.idx +3 -0
  93. package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.gfa +15 -0
  94. package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.walks.gz +0 -0
  95. package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.walks.gz.idx +3 -0
  96. package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.gfa +19 -0
  97. package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.walks.gz +0 -0
  98. package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.walks.gz.idx +3 -0
  99. package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.gfa +11 -0
  100. package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.walks.gz +0 -0
  101. package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.walks.gz.idx +3 -0
  102. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz +0 -0
  103. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz.idx +3 -0
  104. package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.gfa +23 -0
  105. package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.walks.gz +0 -0
  106. package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.walks.gz.idx +3 -0
  107. package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.gfa +50 -0
  108. package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.walks.gz +0 -0
  109. package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.walks.gz.idx +3 -0
  110. package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.gfa +45 -0
  111. package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz +0 -0
  112. package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz.idx +3 -0
  113. package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.gfa +22 -0
  114. package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.walks.gz +0 -0
  115. package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.walks.gz.idx +3 -0
  116. package/src/RgfaTabixAdapter/walkFiles.test.ts +131 -119
  117. package/src/RgfaTabixAdapter/walkReader.ts +36 -49
  118. package/src/WalkFormsAdapter/WalkFormsAdapter.test.ts +7 -28
  119. package/src/WalkFormsAdapter/WalkFormsAdapter.ts +4 -29
  120. package/src/WalkFormsAdapter/configSchema.ts +13 -13
  121. package/src/WalkFormsAdapter/formRows.test.ts +0 -7
  122. package/src/WalkFormsAdapter/formRows.ts +0 -12
  123. package/src/WalkFormsAdapter/formsMenu.test.ts +1 -1
  124. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +54 -96
  125. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +56 -152
  126. package/src/WalkTabixSyntenyAdapter/configSchema.ts +15 -16
  127. package/src/WalkTabixSyntenyAdapter/gbzParity.test.ts +5 -6
  128. package/src/WalkTabixSyntenyAdapter/walkLanes.ts +48 -142
  129. package/src/graphTrackConfig.test.ts +1 -1
  130. package/src/graphTrackDefaults/graphTrackDefaults.test.ts +7 -10
  131. package/src/launchFromGraph/syntenyTracks.test.ts +1 -1
  132. package/src/locationName.ts +2 -2
  133. package/src/panSNAliases/panSNAliases.test.ts +4 -6
  134. package/src/panSNTabix.test.ts +3 -23
  135. package/src/panSNTabix.ts +58 -34
  136. package/src/synteny/laneZoomNotice.test.ts +1 -0
  137. package/src/version.ts +1 -1
  138. package/dist/chunks/LinearGraphDisplay-2AZ7X7TK.js +0 -2
  139. package/dist/chunks/MinigraphBubbleAdapter-NR3MMUUG.js +0 -2
  140. package/dist/chunks/MinigraphBubbleAdapter-NR3MMUUG.js.map +0 -7
  141. package/dist/chunks/RgfaTabixAdapter-JDQLVQVP.js +0 -2
  142. package/dist/chunks/RgfaTabixAdapter-JDQLVQVP.js.map +0 -7
  143. package/dist/chunks/WalkFormsAdapter-YMQC3NLG.js +0 -2
  144. package/dist/chunks/WalkFormsAdapter-YMQC3NLG.js.map +0 -7
  145. package/dist/chunks/WalkTabixSyntenyAdapter-PBWN53PE.js +0 -2
  146. package/dist/chunks/WalkTabixSyntenyAdapter-PBWN53PE.js.map +0 -7
  147. package/dist/chunks/chunk-6VNDP3UB.js +0 -2
  148. package/dist/chunks/chunk-6VNDP3UB.js.map +0 -7
  149. package/dist/chunks/chunk-A27SW7X7.js +0 -2
  150. package/dist/chunks/chunk-A27SW7X7.js.map +0 -7
  151. package/dist/chunks/chunk-APSXG7SV.js +0 -2
  152. package/dist/chunks/chunk-DEWVJ57F.js +0 -4
  153. package/dist/chunks/chunk-DEWVJ57F.js.map +0 -7
  154. package/dist/chunks/chunk-EEWEXRY6.js +0 -2
  155. package/dist/chunks/chunk-EFXNCI7R.js +0 -9
  156. package/dist/chunks/chunk-EH5OCKSE.js +0 -3
  157. package/dist/chunks/chunk-EH5OCKSE.js.map +0 -7
  158. package/dist/chunks/chunk-GLSUAMGV.js +0 -3
  159. package/dist/chunks/chunk-GLSUAMGV.js.map +0 -7
  160. package/dist/chunks/chunk-LFQFVYNY.js.map +0 -7
  161. package/dist/chunks/chunk-QUDJ7AM3.js +0 -2
  162. package/dist/chunks/chunk-QUDJ7AM3.js.map +0 -7
  163. package/dist/chunks/chunk-T7LVVBTT.js +0 -2
  164. package/dist/chunks/chunk-T7LVVBTT.js.map +0 -7
  165. package/dist/chunks/chunk-ZBFIEBO6.js +0 -2
  166. package/dist/chunks/chunk-ZBFIEBO6.js.map +0 -7
  167. package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.walks.bed.gz +0 -0
  168. package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.walks.bed.gz.tbi +0 -0
  169. package/src/RgfaTabixAdapter/test_data/walks5_follow.GRCh38.walks.bed.gz +0 -0
  170. package/src/RgfaTabixAdapter/test_data/walks5_follow.GRCh38.walks.bed.gz.tbi +0 -0
  171. package/src/RgfaTabixAdapter/test_data/walks5_header.GRCh38.walks.bed.gz +0 -0
  172. package/src/RgfaTabixAdapter/test_data/walks5_header.GRCh38.walks.bed.gz.tbi +0 -0
  173. package/src/RgfaTabixAdapter/test_data/walks5_inversion.GRCh38.walks.bed.gz +0 -0
  174. package/src/RgfaTabixAdapter/test_data/walks5_inversion.GRCh38.walks.bed.gz.tbi +0 -0
  175. package/src/RgfaTabixAdapter/test_data/walks5_lanepairs.GRCh38.walks.bed.gz +0 -0
  176. package/src/RgfaTabixAdapter/test_data/walks5_lanepairs.GRCh38.walks.bed.gz.tbi +0 -0
  177. package/src/RgfaTabixAdapter/test_data/walks5_maxnode.GRCh38.walks.bed.gz +0 -0
  178. package/src/RgfaTabixAdapter/test_data/walks5_maxnode.GRCh38.walks.bed.gz.tbi +0 -0
  179. package/src/RgfaTabixAdapter/test_data/walks5_rejoin.GRCh38.walks.bed.gz +0 -0
  180. package/src/RgfaTabixAdapter/test_data/walks5_rejoin.GRCh38.walks.bed.gz.tbi +0 -0
  181. package/src/RgfaTabixAdapter/test_data/walks5_skip.GRCh38.walks.bed.gz +0 -0
  182. package/src/RgfaTabixAdapter/test_data/walks5_skip.GRCh38.walks.bed.gz.tbi +0 -0
  183. package/src/RgfaTabixAdapter/test_data/walks5_skipfollow.GRCh38.walks.bed.gz +0 -0
  184. package/src/RgfaTabixAdapter/test_data/walks5_skipfollow.GRCh38.walks.bed.gz.tbi +0 -0
  185. package/src/RgfaTabixAdapter/test_data/walks5_skipinv.GRCh38.walks.bed.gz +0 -0
  186. package/src/RgfaTabixAdapter/test_data/walks5_skipinv.GRCh38.walks.bed.gz.tbi +0 -0
  187. package/src/RgfaTabixAdapter/test_data/walks5_twopart.GRCh38.walks.bed.gz +0 -0
  188. package/src/RgfaTabixAdapter/test_data/walks5_twopart.GRCh38.walks.bed.gz.tbi +0 -0
  189. /package/dist/chunks/{GraphGenomeView-PPOVN5LA.js.map → GraphGenomeView-XFKLX3VQ.js.map} +0 -0
  190. /package/dist/chunks/{GraphTrackSettingsDialog-BRTDTVOJ.js.map → GraphTrackSettingsDialog-KOYYI2XH.js.map} +0 -0
  191. /package/dist/chunks/{HighlightColorDialog-CGW7J3SK.js.map → HighlightColorDialog-F4IARMEO.js.map} +0 -0
  192. /package/dist/chunks/{LinearGraphDisplay-2AZ7X7TK.js.map → LinearGraphDisplay-BZ44C6S3.js.map} +0 -0
  193. /package/dist/chunks/{chunk-APSXG7SV.js.map → chunk-TLUGH4VW.js.map} +0 -0
  194. /package/dist/chunks/{renderSvg-UKXPWKKV.js.map → renderSvg-DLJTA2B3.js.map} +0 -0
@@ -1,15 +1,15 @@
1
1
  import { resolvePanSNPrefix } from '@jbrowse/bandage-core/pansn'
2
- import { WalkReader, referenceNodes, walksKept } from '@jbrowse/graph-walks'
2
+ import { checkRange, walksKept } from '@jbrowse/graph-walks'
3
3
 
4
- import { getLines } from '../tabixRange.ts'
5
4
  import { walkCutFor } from './walkCut.ts'
6
5
 
7
6
  import type { SubgraphAdapterOptions } from '../GetSubgraph.ts'
8
- import type { TabixIndexedFile } from '@gmod/tabix'
7
+ import type { RefNameSource } from '../panSNTabix.ts'
9
8
  import type {
10
9
  BaseFeatureDataAdapter,
11
10
  BaseOptions,
12
11
  } from '@jbrowse/core/data_adapters/BaseAdapter'
12
+ import type { WalkReader } from '@jbrowse/graph-walks'
13
13
 
14
14
  // The zoom-in notices name the config slots that set the budgets
15
15
  export const BUDGET_SLOTS = {
@@ -18,7 +18,7 @@ export const BUDGET_SLOTS = {
18
18
  }
19
19
 
20
20
  // Walk rows read a list of haplotypes, or of the samples they show, this long or
21
- // shorter in full where format 5 abridged it; a longer list, or every
21
+ // shorter in full where the walk file abridged it; a longer list, or every
22
22
  // haplotype, keeps the abridged rows
23
23
  export const EXPAND_NAMED_MAX = 64
24
24
 
@@ -28,14 +28,25 @@ export const EXPAND_NAMED_MAX = 64
28
28
  * budget slots. @jbrowse/graph-walks reads and cuts the file.
29
29
  */
30
30
  export class WalkIndex {
31
- readonly reader: WalkReader
31
+ // What PanSNRefNames reads of the file: its reference sequences, and the
32
+ // bytes a cut of each region fetches, which the directory gives before any
33
+ // row is read
34
+ readonly source: RefNameSource = {
35
+ names: opts => this.reader.referenceSequences(opts),
36
+ bytes: async (regions, opts) => {
37
+ let total = 0
38
+ for (const { refName, start, end } of regions) {
39
+ checkRange(refName, start, end)
40
+ total += await this.reader.bytesFor(refName, { start, end }, opts)
41
+ }
42
+ return total
43
+ },
44
+ }
32
45
 
33
46
  constructor(
34
- readonly file: TabixIndexedFile,
47
+ readonly reader: WalkReader,
35
48
  private adapter: BaseFeatureDataAdapter,
36
- ) {
37
- this.reader = new WalkReader(file)
38
- }
49
+ ) {}
39
50
 
40
51
  /**
41
52
  * The haplotypes the header names, `sample#haplotype` in byte order, or
@@ -56,10 +67,10 @@ export class WalkIndex {
56
67
 
57
68
  /**
58
69
  * The graph display's cut of a window: the reference walk, the walks of
59
- * `haplotypes` (every walk when unset), and the nodes and links they visit,
60
- * with the haplotypes whose deletion spans the window as `skips`, which walk
61
- * rows draw. Walk rows draw runs, so the step budget spares them, and read a
62
- * short list of named walks in full where format 5 abridged them.
70
+ * `haplotypes` (every walk when unset), the nodes and links they visit, and
71
+ * every departure from the reference over the window, which walk rows draw.
72
+ * Walk rows draw runs, so the step budget spares them, and read a short
73
+ * list of named walks in full where the file abridged them.
63
74
  */
64
75
  async subgraph(
65
76
  refName: string,
@@ -93,7 +104,7 @@ export class WalkIndex {
93
104
  const asked = expand?.length
94
105
  ? (name: string) => expand.includes(name)
95
106
  : undefined
96
- const { graph, kept, fragments, skips } = await this.reader.cut(
107
+ const { graph, kept, fragments, departures } = await this.reader.cut(
97
108
  refName,
98
109
  region,
99
110
  {
@@ -109,52 +120,28 @@ export class WalkIndex {
109
120
  : {}),
110
121
  },
111
122
  )
112
- return walkCutFor(graph.tables(kept, fragments, skips), region, walkRows)
123
+ return walkCutFor(
124
+ graph.tables(kept, fragments, departures),
125
+ region,
126
+ walkRows,
127
+ )
113
128
  }
114
129
 
115
130
  /**
116
- * The reference nodes overlapping a window, from the ref rows of its
117
- * chunks. A row's tabix interval is its chunk's first base, and gfa-to-tabix
118
- * files a node crossing in from a chunk before under that chunk, so the read
119
- * starts at queryStart.
131
+ * The reference nodes overlapping a window, each once, from the ref rows of
132
+ * the tiles over it
120
133
  */
121
134
  async referenceNodes(
122
135
  refName: string,
123
136
  region: { start: number; end: number },
124
137
  opts: BaseOptions,
125
138
  ) {
126
- const refRows: string[][] = []
127
- await getLines(
128
- this.file,
129
- refName,
130
- await this.reader.queryStart(region.start, {
131
- ...opts,
132
- refName,
133
- end: region.end,
134
- }),
135
- region.end,
136
- {
137
- signal: opts.signal,
138
- lineCallback: line => {
139
- const cols = line.split('\t')
140
- if (cols[3] === 'ref') {
141
- refRows.push(cols)
142
- }
143
- },
144
- },
145
- )
139
+ const nodes = await this.reader.referenceNodes(refName, region, opts)
146
140
  const seen = new Set<number>()
147
- return referenceNodes(refRows).filter(node => {
148
- if (
149
- node.refName !== refName ||
150
- node.end <= region.start ||
151
- node.start >= region.end ||
152
- seen.has(node.id)
153
- ) {
154
- return false
155
- }
141
+ return nodes.filter(node => {
142
+ const first = !seen.has(node.id)
156
143
  seen.add(node.id)
157
- return true
144
+ return first
158
145
  })
159
146
  }
160
147
  }
@@ -14,14 +14,14 @@ vi.mock('@jbrowse/graph-walks', async importOriginal => {
14
14
  return { ...actual, formsCut: vi.fn(actual.formsCut) }
15
15
  })
16
16
 
17
- // Four walks over a 3.6 kb reference of six 600 bp nodes, in 1 kb chunks
17
+ // Four walks over a 3.6 kb reference of six 600 bp nodes, in 1 kb tiles
18
18
  // (RgfaTabixAdapter/walkFiles.test.ts builds on the same file):
19
19
  // W GRCh38 0 chr1 >1>2>3>4>5>6
20
20
  // W HG002 1 chr1 >1>2>7>4>5>6 7 (550 bp) replaces 3
21
21
  // W HG002 2 chr1 >1>2>3>4>8>6 8 (20 bp) replaces 5
22
22
  // W HG00097 1 chr1 >1>2>3>4>5>6
23
23
  const walks =
24
- require.resolve('../RgfaTabixAdapter/test_data/walks5_header.GRCh38.walks.bed.gz')
24
+ require.resolve('../RgfaTabixAdapter/test_data/walks7/header.GRCh38.walks.gz')
25
25
 
26
26
  const local = (path: string) => ({
27
27
  localPath: path,
@@ -33,7 +33,7 @@ function makeAdapter(slots: Record<string, unknown>) {
33
33
  return new Adapter(
34
34
  configSchema.create({
35
35
  walksLocation: local(walks),
36
- walksIndex: { location: local(`${walks}.tbi`) },
36
+ walksIndex: local(`${walks}.idx`),
37
37
  ...slots,
38
38
  }),
39
39
  )
@@ -51,15 +51,6 @@ const region = (start: number, end: number, refName = 'chr1') => ({
51
51
  const featuresOf = (adapter: Adapter, query = region(0, 3600)) =>
52
52
  firstValueFrom(adapter.getFeatures(query).pipe(toArray()))
53
53
 
54
- const placeholders = (features: Awaited<ReturnType<typeof featuresOf>>) =>
55
- features
56
- .filter(f => f.id().startsWith('forms-reference-'))
57
- .map(f => ({
58
- start: f.get('start'),
59
- end: f.get('end'),
60
- genotypes: f.get('genotypes'),
61
- }))
62
-
63
54
  test('registers the adapter type', () => {
64
55
  const pm = new PluginManager()
65
56
  WalkFormsAdapterF(pm)
@@ -121,17 +112,10 @@ test('features are the pinned window changes, with a genotype per form', async (
121
112
  ])
122
113
  })
123
114
 
124
- test('a query with no change gives one reference placeholder', async () => {
115
+ test('a query with no change gives no features', async () => {
125
116
  const adapter = makeAdapter({ pinned: pinned(3) })
126
- expect(placeholders(await featuresOf(adapter, region(1900, 2300)))).toEqual([
127
- { start: 1900, end: 1901, genotypes: { F1: '0', F2: '0', F3: '0' } },
128
- ])
129
- expect(
130
- placeholders(await featuresOf(adapter, region(0, 3600, 'chr2'))),
131
- ).toHaveLength(1)
132
- expect(
133
- placeholders(await featuresOf(adapter, region(2900, 3600))),
134
- ).toHaveLength(0)
117
+ expect(await featuresOf(adapter, region(1900, 2300))).toEqual([])
118
+ expect(await featuresOf(adapter, region(0, 3600, 'chr2'))).toEqual([])
135
119
  })
136
120
 
137
121
  test('a floor change regroups the cut without cutting again', async () => {
@@ -142,9 +126,7 @@ test('a floor change regroups the cut without cutting again', async () => {
142
126
  expect((await coarse.getSourcesAndWarnings()).sources).toEqual([
143
127
  { name: 'F1', label: '100% · ref', haplotypes: 3, forms: 1 },
144
128
  ])
145
- expect(placeholders(await featuresOf(coarse))).toEqual([
146
- { start: 0, end: 1, genotypes: { F1: '0' } },
147
- ])
129
+ expect(await featuresOf(coarse)).toEqual([])
148
130
  expect(formsCut).toHaveBeenCalledTimes(1)
149
131
  })
150
132
 
@@ -162,9 +144,6 @@ test('maxForms gives the smaller forms one empty row', async () => {
162
144
  expect(warnings).toEqual([
163
145
  expect.stringMatching(/^Forms of chr1:7-3,600: 2 smaller forms/),
164
146
  ])
165
- expect(placeholders(await featuresOf(adapter))).toEqual([
166
- { start: 0, end: 1, genotypes: { F1: '0' } },
167
- ])
168
147
  })
169
148
 
170
149
  test('a pinned window past walkByteBudget says so, without a zoom-in notice', async () => {
@@ -4,7 +4,6 @@ import { ObservableCreate } from '@jbrowse/core/util/rxjs'
4
4
  import {
5
5
  ExpansionTooLargeError,
6
6
  RegionTooLargeError,
7
- WalkReader,
8
7
  bpString,
9
8
  formsCut,
10
9
  panSNContig,
@@ -12,14 +11,9 @@ import {
12
11
  structuralForms,
13
12
  } from '@jbrowse/graph-walks'
14
13
 
15
- import {
16
- formSources,
17
- formVariants,
18
- formWarnings,
19
- referenceGenotypes,
20
- } from './formRows.ts'
14
+ import { formSources, formVariants, formWarnings } from './formRows.ts'
21
15
  import { floorOf, pinnedLocus, pinnedOf, warningPrefix } from './pinned.ts'
22
- import { openTabixSlot } from '../panSNTabix.ts'
16
+ import { openWalkReader } from '../panSNTabix.ts'
23
17
 
24
18
  import type { WalkFormsAdapterConfig } from './configSchema.ts'
25
19
  import type { Pinned } from './pinned.ts'
@@ -85,9 +79,7 @@ function cachedCut(key: string, cut: () => Promise<HaplotypeDepartures[]>) {
85
79
  export default class WalkFormsAdapter extends BaseFeatureDataAdapter<WalkFormsAdapterConfig> {
86
80
  public static capabilities = ['getFeatures', 'getRefNames']
87
81
 
88
- private readonly reader = new WalkReader(
89
- openTabixSlot(this, ['walksLocation'], ['walksIndex']),
90
- )
82
+ private readonly reader = openWalkReader(this)
91
83
 
92
84
  private formsRead: Promise<StructuralForms> | undefined
93
85
 
@@ -118,7 +110,7 @@ export default class WalkFormsAdapter extends BaseFeatureDataAdapter<WalkFormsAd
118
110
 
119
111
  // Read once per adapter, and so once per floor and exclude list. The cut
120
112
  // takes no caller's signal, since every later caller shares it. A partial
121
- // expansion would leave some walks as net changes over a whole chunk, so a
113
+ // expansion would leave some walks as net changes over a whole tile, so a
122
114
  // window too large to read them all errors instead.
123
115
  private forms(opts: BaseOptions) {
124
116
  if (!this.formsRead) {
@@ -209,23 +201,6 @@ export default class WalkFormsAdapter extends BaseFeatureDataAdapter<WalkFormsAd
209
201
  }),
210
202
  )
211
203
  }
212
- // Core before 5.0.0-beta.14 (1845c280a9) sends no payload for a block
213
- // with no records, which leaves the display on "Loading". The reference
214
- // placeholder draws nothing; drop it once the host floor reaches beta.14
215
- if (variants.length === 0) {
216
- const start = Math.floor(query.start)
217
- observer.next(
218
- new SimpleFeature({
219
- uniqueId: `forms-reference-${query.refName}-${start}`,
220
- refName: query.refName,
221
- start,
222
- end: start + 1,
223
- REF: 'N',
224
- ALT: ['.'],
225
- genotypes: referenceGenotypes(result, this.maxForms()),
226
- }),
227
- )
228
- }
229
204
  observer.complete()
230
205
  }, opts.signal)
231
206
  }
@@ -1,11 +1,7 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
2
 
3
3
  import { DEFAULT_MAX_FORMS } from './formRows.ts'
4
- import {
5
- fileLocationSlot,
6
- tabixIndexSchema,
7
- walksLocations,
8
- } from '../panSNTabix.ts'
4
+ import { fileLocationSlot, walksLocations } from '../panSNTabix.ts'
9
5
 
10
6
  import type { Instance } from '@jbrowse/mobx-state-tree'
11
7
 
@@ -17,7 +13,7 @@ import type { Instance } from '@jbrowse/mobx-state-tree'
17
13
  * [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) `--walks` file by the
18
14
  * structural changes their walks make over one pinned window, through
19
15
  * @jbrowse/graph-walks' `formsCut` and `structuralForms`. Each group is a
20
- * form, which `LinearMultiSampleVariantDisplay` draws as one row, and each
16
+ * form, which `LinearVariantDisplay` draws as one row, and each
21
17
  * change a variant whose genotype is `1` in the forms that make it.
22
18
  *
23
19
  * - The adapter cuts the pinned window once, whatever the view shows; outside
@@ -28,13 +24,15 @@ import type { Instance } from '@jbrowse/mobx-state-tree'
28
24
  * - A variant's `consequence` is `loss`, `gain`, `shift`, `inversion` or
29
25
  * `net`, for colouring the cells; `svType` and `type` follow core's names
30
26
  * - `walksUri` takes the prefix of one reference's walk file and resolves
31
- * `<walksUri>.walks.bed.gz` and its `.tbi`, as the other walk adapters do
27
+ * `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`, as
28
+ * the other walk adapters do. The adapter reads walk format 7, which
29
+ * gfa-to-tabix writes from 4.0
32
30
  *
33
31
  * #example
34
32
  * ```js
35
33
  * {
36
34
  * type: 'WalkFormsAdapter',
37
- * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f5s.GRCh38',
35
+ * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.GRCh38',
38
36
  * pinned: { refName: 'chr1', start: 109680000, end: 109715000 },
39
37
  * exclude: ['CHM13'],
40
38
  * }
@@ -45,13 +43,15 @@ const WalkFormsAdapter = ConfigurationSchema(
45
43
  {
46
44
  /**
47
45
  * #slot
48
- * a `gfa-to-tabix --walks` file in walk format 5
46
+ * a `gfa-to-tabix --walks` file in walk format 7
49
47
  */
50
- walksLocation: fileLocationSlot('/path/to/graph.walks.bed.gz'),
48
+ walksLocation: fileLocationSlot('/path/to/graph.walks.gz'),
51
49
  /**
52
50
  * #slot
51
+ * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset
52
+ * reads it beside the walk file.
53
53
  */
54
- walksIndex: tabixIndexSchema('WalkFormsWalksIndex'),
54
+ walksIndex: fileLocationSlot(''),
55
55
  /**
56
56
  * #slot
57
57
  * The window the forms come from, `{ refName, start, end }`, 0-based and
@@ -94,8 +94,8 @@ const WalkFormsAdapter = ConfigurationSchema(
94
94
  },
95
95
  /**
96
96
  * #slot
97
- * The most compressed bytes the forms cut fetches from the walk file, as
98
- * its Tabix index estimates it before any row is read. A pinned window
97
+ * The most compressed bytes the forms cut fetches from the walk file,
98
+ * which its directory gives before any row is read. A pinned window
99
99
  * over it shows an error instead. 1 MB holds about 1 Mb of the MHC, whose
100
100
  * cut takes 13 s and 0.8 GB.
101
101
  */
@@ -6,7 +6,6 @@ import {
6
6
  formSources,
7
7
  formVariants,
8
8
  formWarnings,
9
- referenceGenotypes,
10
9
  } from './formRows.ts'
11
10
 
12
11
  import type { Departure, HaplotypeDepartures } from '@jbrowse/graph-walks'
@@ -35,7 +34,6 @@ const haplotype = (
35
34
  haplotype: name,
36
35
  covered,
37
36
  departures,
38
- open: false,
39
37
  })
40
38
 
41
39
  const deletion = departure(1000, 3000, 0)
@@ -189,11 +187,6 @@ test('past maxForms the smaller forms share one empty row', () => {
189
187
  )
190
188
  })
191
189
 
192
- test('reference genotypes cover the forms with a row of their own', () => {
193
- expect(referenceGenotypes(result, 2)).toEqual({ F1: '0', F2: '0' })
194
- expect(Object.keys(referenceGenotypes(result, Infinity))).toHaveLength(12)
195
- })
196
-
197
190
  test('one form past maxForms keeps its own row', () => {
198
191
  expect(formSources(result, 11).map(s => s.name)).not.toContain(OTHER_FORMS)
199
192
  expect(formSources(result, 10).at(-1)?.name).toBe(OTHER_FORMS)
@@ -147,18 +147,6 @@ export function formWarnings(
147
147
  ]
148
148
  }
149
149
 
150
- // Genotype `0` in every form with a row of its own
151
- export function referenceGenotypes(
152
- result: StructuralForms,
153
- maxForms = DEFAULT_MAX_FORMS,
154
- ): Record<string, string> {
155
- return Object.fromEntries(
156
- result.forms
157
- .slice(0, shownCount(result, maxForms))
158
- .map((_, j) => [formName(j), '0']),
159
- )
160
- }
161
-
162
150
  export interface FormVariant {
163
151
  id: string
164
152
  start: number
@@ -93,7 +93,7 @@ const makeView = (adapter: Record<string, unknown>) => makeSession(adapter).view
93
93
 
94
94
  const formsAdapter = {
95
95
  type: 'WalkFormsAdapter',
96
- walksLocation: { uri: 'x.walks.bed.gz', locationType: 'UriLocation' },
96
+ walksLocation: { uri: 'x.walks.gz', locationType: 'UriLocation' },
97
97
  pinned: LPA,
98
98
  }
99
99