@jbrowse/bandage-core 11.7.3 → 11.9.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 (99) hide show
  1. package/README.md +59 -19
  2. package/dist/bubbles/bubbleHalos.js +6 -6
  3. package/dist/bubbles/classifyBubble.js +5 -5
  4. package/dist/bubbles/superbubbles.js +7 -7
  5. package/dist/chunks/{chunk-K4KVAMEF.js → chunk-2A6Z2DHF.js} +1 -1
  6. package/dist/chunks/{chunk-4SN7R4UF.js → chunk-2MXFG3W7.js} +1 -1
  7. package/dist/chunks/chunk-3BDQQTXY.js +568 -0
  8. package/dist/chunks/{chunk-QXBQDHKL.js → chunk-3BOREHCJ.js} +80 -38
  9. package/dist/chunks/{chunk-F4CDC72I.js → chunk-3DHGSHC3.js} +1 -1
  10. package/dist/chunks/{chunk-P276TWPM.js → chunk-3GORESBG.js} +1 -1
  11. package/dist/chunks/{chunk-4KOYS5WR.js → chunk-4BYGFDQB.js} +1 -1
  12. package/dist/chunks/{chunk-LH436HS2.js → chunk-4JDO7ZLN.js} +2 -2
  13. package/dist/chunks/{chunk-2US43KNG.js → chunk-7YSIP3O2.js} +2 -2
  14. package/dist/chunks/{chunk-VNF236GG.js → chunk-ARXDNQLF.js} +2 -2
  15. package/dist/chunks/{chunk-N73RA4DR.js → chunk-AURNOR27.js} +3 -3
  16. package/dist/chunks/{chunk-63XWYNID.js → chunk-BDS5VZYZ.js} +4 -4
  17. package/dist/chunks/{chunk-BXE3SBBN.js → chunk-C3KAPREU.js} +1 -1
  18. package/dist/chunks/{chunk-VXKL2ZLR.js → chunk-GDZQFELP.js} +259 -60
  19. package/dist/chunks/{chunk-2T3V6Z3M.js → chunk-GYJMPVOU.js} +1 -1
  20. package/dist/chunks/{chunk-BFUS3ENH.js → chunk-HEYIAMTC.js} +2 -2
  21. package/dist/chunks/{chunk-HMEAGAGC.js → chunk-HIN56TLA.js} +2 -2
  22. package/dist/chunks/{chunk-2VMKQKVO.js → chunk-HNNP5QUN.js} +1 -1
  23. package/dist/chunks/{chunk-W5YRBEWQ.js → chunk-I53QYITQ.js} +1 -1
  24. package/dist/chunks/{chunk-UTDMFVC7.js → chunk-I5CHAYDZ.js} +8 -8
  25. package/dist/chunks/{chunk-EPOPGV5G.js → chunk-IXLT3JJX.js} +1 -1
  26. package/dist/chunks/{chunk-SG7VQB4F.js → chunk-IZKM4NY7.js} +1 -1
  27. package/dist/chunks/{chunk-KMLATBNT.js → chunk-J7RNXBXA.js} +3 -3
  28. package/dist/chunks/{chunk-VACK24HF.js → chunk-JJV2GT2Z.js} +43 -9
  29. package/dist/chunks/{chunk-PKGPSTRW.js → chunk-JO2T77NW.js} +2 -2
  30. package/dist/chunks/{chunk-XKPXOIWD.js → chunk-JVT3XTKN.js} +3 -3
  31. package/dist/chunks/{chunk-SDI6BVG7.js → chunk-KKHXMJEE.js} +1 -1
  32. package/dist/chunks/{chunk-G7SG4XMK.js → chunk-LODKC7PJ.js} +7 -0
  33. package/dist/chunks/{chunk-AJQRKN3X.js → chunk-N3DCLT7M.js} +1 -1
  34. package/dist/chunks/{chunk-ZZZ6NVLW.js → chunk-NAYS472K.js} +1 -1
  35. package/dist/chunks/{chunk-AWJJSA7D.js → chunk-NWEVR2OQ.js} +1 -1
  36. package/dist/chunks/{chunk-33KUO34R.js → chunk-P2GJBFNA.js} +1 -1
  37. package/dist/chunks/{chunk-IHM43Y7B.js → chunk-RT4U3DH3.js} +1 -1
  38. package/dist/chunks/{chunk-XTCIKBWM.js → chunk-S6E3PMH7.js} +1 -1
  39. package/dist/chunks/{chunk-BLDUBB7X.js → chunk-SZYFZNCO.js} +2 -2
  40. package/dist/chunks/{chunk-T3MEG5D3.js → chunk-T2UNTWU5.js} +90 -21
  41. package/dist/chunks/{chunk-QJC63NFR.js → chunk-TQ26XEFL.js} +2 -2
  42. package/dist/chunks/{chunk-6RB5ZQ34.js → chunk-UEWIGD52.js} +51 -14
  43. package/dist/chunks/{chunk-SENPGW4O.js → chunk-VCUOYVLC.js} +1 -1
  44. package/dist/chunks/{chunk-CL6ELLVF.js → chunk-VNCHWWLG.js} +1 -1
  45. package/dist/chunks/{chunk-GD6RUZU5.js → chunk-VQ353UDK.js} +14 -8
  46. package/dist/chunks/{chunk-QLLKALSH.js → chunk-VTGQCLGI.js} +1 -1
  47. package/dist/chunks/{chunk-Z4HXW6ZH.js → chunk-ZWBQ4RRK.js} +24 -10
  48. package/dist/cli/figure.js +31 -30
  49. package/dist/cli/fold.js +6 -6
  50. package/dist/deletionEdges.js +2 -2
  51. package/dist/figure.js +27 -26
  52. package/dist/figureData.js +25 -24
  53. package/dist/figureScene.js +18 -17
  54. package/dist/figureSettings.js +6 -6
  55. package/dist/foldVariants.js +2 -2
  56. package/dist/genes/genePins.js +3 -3
  57. package/dist/graphLabels.js +4 -4
  58. package/dist/index.js +45 -44
  59. package/dist/labelLayout.js +8 -8
  60. package/dist/layout/forceCache.js +6 -6
  61. package/dist/layout/mergeRuns.js +2 -2
  62. package/dist/layout/orientToReference.js +2 -2
  63. package/dist/layout/tubeMapLayout.js +9 -9
  64. package/dist/layout/walkRowDraw.js +9 -8
  65. package/dist/layout/walkRowLayout.js +3 -3
  66. package/dist/layout/walkRowRuns.js +1 -1
  67. package/dist/layout/walkRows.js +2 -2
  68. package/dist/layout/walkStrip.js +13 -12
  69. package/dist/layoutModes.js +11 -11
  70. package/dist/pathColors.js +5 -5
  71. package/dist/pipeline.js +5 -5
  72. package/dist/referenceStrip.js +9 -8
  73. package/dist/renderer/GeometryBuilder.js +8 -7
  74. package/dist/renderer/walkLanes.js +46 -0
  75. package/dist/tubeMap/axis.js +5 -5
  76. package/dist/tubeMap/bundle.js +10 -10
  77. package/dist/tubeMap/coarsen.js +10 -10
  78. package/dist/tubeMap/deviations.js +11 -11
  79. package/dist/tubeMap/draw.js +5 -5
  80. package/dist/tubeMap/genes.js +6 -6
  81. package/dist/tubeMap/nodeColors.js +9 -8
  82. package/dist/tubeMap/reads.js +2 -2
  83. package/dist/types/figureData.d.ts +22 -0
  84. package/dist/types/renderer/types.d.ts +20 -0
  85. package/dist/types/renderer/walkLanes.d.ts +76 -0
  86. package/dist/types/util/geometry.d.ts +13 -1
  87. package/dist/types/version.d.ts +1 -1
  88. package/dist/types/walkEncoding.d.ts +9 -5
  89. package/dist/types/walkHighlight.d.ts +3 -0
  90. package/dist/util/SpatialIndex.js +4 -4
  91. package/dist/util/edgeCurves.js +3 -3
  92. package/dist/util/geometry.js +7 -1
  93. package/dist/util/hitDetection.js +5 -5
  94. package/dist/version.js +1 -1
  95. package/dist/viewport.js +6 -6
  96. package/dist/walkEncoding.js +13 -10
  97. package/dist/walkHighlight.js +10 -9
  98. package/dist/walkKey.js +5 -5
  99. package/package.json +1 -1
