jbrowse-plugin-graphgenomeviewer 4.0.6 → 4.0.8

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/README.md +41 -239
  2. package/dist/chunks/AddTrackWorkflow-LRRSAVSX.js +2 -0
  3. package/dist/chunks/AddTrackWorkflow-LRRSAVSX.js.map +7 -0
  4. package/dist/chunks/{GbzBaseSyntenyAdapter-BLSUE5LT.js → GbzBaseSyntenyAdapter-WI3VYEF2.js} +5 -5
  5. package/dist/chunks/{GbzBaseSyntenyAdapter-BLSUE5LT.js.map → GbzBaseSyntenyAdapter-WI3VYEF2.js.map} +4 -4
  6. package/dist/chunks/GraphGenomeView-K5PZO33Q.js +10 -0
  7. package/dist/chunks/GraphGenomeView-K5PZO33Q.js.map +7 -0
  8. package/dist/chunks/GraphTrackSettingsDialog-6STIFKVD.js +4 -0
  9. package/dist/chunks/GraphTrackSettingsDialog-6STIFKVD.js.map +7 -0
  10. package/dist/chunks/LinearGraphDisplay-3WQBA6ZX.js +2 -0
  11. package/dist/chunks/LinearGraphDisplay-3WQBA6ZX.js.map +7 -0
  12. package/dist/chunks/chunk-254OZVVL.js +2 -0
  13. package/dist/chunks/chunk-254OZVVL.js.map +7 -0
  14. package/dist/chunks/chunk-5TBIQWPH.js +4 -0
  15. package/dist/chunks/chunk-5TBIQWPH.js.map +7 -0
  16. package/dist/chunks/chunk-JVMMNMQG.js +2 -0
  17. package/dist/chunks/chunk-JVMMNMQG.js.map +7 -0
  18. package/dist/chunks/chunk-NBDRTXH2.js +2 -0
  19. package/dist/chunks/chunk-NBDRTXH2.js.map +7 -0
  20. package/dist/chunks/chunk-VXUVWSY5.js +2 -0
  21. package/dist/chunks/chunk-VXUVWSY5.js.map +7 -0
  22. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +2 -2
  23. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  24. package/package.json +3 -1
  25. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +45 -1
  26. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts +26 -114
  27. package/src/GbzBaseSyntenyAdapter/configSchema.ts +1 -1
  28. package/src/GbzBaseSyntenyAdapter/gbzWindow.ts +166 -0
  29. package/src/GbzBaseSyntenyAdapter/index.ts +1 -2
  30. package/src/GetSubgraph.test.ts +1 -1
  31. package/src/GetSubgraph.ts +8 -1
  32. package/src/GraphAddTrackWorkflow/buildTrackConfig.test.ts +1 -5
  33. package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +7 -15
  34. package/src/GraphComputeLayout.ts +7 -13
  35. package/src/GraphGenomeView/bubbles/bubbleHalos.test.ts +12 -1
  36. package/src/GraphGenomeView/bubbles/bubbleHalos.ts +16 -11
  37. package/src/GraphGenomeView/bubbles/classifyBubble.test.ts +47 -12
  38. package/src/GraphGenomeView/bubbles/classifyBubble.ts +45 -6
  39. package/src/GraphGenomeView/colorSchemes.ts +16 -0
  40. package/src/GraphGenomeView/components/BubbleHalos.tsx +10 -96
  41. package/src/GraphGenomeView/components/BubbleOverlay.tsx +18 -37
  42. package/src/GraphGenomeView/components/ColorSchemeSelect.tsx +3 -3
  43. package/src/GraphGenomeView/components/GenePins.tsx +7 -47
  44. package/src/GraphGenomeView/components/GraphCanvas.tsx +98 -68
  45. package/src/GraphGenomeView/components/GraphGenomeView.test.tsx +3 -3
  46. package/src/GraphGenomeView/components/GraphGenomeView.tsx +2 -2
  47. package/src/GraphGenomeView/components/GraphLoadStatus.tsx +2 -2
  48. package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +11 -11
  49. package/src/GraphGenomeView/components/GraphStats.tsx +3 -4
  50. package/src/GraphGenomeView/components/GraphToolbar.tsx +5 -5
  51. package/src/GraphGenomeView/components/ImportForm.tsx +2 -2
  52. package/src/GraphGenomeView/components/LabelChip.tsx +1 -1
  53. package/src/GraphGenomeView/components/LabelLayer.tsx +106 -0
  54. package/src/GraphGenomeView/components/LayoutSelect.tsx +3 -3
  55. package/src/GraphGenomeView/components/RepeatSelect.tsx +3 -3
  56. package/src/GraphGenomeView/components/SettingsMenu.tsx +2 -2
  57. package/src/GraphGenomeView/components/TubeMapOverlay.tsx +70 -0
  58. package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +13 -6
  59. package/src/GraphGenomeView/components/WalkSelect.tsx +2 -2
  60. package/src/GraphGenomeView/graphLabels.ts +74 -75
  61. package/src/GraphGenomeView/host.ts +4 -3
  62. package/src/GraphGenomeView/index.ts +1 -1
  63. package/src/GraphGenomeView/labelLayout.test.ts +221 -0
  64. package/src/GraphGenomeView/labelLayout.ts +227 -0
  65. package/src/GraphGenomeView/layout/tubeMapLayout.test.ts +95 -0
  66. package/src/GraphGenomeView/layout/tubeMapLayout.ts +276 -0
  67. package/src/GraphGenomeView/layoutModes.ts +27 -0
  68. package/src/GraphGenomeView/model.test.ts +105 -316
  69. package/src/GraphGenomeView/model.ts +533 -876
  70. package/src/GraphGenomeView/nodeWidths.ts +21 -0
  71. package/src/GraphGenomeView/{components/overlayLabels.test.ts → overlayLabels.test.ts} +17 -2
  72. package/src/GraphGenomeView/{components/overlayLabels.ts → overlayLabels.ts} +47 -18
  73. package/src/GraphGenomeView/pipeline.ts +236 -0
  74. package/src/GraphGenomeView/renderPasses.bench.ts +32 -24
  75. package/src/GraphGenomeView/renderPipeline.test.ts +8 -1
  76. package/src/GraphGenomeView/renderer/recordingCanvas.ts +1 -2
  77. package/src/GraphGenomeView/subgraphLoad.test.ts +20 -12
  78. package/src/GraphGenomeView/tubeMap/draw.ts +264 -0
  79. package/src/GraphGenomeView/tubeMap/frame.test.ts +59 -0
  80. package/src/GraphGenomeView/tubeMap/frame.ts +78 -0
  81. package/src/GraphGenomeView/tubeMap/warp.test.ts +58 -0
  82. package/src/GraphGenomeView/tubeMap/warp.ts +99 -0
  83. package/src/GraphGenomeView/types.ts +8 -4
  84. package/src/GraphGenomeView/viewModel.ts +135 -0
  85. package/src/GraphGenomeView/viewport.ts +91 -0
  86. package/src/GraphTrack/index.ts +53 -0
  87. package/src/LaunchGraphGenomeView.ts +3 -3
  88. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +178 -63
  89. package/src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx +22 -0
  90. package/src/LinearGraphDisplay/components/LinearGraphDisplay.tsx +15 -36
  91. package/src/{GraphGenomeView → LinearGraphDisplay}/components/SubgraphContextSelect.tsx +7 -10
  92. package/src/{GraphGenomeView → LinearGraphDisplay}/components/SubgraphHaplotypesField.tsx +11 -12
  93. package/src/LinearGraphDisplay/configSchema.ts +1 -2
  94. package/src/LinearGraphDisplay/index.ts +12 -9
  95. package/src/LinearGraphDisplay/model.ts +295 -234
  96. package/src/RgfaTabixAdapter/configSchema.ts +1 -1
  97. package/src/RgfaTabixAdapter/index.ts +1 -1
  98. package/src/core.test.ts +109 -0
  99. package/src/core.ts +149 -0
  100. package/src/graphTrackConfig.test.ts +20 -0
  101. package/src/graphTrackConfig.ts +33 -0
  102. package/src/graphTrackDefaults/graphTrackDefaults.test.ts +71 -0
  103. package/src/graphTrackDefaults/index.ts +88 -0
  104. package/src/hoverSync/graphViewHighlights.test.ts +2 -2
  105. package/src/hoverSync/graphViewHighlights.ts +16 -17
  106. package/src/index.ts +4 -0
  107. package/src/launchFromGraph/launchFromGraph.ts +7 -2
  108. package/src/launchFromGraph/launchTracks.ts +2 -3
  109. package/src/launchFromGraph/syntenyTracks.ts +1 -1
  110. package/src/version.ts +1 -1
  111. package/dist/chunks/AddTrackWorkflow-I4EPGFPJ.js +0 -2
  112. package/dist/chunks/AddTrackWorkflow-I4EPGFPJ.js.map +0 -7
  113. package/dist/chunks/GraphGenomeView-XPAI2P62.js +0 -10
  114. package/dist/chunks/GraphGenomeView-XPAI2P62.js.map +0 -7
  115. package/dist/chunks/GraphSettingsDialog-KQK4YZN5.js +0 -2
  116. package/dist/chunks/GraphSettingsDialog-KQK4YZN5.js.map +0 -7
  117. package/dist/chunks/LinearGraphDisplay-K4WU7WQ4.js +0 -2
  118. package/dist/chunks/LinearGraphDisplay-K4WU7WQ4.js.map +0 -7
  119. package/dist/chunks/chunk-5T6MYZYN.js +0 -2
  120. package/dist/chunks/chunk-5T6MYZYN.js.map +0 -7
  121. package/dist/chunks/chunk-HG4BVF35.js +0 -4
  122. package/dist/chunks/chunk-HG4BVF35.js.map +0 -7
  123. package/dist/chunks/chunk-OHT6UX4C.js +0 -4
  124. package/dist/chunks/chunk-OHT6UX4C.js.map +0 -7
  125. package/dist/chunks/chunk-OP7IRVG6.js +0 -2
  126. package/dist/chunks/chunk-OP7IRVG6.js.map +0 -7
  127. package/src/GraphGenomeView/laneRamp.test.ts +0 -97
  128. package/src/GraphGenomeView/laneRamp.ts +0 -88
  129. package/src/launchSubgraph/launchSubgraphView.ts +0 -132
  130. package/src/launchSubgraph/subgraphTracks.test.ts +0 -165
  131. package/src/launchSubgraph/subgraphTracks.ts +0 -151
  132. package/src/launchSubgraph/testEnv.ts +0 -255
package/README.md CHANGED
@@ -1,267 +1,69 @@
1
1
  # jbrowse-plugin-graphgenomeviewer
2
2
 
3
- A JBrowse 2 plugin that draws a pangenome graph (GFA / rGFA) as a track of a
4
- linear genome view, and as a **GraphGenomeView** of its own for a whole file.
5
-
6
- ## Screenshots
7
-
8
- The LPA KIV-2 window of the HPRC release 2 graph in the **force-directed
9
- layout**: the GRCh38 backbone runs left to right, coloured by position the way
10
- the rGFA segments track above it is, and the kringle repeat array is the knot of
11
- loops in the middle. Each bubble the graph holds is haloed along its own nodes
12
- and labelled by what it is; the label opens the bubble on its own.
3
+ Pangenome graphs in JBrowse 2.
13
4
 
14
5
  ![KIV-2, force-directed, with its bubbles marked](img/force_kiv2.png)
15
6
 
16
- Clicking the array's label opens its 29 segments in the same layout, with a
17
- button back to the window. A popped graph derives its own bubbles, so a
18
- superbubble opens level by level:
19
-
20
- ![The KIV-2 array popped open](img/force_kiv2_popped.png)
21
-
22
- Over a gbz-base database the cut carries the haplotypes' walks. A node draws
23
- thicker the more of them carry it, Bandage's depth as width, and every route
24
- through a bubble is labelled at the far point of its loop for the haplotypes
25
- that take it and how long it is, so the array reads as one copy count per
26
- haplotype:
27
-
28
- ![KIV-2 over gbz-base, eight haplotypes, force-directed](img/force_kiv2_gbz.png)
29
-
30
- Picking one walk lifts it out of the drawing. HG00133's route through the window
31
- keeps its ink and the other haplotypes fade; the readout says it carries 116 kb
32
- more than GRCh38 through the array:
33
-
34
- ![HG00133's walk lifted out of the KIV-2 cut](img/force_kiv2_walk.png)
35
-
36
- MHC class II, where one 254-segment superbubble covers the DRB haplotype block
37
- and a run of small indels follows it. The session's gene track is drawn onto the
38
- graph: exons as dark stretches along the backbone nodes that carry them, and
39
- each gene's name pinned under the backbone at its midpoint, so the superbubble
40
- reads as HLA-DRB5's and the indels as HLA-DRB6's and HLA-DRB1's:
7
+ ![Tube maps, and a tube map track under a linear view](img/tube_map.png)
41
8
 
42
- ![MHC class II, force-directed, with genes on the backbone](img/force_mhc.png)
9
+ - Eight layouts: force-directed (Bandage FMMM), variant map, ordered, anchored,
10
+ sample rows, walk rows, and sequenceTubeMap's tube map on its own axis or the
11
+ reference's
12
+ - Bubbles from `gfatools bubble` or the graph itself, opened level by level
13
+ - gbz-base haplotypes as walks: carriage as node thickness, one walk lifted out
43
14
 
44
- The KIV-2 window as a **variant map**, the reference as one line with one typed
45
- glyph per bubble:
15
+ ## Usage
46
16
 
47
- ![Variant map of KIV-2](img/variant_map_kiv2.png)
48
-
49
- It ships six layouts:
50
-
51
- - **Force-directed**: the graph's shape, computed by the OGDF FMMM engine from
52
- [Bandage](https://github.com/rrwick/Bandage), seeded along the reference and
53
- turned to read left to right. The engine lays out unbranching runs rather than
54
- nodes, so a base-level cut of 15,000 nodes draws in a few seconds. The Walk
55
- picker lifts one haplotype out: its route keeps its ink, the rest fades, and a
56
- readout gives its length against the reference.
57
- - **Variant map** (rGFA or a reference path): the reference as a line, one typed
58
- glyph per bubble, click to open a bubble's graph, and again for a bubble
59
- inside it.
60
- - **Ordered** (rGFA or a reference path): x is reference order rather than bp,
61
- so every node gets room and a bubble reads as a lens. Scrolls sideways.
62
- - **Anchored** (rGFA or a reference path): x is reference bp, one row per stable
63
- rank, aligned under a linear view.
64
- - **Sample rows**: x is reference bp, one row per contributing assembly.
65
- - **Walk rows** (W or P lines): x is each walk's own bp, one bar per haplotype,
66
- sequence the reference also carries in blue and sequence it does not in
67
- purple, so a repeat expansion reads as bar length. The Repeat picker tiles the
68
- bars by a repeat annotation's unit and marks the allele a genotyper called.
69
-
70
- The bubbles come from `gfatools bubble` output beside the rGFA index
71
- (`<prefix>.bubbles.bed.gz`), which HPRC's hosted graph has and
72
- `scripts/build_rgfa_tabix.sh` in jbrowse-components writes, or, for a graph with
73
- no index, a GBZ cut, a pggb file or a popped bubble, from the graph itself off
74
- the ordered layout's layering. Every node layout marks them as halos; the
75
- variant map draws them as glyphs.
76
-
77
- ### The graph as a track
78
-
79
- A graph track's display is `LinearGraphDisplay`. It cuts the view's window plus
80
- a window-width each side and re-cuts once the view leaves the cut, keeping its
81
- sample rows in the order they were drawn. On a layout whose x is reference bp,
82
- such as Anchored, Sample rows, Walk rows or the Variant map, the graph draws
83
- under the view's own coordinates and pans and zooms with it. The force-directed
84
- and ordered layouts draw in their own coordinates inside the track, fitted to
85
- it, with their own zoom in the track menu, the way a variant matrix does. The
86
- track menu also picks the layout, the colour, a walk to lift out, and opens the
87
- settings.
17
+ Needs JBrowse 5.0.0-beta.9 or later.
88
18
 
89
19
  ```json
90
20
  {
91
- "type": "FeatureTrack",
92
- "trackId": "hprc_graph",
93
- "name": "HPRC release 2 graph",
94
- "assemblyNames": ["hg38"],
95
- "adapter": { "type": "RgfaTabixAdapter", "uri": "https://example.com/hprc" },
96
- "displays": [
97
- {
98
- "type": "LinearGraphDisplay",
99
- "displayId": "hprc_graph-LinearGraphDisplay"
100
- },
21
+ "plugins": [
101
22
  {
102
- "type": "LinearBasicDisplay",
103
- "displayId": "hprc_graph-LinearBasicDisplay"
23
+ "name": "GraphGenomeView",
24
+ "esmUrl": "https://unpkg.com/jbrowse-plugin-graphgenomeviewer/dist/jbrowse-plugin-graphgenomeviewer.esm.js"
104
25
  }
105
26
  ]
106
27
  }
107
28
  ```
108
29
 
109
- The first display is the one the track opens with; the second is the segments
110
- lane, one block per segment, reachable from the track menu.
111
-
112
- A fine cut spans at most 5 Mb. An rGFA track can carry a coarse tier, one node
113
- per bubble, built by `build_bubble_tier.sh` in jbrowse-components; past
114
- `aboveBpPerPx` in the linear view the track cuts that pair instead, with no bp
115
- cap:
116
-
117
- ```json
118
- {
119
- "type": "RgfaTabixAdapter",
120
- "uri": "https://example.com/hprc-v2.0-mc-grch38",
121
- "coarse": {
122
- "uri": "https://example.com/hprc-v2.0-mc-grch38.tier10000",
123
- "aboveBpPerPx": 1000
124
- }
125
- }
126
- ```
127
-
128
- **Add → Graph genome view** opens a whole GFA file in a view of its own, with
129
- the same layouts and its own pan and zoom.
130
-
131
- ### Demonstration loci
132
-
133
- Six HPRC release 2 windows, the ones the
134
- [HPRC tutorials](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc/) walk
135
- through, are the standing test set for layout screenshots. Each cuts to under
136
- 300 nodes and shows a different kind of variation:
137
-
138
- | Locus | Window | What it shows |
139
- | ------------ | ------------------------------ | ----------------------------------- |
140
- | LPA KIV-2 | `chr6:160,525,000-160,655,000` | the kringle repeat, copy per loop |
141
- | MHC class II | `chr6:32,510,000-32,600,000` | DRB haplotypes, dozens of alleles |
142
- | AMY1 | `chr1:103,690,000-103,780,000` | amylase copy number |
143
- | C4 | `chr6:31,980,000-32,050,000` | one bubble over the C4 duplication |
144
- | CFH | `chr1:196,640,000-196,900,000` | an 84 kb deletion as a bare edge |
145
- | KIR | `chr19:54,750,000-54,840,000` | the KIR cluster, densest of the six |
146
-
147
- [docs/layout-experiments.md](docs/layout-experiments.md) draws all six in every
148
- layout the plugin has and in the ones proposed to replace them, and
149
- `scripts/layout-lab/` reproduces the figures.
150
-
151
- ## License (GPL-3.0)
152
-
153
- This plugin is **GPL-3.0-or-later**. The force-directed layout is computed by a
154
- WebAssembly build of Bandage's FMMM layout from [OGDF](https://ogdf.github.io/),
155
- and both Bandage and OGDF are GPL-licensed, so this plugin takes the same
156
- license rather than linking around it.
157
-
158
- JBrowse itself is unaffected and stays Apache-2.0: this is a separate plugin,
159
- loaded at runtime only by configs that ask for it. The anchored and sample-row
160
- layouts are pure TypeScript and need no external engine.
161
-
162
- ## Developing
163
-
164
- Requires [pnpm](https://pnpm.io/installation). The plugin builds against the
165
- published `@jbrowse/*` packages at 5.0.0-beta.9 and needs a host of at least
166
- that version: it hands its RPC calls an AbortSignal, which an earlier JBrowse 5
167
- beta cannot post to its worker.
168
-
169
- ```console
170
- pnpm install
171
- pnpm start # esbuild watch, serves dist/out.js on :9000 with CORS
172
- ```
173
-
174
- In another terminal, serve a JBrowse Web that points at `config.json` (its
175
- `plugins` entry already targets `http://localhost:9000/dist/out.js`).
176
-
177
- ## Building
178
-
179
- ```console
180
- pnpm build # native ESM bundle via esbuild (code-split)
181
- pnpm typecheck # tsc, separately — esbuild strips types without checking them
182
- ```
183
-
184
- This writes the plugin to `dist/`, and the **whole directory must be served
185
- together** — the entry loads its sibling chunks relative to its own url:
186
-
187
- - `jbrowse-plugin-graphgenomeviewer.esm.js` — the plugin entry
188
- - `chunks/bandage-layout-<hash>.js` — the Bandage layout engine (~425kb),
189
- imported on demand and named by content hash so a redeployed engine is never
190
- served from cache
191
- - `chunks/*.js` — other lazily-loaded code split out of the entry
192
-
193
- Load the plugin from any JBrowse config, 5.0.0-beta.9 or later, with an
194
- `esmUrl`:
30
+ - **File → Open track** opens an rGFA index (`.segs.bed.gz` from
31
+ `build_rgfa_tabix.sh`) or a gbz-base database (`.gbz.db`) as a `GraphTrack`
32
+ - **Add → Graph genome view** opens a whole GFA file
33
+ - A hand-written track needs only the adapter:
195
34
 
196
35
  ```json
197
36
  {
198
- "plugins": [
199
- {
200
- "name": "GraphGenomeView",
201
- "esmUrl": "https://unpkg.com/jbrowse-plugin-graphgenomeviewer/dist/jbrowse-plugin-graphgenomeviewer.esm.js"
37
+ "type": "GraphTrack",
38
+ "trackId": "hprc_graph",
39
+ "name": "HPRC release 2 graph",
40
+ "assemblyNames": ["hg38"],
41
+ "adapter": {
42
+ "type": "RgfaTabixAdapter",
43
+ "uri": "https://example.com/hprc",
44
+ "coarse": {
45
+ "uri": "https://example.com/hprc.tier10000",
46
+ "aboveBpPerPx": 1000
202
47
  }
203
- ]
48
+ }
204
49
  }
205
50
  ```
206
51
 
207
- Note: ESM plugins are loaded via a dynamic `import()`, which cannot carry a
208
- subresource-integrity hash the way a UMD `<script integrity>` can — there is
209
- nowhere to put a digest. For a deployment that needs pinned, tamper-evident
210
- bytes, serve the plugin from an immutable, version-pinned url on a host you
211
- control. The engine chunk is already immutable by content hash.
212
-
213
- The engine is a lazy chunk: it is only fetched the first time someone selects
214
- the force-directed layout, so sessions that use the anchored or sample-row
215
- layouts never download it. Its url is not configured anywhere — `loadBandage` is
216
- a plain dynamic `import()`, so the browser resolves the chunk relative to the
217
- plugin module's own url (`import.meta.url`, defined on the main thread and in
218
- the RPC worker alike). That is why the whole `dist/` has to be served together,
219
- and it is also why there is nothing to point elsewhere: to host the engine on
220
- another origin, rebuild with the chunk emitted there.
221
-
222
- ### Rebuilding the engine
223
-
224
- `src/bandage/bandage-layout.js` is a committed build artifact, so a normal
225
- `pnpm build` never needs Emscripten. Regenerate it only when the C++ layout
226
- sources change:
227
-
228
- ```console
229
- pnpm build:wasm # needs emsdk, nothing else
230
- ```
231
-
232
- Emscripten is the only thing you have to install. OGDF is vendored at
233
- `vendor/ogdf` (a stock checkout of it does not build for wasm at all — see
234
- [`vendor/README.md`](vendor/README.md)), so this works offline from a fresh
235
- clone of this repo alone. Roughly four minutes the first time, seconds after
236
- that.
237
-
238
- It compiles with `-sSINGLE_FILE=1`, embedding the wasm as base64 so the result
239
- is one self-contained ES module that esbuild can copy rather than bundle.
52
+ - The track menu picks layout, colour and walk, and switches to the segments
53
+ lane or, for gbz-base, the haplotype lanes
54
+ - Cuts the window plus a window each side, up to 5 Mb; past `aboveBpPerPx`, the
55
+ `coarse` tier (`build_bubble_tier.sh` in jbrowse-components)
56
+ - gbz-base swaps in `{ "type": "GbzBaseSyntenyAdapter", "uri": "….gbz.db" }`; an
57
+ `hg38` or `hs1` track finds the graph's GRCh38 or CHM13 reference sample, and
58
+ `assemblyNameToPanSN` covers other names
240
59
 
241
- A rebuild has to be checked against the drawing rather than against the file,
242
- since the artifact's bytes move for reasons the layout does not — see
243
- [`src/bandage/README.md`](src/bandage/README.md) for
244
- `scripts/layout-digest.mjs`.
60
+ ## Docs
245
61
 
246
- ## Testing
247
-
248
- ```console
249
- pnpm test # vitest unit tests
250
- pnpm test:watch
251
- pnpm test:wasm # runs the committed Bandage engine, no deps needed
252
- pnpm test:e2e # puppeteer, opt-in — see test/README.md
253
- pnpm host-compat # boots dist/ on the hosted JBrowse releases and cuts a graph
254
- pnpm lint
255
- pnpm typecheck
256
- ```
62
+ - [docs/layouts.md](docs/layouts.md) — layouts, bubbles, walks, genes, loci
63
+ - [docs/developing.md](docs/developing.md) — building, testing, `host-compat`
64
+ - [docs/layout-experiments.md](docs/layout-experiments.md) — every locus in
65
+ every layout
257
66
 
258
- `pnpm test:e2e` drives the force layout through a real JBrowse in a headless
259
- browser, behind `RUN_E2E=1` because it needs a jbrowse-web build to serve;
260
- [`test/README.md`](test/README.md) explains how to run it.
67
+ ## License
261
68
 
262
- `pnpm host-compat` is the check a publish has to pass, and `pnpm version` runs
263
- it. It serves the built `dist/` to a real shipped config on each hosted release
264
- and cuts a subgraph there, because the failures it catches pass tsc, eslint and
265
- the unit tests: an RPC argument a released core cannot post to its worker, or a
266
- re-export the host no longer serves, shows only when the bundle runs on the
267
- host.
69
+ GPL-3.0-or-later (the wasm FMMM engine is OGDF, GPL).
@@ -0,0 +1,2 @@
1
+ import{a as F,b as T,e as y}from"./chunk-JVMMNMQG.js";import"./chunk-D7XFR2IV.js";import{a as N}from"./chunk-J4OLMLS5.js";import{a as W}from"./chunk-FCWXYIFC.js";import{a as C,b as B,c as H,d as _,e as O}from"./chunk-XEJ47DLD.js";import{a as w,b as t}from"./chunk-FY3BTKY4.js";var S=w((q,L)=>{L.exports=JBrowseExports["@jbrowse/core/util/tss-react"]});var s=t(O(),1),i=t(_(),1),l=t(N(),1),A=t(S(),1),R=t(W(),1),e=t(H(),1),x=t(B(),1);var o=t(C(),1),j=(0,A.makeStyles)()(n=>({paper:{margin:n.spacing(),padding:n.spacing()},field:{marginTop:n.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),D=["RgfaTabixAdapter","MinigraphBubbleAdapter"],J=(0,x.observer)(function({model:r}){let{classes:c}=j(),h=(0,l.getSession)(r),b=(0,R.getRoot)(r),[m,G]=(0,s.useState)("RgfaTabixAdapter"),[p,v]=(0,s.useState)(),[g,P]=(0,s.useState)(),[u,I]=(0,s.useState)(""),[d,M]=(0,s.useState)("Pangenome graph"),[f,k]=(0,s.useState)();function E(){if(!(!p||!r.assembly))try{k(void 0);let a=d.trim();(0,l.addTrackFromWidget)({model:r,session:h,conf:y({choice:m,loc:p,indexLoc:g,assembly:r.assembly,sample:u,trackId:(0,l.makeTrackId)({name:a}),name:a})})}catch(a){k(a)}}return(0,o.jsxs)(e.Paper,{className:c.paper,children:[f?(0,o.jsx)(i.ErrorMessage,{error:f}):null,(0,o.jsxs)(e.FormControl,{children:[(0,o.jsx)(e.FormLabel,{children:"File type"}),(0,o.jsx)(e.RadioGroup,{value:m,onChange:a=>{G(a.target.value)},children:D.map(a=>(0,o.jsx)(e.FormControlLabel,{value:a,control:(0,o.jsx)(e.Radio,{}),label:F[a]},a))})]}),(0,o.jsx)(i.FileSelector,{location:p,name:T[m],rootModel:b,setLocation:v}),(0,o.jsx)(i.FileSelector,{location:g,name:"Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)",rootModel:b,setLocation:P}),(0,o.jsx)(e.TextField,{className:c.field,value:u,onChange:a=>{I(a.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:"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}),(0,o.jsx)(e.TextField,{className:c.field,value:d,helperText:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:a=>{M(a.target.value)}}),(0,o.jsx)(i.AssemblySelector,{session:h,helperText:"Select assembly to add track to",selected:r.assembly,onChange:a=>{r.setAssembly(a)},fullWidth:!0}),(0,o.jsx)(e.Button,{variant:"contained",className:c.submit,disabled:!p||!d.trim()||!r.assembly,onClick:E,children:"Submit"})]})}),K=J;export{K as default};
2
+ //# sourceMappingURL=AddTrackWorkflow-LRRSAVSX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["global-externals:@jbrowse/core/util/tss-react", "../../src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx"],
4
+ "sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/core/util/tss-react\"];", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport { addTrackFromWidget, getSession, makeTrackId } from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot } 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 buildTrackConfig,\n} from './buildTrackConfig'\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 '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 [sample, setSample] = useState('')\n const [trackName, setTrackName] = useState('Pangenome graph')\n const [error, setError] = useState<unknown>()\n\n function handleSubmit() {\n if (!loc || !model.assembly) {\n return\n }\n try {\n setError(undefined)\n const name = trackName.trim()\n addTrackFromWidget({\n model,\n session,\n conf: buildTrackConfig({\n choice,\n loc,\n indexLoc,\n assembly: model.assembly,\n sample,\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 }}\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=\"Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)\"\n rootModel={rootModel}\n setLocation={setIndexLoc}\n />\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=\"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 placeholder=\"GRCh38\"\n fullWidth\n />\n <TextField\n className={classes.field}\n value={trackName}\n helperText=\"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}\n onClick={handleSubmit}\n >\n Submit\n </Button>\n </Paper>\n )\n})\n\nexport default GraphAddTrackWidget\n"],
5
+ "mappings": "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",
6
+ "names": ["require_tss_react", "__commonJSMin", "exports", "module", "import_react", "import_ui", "import_util", "import_tss_react", "import_mobx_state_tree", "import_material", "import_mobx_react", "import_jsx_runtime", "useStyles", "theme", "CHOICES", "GraphAddTrackWidget", "model", "classes", "session", "rootModel", "choice", "setChoice", "loc", "setLoc", "indexLoc", "setIndexLoc", "sample", "setSample", "trackName", "setTrackName", "error", "setError", "handleSubmit", "name", "buildTrackConfig", "e", "event", "option", "GRAPH_FILE_LABELS", "GRAPH_FILE_FIELDS", "arg", "AddTrackWorkflow_default"]
7
+ }