package/README.md CHANGED
@@ -43,7 +43,7 @@ npm install @jbrowse/bandage-core
43
43
  backbone lies on. `featuresOnBackbone` renames that assembly's genes onto the
44
44
  backbone's refNames, and `genePins` pins only those
45
45
 
46
- ## Figures and the coarse tier
46
+ ## Figures
47
47
 
48
48
  - `figureSvg` draws a graph and its lifted walks to a standalone SVG. The
49
49
  `bandage-figure` CLI makes one from a JSON spec with no browser:
@@ -52,9 +52,43 @@ npm install @jbrowse/bandage-core
52
52
  - `figureData` returns what `figureSvg` would draw as columnar tables, for
53
53
  another graphics system to draw;
54
54
  [ggbandage](https://github.com/GMOD/ggbandage) draws them in ggplot2
55
- - The `bandage-fold` CLI folds every variant under a size into the reference, so
56
- a graph track can draw a whole chromosome. See
57
- [docs/coarse-tier.md](docs/coarse-tier.md)
55
+
56
+ ## Coarse tier: `bandage-fold`
57
+
58
+ `bandage-fold` writes an rGFA with every variant under `--below` bp folded into
59
+ the reference. Indexed by gfa-to-tabix, the output is the coarse tier a graph
60
+ track draws once zoomed out past the fine index, so a whole chromosome fits.
61
+ [`gfa-to-tabix fold`](https://github.com/GMOD/gfa-to-tabix/blob/main/docs/subcommands.md#fold)
62
+ documents the fold and the handover from the fine index.
63
+
64
+ ```console
65
+ npx -p @jbrowse/bandage-core bandage-fold graph.rgfa.gz --below 10000 \
66
+ | gfa-to-tabix - -o graph.fold10000
67
+ ```
68
+
69
+ - The input is a GFA or rGFA, plain or gzipped, or `-` for stdin. `-o out.gfa`
70
+ writes a file in place of stdout
71
+ - `--reference PATH` names a plain GFA's backbone path. In an rGFA, the segments
72
+ tagged `SR:i:0` form the backbone
73
+ - The fold keeps the backbone, every allele whose own length or the reference it
74
+ replaces reaches `--below`, and the shortest way from each one's ends back to
75
+ the backbone. It joins the reference between kept alleles into one segment
76
+ - `bandage-fold` drops paths and walks from the output. It writes forward a
77
+ segment that a plain GFA's path reads reversed, and flips its links to match,
78
+ so the output re-reads as the graph that was folded
79
+ - gfa-to-tabix's `--layout anchored|contig` should match the fine index's. An
80
+ anchored window inside a large bubble then returns the whole bubble in both
81
+ tiers, and a contig one only what links reach from it
82
+ - The graph track folds each cut it draws at ten pixels (`FOLD_PX` in
83
+ jbrowse-plugin-graphgenomeviewer), and folding a fold again at a larger size
84
+ closely matches folding the original at that size. A tier folded at N and
85
+ handed over at N / 10 bp per pixel, such as
86
+ `coarse: { uri: "graph.fold10000", aboveBpPerPx: 1000 }`, therefore draws
87
+ nearly what the fine cut drew
88
+ - Node caps a string at 512 MB, and `bandage-fold` reads the whole graph into
89
+ one, so it cannot fold a whole human pangenome. `gfa-to-tabix fold`, a port of
90
+ the same fold, writes the index in one pass:
91
+ `gfa-to-tabix fold graph.rgfa.gz --below 10000 -o graph.fold10000`
58
92
 
59
93
  ## Developing
60
94
 
@@ -64,21 +98,27 @@ pnpm test # unit tests
64
98
  pnpm build # dist/ with declarations
65
99
  ```
66
100
 
67
- The FMMM engine and its wasm build are in
68
- [graph-fmmm-layout](https://github.com/GMOD/graph-fmmm-layout).
69
-
70
- CI also packs the core and runs the typecheck and tests of
71
- [BandageJS](https://github.com/cmdcolin/BandageJS) and
72
- [jbrowse-plugin-graphgenomeviewer](https://github.com/GMOD/jbrowse-plugin-graphgenomeviewer)
73
- against it. For an API change, push the consumer's matching change to a
74
- `core-next` branch in that consumer's repo, which CI tests in place of `main`
75
- until the release.
76
-
77
- Release with `pnpm version patch`: it lints, tests, stamps `src/version.ts`,
78
- writes the changelog with git-cliff and pushes the `v*` tag. `publish.yml` then
79
- runs CI, consumers included, and publishes to npm with trusted publishing only
80
- if it passes. When a consumer fails, push its side to `core-next` and rerun the
81
- failed jobs.
101
+ - The FMMM engine and its wasm build are in
102
+ [graph-fmmm-layout](https://github.com/GMOD/graph-fmmm-layout)
103
+ - CI also packs the core and runs the typecheck and tests of
104
+ [BandageJS](https://github.com/cmdcolin/BandageJS) and
105
+ [jbrowse-plugin-graphgenomeviewer](https://github.com/GMOD/jbrowse-plugin-graphgenomeviewer)
106
+ against it. For an API change, push the consumer's matching change to a
107
+ `core-next` branch in that consumer's repo, which CI tests in place of `main`
108
+ until the release
109
+ - `src/foldParity.test.ts` folds a few hundred random rGFA graphs with
110
+ `foldVariants` and with the gfa-to-tabix release that
111
+ `.github/actions/gfa-to-tabix` pins, and fails when they fold differently.
112
+ Locally the test runs the `gfa-to-tabix` on PATH or named by `GFA_TO_TABIX`,
113
+ and skips without one. In the other direction, gfa-to-tabix's
114
+ `scripts/parity-fold.sh` checks that `gfa-to-tabix fold` writes the same bytes
115
+ as `bandage-fold | gfa-to-tabix -`, and its CI tests the port against a pinned
116
+ bandage-core
117
+ - Release with `pnpm version patch`: it lints, tests, stamps `src/version.ts`,
118
+ writes the changelog with git-cliff and pushes the `v*` tag. `publish.yml`
119
+ then runs CI, consumers included, and publishes to npm with trusted publishing
120
+ only if it passes. When a consumer fails, push its side to `core-next` and
121
+ rerun the failed jobs
82
122
 
83
123
  ## See also
84
124
 
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  bubbleHalos,
3
3
  coversGraph
4
- } from "../chunks/chunk-BLDUBB7X.js";
5
- import "../chunks/chunk-AWJJSA7D.js";
4
+ } from "../chunks/chunk-SZYFZNCO.js";
5
+ import "../chunks/chunk-NWEVR2OQ.js";
6
6
  import "../chunks/chunk-FX4RDMDN.js";
7
- import "../chunks/chunk-N73RA4DR.js";
7
+ import "../chunks/chunk-AURNOR27.js";
8
8
  import "../chunks/chunk-HMXCN6PG.js";
9
9
  import "../chunks/chunk-AB35TJST.js";
10
- import "../chunks/chunk-2VMKQKVO.js";
11
- import "../chunks/chunk-P276TWPM.js";
10
+ import "../chunks/chunk-HNNP5QUN.js";
11
+ import "../chunks/chunk-3GORESBG.js";
12
12
  import "../chunks/chunk-TLWXLNLY.js";
13
13
  import "../chunks/chunk-3YBP46PB.js";
14
- import "../chunks/chunk-VACK24HF.js";
14
+ import "../chunks/chunk-JJV2GT2Z.js";
15
15
  import "../chunks/chunk-CPMHA4W5.js";
16
16
  import "../chunks/chunk-ZPZ7GNBT.js";
17
17
  import "../chunks/chunk-BSOZW3FC.js";
@@ -3,16 +3,16 @@ import {
3
3
  BUBBLE_KIND_NAMES,
4
4
  bubbleSegmentIds,
5
5
  classifyBubble
6
- } from "../chunks/chunk-AWJJSA7D.js";
6
+ } from "../chunks/chunk-NWEVR2OQ.js";
7
7
  import "../chunks/chunk-FX4RDMDN.js";
8
- import "../chunks/chunk-N73RA4DR.js";
8
+ import "../chunks/chunk-AURNOR27.js";
9
9
  import "../chunks/chunk-HMXCN6PG.js";
10
10
  import "../chunks/chunk-AB35TJST.js";
11
- import "../chunks/chunk-2VMKQKVO.js";
12
- import "../chunks/chunk-P276TWPM.js";
11
+ import "../chunks/chunk-HNNP5QUN.js";
12
+ import "../chunks/chunk-3GORESBG.js";
13
13
  import "../chunks/chunk-TLWXLNLY.js";
14
14
  import "../chunks/chunk-3YBP46PB.js";
15
- import "../chunks/chunk-VACK24HF.js";
15
+ import "../chunks/chunk-JJV2GT2Z.js";
16
16
  import "../chunks/chunk-CPMHA4W5.js";
17
17
  import "../chunks/chunk-ZPZ7GNBT.js";
18
18
  import "../chunks/chunk-BSOZW3FC.js";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  graphBubbles,
3
3
  superbubblesFromGraph
4
- } from "../chunks/chunk-KMLATBNT.js";
5
- import "../chunks/chunk-BLDUBB7X.js";
4
+ } from "../chunks/chunk-J7RNXBXA.js";
5
+ import "../chunks/chunk-SZYFZNCO.js";
6
6
  import "../chunks/chunk-RFG42VIO.js";
7
- import "../chunks/chunk-AWJJSA7D.js";
7
+ import "../chunks/chunk-NWEVR2OQ.js";
8
8
  import "../chunks/chunk-FX4RDMDN.js";
9
9
  import "../chunks/chunk-MHZTTLBU.js";
10
10
  import "../chunks/chunk-UAFATXYA.js";
11
11
  import "../chunks/chunk-VX656OAZ.js";
12
- import "../chunks/chunk-N73RA4DR.js";
12
+ import "../chunks/chunk-AURNOR27.js";
13
13
  import "../chunks/chunk-HMXCN6PG.js";
14
14
  import "../chunks/chunk-AB35TJST.js";
15
- import "../chunks/chunk-2VMKQKVO.js";
16
- import "../chunks/chunk-P276TWPM.js";
15
+ import "../chunks/chunk-HNNP5QUN.js";
16
+ import "../chunks/chunk-3GORESBG.js";
17
17
  import "../chunks/chunk-TLWXLNLY.js";
18
18
  import "../chunks/chunk-3YBP46PB.js";
19
- import "../chunks/chunk-VACK24HF.js";
19
+ import "../chunks/chunk-JJV2GT2Z.js";
20
20
  import "../chunks/chunk-CPMHA4W5.js";
21
21
  import "../chunks/chunk-ZPZ7GNBT.js";
22
22
  import "../chunks/chunk-BSOZW3FC.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  engineKey,
3
3
  forceLayout
4
- } from "./chunk-XKPXOIWD.js";
4
+ } from "./chunk-JVT3XTKN.js";
5
5
 
6
6
  // src/layout/forceCache.ts
7
7
  var DEFAULT_SIZE = 4;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ENGINE_DEFAULTS
3
- } from "./chunk-XKPXOIWD.js";
3
+ } from "./chunk-JVT3XTKN.js";
4
4
 
5
5
  // src/figureSettings.ts
6
6
  var FIGURE_DEFAULTS = {