jbrowse-plugin-graphgenomeviewer 6.27.0 → 7.1.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.
- package/README.md +80 -196
- package/dist/chunks/GbzBaseSyntenyAdapter-TIXR4Y3J.js +2 -0
- package/dist/chunks/GbzBaseSyntenyAdapter-TIXR4Y3J.js.map +7 -0
- package/dist/chunks/{GraphGenomeView-T4YQMLAX.js → GraphGenomeView-Z2WZKEEO.js} +2 -2
- package/dist/chunks/{GraphGenomeView-T4YQMLAX.js.map → GraphGenomeView-Z2WZKEEO.js.map} +1 -1
- package/dist/chunks/{GraphTrackSettingsDialog-EQ5W5KTL.js → GraphTrackSettingsDialog-TAM6PMXD.js} +2 -2
- package/dist/chunks/{HighlightColorDialog-3BONNNBR.js → HighlightColorDialog-EYBKFSJU.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-WIBVWRQE.js +2 -0
- package/dist/chunks/{LinearGraphDisplay-MQ4LD2RQ.js.map → LinearGraphDisplay-WIBVWRQE.js.map} +1 -1
- package/dist/chunks/{MinigraphBubbleAdapter-DPRKYY5Y.js → MinigraphBubbleAdapter-AGI2UYQR.js} +2 -2
- package/dist/chunks/RgfaTabixAdapter-2OL5X3HF.js +3 -0
- package/dist/chunks/RgfaTabixAdapter-2OL5X3HF.js.map +7 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-UKFHCFOF.js +2 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-UKFHCFOF.js.map +7 -0
- package/dist/chunks/bandage-layout-UZEOCKMS.js +1699 -0
- package/dist/chunks/bandage-layout-UZEOCKMS.js.map +7 -0
- package/dist/chunks/{chunk-56V22DVI.js → chunk-3Q4RBDCL.js} +1 -1
- package/dist/chunks/{chunk-56V22DVI.js.map → chunk-3Q4RBDCL.js.map} +1 -1
- package/dist/chunks/{chunk-OUN4BNWJ.js → chunk-446RWIA3.js} +1 -1
- package/dist/chunks/{chunk-OUN4BNWJ.js.map → chunk-446RWIA3.js.map} +1 -1
- package/dist/chunks/chunk-5SFGHDQA.js +2 -0
- package/dist/chunks/chunk-5SFGHDQA.js.map +7 -0
- package/dist/chunks/{chunk-ECZOKJYP.js → chunk-AMFIBQVR.js} +2 -2
- package/dist/chunks/{chunk-HW4LIGPA.js → chunk-AU73K7LX.js} +1 -1
- package/dist/chunks/{chunk-HW4LIGPA.js.map → chunk-AU73K7LX.js.map} +1 -1
- package/dist/chunks/{chunk-V4YHDVV3.js → chunk-BJMRBVG3.js} +2 -2
- package/dist/chunks/{chunk-V4YHDVV3.js.map → chunk-BJMRBVG3.js.map} +1 -1
- package/dist/chunks/chunk-DZ4OUKQV.js +2 -0
- package/dist/chunks/chunk-DZ4OUKQV.js.map +7 -0
- package/dist/chunks/chunk-EWFJBQDV.js +3 -0
- package/dist/chunks/chunk-EWFJBQDV.js.map +7 -0
- package/dist/chunks/chunk-GOFS7BXK.js +3 -0
- package/dist/chunks/chunk-GOFS7BXK.js.map +7 -0
- package/dist/chunks/chunk-IJQTSJGT.js +4 -0
- package/dist/chunks/chunk-IJQTSJGT.js.map +7 -0
- package/dist/chunks/chunk-IXQK7JAW.js +2 -0
- package/dist/chunks/chunk-IXQK7JAW.js.map +7 -0
- package/dist/chunks/{chunk-Z4B6RZGP.js → chunk-J6NZIAZF.js} +2 -2
- package/dist/chunks/{chunk-Z4B6RZGP.js.map → chunk-J6NZIAZF.js.map} +1 -1
- package/dist/chunks/chunk-LUTMKRXY.js +2 -0
- package/dist/chunks/chunk-LUTMKRXY.js.map +7 -0
- package/dist/chunks/chunk-MHPJB22Z.js +2 -0
- package/dist/chunks/chunk-MHPJB22Z.js.map +7 -0
- package/dist/chunks/{chunk-RKOQVSZG.js → chunk-SAMJE6GH.js} +2 -2
- package/dist/chunks/chunk-TXI43PEN.js +2 -0
- package/dist/chunks/chunk-TXI43PEN.js.map +7 -0
- package/dist/chunks/{chunk-U6CKN6LS.js → chunk-WRH2EJKX.js} +2 -2
- package/dist/chunks/chunk-WX26KTZM.js +2 -0
- package/dist/chunks/chunk-WX26KTZM.js.map +7 -0
- package/dist/chunks/{chunk-TOT4S3TG.js → chunk-XT766CZ5.js} +1 -1
- package/dist/chunks/{chunk-TOT4S3TG.js.map → chunk-XT766CZ5.js.map} +1 -1
- package/dist/chunks/chunk-YJHYBDYF.js +9 -0
- package/dist/chunks/chunk-YJHYBDYF.js.map +7 -0
- package/dist/chunks/chunk-YSTMDXXX.js +2 -0
- package/dist/chunks/chunk-YSTMDXXX.js.map +7 -0
- package/dist/chunks/{renderSvg-QLUKGVIN.js → renderSvg-ST2GBBOC.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +4 -4
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +3 -2
- package/src/GraphGenomeView/components/LabelLayer.tsx +17 -43
- package/src/GraphGenomeView/components/usePaneGestures.test.tsx +1 -1
- package/src/GraphGenomeView/model.test.ts +23 -0
- package/src/GraphGenomeView/pane/graphViews.ts +1 -7
- package/src/GraphGenomeView/pane/launchActions.ts +40 -11
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.ts +8 -13
- package/src/RgfaTabixAdapter/configSchema.ts +14 -32
- package/src/RgfaTabixAdapter/walkFiles.test.ts +87 -268
- package/src/RgfaTabixAdapter/walkReader.ts +8 -278
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +4 -8
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +7 -15
- package/src/WalkTabixSyntenyAdapter/configSchema.ts +12 -47
- package/src/WalkTabixSyntenyAdapter/gbzParity.test.ts +4 -7
- package/src/WalkTabixSyntenyAdapter/walkLanes.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/chunks/GbzBaseSyntenyAdapter-O5OWS5EK.js +0 -2
- package/dist/chunks/GbzBaseSyntenyAdapter-O5OWS5EK.js.map +0 -7
- package/dist/chunks/LinearGraphDisplay-MQ4LD2RQ.js +0 -2
- package/dist/chunks/RgfaTabixAdapter-DRAJSERI.js +0 -3
- package/dist/chunks/RgfaTabixAdapter-DRAJSERI.js.map +0 -7
- package/dist/chunks/WalkTabixSyntenyAdapter-PY4HXRFX.js +0 -2
- package/dist/chunks/WalkTabixSyntenyAdapter-PY4HXRFX.js.map +0 -7
- package/dist/chunks/bandage-layout-3AR6BCUD-OCBA5MS7.js +0 -1660
- package/dist/chunks/bandage-layout-3AR6BCUD-OCBA5MS7.js.map +0 -7
- package/dist/chunks/chunk-2APZWSYD.js +0 -3
- package/dist/chunks/chunk-2APZWSYD.js.map +0 -7
- package/dist/chunks/chunk-CH2E7TRS.js +0 -2
- package/dist/chunks/chunk-CH2E7TRS.js.map +0 -7
- package/dist/chunks/chunk-G57N55FV.js +0 -3
- package/dist/chunks/chunk-G57N55FV.js.map +0 -7
- package/dist/chunks/chunk-G73A6PEI.js +0 -2
- package/dist/chunks/chunk-G73A6PEI.js.map +0 -7
- package/dist/chunks/chunk-KJOBOE4W.js +0 -2
- package/dist/chunks/chunk-KJOBOE4W.js.map +0 -7
- package/dist/chunks/chunk-Q5PP7UMC.js +0 -9
- package/dist/chunks/chunk-Q5PP7UMC.js.map +0 -7
- package/dist/chunks/chunk-STTY74OG.js +0 -4
- package/dist/chunks/chunk-STTY74OG.js.map +0 -7
- package/dist/chunks/chunk-XJDTSPBL.js +0 -2
- package/dist/chunks/chunk-XJDTSPBL.js.map +0 -7
- package/dist/chunks/chunk-ZWMYT35X.js +0 -2
- package/dist/chunks/chunk-ZWMYT35X.js.map +0 -7
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_follow.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_header.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_maxnode.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks_rejoin.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/walkFormat2.test.ts +0 -186
- package/src/RgfaTabixAdapter/walkFormat2.ts +0 -682
- package/src/RgfaTabixAdapter/walkRows.test.ts +0 -449
- package/src/RgfaTabixAdapter/walkRows.ts +0 -746
- /package/dist/chunks/{GraphTrackSettingsDialog-EQ5W5KTL.js.map → GraphTrackSettingsDialog-TAM6PMXD.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-3BONNNBR.js.map → HighlightColorDialog-EYBKFSJU.js.map} +0 -0
- /package/dist/chunks/{MinigraphBubbleAdapter-DPRKYY5Y.js.map → MinigraphBubbleAdapter-AGI2UYQR.js.map} +0 -0
- /package/dist/chunks/{chunk-ECZOKJYP.js.map → chunk-AMFIBQVR.js.map} +0 -0
- /package/dist/chunks/{chunk-RKOQVSZG.js.map → chunk-SAMJE6GH.js.map} +0 -0
- /package/dist/chunks/{chunk-U6CKN6LS.js.map → chunk-WRH2EJKX.js.map} +0 -0
- /package/dist/chunks/{renderSvg-QLUKGVIN.js.map → renderSvg-ST2GBBOC.js.map} +0 -0
package/README.md
CHANGED
|
@@ -2,222 +2,106 @@
|
|
|
2
2
|
|
|
3
3
|
Pangenome graphs in JBrowse 2.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
with commands you can run:
|
|
9
|
-
|
|
10
|
-
- **[Hosting your own graph](https://jbrowse.org/jb2/docs/tutorials/pangenome_prepare_graph)**
|
|
11
|
-
— start here. One script turns an rGFA or GFA into indexed files and a track
|
|
12
|
-
config; later sections add haplotype walks and gbz-base
|
|
13
|
-
- [pggb](https://jbrowse.org/jb2/docs/tutorials/pangenome_ecoli) — five _E.
|
|
14
|
-
coli_ strains from FASTA to graph, index, synteny and variants
|
|
15
|
-
- [Minigraph-Cactus](https://jbrowse.org/jb2/docs/tutorials/pangenome_cactus) —
|
|
16
|
-
the same from `cactus-pangenome`
|
|
17
|
-
- [Cattle](https://jbrowse.org/jb2/docs/tutorials/pangenome_cattle) and
|
|
18
|
-
[mouse](https://jbrowse.org/jb2/docs/tutorials/pangenome_mouse) — published
|
|
19
|
-
graphs: `vg deconstruct` one, rank the bubbles of another
|
|
20
|
-
- HPRC release 2:
|
|
21
|
-
[graph alleles](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc),
|
|
22
|
-
[haplotypes against each other](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc_haplotypes),
|
|
23
|
-
[repeat lengths](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc_repeats)
|
|
24
|
-
- [Graph genome view user guide](https://jbrowse.org/jb2/docs/user_guides/graph_genome_view)
|
|
25
|
-
|
|
26
|
-
## What data to use
|
|
27
|
-
|
|
28
|
-
The plugin reads a graph as tabix files or a gbz-base database, one window at a
|
|
29
|
-
time. A GFA small enough to load whole opens with **Add → Graph genome view**.
|
|
30
|
-
|
|
31
|
-
Build the graph with [minigraph](https://github.com/lh3/minigraph) (rGFA),
|
|
32
|
-
[pggb](https://github.com/pangenome/pggb) or
|
|
33
|
-
[Minigraph-Cactus](https://github.com/ComparativeGenomicsToolkit/cactus/blob/master/doc/pangenome.md)
|
|
34
|
-
(GFA and GBZ), then index what you have:
|
|
35
|
-
|
|
36
|
-
- **rGFA** — `gfa-to-tabix build graph.rgfa.gz -o out` (0.11.0+). It calls
|
|
37
|
-
[gfatools](https://github.com/lh3/gfatools) for the bubbles and writes
|
|
38
|
-
`.segs.bed.gz`, `.links.bed.gz`, `.bubbles.bed.gz`, `.alleles.bed.gz`, a
|
|
39
|
-
coarse tier, a `.graph.json` manifest and a track config. Opening
|
|
40
|
-
`out.segs.bed.gz` in **Add pangenome graph track** reads the manifest.
|
|
41
|
-
Adapter: `RgfaTabixAdapter`
|
|
42
|
-
- **Plain GFA** (pggb, odgi, vg, base-level Minigraph-Cactus) — the same
|
|
43
|
-
command, with `--reference`, `--assembly` and `--snarls`, a VCF from
|
|
44
|
-
`vg deconstruct -a` or `pggb -V`
|
|
45
|
-
- **Alleles, with a CIGAR each** — `build` writes `.alleles.bed.gz`, which an
|
|
46
|
-
alignments track draws; `gfa-to-tabix alleles <prefix>` makes one from a
|
|
47
|
-
`--layout contig` index
|
|
48
|
-
- **Haplotype walks, as tabix files** — `vg convert -f graph.gbz`, then
|
|
49
|
-
`gfa-to-tabix --walks`. Adapter: `WalkTabixSyntenyAdapter`, or
|
|
50
|
-
`RgfaTabixAdapter` with `walksUri`
|
|
51
|
-
- **Haplotype walks, as one database** — `vg chains`, `gbz-base construct`,
|
|
52
|
-
`gbz-haplotype-index` make `.gbz.db` and `.haplotype-index.db`. Adapter:
|
|
53
|
-
`GbzBaseSyntenyAdapter`
|
|
54
|
-
- **Reads** — `vg giraffe -o gaf`, `vg gamsort -G`, `bgzip`, `tabix` make a
|
|
55
|
-
`.gaf.gz` for a gbz-base adapter's `reads`
|
|
56
|
-
- **Minigraph paths per assembly** — `minigraph -cxasm --call` per sample, then
|
|
57
|
-
`gfa-to-tabix paths` (0.9.0+) writes one row per bubble and sample
|
|
58
|
-
|
|
59
|
-
[vg](https://github.com/vgteam/vg) 1.69.0 or later covers the GBZ steps.
|
|
60
|
-
|
|
61
|
-
## As a track of a linear view
|
|
62
|
-
|
|
63
|
-
A `GraphTrack` cuts the graph for the view's window and redraws it as you pan. A
|
|
64
|
-
force-directed track draws a strip of the reference segments at their bp above
|
|
65
|
-
the graph, each in its node's colour, so the graph reads against the tracks
|
|
66
|
-
above it.
|
|
67
|
-
|
|
68
|
-
- **LPA's KIV-2 repeat.** The goldenrod outlines on the graph are the gene
|
|
69
|
-
track's LPA exons. The charcoal loops, sequence off the reference, hang inside
|
|
70
|
-
the array the curated VNTR track marks.
|
|
5
|
+
- **In:** a GFA, rGFA, GBZ or walk-indexed graph
|
|
6
|
+
- **Out:** a graph track in a linear view, or a view of its own, with
|
|
7
|
+
haplotypes, bubbles and genes marked
|
|
71
8
|
|
|
72
9
|

|
|
73
10
|
|
|
74
|
-
|
|
75
|
-
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
1. Add the plugin to your JBrowse 5.0.0-beta.11 or later config:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"plugins": [
|
|
18
|
+
{
|
|
19
|
+
"name": "GraphGenomeView",
|
|
20
|
+
"esmUrl": "https://jbrowse.org/plugins/jbrowse-plugin-graphgenomeviewer/latest/dist/jbrowse-plugin-graphgenomeviewer.esm.js"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Open a graph:
|
|
27
|
+
- **A small GFA:** Add → **Graph genome view** opens the whole file
|
|
28
|
+
- **A large graph:** index it with
|
|
29
|
+
[gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) or build a gbz-base
|
|
30
|
+
database, then File → **Open track**. The track redraws the graph for the
|
|
31
|
+
view's window as you pan. See [docs/data.md](docs/data.md)
|
|
32
|
+
|
|
33
|
+
3. Explore:
|
|
34
|
+
- Pick a layout from the track menu: force-directed, ordered, anchored,
|
|
35
|
+
sample rows, walk rows or tube map ([docs/layouts.md](docs/layouts.md))
|
|
36
|
+
- Lift haplotypes or show a panel per haplotype
|
|
37
|
+
([docs/haplotypes.md](docs/haplotypes.md))
|
|
38
|
+
- Launch → **Graph genome view** on a track opens its cut as a view, where
|
|
39
|
+
hovering a node bands its bp in the linear view
|
|
40
|
+
- Export SVG from the track or the view
|
|
41
|
+
|
|
42
|
+
The [JBrowse tutorials](#tutorials) walk through the whole process with commands
|
|
43
|
+
you can run.
|
|
44
|
+
|
|
45
|
+
## What it draws
|
|
76
46
|
|
|
77
47
|

|
|
78
48
|
|
|
79
|
-
- **Copy number off a bar.** Walk rows tile each haplotype by the 5,548 bp
|
|
80
|
-
kringle: GRCh38's six units are the six LPA exon pairs above, and HG00133
|
|
81
|
-
has 27.
|
|
82
|
-
|
|
83
49
|

|
|
84
50
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
## Features
|
|
103
|
-
|
|
104
|
-
- Seven layouts: force-directed (Bandage FMMM, or stress in a track), ordered,
|
|
105
|
-
anchored, sample rows, walk rows, and sequenceTubeMap's tube map on its own
|
|
106
|
-
axis or the reference's
|
|
107
|
-
- Genes from the session's annotation track, drawn on the graph
|
|
108
|
-
- Hovering a callset or MAF row in the same view lifts that haplotype's walk
|
|
109
|
-
- Bubbles from `gfatools bubble` or the graph itself, opened level by level
|
|
110
|
-
- gbz-base haplotypes as walks: the number of walks through a node as its
|
|
111
|
-
thickness, walks lifted out as metro-map lanes or side by side, a panel per
|
|
112
|
-
walk or a row per sample, each shading from its start to its end
|
|
113
|
-
- Tube maps split into a panel per sample, haplotype or sample table column,
|
|
114
|
-
drawn as a tube per route and coloured by a sample table column
|
|
115
|
-
- GAF reads in the tube map, with their mismatches, from a gbz-base track
|
|
116
|
-
- Figures as SVG: the graph track in the linear view's Export SVG, the graph
|
|
117
|
-
genome view's own Export SVG, or a JSON spec with no browser
|
|
118
|
-
([docs/figures.md](https://github.com/GMOD/bandage-core/blob/main/docs/figures.md))
|
|
119
|
-
|
|
120
|
-
## Usage
|
|
121
|
-
|
|
122
|
-
Needs JBrowse 5.0.0-beta.11 or later.
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
{
|
|
126
|
-
"plugins": [
|
|
127
|
-
{
|
|
128
|
-
"name": "GraphGenomeView",
|
|
129
|
-
"esmUrl": "https://jbrowse.org/plugins/jbrowse-plugin-graphgenomeviewer/latest/dist/jbrowse-plugin-graphgenomeviewer.esm.js"
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
- **File → Open track** opens an rGFA index (`.segs.bed.gz` from
|
|
136
|
-
[gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix)) or a gbz-base database
|
|
137
|
-
(`.gbz.db`) as a `GraphTrack`. It finds the links and indexes beside the url,
|
|
138
|
-
which a presigned url's signature doesn't cover; spell out each location in a
|
|
139
|
-
config instead
|
|
140
|
-
- Open track's **Add pangenome graph track** workflow also reads
|
|
141
|
-
`<prefix>.graph.json` beside a `<prefix>.segs.bed.gz` (written by
|
|
142
|
-
`gfa-to-tabix build`) for the coarse tier and the reference's PanSN sample;
|
|
143
|
-
without one, the track has no coarse tier
|
|
144
|
-
- A hand-written track needs only the adapter:
|
|
145
|
-
|
|
146
|
-
```json
|
|
147
|
-
{
|
|
148
|
-
"type": "GraphTrack",
|
|
149
|
-
"trackId": "hprc_graph",
|
|
150
|
-
"name": "HPRC release 2 graph",
|
|
151
|
-
"assemblyNames": ["hg38"],
|
|
152
|
-
"adapter": {
|
|
153
|
-
"type": "RgfaTabixAdapter",
|
|
154
|
-
"uri": "https://example.com/hprc",
|
|
155
|
-
"coarse": {
|
|
156
|
-
"uri": "https://example.com/hprc.fold10000",
|
|
157
|
-
"foldBelowBp": 10000
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- The track menu picks layout, colour and highlighted haplotypes, and switches
|
|
164
|
-
to the segments lane or, for gbz-base and walk-indexed graphs, the haplotype
|
|
165
|
-
lanes
|
|
166
|
-
- Cuts the window plus a window each side, up to 5 Mb; past `aboveBpPerPx`
|
|
167
|
-
(default `foldBelowBp / 10`), the `coarse` tier (`gfa-to-tabix fold`)
|
|
168
|
-
- Past the cut (5 Mb, or a gbz-base adapter's `nodeLimit`) the track asks you to
|
|
169
|
-
zoom in. For a population view of a wide window, add the graph's VCF as a
|
|
170
|
-
variant track (`vg deconstruct` makes one from a GBZ)
|
|
171
|
-
- gbz-base swaps in `{ "type": "GbzBaseSyntenyAdapter", "uri": "….gbz.db" }`; an
|
|
172
|
-
`hg38` or `hs1` track finds the graph's GRCh38 or CHM13 reference sample, and
|
|
173
|
-
`assemblyNameToPanSN` covers other names. A haplotype's lane draws on the
|
|
174
|
-
assembly aliased by its PanSN name (`HG002#1`) with no map entry
|
|
175
|
-
- A walk-indexed graph (`gfa-to-tabix --walks`) swaps in
|
|
176
|
-
`{ "type": "WalkTabixSyntenyAdapter", "walksUri": "….GRCh38", "assemblyNames": ["hg38"] }`
|
|
177
|
-
and draws the same haplotype lanes from the walk files, with no database
|
|
178
|
-
- `"reads": "….gaf.gz"` on the gbz-base adapter draws GAF reads in the tube map
|
|
179
|
-
layouts, fetched through its tabix index;
|
|
180
|
-
[docs/layouts.md](docs/layouts.md#reads) has the config and how to make one
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
## Tutorials
|
|
54
|
+
|
|
55
|
+
In the [JBrowse 2 docs](https://jbrowse.org/jb2/docs/tutorials/):
|
|
56
|
+
|
|
57
|
+
- **[Hosting your own graph](https://jbrowse.org/jb2/docs/tutorials/pangenome_prepare_graph):**
|
|
58
|
+
start here
|
|
59
|
+
- [pggb](https://jbrowse.org/jb2/docs/tutorials/pangenome_ecoli) and
|
|
60
|
+
[Minigraph-Cactus](https://jbrowse.org/jb2/docs/tutorials/pangenome_cactus)
|
|
61
|
+
- [Cattle](https://jbrowse.org/jb2/docs/tutorials/pangenome_cattle) and
|
|
62
|
+
[mouse](https://jbrowse.org/jb2/docs/tutorials/pangenome_mouse)
|
|
63
|
+
- HPRC release 2:
|
|
64
|
+
[graph alleles](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc),
|
|
65
|
+
[haplotypes](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc_haplotypes),
|
|
66
|
+
[repeat lengths](https://jbrowse.org/jb2/docs/tutorials/pangenome_hprc_repeats)
|
|
67
|
+
- [User guide](https://jbrowse.org/jb2/docs/user_guides/graph_genome_view)
|
|
181
68
|
|
|
182
69
|
## Docs
|
|
183
70
|
|
|
184
|
-
|
|
185
|
-
- [docs/developing.md](docs/developing.md) — building, testing, `host-compat`
|
|
71
|
+
In reading order:
|
|
186
72
|
|
|
187
|
-
|
|
73
|
+
1. [Data and track config](docs/data.md): index a graph and write the track
|
|
74
|
+
2. [Layouts](docs/layouts.md): the seven layouts, colour, the reference strip
|
|
75
|
+
3. [Haplotypes](docs/haplotypes.md): lifting, panels, colouring, walk rows
|
|
76
|
+
4. [Tube maps](docs/tube-maps.md): panels, routes, reads
|
|
77
|
+
5. [Bubbles](docs/bubbles.md) and [genes](docs/genes.md)
|
|
78
|
+
6. [Developing](docs/developing.md): build, test, release
|
|
188
79
|
|
|
189
|
-
|
|
80
|
+
## See also
|
|
190
81
|
|
|
191
|
-
- [BandageJS](https://github.com/cmdcolin/BandageJS)
|
|
192
|
-
same layouts
|
|
193
|
-
- [
|
|
194
|
-
as ggplot2 layers
|
|
195
|
-
- [ggtubemap](https://github.com/GMOD/ggtubemap) - R port of the tube map, as
|
|
196
|
-
ggplot2 layers
|
|
197
|
-
- [sequenceTubeMap, MemPanG26 edition](https://github.com/cmdcolin/sequenceTubeMap) -
|
|
82
|
+
- [BandageJS](https://github.com/cmdcolin/BandageJS): standalone page with the
|
|
83
|
+
same layouts
|
|
84
|
+
- [sequenceTubeMap, MemPanG26 edition](https://github.com/cmdcolin/sequenceTubeMap):
|
|
198
85
|
our fork of the tube map app
|
|
199
86
|
|
|
200
|
-
|
|
87
|
+
### Programmatic usage
|
|
201
88
|
|
|
202
|
-
- [@jbrowse/bandage-core](https://github.com/GMOD/bandage-core)
|
|
203
|
-
drawing engine
|
|
204
|
-
- [@jbrowse/graph-stress-layout](https://github.com/GMOD/graph-stress-layout)
|
|
205
|
-
stress layout
|
|
206
|
-
- [@jbrowse/tubemap-core](https://github.com/GMOD/tubemap-core)
|
|
89
|
+
- [@jbrowse/bandage-core](https://github.com/GMOD/bandage-core) (npm): layout
|
|
90
|
+
and drawing engine, plus `bandage-figure` for SVGs with no browser
|
|
91
|
+
- [@jbrowse/graph-stress-layout](https://github.com/GMOD/graph-stress-layout)
|
|
92
|
+
(npm): stress layout
|
|
93
|
+
- [@jbrowse/tubemap-core](https://github.com/GMOD/tubemap-core) (npm): tube map
|
|
207
94
|
layout
|
|
208
|
-
- [@gmod/gbz-base](https://github.com/GMOD/gbz-base-js)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
- [
|
|
214
|
-
graph track
|
|
215
|
-
- [gbz-haplotype-index](https://github.com/GMOD/gbz-haplotype-index) - names
|
|
95
|
+
- [@gmod/gbz-base](https://github.com/GMOD/gbz-base-js) (npm): `.gbz.db` reader
|
|
96
|
+
- [ggbandage](https://github.com/GMOD/ggbandage) (R): Bandage layout as ggplot2
|
|
97
|
+
layers
|
|
98
|
+
- [ggtubemap](https://github.com/GMOD/ggtubemap) (R): tube map as ggplot2 layers
|
|
99
|
+
- [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix): indexes a GFA
|
|
100
|
+
- [gbz-haplotype-index](https://github.com/GMOD/gbz-haplotype-index): names
|
|
216
101
|
every walk in a gbz-base cut
|
|
217
|
-
- [gfa-to-pairwise-paf](https://github.com/cmdcolin/gfa-to-pairwise-paf-rs)
|
|
102
|
+
- [gfa-to-pairwise-paf](https://github.com/cmdcolin/gfa-to-pairwise-paf-rs):
|
|
218
103
|
graph to PAF, for synteny views
|
|
219
104
|
|
|
220
105
|
## License
|
|
221
106
|
|
|
222
|
-
GPL-3.0-or-later
|
|
223
|
-
drawing algorithms which are both GPL).
|
|
107
|
+
GPL-3.0-or-later, based on work from Bandage and OGDF, both GPL.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as q,b as re,c as de,d as oe,e as T}from"./chunk-SAMJE6GH.js";import{a as ne}from"./chunk-KOB7YIMR.js";import{a as Z,b as U,c as X,d as g,e as C,f as M,g as k,h as E,i as z,k as Y}from"./chunk-YJHYBDYF.js";import"./chunk-EWFJBQDV.js";import{a as O,b as H}from"./chunk-3Q4RBDCL.js";import"./chunk-AU73K7LX.js";import"./chunk-IXQK7JAW.js";import{a as ae}from"./chunk-TXI43PEN.js";import{a as ee,c as L,f as te}from"./chunk-AMFIBQVR.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import{e as A,f as P,g as B}from"./chunk-446RWIA3.js";import"./chunk-E7J6SB5P.js";import{b as G,e as J,f as K,g as V}from"./chunk-5OI6LO4I.js";import"./chunk-7WIBGKBU.js";import{a as N}from"./chunk-OGQ6OQDN.js";import"./chunk-NDRLCGPC.js";import{e as W,o as $}from"./chunk-TENPGIPX.js";function F(n){let i=/\.gbz\.db$/i;return i.test(n)?n.replace(i,".haplotype-index.db"):void 0}function fe(n){return K(n)&&F(J(n))?V(n,i=>F(i)):void 0}function he(n){return n instanceof Error&&(/\bHTTP 40[34]\b/.test(n.message)||n.code==="ENOENT")}async function se(n,i){let t=fe(n);if(!t)return{};try{return await N(t,i).stat(),{location:t}}catch(e){return he(e)?{}:{unreadable:String(e)}}}var ge=5e3,ue=50*2**20,_=class extends Error{constructor(t){super(`this GAF is ${(t/2**20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`);this.name="UnindexedGafTooLargeError"}};function ye(n,i){if(n.length<=i)return n;let t=n.length/i;return Array.from({length:i},(e,a)=>n[Math.floor(a*t)])}var ie=(n,i)=>n.path.some(t=>i.has(t.name)),v=class{constructor(i,t){this.file=i;this.tabix=t;this.whole=L({setup:async({signal:i})=>{let{size:t}=await this.file.stat();if(t>ue)throw new _(t);let e=await this.file.readFile({signal:i}),a=new TextDecoder().decode(e[0]===31&&e[1]===139?await ee(e):e);return H(a)}})}async readIndexed(i,t,e){let a=1/0,r=-1/0;for(let c of t){let s=Number(c);Number.isInteger(s)&&(a=Math.min(a,s),r=Math.max(r,s))}let o=[];return a<=r&&await i.getLines("{node}",a,r+1,{signal:e,lineCallback:c=>{let s=O(c);s&&ie(s,t)&&o.push(s)}}),o}async readsOver(i,{signal:t}={}){let e=this.tabix?await this.readIndexed(this.tabix,i,t):(await this.whole({signal:t})).filter(a=>ie(a,i));return{records:ye(e,ge),total:e.length}}};var I=class extends Error{constructor(t){super(t===void 0?"no haplotype index is set, so the walks cannot be named; build one with gbz-haplotype-index (cargo install gbz-haplotype-index) and set it as haplotypeIndexLocation":`the haplotype index beside the graph database could not be checked (${t}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`);this.name="NoHaplotypeIndexError"}},D=class extends Error{constructor(t,e){super(`the graph is cut on its reference, ${e}; a window on ${t} has no reference coordinates to cut at. Open the graph from a ${e} view, and find this haplotype's lane there`);this.name="HaplotypeWindowError"}};function be(n,i){return`${g(n)}#${n.contig}@${i.start.node}.${i.start.offset}`}function we({alignment:n,assemblyName:i,refName:t,lane:e}){let{refStart:a,refEnd:r,strand:o,cigar:c}=n;if(!(r<=a)){let{name:s,hapStart:p,hapEnd:l}=n,f=be(s,n),u={uniqueId:f,assemblyName:i,refName:t,start:a,end:r,type:"match",strand:o==="-"?-1:1,CIGAR:c,syntenyId:f,mate:{refName:s.contig,start:p,end:l,assemblyName:e}};return new q(u)}}function xe({pair:n,lane:i,mateLane:t}){let e=`${g(n.target)}#${n.target.contig}:${n.targetStart}-${n.targetEnd}|${g(n.query)}#${n.query.contig}:${n.queryStart}-${n.queryEnd}`;return new q({uniqueId:e,assemblyName:i,refName:n.target.contig,start:n.targetStart,end:n.targetEnd,type:"match",strand:n.strand==="-"?-1:1,CIGAR:n.cigar,syntenyId:e,identity:n.matches/Math.max(n.columns,1),numMatches:n.matches,blockLen:n.columns,mate:{refName:n.query.contig,start:n.queryStart,end:n.queryEnd,assemblyName:t}})}var Se=12e4;function Pe(n,i){let t=new Map;for(let a of n)for(let{name:r,start:o,end:c}of a.walkSpans()){let s=g(r);if(i.has(s)){let p=`${s}#${r.contig}`,l=t.get(p);l?l.push([o,c]):t.set(p,[[o,c]])}}let e=0;for(let a of t.values()){a.sort((r,o)=>r[0]-o[0]);for(let r=1;r<a.length;r++){let o=a[r][0]-a[r-1][1];o>0&&o<=Se&&(e=Math.max(e,o))}}return e}function Q(n,i){return n instanceof X&&(n.message=`Zoom in to about ${W(n.fitsBp)} to see ${i}`),n}var ce=n=>({...n,start:Math.floor(n.start),end:Math.ceil(n.end)}),j=class extends re{constructor(){super(...arguments);this.graph=L({label:"Opening pangenome database",setup:async()=>{let t=this.getConf("gbzDbLocation"),e=this.getConf("haplotypeIndexLocation"),a=G(e)?{location:e}:await se(t,this.pluginManager),r=a.location,o=await U.open({source:N(t,this.pluginManager),haplotypeIndex:r?N(r,this.pluginManager):void 0}),c=this.getConf("assemblyNames")[0];if(c===void 0)throw new Error("GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");let s=await M(o),p=k({configured:this.getConf("referenceSample"),anchorPrefix:P(this,c),referenceSamples:s});return{db:o,anchor:c,referenceSample:p,referenceSamples:s,unreadableIndex:a.unreadable}}});this.gaf=L({label:"Opening reads",setup:async()=>{let t=this.getConf("readsLocation"),e=this.getConf(["readsIndex","location"]);return G(t)?new v(N(t,this.pluginManager),G(e)?te(this,["readsLocation"],["readsIndex"]):void 0):void 0}})}async referenceQuery(t,e){let{db:a,referenceSample:r}=await this.graph(e);return E(a,r,t)}async getHaplotypes(t={}){let{db:e,referenceSamples:a}=await this.graph(t),r=new Map;for(let o of await e.paths()){let c=g(o.name),s=r.get(c);s?s.contigs.includes(o.name.contig)||s.contigs.push(o.name.contig):r.set(c,{prefix:c,sample:o.name.sample,haplotype:o.name.haplotype,contigs:[o.name.contig],isReference:a.includes(o.name.sample)})}return[...r.values()]}async getHeader(t={}){let{anchor:e,referenceSample:a,referenceSamples:r}=await this.graph(t),o=B(this),c=[];for(let s of await this.getHaplotypes(t))s.sample!==a&&c.push({name:T(o,s.prefix),label:s.prefix,group:s.sample});return{hasCoarseTier:!1,anchorAssemblyName:e,referenceSample:a,referenceSamples:r,lanes:c}}async getRefNames(t={}){let{db:e,anchor:a,referenceSample:r}=await this.graph(t),{assemblyName:o}=t,c=o===a?void 0:P(this,o),s=(await e.paths()).filter(p=>o===a?p.isIndexed&&p.name.sample===r:A(g(p.name),c)).map(p=>p.name.contig);return[...new Set(s)]}keepPredicate(t,e){let a=t===void 0||t.length===0?void 0:t.map(r=>P(this,r));return a===void 0&&e===void 0?void 0:r=>C(r,a)&&(e===void 0||A(g(r),e))}async getSubgraph(t,e={}){let{signal:a}=e,{db:r,anchor:o,referenceSample:c,unreadableIndex:s}=await this.graph({signal:a}),{assemblyName:p,refName:l,start:f,end:u}=ce(t);if(p!==o)throw new D(p,o);let y=await this.referenceQuery(l,{signal:a});if(!y)throw new Error(`${c} has no indexed path ${l} in this graph`);let x=this.keepPredicate(e.haplotypes);if(x!==void 0&&!r.hasHaplotypeIndex)throw new I(s);let m=await Y(r,y,f,u,{context:this.getConf("context"),snarls:e.snarls??this.getConf("subgraphSnarls"),limit:this.getConf("nodeLimit"),signal:e.signal,keep:x}).catch(b=>{throw Q(b,"the graph")});return typeof m=="string"?m:ae(m,{start:f,end:u},e.walkRows)}async getReads(t,e={}){let a=await this.gaf(e);return a?a.readsOver(new Set(t),e):{records:[],total:0}}async laneHaplotypes(t,e){let a=P(this,t);return(await this.getHaplotypes(e)).filter(r=>A(r.prefix,a))}async anchorFeatures(t,e){let{db:a}=await this.graph(e),{assemblyName:r,refName:o,start:c,end:s}=t,p=P(this,e.targetAssemblyName),l=B(this),f=this.keepPredicate(e.haplotypes,p),u=await this.referenceQuery(o,e),y=this.getConf("nodeLimit");return(u?await $(`Reading graph ${o}:${c.toLocaleString()}-${s.toLocaleString()}`,e.statusCallback,()=>a.getAlignments({path:u,start:c,end:s,context:this.getConf("context"),haplotypes:"all",limit:y,signal:e.signal,keep:f}).catch(m=>{throw Q(z(m,y,s-c)??m,"lanes")})):[]).flatMap(m=>{let b=m.resolved?we({alignment:m,assemblyName:r,refName:o,lane:T(l,g(m.name))}):void 0;return b===void 0?[]:[b]})}async pairFeatures(t,e,a){let{db:r}=await this.graph(a),{refName:o,start:c,end:s}=t,l=(await Promise.all(e.map(async d=>({pair:d,featureSide:await this.laneHaplotypes(d.queryAssemblyName,a),mateSide:await this.laneHaplotypes(d.targetAssemblyName,a)})))).filter(({featureSide:d,mateSide:h})=>d.length>0&&h.length>0),f=new Set(l.flatMap(({featureSide:d,mateSide:h})=>[...d,...h].map(g))),u=await this.referenceQuery(o,a),y=this.getConf("nodeLimit"),x=this.getConf("context"),[m]=e,b=(d,h)=>r.getSubgraphs({path:d,start:c,end:s,context:h,snarls:this.getConf("subgraphSnarls"),haplotypes:"all",limit:y,signal:a.signal,keep:S=>f.has(g(S))}),pe=async d=>{let h=await b(d,x).catch(w=>{throw Q(z(w,y,s-c)??w,"lanes")}),S=Pe(h,f),R=Math.ceil(S/2)+2e3;return S>0&&R>x?b(d,R).catch(w=>{if(w instanceof Z)return h;throw w}):h};return(u&&m&&l.length>0?await $(e.length===1?`Reading ${m.queryAssemblyName} against ${m.targetAssemblyName}`:`Reading ${e.length} lane pairs`,a.statusCallback,()=>pe(u)):[]).flatMap(d=>l.flatMap(({pair:h,featureSide:S,mateSide:R})=>S.flatMap(w=>R.flatMap(le=>d.pairAlignments({target:w,query:le,bases:!1}).map(me=>xe({pair:me,lane:h.queryAssemblyName,mateLane:h.targetAssemblyName}))))))}getFeatures(t,e={}){let a=ce(t);return ne(async r=>{let{db:o,anchor:c,unreadableIndex:s}=await this.graph(e);if(!o.hasHaplotypeIndex)throw new I(s);if(a.assemblyName===c){let p=oe(e),l=p.length>0?await this.pairFeatures(a,p,e):await this.anchorFeatures(a,e);for(let f of l)r.next(f)}r.complete()},e.signal)}};export{D as HaplotypeWindowError,I as NoHaplotypeIndexError,de as PairTargetError,j as default,we as fragmentFeature,xe as pairFeature,Pe as widestWalkGap};
|
|
2
|
+
//# sourceMappingURL=GbzBaseSyntenyAdapter-TIXR4Y3J.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@10.2.4/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-VQWHMWLF.js", "../../src/GbzBaseSyntenyAdapter/companion.ts", "../../src/gaf/gafFile.ts", "../../src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n GBZ_CUT_DEFAULTS,\n cutWindowGFA,\n haplotypeWanted,\n referencePathQuery,\n referenceSamplesOf,\n resolveReferenceSample\n} from \"./chunk-Q7LYHGGQ.js\";\n\n// src/gbzCut.ts\nimport { GBZBase } from \"@gmod/gbz-base\";\nvar HPRC_GBZ = {\n db: \"https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.gbz.db\",\n index: \"https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.haplotype-index.f3.db\"\n};\nfunction haplotypeIndexBeside(db) {\n const GBZ_DB = /\\.gbz\\.db$/i;\n return GBZ_DB.test(db) ? db.replace(GBZ_DB, \".haplotype-index.db\") : void 0;\n}\nfunction parseRegion(text) {\n const m = /^\\s*([^:\\s]+):([\\d,]+)-([\\d,]+)\\s*$/.exec(text);\n if (!m) {\n throw new Error(\n `\"${text}\" is not a region like chr6:160,614,798-160,647,758`\n );\n }\n const n = (s) => Number(s.replaceAll(\",\", \"\"));\n const region = { refName: m[1], start: n(m[2]), end: n(m[3]) };\n if (region.end <= region.start) {\n throw new Error(`\"${text}\" ends at or before it starts`);\n }\n return region;\n}\nasync function openGbz(db, index) {\n const base = await GBZBase.open({ source: db, haplotypeIndex: index });\n return { base, referenceSamples: await referenceSamplesOf(base) };\n}\nfunction referenceSample(ref, samples) {\n try {\n return resolveReferenceSample({\n configured: \"\",\n anchorPrefix: ref ?? samples[0] ?? \"\",\n referenceSamples: samples\n });\n } catch (e) {\n if (ref) {\n return ref;\n }\n throw e;\n }\n}\nasync function cutGbzRegion({ base, referenceSamples }, src, signal) {\n const region = parseRegion(src.region);\n const sample = referenceSample(src.referenceSample, referenceSamples);\n const query = await referencePathQuery(base, sample, region.refName);\n if (!query) {\n throw new Error(`${sample} has no indexed path named ${region.refName}`);\n }\n signal?.throwIfAborted();\n const wanted = src.haplotypes?.length ? src.haplotypes : void 0;\n const text = await cutWindowGFA(base, query, region.start, region.end, {\n context: src.context ?? GBZ_CUT_DEFAULTS.context,\n snarls: src.snarls ?? GBZ_CUT_DEFAULTS.snarls,\n limit: GBZ_CUT_DEFAULTS.limit,\n signal,\n keep: wanted ? (name) => haplotypeWanted(name, wanted) : void 0\n });\n return { text, region, sample };\n}\n\nexport {\n HPRC_GBZ,\n haplotypeIndexBeside,\n parseRegion,\n openGbz,\n cutGbzRegion\n};\n", "import { haplotypeIndexBeside } from '@jbrowse/bandage-core/gbzCut'\nimport { openLocation } from '@jbrowse/core/util/io'\n\nimport { locationName, readsSiblings, renamed } from '../locationName'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { FileLocation } from '@jbrowse/core/util/types'\n\nexport function siblingCompanion(gbzDb: FileLocation) {\n return readsSiblings(gbzDb) && haplotypeIndexBeside(locationName(gbzDb))\n ? renamed(gbzDb, name => haplotypeIndexBeside(name)!)\n : undefined\n}\n\n// 404 is a missing file, and so is 403 from a bucket that does not let a\n// reader list it; anything else leaves the file's presence unknown\nfunction isMissing(error: unknown) {\n return (\n error instanceof Error &&\n (/\\bHTTP 40[34]\\b/.test(error.message) ||\n (error as { code?: unknown }).code === 'ENOENT')\n )\n}\n\n// `unreadable` is why a companion that may be there could not be checked, such\n// as a network error, or a server that answers a missing file without CORS\nexport async function findCompanion(\n gbzDb: FileLocation,\n pluginManager?: PluginManager,\n): Promise<{ location?: FileLocation; unreadable?: string }> {\n const candidate = siblingCompanion(gbzDb)\n if (!candidate) {\n return {}\n }\n try {\n await openLocation(candidate, pluginManager).stat()\n return { location: candidate }\n } catch (error) {\n return isMissing(error) ? {} : { unreadable: String(error) }\n }\n}\n", "import { unzip } from '@gmod/bgzf-filehandle'\nimport { parseGaf, parseGafLine } from '@jbrowse/bandage-core/gaf/parseGaf'\nimport { cachedSetup } from '@jbrowse/core/data_adapters/BaseAdapter'\n\nimport type { TabixIndexedFile } from '@gmod/tabix'\nimport type { GafRecord } from '@jbrowse/bandage-core/gaf/parseGaf'\n\ninterface WholeFile {\n stat(): Promise<{ size: number }>\n readFile(opts?: { signal?: AbortSignal }): Promise<Uint8Array>\n}\n\nexport interface GafReads {\n records: GafRecord[]\n // reads over the nodes before sampling\n total: number\n}\n\n// The tube map lays reads out on the main thread at about 40 ms per thousand\nexport const MAX_READS = 5000\n\n// An unindexed GAF is read whole, once, into the worker\nconst MAX_UNINDEXED_BYTES = 50 * 2 ** 20\n\nexport class UnindexedGafTooLargeError extends Error {\n override name = 'UnindexedGafTooLargeError'\n\n constructor(size: number) {\n super(\n `this GAF is ${(size / 2 ** 20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`,\n )\n }\n}\n\n// Evenly spaced, so a pileup thins out rather than losing its right half\nfunction sample(records: GafRecord[], max: number) {\n if (records.length <= max) {\n return records\n }\n const stride = records.length / max\n return Array.from({ length: max }, (_, k) => records[Math.floor(k * stride)]!)\n}\n\nconst touches = (record: GafRecord, names: ReadonlySet<string>) =>\n record.path.some(step => names.has(step.name))\n\n// A GAF over a graph's segments: bgzipped and indexed with `tabix -p gaf`,\n// which keys each line by its lowest and highest node id and so needs numeric\n// segment names, or plain or gzipped and read whole.\nexport class GafFile {\n // Shared by every window, so the signal is cachedSetup's own, which aborts\n // once no caller is left waiting\n private whole = cachedSetup({\n setup: async ({ signal }) => {\n const { size } = await this.file.stat()\n if (size > MAX_UNINDEXED_BYTES) {\n throw new UnindexedGafTooLargeError(size)\n }\n const bytes = await this.file.readFile({ signal })\n const text = new TextDecoder().decode(\n bytes[0] === 0x1f && bytes[1] === 0x8b ? await unzip(bytes) : bytes,\n )\n return parseGaf(text)\n },\n })\n\n constructor(\n private file: WholeFile,\n private tabix?: TabixIndexedFile,\n ) {}\n\n private async readIndexed(\n tabix: TabixIndexedFile,\n names: ReadonlySet<string>,\n signal?: AbortSignal,\n ) {\n let lo = Infinity\n let hi = -Infinity\n for (const name of names) {\n const id = Number(name)\n if (Number.isInteger(id)) {\n lo = Math.min(lo, id)\n hi = Math.max(hi, id)\n }\n }\n const records: GafRecord[] = []\n if (lo <= hi) {\n // a GAF index ignores the refName, and getLines keeps a read whose node\n // ids span min..max when min < end && max >= start, hence hi + 1\n await tabix.getLines('{node}', lo, hi + 1, {\n signal,\n lineCallback: line => {\n const record = parseGafLine(line)\n if (record && touches(record, names)) {\n records.push(record)\n }\n },\n })\n }\n return records\n }\n\n async readsOver(\n names: ReadonlySet<string>,\n { signal }: { signal?: AbortSignal } = {},\n ): Promise<GafReads> {\n const records = this.tabix\n ? await this.readIndexed(this.tabix, names, signal)\n : (await this.whole({ signal })).filter(r => touches(r, names))\n return { records: sample(records, MAX_READS), total: records.length }\n }\n}\n", "import { GBZBase, SubgraphLimitError } from '@gmod/gbz-base'\nimport {\n NodeLimitError,\n cutWindowTables,\n haplotypePrefix,\n haplotypeWanted,\n nodeLimitError,\n referencePathQuery,\n referenceSamplesOf,\n resolveReferenceSample,\n} from '@jbrowse/bandage-core/gbzWindow'\nimport {\n assemblyByPanSNPrefix,\n panSNMatchesPrefix,\n resolvePanSNPrefix,\n} from '@jbrowse/bandage-core/pansn'\nimport { cachedSetup } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { getBpDisplayStr, updateStatus } from '@jbrowse/core/util'\nimport { openLocation } from '@jbrowse/core/util/io'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\n\nimport { findCompanion } from './companion.ts'\nimport { walkCutFor } from '../RgfaTabixAdapter/walkRowRuns.ts'\nimport { GafFile } from '../gaf/gafFile.ts'\nimport { locationIsSet } from '../locationName.ts'\nimport { openTabixSlot } from '../panSNTabix.ts'\nimport { ComparativeAdapterBase } from '../synteny/ComparativeAdapterBase.ts'\nimport SyntenyFeature from '../synteny/SyntenyFeature.ts'\nimport { laneAssemblyName, requestedPairs } from '../synteny/lanePairs.ts'\n\nimport type { GbzBaseSyntenyAdapterConfig } from './configSchema.ts'\nimport type { SubgraphAdapterOptions } from '../GetSubgraph.ts'\nimport type { GafReads } from '../gaf/gafFile.ts'\nimport type { LaneFeatureOptions, LanePair } from '../synteny/lanePairs.ts'\nimport type {\n HaplotypeAlignment,\n HaplotypeRef,\n PairAlignment,\n PathName,\n PathQuery,\n Subgraph,\n} from '@gmod/gbz-base'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util'\nimport type { FileLocation, Region } from '@jbrowse/core/util/types'\n\nexport class NoHaplotypeIndexError extends Error {\n override name = 'NoHaplotypeIndexError'\n\n constructor(unreadable?: string) {\n super(\n unreadable === undefined\n ? 'no haplotype index is set, so the walks cannot be named; build one with gbz-haplotype-index (cargo install gbz-haplotype-index) and set it as haplotypeIndexLocation'\n : `the haplotype index beside the graph database could not be checked (${unreadable}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`,\n )\n }\n}\n\nexport interface GbzHaplotype {\n prefix: string\n sample: string\n haplotype: number\n contigs: string[]\n isReference: boolean\n}\n\n/**\n * One lane the header declares, in the shape MultiWaySyntenyDisplay's lane\n * picker reads: `name` is the lane's assembly name, the same string the\n * fetched features' mates carry, `label` its PanSN prefix and `group` its\n * sample, so a diploid sample's two lanes sit together\n */\ninterface GbzHeaderLane {\n name: string\n label: string\n group: string\n}\n\nexport { PairTargetError } from '../synteny/lanePairs.ts'\nexport type { LanePair } from '../synteny/lanePairs.ts'\n\nexport class HaplotypeWindowError extends Error {\n override name = 'HaplotypeWindowError'\n\n constructor(assemblyName: string, anchor: string) {\n super(\n `the graph is cut on its reference, ${anchor}; a window on ${assemblyName} has no reference coordinates to cut at. Open the graph from a ${anchor} view, and find this haplotype's lane there`,\n )\n }\n}\n\ntype ResolvedAlignment = Extract<HaplotypeAlignment, { resolved: true }>\n\n/**\n * The id of one haplotype fragment: the walk's GBWT position at its first node\n * in the window, which is a property of the graph, so the same fragment gets\n * the same id on a refetch of the same window and the display's hover and\n * selection survive it. `clipToRegion` suffixes the window.\n */\nfunction fragmentId(name: PathName, alignment: ResolvedAlignment) {\n return `${haplotypePrefix(name)}#${name.contig}@${alignment.start.node}.${alignment.start.offset}`\n}\n\nexport function fragmentFeature({\n alignment,\n assemblyName,\n refName,\n lane,\n}: {\n alignment: ResolvedAlignment\n assemblyName: string\n refName: string\n lane: string\n}) {\n const { refStart, refEnd, strand, cigar } = alignment\n if (refEnd <= refStart) {\n return undefined\n } else {\n const { name, hapStart, hapEnd } = alignment\n const id = fragmentId(name, alignment)\n const data: SimpleFeatureSerialized = {\n uniqueId: id,\n assemblyName,\n refName,\n start: refStart,\n end: refEnd,\n type: 'match',\n strand: strand === '-' ? -1 : 1,\n CIGAR: cigar,\n syntenyId: id,\n mate: {\n refName: name.contig,\n start: hapStart,\n end: hapEnd,\n assemblyName: lane,\n },\n }\n return new SyntenyFeature(data)\n }\n}\n\n/**\n * One record of a lane pair, on the target walk's own contig with the query\n * walk as its mate. gbz-base writes the CIGAR along the target, a `D` being\n * target bases the query lacks, which is the side a JBrowse feature is, so it\n * passes through unchanged.\n */\nexport function pairFeature({\n pair,\n lane,\n mateLane,\n}: {\n pair: PairAlignment\n lane: string\n mateLane: string\n}) {\n const id = `${haplotypePrefix(pair.target)}#${pair.target.contig}:${pair.targetStart}-${pair.targetEnd}|${haplotypePrefix(pair.query)}#${pair.query.contig}:${pair.queryStart}-${pair.queryEnd}`\n return new SyntenyFeature({\n uniqueId: id,\n assemblyName: lane,\n refName: pair.target.contig,\n start: pair.targetStart,\n end: pair.targetEnd,\n type: 'match',\n strand: pair.strand === '-' ? -1 : 1,\n CIGAR: pair.cigar,\n syntenyId: id,\n identity: pair.matches / Math.max(pair.columns, 1),\n numMatches: pair.matches,\n blockLen: pair.columns,\n mate: {\n refName: pair.query.contig,\n start: pair.queryStart,\n end: pair.queryEnd,\n assemblyName: mateLane,\n },\n })\n}\n\n// The longest detour a pair cut widens its context to take in\nconst BRIDGE_MAX_BP = 120_000\n\n/**\n * The widest gap, up to `BRIDGE_MAX_BP`, between two pieces of one kept walk:\n * a haplotype that left the cut's nodes for sequence the reference lacks and\n * came back. Two kept haplotypes that share that sequence only align across it\n * once its nodes are in the cut.\n */\nexport function widestWalkGap(subgraphs: Subgraph[], kept: Set<string>) {\n const byPath = new Map<string, [number, number][]>()\n for (const subgraph of subgraphs) {\n for (const { name, start, end } of subgraph.walkSpans()) {\n const prefix = haplotypePrefix(name)\n if (kept.has(prefix)) {\n const key = `${prefix}#${name.contig}`\n const spans = byPath.get(key)\n if (spans) {\n spans.push([start, end])\n } else {\n byPath.set(key, [[start, end]])\n }\n }\n }\n }\n let widest = 0\n for (const spans of byPath.values()) {\n spans.sort((a, b) => a[0] - b[0])\n for (let i = 1; i < spans.length; i++) {\n const gap = spans[i]![0] - spans[i - 1]![1]\n if (gap > 0 && gap <= BRIDGE_MAX_BP) {\n widest = Math.max(widest, gap)\n }\n }\n }\n return widest\n}\n\n// A window past the node limit fails as a zoom-in notice naming a span that\n// fits\nfunction zoomInNotice(error: unknown, what: string) {\n if (error instanceof NodeLimitError) {\n error.message = `Zoom in to about ${getBpDisplayStr(error.fitsBp)} to see ${what}`\n }\n return error\n}\n\n// gbz-base reads whole bp; a view asks at fractional ones\nconst wholeBp = (region: Region) => ({\n ...region,\n start: Math.floor(region.start),\n end: Math.ceil(region.end),\n})\n\nexport default class GbzBaseSyntenyAdapter extends ComparativeAdapterBase<GbzBaseSyntenyAdapterConfig> {\n private graph = cachedSetup({\n label: 'Opening pangenome database',\n setup: async () => {\n const gbzDb: FileLocation = this.getConf('gbzDbLocation')\n const configured: FileLocation = this.getConf('haplotypeIndexLocation')\n const companion = locationIsSet(configured)\n ? { location: configured }\n : await findCompanion(gbzDb, this.pluginManager)\n const indexLocation = companion.location\n const db = await GBZBase.open({\n source: openLocation(gbzDb, this.pluginManager),\n haplotypeIndex: indexLocation\n ? openLocation(indexLocation, this.pluginManager)\n : undefined,\n })\n const anchor = this.getConf('assemblyNames')[0]\n if (anchor === undefined) {\n throw new Error(\n 'GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as',\n )\n }\n const referenceSamples = await referenceSamplesOf(db)\n const referenceSample = resolveReferenceSample({\n configured: this.getConf('referenceSample'),\n anchorPrefix: resolvePanSNPrefix(this, anchor),\n referenceSamples,\n })\n return {\n db,\n anchor,\n referenceSample,\n referenceSamples,\n unreadableIndex: companion.unreadable,\n }\n },\n })\n\n /**\n * The indexed reference path a window on `refName` resolves against, or\n * undefined when the reference sample has no indexed path by that contig.\n */\n private async referenceQuery(\n refName: string,\n opts: BaseOptions,\n ): Promise<PathQuery | undefined> {\n const { db, referenceSample } = await this.graph(opts)\n return referencePathQuery(db, referenceSample, refName)\n }\n\n /**\n * Every haplotype the graph carries a walk for, `sample#haplotype` with its\n * contigs, from the Paths scan the adapter already makes; the lane picker's\n * source list. Reference samples are included and flagged.\n */\n async getHaplotypes(opts: BaseOptions = {}): Promise<GbzHaplotype[]> {\n const { db, referenceSamples } = await this.graph(opts)\n const byPrefix = new Map<string, GbzHaplotype>()\n for (const path of await db.paths()) {\n const prefix = haplotypePrefix(path.name)\n const entry = byPrefix.get(prefix)\n if (entry) {\n if (!entry.contigs.includes(path.name.contig)) {\n entry.contigs.push(path.name.contig)\n }\n } else {\n byPrefix.set(prefix, {\n prefix,\n sample: path.name.sample,\n haplotype: path.name.haplotype,\n contigs: [path.name.contig],\n isReference: referenceSamples.includes(path.name.sample),\n })\n }\n }\n return [...byPrefix.values()]\n }\n\n /**\n * `lanes` is every haplotype but the reference sample's own, which is the\n * anchor rather than a lane, declared up front so the display can offer the\n * whole graph's haplotypes before a fetch has placed any of them.\n */\n async getHeader(opts: BaseOptions = {}) {\n const { anchor, referenceSample, referenceSamples } = await this.graph(opts)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n const lanes: GbzHeaderLane[] = []\n for (const haplotype of await this.getHaplotypes(opts)) {\n if (haplotype.sample !== referenceSample) {\n lanes.push({\n name: laneAssemblyName(asmByPrefix, haplotype.prefix),\n label: haplotype.prefix,\n group: haplotype.sample,\n })\n }\n }\n return {\n hasCoarseTier: false,\n anchorAssemblyName: anchor,\n referenceSample,\n referenceSamples,\n lanes,\n }\n }\n\n async getRefNames(opts: BaseOptions = {}) {\n const { db, anchor, referenceSample } = await this.graph(opts)\n const { assemblyName } = opts\n const prefix =\n assemblyName === anchor\n ? undefined\n : resolvePanSNPrefix(this, assemblyName)\n const contigs = (await db.paths())\n .filter(path =>\n assemblyName === anchor\n ? path.isIndexed && path.name.sample === referenceSample\n : panSNMatchesPrefix(haplotypePrefix(path.name), prefix),\n )\n .map(path => path.name.contig)\n return [...new Set(contigs)]\n }\n\n /**\n * The predicate gbz-base builds a window for, from the lanes a fetch asks\n * for. With a companion whose stray rows cover the window gbz-base walks\n * only the wanted haplotypes; otherwise it names every walk and keeps the\n * ones the predicate accepts, and throws rather than guess when a walk has\n * no name. Either way a cut holds those walks, the reference, and the nodes\n * they visit. Undefined when every haplotype is wanted.\n */\n //\n // `targetPrefix` is a pairwise view's one lane, and it belongs in here: left\n // to filter what came back, it handed gbz-base no predicate, and every\n // haplotype in the graph was walked for one to be kept.\n private keepPredicate(\n haplotypes: string[] | undefined,\n targetPrefix?: string,\n ) {\n const wantedPrefixes =\n haplotypes === undefined || haplotypes.length === 0\n ? undefined\n : haplotypes.map(lane => resolvePanSNPrefix(this, lane))\n return wantedPrefixes === undefined && targetPrefix === undefined\n ? undefined\n : (name: PathName) =>\n haplotypeWanted(name, wantedPrefixes) &&\n (targetPrefix === undefined ||\n panSNMatchesPrefix(haplotypePrefix(name), targetPrefix))\n }\n\n /**\n * The graph view's cut of the window, as tables: the reference walk, every\n * top-level snarl contained in it, and one walk per haplotype, PanSN-named\n * when the database (or its companion) carries the haplotype index and\n * `unknown#N` otherwise. The reference walk is the first, which is the one\n * the view anchors on by default. With `haplotypes` the walks are that\n * set's and the nodes those walks visit, the reference walk kept. With\n * `walkRows` the rows' runs come along, as on a walk-file cut.\n *\n * Only a window on the anchor can be cut: a haplotype lane's coordinates\n * are its own contig's, and the graph is indexed for random access on the\n * reference sample's paths alone.\n */\n async getSubgraph(region: Region, opts: SubgraphAdapterOptions = {}) {\n const { signal } = opts\n const { db, anchor, referenceSample, unreadableIndex } = await this.graph({\n signal,\n })\n const { assemblyName, refName, start, end } = wholeBp(region)\n if (assemblyName !== anchor) {\n throw new HaplotypeWindowError(assemblyName, anchor)\n }\n const query = await this.referenceQuery(refName, { signal })\n if (!query) {\n throw new Error(\n `${referenceSample} has no indexed path ${refName} in this graph`,\n )\n }\n const keep = this.keepPredicate(opts.haplotypes)\n if (keep !== undefined && !db.hasHaplotypeIndex) {\n throw new NoHaplotypeIndexError(unreadableIndex)\n }\n const cut = await cutWindowTables(db, query, start, end, {\n context: this.getConf('context'),\n snarls: opts.snarls ?? this.getConf('subgraphSnarls'),\n limit: this.getConf('nodeLimit'),\n signal: opts.signal,\n keep,\n }).catch((error: unknown) => {\n throw zoomInNotice(error, 'the graph')\n })\n return typeof cut === 'string'\n ? cut\n : walkCutFor(cut, { start, end }, opts.walkRows)\n }\n\n private gaf = cachedSetup({\n label: 'Opening reads',\n setup: async () => {\n const location: FileLocation = this.getConf('readsLocation')\n const index: FileLocation = this.getConf(['readsIndex', 'location'])\n return locationIsSet(location)\n ? new GafFile(\n openLocation(location, this.pluginManager),\n locationIsSet(index)\n ? openTabixSlot(this, ['readsLocation'], ['readsIndex'])\n : undefined,\n )\n : undefined\n },\n })\n\n /**\n * The reads over a cut's segments, from `readsLocation`, sampled down to\n * what the tube map lays out at interactive speed\n */\n async getReads(\n nodeNames: string[],\n opts: BaseOptions = {},\n ): Promise<GafReads> {\n const gaf = await this.gaf(opts)\n return gaf\n ? gaf.readsOver(new Set(nodeNames), opts)\n : { records: [], total: 0 }\n }\n\n private async laneHaplotypes(\n assemblyName: string,\n opts: BaseOptions,\n ): Promise<HaplotypeRef[]> {\n const prefix = resolvePanSNPrefix(this, assemblyName)\n return (await this.getHaplotypes(opts)).filter(haplotype =>\n panSNMatchesPrefix(haplotype.prefix, prefix),\n )\n }\n\n private async anchorFeatures(region: Region, opts: LaneFeatureOptions) {\n const { db } = await this.graph(opts)\n const { assemblyName, refName, start, end } = region\n const targetPrefix = resolvePanSNPrefix(this, opts.targetAssemblyName)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n const keep = this.keepPredicate(opts.haplotypes, targetPrefix)\n const query = await this.referenceQuery(refName, opts)\n const nodeLimit: number = this.getConf('nodeLimit')\n const alignments = query\n ? await updateStatus(\n `Reading graph ${refName}:${start.toLocaleString()}-${end.toLocaleString()}`,\n opts.statusCallback,\n () =>\n db\n .getAlignments({\n path: query,\n start,\n end,\n context: this.getConf('context'),\n haplotypes: 'all',\n limit: nodeLimit,\n signal: opts.signal,\n keep,\n })\n .catch((error: unknown) => {\n throw zoomInNotice(\n nodeLimitError(error, nodeLimit, end - start) ?? error,\n 'lanes',\n )\n }),\n )\n : []\n return alignments.flatMap(alignment => {\n const feature = alignment.resolved\n ? fragmentFeature({\n alignment,\n assemblyName,\n refName,\n lane: laneAssemblyName(\n asmByPrefix,\n haplotypePrefix(alignment.name),\n ),\n })\n : undefined\n return feature === undefined ? [] : [feature]\n })\n }\n\n /**\n * Each pair's two lanes cut out of the anchor window alone, all pairs in one\n * cut, and each walk of a pair's query lane aligned to each walk of its\n * target lane on the nodes both visit, with no base compared. A pair's\n * records sit on its query lane's contigs, the lane the display draws on top.\n *\n * Whether the index has anchor rows changes only how fast gbz-base finds\n * the walks: both routes cut the same pieces.\n */\n private async pairFeatures(\n region: Region,\n pairs: LanePair[],\n opts: LaneFeatureOptions,\n ) {\n const { db } = await this.graph(opts)\n const { refName, start, end } = region\n const sides = await Promise.all(\n pairs.map(async pair => ({\n pair,\n featureSide: await this.laneHaplotypes(pair.queryAssemblyName, opts),\n mateSide: await this.laneHaplotypes(pair.targetAssemblyName, opts),\n })),\n )\n const answerable = sides.filter(\n ({ featureSide, mateSide }) =>\n featureSide.length > 0 && mateSide.length > 0,\n )\n const kept = new Set(\n answerable.flatMap(({ featureSide, mateSide }) =>\n [...featureSide, ...mateSide].map(haplotypePrefix),\n ),\n )\n const query = await this.referenceQuery(refName, opts)\n const nodeLimit: number = this.getConf('nodeLimit')\n const baseContext: number = this.getConf('context')\n const [first] = pairs\n const cut = (path: PathQuery, context: number) =>\n db.getSubgraphs({\n path,\n start,\n end,\n context,\n snarls: this.getConf('subgraphSnarls'),\n haplotypes: 'all',\n limit: nodeLimit,\n signal: opts.signal,\n keep: name => kept.has(haplotypePrefix(name)),\n })\n // a cut past the node limit for the wider context keeps the first one\n const bridged = async (path: PathQuery) => {\n const subgraphs = await cut(path, baseContext).catch((error: unknown) => {\n throw zoomInNotice(\n nodeLimitError(error, nodeLimit, end - start) ?? error,\n 'lanes',\n )\n })\n const gap = widestWalkGap(subgraphs, kept)\n const context = Math.ceil(gap / 2) + 2000\n return gap > 0 && context > baseContext\n ? cut(path, context).catch((error: unknown) => {\n if (error instanceof SubgraphLimitError) {\n return subgraphs\n }\n throw error\n })\n : subgraphs\n }\n const subgraphs =\n query && first && answerable.length > 0\n ? await updateStatus(\n pairs.length === 1\n ? `Reading ${first.queryAssemblyName} against ${first.targetAssemblyName}`\n : `Reading ${pairs.length} lane pairs`,\n opts.statusCallback,\n () => bridged(query),\n )\n : []\n return subgraphs.flatMap(subgraph =>\n answerable.flatMap(({ pair, featureSide, mateSide }) =>\n featureSide.flatMap(target =>\n mateSide.flatMap(mate =>\n subgraph\n .pairAlignments({ target, query: mate, bases: false })\n .map(alignment =>\n pairFeature({\n pair: alignment,\n lane: pair.queryAssemblyName,\n mateLane: pair.targetAssemblyName,\n }),\n ),\n ),\n ),\n ),\n )\n }\n\n getFeatures(asked: Region, opts: LaneFeatureOptions = {}) {\n const region = wholeBp(asked)\n return ObservableCreate<Feature>(async observer => {\n const { db, anchor, unreadableIndex } = await this.graph(opts)\n if (!db.hasHaplotypeIndex) {\n throw new NoHaplotypeIndexError(unreadableIndex)\n }\n // the graph is indexed on its reference alone, so a window on a\n // haplotype lane has no answer: a lane pair is read inside the anchor's\n if (region.assemblyName === anchor) {\n const pairs = requestedPairs(opts)\n const features =\n pairs.length > 0\n ? await this.pairFeatures(region, pairs, opts)\n : await this.anchorFeatures(region, opts)\n for (const feature of features) {\n observer.next(feature)\n }\n }\n observer.complete()\n }, opts.signal)\n }\n}\n"],
|
|
5
|
+
"mappings": "ixBAeA,SAASA,EAAqBC,EAAI,CAChC,IAAMC,EAAS,cACf,OAAOA,EAAO,KAAKD,CAAE,EAAIA,EAAG,QAAQC,EAAQ,qBAAqB,EAAI,MACvE,CCVO,SAASC,GAAiBC,EAAqB,CACpD,OAAOC,EAAcD,CAAK,GAAKE,EAAqBC,EAAaH,CAAK,CAAC,EACnEI,EAAQJ,EAAOK,GAAQH,EAAqBG,CAAI,CAAE,EAClD,MACN,CAIA,SAASC,GAAUC,EAAgB,CACjC,OACEA,aAAiB,QAChB,kBAAkB,KAAKA,EAAM,OAAO,GAClCA,EAA6B,OAAS,SAE7C,CAIA,eAAsBC,GACpBR,EACAS,EAC2D,CAC3D,IAAMC,EAAYX,GAAiBC,CAAK,EACxC,GAAI,CAACU,EACH,MAAO,CAAC,EAEV,GAAI,CACF,aAAMC,EAAaD,EAAWD,CAAa,EAAE,KAAK,EAC3C,CAAE,SAAUC,CAAU,CAC/B,OAASH,EAAO,CACd,OAAOD,GAAUC,CAAK,EAAI,CAAC,EAAI,CAAE,WAAY,OAAOA,CAAK,CAAE,CAC7D,CACF,CCrBO,IAAMK,GAAY,IAGnBC,GAAsB,GAAK,GAAK,GAEzBC,EAAN,cAAwC,KAAM,CAGnD,YAAYC,EAAc,CACxB,MACE,gBAAgBA,EAAO,GAAK,IAAI,QAAQ,CAAC,CAAC,+DAC5C,EALF,KAAS,KAAO,2BAMhB,CACF,EAGA,SAASC,GAAOC,EAAsBC,EAAa,CACjD,GAAID,EAAQ,QAAUC,EACpB,O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C,MAAM,KAAK,eAAetB,EAAQsB,CAAI,EAC5C,QAAW4B,KAAWgB,EACpBF,EAAS,KAAKd,CAAO,CAEzB,CACAc,EAAS,SAAS,CACpB,EAAG1C,EAAK,MAAM,CAChB,CACF",
|
|
6
|
+
"names": ["haplotypeIndexBeside", "db", "GBZ_DB", "siblingCompanion", "gbzDb", "readsSiblings", "haplotypeIndexBeside", "locationName", "renamed", "name", "isMissing", "error", "findCompanion", "pluginManager", "candidate", "openLocation", "MAX_READS", "MAX_UNINDEXED_BYTES", "UnindexedGafTooLargeError", "size", "sample", "records", "max", "stride", "_", "k", "touches", "record", "names", "step", "GafFile", "file", "tabix", "cachedSetup", "signal", "bytes", "text", "unzip", "parseGaf", "lo", "hi", "name", "id", "line", "parseGafLine", "r", "NoHaplotypeIndexError", "unreadable", "HaplotypeWindowError", "assemblyName", "anchor", "fragmentId", "name", "alignment", "haplotypePrefix", "fragmentFeature", "refName", "lane", "refStart", "refEnd", "strand", "cigar", "hapStart", "hapEnd", "id", "data", "SyntenyFeature", "pairFeature", "pair", "mateLane", "BRIDGE_MAX_BP", "widestWalkGap", "subgraphs", "kept", "byPath", "subgraph", "start", "end", "prefix", "key", "spans", "widest", "a", "b", "i", "gap", "zoomInNotice", "error", "what", "NodeLimitError", "getBpDisplayStr", "wholeBp", "region", "GbzBaseSyntenyAdapter", "ComparativeAdapterBase", "cachedSetup", "gbzDb", "configured", "companion", "locationIsSet", "findCompanion", "indexLocation", "db", "GBZBase", "openLocation", "referenceSamples", "referenceSamplesOf", "referenceSample", "resolveReferenceSample", "resolvePanSNPrefix", "location", "index", "GafFile", "openTabixSlot", "opts", "referencePathQuery", "byPrefix", "path", "entry", "asmByPrefix", "assemblyByPanSNPrefix", "lanes", "haplotype", "laneAssemblyName", "contigs", "panSNMatchesPrefix", "haplotypes", "targetPrefix", "wantedPrefixes", "haplotypeWanted", "signal", "unreadableIndex", "query", "keep", "cut", "cutWindowTables", "walkCutFor", "nodeNames", "gaf", "nodeLimit", "updateStatus", "nodeLimitError", "feature", "pairs", "answerable", "featureSide", "mateSide", "baseContext", "first", "context", "bridged", "SubgraphLimitError", "target", "mate", "asked", "ObservableCreate", "observer", "requestedPairs", "features"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-BJMRBVG3.js";import"./chunk-J6NZIAZF.js";import"./chunk-GOFS7BXK.js";import"./chunk-IJQTSJGT.js";import{k as d}from"./chunk-YSTMDXXX.js";import"./chunk-5SFGHDQA.js";import"./chunk-DZ4OUKQV.js";import"./chunk-MHPJB22Z.js";import"./chunk-XT766CZ5.js";import"./chunk-EWFJBQDV.js";import"./chunk-3Q4RBDCL.js";import"./chunk-AU73K7LX.js";import"./chunk-TXI43PEN.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import"./chunk-446RWIA3.js";import"./chunk-5OI6LO4I.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as x}from"./chunk-6OPB7FOJ.js";import{A as l,F as L,H as p,d as s,i as v,o as n,x as G}from"./chunk-E3WYW7Z6.js";import{a as y,b as a,c as r,d as i}from"./chunk-JMBDTNUR.js";var w=d()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}}),E=i(function({model:e}){let{classes:t}=w();return e.isLoading?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[a(v,{variant:"h6",message:e.statusMessage}),a(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),a(G,{variant:"indeterminate"})]}):e.error?a(l,{className:t.paper,children:a(s,{error:e.error,onReset:()=>{e.retryLoad()}})}):a(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[a(p,{variant:"h6",children:"Loading canceled"}),a(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),g=E;var F=`H VN:Z:1.0
|
|
2
2
|
S 1 ACGT
|
|
3
3
|
S 2 GGCC
|
|
4
4
|
S 3 TTAA
|
|
@@ -7,4 +7,4 @@ L 1 + 2 + 0M
|
|
|
7
7
|
L 1 + 3 + 0M
|
|
8
8
|
L 2 + 4 + 0M
|
|
9
9
|
L 3 + 4 + 0M`,S=d()({column:{display:"flex",flexDirection:"column",gap:8},rowEnd:{display:"flex",gap:8,alignItems:"flex-end"},rowCenter:{display:"flex",gap:8,alignItems:"center"},flex1:{flex:1},paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto"},header:{marginBottom:12},footer:{marginTop:12,display:"flex",justifyContent:"flex-end"}}),T=i(function({model:e}){let{classes:t}=S(),[m,M]=x("");function u(){let o=m.trim();o&&e.loadGFAFromLocation({uri:o,locationType:"UriLocation"})}function N(o){let c=o.target.files?.[0];o.target.value="",c&&c.text().then(f=>e.loadGFA(f,c.name)).catch(f=>{e.setError(f)})}return r(l,{className:t.paper,children:[a("div",{className:t.header,children:a(p,{variant:"h6",children:"Load a GFA graph"})}),r("div",{className:t.column,children:[r("div",{className:t.rowCenter,children:[r(n,{variant:"outlined",component:"label",size:"small",children:["Choose file",a("input",{type:"file",accept:".gfa,.gfa1,.gfa2",hidden:!0,onChange:o=>{N(o)}})]}),a(p,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),r("div",{className:t.rowEnd,children:[a(L,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:m,onChange:o=>{M(o.target.value)},onKeyDown:o=>{o.key==="Enter"&&u()},className:t.flex1}),a(n,{variant:"contained",onClick:()=>{u()},disabled:!m.trim(),children:"Open"})]})]}),a("div",{className:t.footer,children:a(n,{size:"small",onClick:()=>{e.loadGFA(F,"Example graph")},children:"Load 4-node example"})}),e.error?a(s,{error:e.error}):null]})}),P=T;var A=i(function({model:e}){return e.hasGraph?a(C,{model:e}):e.canRetryLoad&&(e.error||e.loadCanceled)?a(g,{model:e}):r(y,{children:[e.isLoading?a(g,{model:e}):null,a("div",{hidden:e.isLoading,children:a(P,{model:e})})]})}),J=A;export{J as default};
|
|
10
|
-
//# sourceMappingURL=GraphGenomeView-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-Z2WZKEEO.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/GraphLoadStatus.tsx", "../../src/GraphGenomeView/components/ImportForm.tsx", "../../src/GraphGenomeView/components/GraphGenomeView.tsx"],
|
|
4
4
|
"sourcesContent": ["import { ErrorBanner, LoadingEllipses } from '@jbrowse/core/ui'\nimport { Button, LinearProgress, Paper, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n paper: {\n padding: 16,\n margin: 8,\n maxWidth: 560,\n marginInline: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 8,\n },\n})\n\n// What a view with no graph on screen shows while its load runs, and after a\n// load of a source it can retry was canceled or failed.\nconst GraphLoadStatus = observer(function GraphLoadStatus({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n if (model.isLoading) {\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-loading\">\n <div className={classes.row}>\n <LoadingEllipses variant=\"h6\" message={model.statusMessage} />\n <Button\n size=\"small\"\n data-testid=\"graph-genome-cancel\"\n onClick={() => {\n model.cancelLoad()\n }}\n >\n Cancel\n </Button>\n </div>\n <LinearProgress variant=\"indeterminate\" />\n </Paper>\n )\n }\n if (model.error) {\n return (\n <Paper className={classes.paper}>\n <ErrorBanner\n error={model.error}\n onReset={() => {\n model.retryLoad()\n }}\n />\n </Paper>\n )\n }\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-load-canceled\">\n <div className={classes.row}>\n <Typography variant=\"h6\">Loading canceled</Typography>\n <Button\n variant=\"contained\"\n size=\"small\"\n data-testid=\"graph-genome-retry\"\n onClick={() => {\n model.retryLoad()\n }}\n >\n Retry\n </Button>\n </div>\n </Paper>\n )\n})\n\nexport default GraphLoadStatus\n", "import { useState } from 'react'\n\nimport { ErrorBanner } from '@jbrowse/core/ui'\nimport { Button, Paper, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst EXAMPLE_GFA = `H\\tVN:Z:1.0\nS\\t1\\tACGT\nS\\t2\\tGGCC\nS\\t3\\tTTAA\nS\\t4\\tCCGG\nL\\t1\\t+\\t2\\t+\\t0M\nL\\t1\\t+\\t3\\t+\\t0M\nL\\t2\\t+\\t4\\t+\\t0M\nL\\t3\\t+\\t4\\t+\\t0M`\n\nconst useStyles = makeStyles()({\n column: { display: 'flex', flexDirection: 'column', gap: 8 },\n rowEnd: { display: 'flex', gap: 8, alignItems: 'flex-end' },\n rowCenter: { display: 'flex', gap: 8, alignItems: 'center' },\n flex1: { flex: 1 },\n paper: { padding: 16, margin: 8, maxWidth: 560, marginInline: 'auto' },\n header: { marginBottom: 12 },\n footer: { marginTop: 12, display: 'flex', justifyContent: 'flex-end' },\n})\n\nconst ImportForm = observer(function ImportForm({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const [url, setUrl] = useState('')\n\n function handleUrlLoad() {\n const uri = url.trim()\n if (uri) {\n void model.loadGFAFromLocation({ uri, locationType: 'UriLocation' })\n }\n }\n\n function handleFileUpload(event: React.ChangeEvent<HTMLInputElement>) {\n const file = event.target.files?.[0]\n // or picking the same file again fires no change\n event.target.value = ''\n if (file) {\n file\n .text()\n .then(text => model.loadGFA(text, file.name))\n .catch((err: unknown) => {\n model.setError(err)\n })\n }\n }\n\n return (\n <Paper className={classes.paper}>\n <div className={classes.header}>\n <Typography variant=\"h6\">Load a GFA graph</Typography>\n </div>\n\n <div className={classes.column}>\n <div className={classes.rowCenter}>\n <Button variant=\"outlined\" component=\"label\" size=\"small\">\n Choose file\n <input\n type=\"file\"\n accept=\".gfa,.gfa1,.gfa2\"\n hidden\n onChange={event => {\n handleFileUpload(event)\n }}\n />\n </Button>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Whole-file GFA; best for small/medium graphs.\n </Typography>\n </div>\n\n <div className={classes.rowEnd}>\n <TextField\n size=\"small\"\n label=\"URL\"\n placeholder=\"https://example.com/graph.gfa\"\n value={url}\n onChange={e => {\n setUrl(e.target.value)\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n handleUrlLoad()\n }\n }}\n className={classes.flex1}\n />\n <Button\n variant=\"contained\"\n onClick={() => {\n handleUrlLoad()\n }}\n disabled={!url.trim()}\n >\n Open\n </Button>\n </div>\n </div>\n\n <div className={classes.footer}>\n <Button\n size=\"small\"\n onClick={() => {\n void model.loadGFA(EXAMPLE_GFA, 'Example graph')\n }}\n >\n Load 4-node example\n </Button>\n </div>\n\n {model.error ? <ErrorBanner error={model.error} /> : null}\n </Paper>\n )\n})\n\nexport default ImportForm\n", "import { observer } from 'mobx-react'\n\nimport GraphCanvas from './GraphCanvas'\nimport GraphLoadStatus from './GraphLoadStatus'\nimport ImportForm from './ImportForm'\n\nimport type { GraphPaneModel } from '../model'\n\nconst GraphGenomeView = observer(function GraphGenomeView({\n model,\n}: {\n model: GraphPaneModel\n}) {\n if (model.hasGraph) {\n return <GraphCanvas model={model} />\n }\n // A launched or restored view has a source of its own, so the import form\n // has nothing to offer it when that source fails\n if (model.canRetryLoad && (model.error || model.loadCanceled)) {\n return <GraphLoadStatus model={model} />\n }\n // Hidden rather than unmounted, so a typed URL survives a failed load\n return (\n <>\n {model.isLoading ? <GraphLoadStatus model={model} /> : null}\n <div hidden={model.isLoading}>\n <ImportFor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BACP,OAAM,GACN,SAAUN,GAAS,CACjBD,EAAiBC,CAAK,CACxB,EACF,GACF,EACAM,EAACC,EAAA,CAAW,QAAQ,UAAU,MAAM,iBAAiB,yDAErD,GACF,EAEAH,EAAC,OAAI,UAAWX,EAAQ,OACtB,UAAAa,EAACG,EAAA,CACC,KAAK,QACL,MAAM,MACN,YAAY,gCACZ,MAAOf,EACP,SAAUgB,GAAK,CACbf,EAAOe,EAAE,OAAO,KAAK,CACvB,EACA,UAAWA,GAAK,CACVA,EAAE,MAAQ,SACZb,EAAc,CAElB,EACA,UAAWJ,EAAQ,MACrB,EACAa,EAACE,EAAA,CACC,QAAQ,YACR,QAAS,IAAM,CACbX,EAAc,CAChB,EACA,SAAU,CAACH,EAAI,KAAK,EACrB,gBAED,GACF,GACF,EAEAY,EAAC,OAAI,UAAWb,EAAQ,OACtB,SAAAa,EAACE,EAAA,CACC,KAAK,QACL,QAAS,IAAM,CACRhB,EAAM,QAAQL,EAAa,eAAe,CACjD,EACD,+BAED,EACF,EAECK,EAAM,MAAQc,EAACK,EAAA,CAAY,MAAOnB,EAAM,MAAO,EAAK,MACvD,CAEJ,CAAC,EAEMoB,EAAQtB,ECtHf,IAAMuB,EAAkBC,EAAS,SAAyB,CACxD,MAAAC,CACF,EAEG,CACD,OAAIA,EAAM,SACDC,EAACC,EAAA,CAAY,MAAOF,EAAO,EAIhCA,EAAM,eAAiBA,EAAM,OAASA,EAAM,cACvCC,EAACE,EAAA,CAAgB,MAAOH,EAAO,EAItCI,EAAAC,EAAA,CACG,UAAAL,EAAM,UAAYC,EAACE,EAAA,CAAgB,MAAOH,EAAO,EAAK,KACvDC,EAAC,OAAI,OAAQD,EAAM,UACjB,SAAAC,EAACK,EAAA,CAAW,MAAON,EAAO,EAC5B,GACF,CAEJ,CAAC,EAEMO,EAAQT",
|
|
6
6
|
"names": ["useStyles", "makeStyles", "GraphLoadStatus", "observer", "model", "classes", "jsxs", "Paper", "jsx", "LoadingEllipses", "Button", "LinearProgress", "ErrorBanner", "Typography", "GraphLoadStatus_default", "EXAMPLE_GFA", "useStyles", "makeStyles", "ImportForm", "observer", "model", "classes", "url", "setUrl", "useState", "handleUrlLoad", "uri", "handleFileUpload", "event", "file", "text", "err", "jsxs", "Paper", "jsx", "Typography", "Button", "TextField", "e", "ErrorBanner", "ImportForm_default", "GraphGenomeView", "observer", "model", "jsx", "GraphCanvas_default", "GraphLoadStatus_default", "jsxs", "Fragment", "ImportForm_default", "GraphGenomeView_default"]
|
|
7
7
|
}
|
package/dist/chunks/{GraphTrackSettingsDialog-EQ5W5KTL.js → GraphTrackSettingsDialog-TAM6PMXD.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as G}from"./chunk-
|
|
1
|
+
import{b as G}from"./chunk-J6NZIAZF.js";import{b as H,c as x}from"./chunk-E2QPSDQL.js";import{k as h}from"./chunk-YSTMDXXX.js";import"./chunk-MHPJB22Z.js";import"./chunk-AU73K7LX.js";import"./chunk-MVVXRZXV.js";import"./chunk-446RWIA3.js";import"./chunk-5OI6LO4I.js";import{g as u}from"./chunk-6OPB7FOJ.js";import{D as v,F as f,H as c,n as g,s as b,w as S,z as C}from"./chunk-E3WYW7Z6.js";import{b as a,c as l,d as i}from"./chunk-JMBDTNUR.js";var F=h()({section:{marginBottom:24},formControl:{minWidth:200}}),M=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],I=i(function({model:t}){let{classes:e}=F();return t.adapterConfig.type==="RgfaTabixAdapter"&&!H(t.adapterConfig)?l("div",{className:e.section,children:[l(b,{className:e.formControl,children:[a(S,{children:"Graph context"}),a(v,{value:t.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:o=>{t.setSubgraphContext(o.target.value),t.cut()},children:M.map(({value:o,label:p})=>a(C,{value:o,children:p},o))})]}),a(c,{variant:"caption",component:"div",color:"text.secondary",children:"How far the cut follows links out of the region. At none, a detour that leaves the window draws as two stubs. No effect on gfa-to-tabix's default anchored index."})]}):null}),L=I;var N=h()({section:{marginBottom:24}});function P(n){let t=n.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e!=="");return t.length===0?void 0:t}var T=i(function({model:t}){let[e,o]=u(t.cutHaplotypes?.join(", ")??""),p=()=>{let r=P(e)??[];r.join(`
|
|
2
2
|
`)===(t.cutHaplotypes??[]).join(`
|
|
3
3
|
`)||(t.setSubgraphHaplotypes(r),t.cut())};return a(f,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:e,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:r=>{o(r.target.value)},onBlur:()=>{p()},onKeyDown:r=>{r.key==="Enter"&&p()}})}),w=i(function({model:t,names:e}){let[o,p]=u(t.cutHaplotypes??[]),[r,d]=u(!1),m=s=>{s.join(`
|
|
4
4
|
`)!==(t.cutHaplotypes??[]).join(`
|
|
5
5
|
`)&&(t.setSubgraphHaplotypes(s),t.cut())};return a(g,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:e,value:o,open:r,onOpen:()=>{d(!0)},onClose:()=>{d(!1),m(o)},onChange:(s,y)=>{p(y),r||m(y)},renderInput:s=>a(f,{...s,label:"Haplotypes",placeholder:o.length===0?"every haplotype":void 0,slotProps:{...s.slotProps,htmlInput:{...s.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),D=i(function({model:t}){let{classes:e}=N(),o=t.haplotypeNames,p=t.cutHaplotypes?.join(",")??"";return x(t.adapterConfig)?l("div",{className:e.section,children:[o?a(w,{model:t,names:o},p):a(T,{model:t},p),l(c,{variant:"caption",component:"div",color:"text.secondary",children:[o?`Which of the graph's ${o.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`:"Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas."," ","Empty is every haplotype."]})]}):null}),k=D;function B({model:n,open:t,onClose:e}){return l(G,{model:n,open:t,onClose:e,children:[a(L,{model:n}),a(k,{model:n})]})}export{B as default};
|
|
6
|
-
//# sourceMappingURL=GraphTrackSettingsDialog-
|
|
6
|
+
//# sourceMappingURL=GraphTrackSettingsDialog-TAM6PMXD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as v,p as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=HighlightColorDialog-
|
|
1
|
+
import{o as v,p as C}from"./chunk-DZ4OUKQV.js";import"./chunk-MHPJB22Z.js";import"./chunk-AU73K7LX.js";import"./chunk-446RWIA3.js";import{F as g,H as t,c as u,o as y,q as c,r as d,z as s}from"./chunk-E3WYW7Z6.js";import{a as h,b as l,c as p,d as m}from"./chunk-JMBDTNUR.js";var b=m(function({model:o,onClose:r}){return p(u,{open:!0,onClose:r,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(t,{variant:"subtitle2",children:"Haplotype"}),l(t,{variant:"subtitle2",children:"Color by"}),l(t,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(f,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:e=>{o.setWalkColor(a,{field:e})},onScheme:e=>{o.setWalkColor(a,{scheme:e})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:r,children:"Done"})})]})});function f({label:i,field:o,scheme:r,onField:a,onScheme:n}){return p(h,{children:[l(t,{variant:"body2",children:i}),l(g,{select:!0,size:"small",value:o,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${i} by`}}},onChange:e=>{a(e.target.value)},children:v.map(e=>l(s,{value:e.value,children:e.label},e.value))}),l(g,{select:!0,size:"small",value:r,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${i}`}}},onChange:e=>{n(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||o==="reference").map(e=>l(s,{value:e.value,children:e.label},e.value))})]})}var P=b;export{P as default};
|
|
2
|
+
//# sourceMappingURL=HighlightColorDialog-EYBKFSJU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"./chunk-BJMRBVG3.js";import"./chunk-J6NZIAZF.js";import"./chunk-GOFS7BXK.js";import"./chunk-IJQTSJGT.js";import"./chunk-YSTMDXXX.js";import"./chunk-5SFGHDQA.js";import"./chunk-DZ4OUKQV.js";import"./chunk-MHPJB22Z.js";import"./chunk-XT766CZ5.js";import"./chunk-EWFJBQDV.js";import"./chunk-3Q4RBDCL.js";import"./chunk-AU73K7LX.js";import"./chunk-TXI43PEN.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import"./chunk-446RWIA3.js";import"./chunk-5OI6LO4I.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as y}from"./chunk-6OPB7FOJ.js";import"./chunk-E3WYW7Z6.js";import{b as e,c as l,d as T}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/display-kit/DisplayBackgroundProgress"];var v=s&&s.__esModule?s.default:s;var i=JBrowseExports["@jbrowse/display-kit/DisplayErrorBar"];var h=i&&i.__esModule?i.default:i;var a=JBrowseExports["@jbrowse/display-kit/DisplayLoadingOverlay"];var O=a&&a.__esModule?a.default:a;var n=JBrowseExports["@jbrowse/display-kit/TooLargeMessage"];var f=n&&n.__esModule?n.default:n;var t=JBrowseExports["@jbrowse/display-ui"],p=r=>t!=null&&r in Object(t)?t[r]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+r+"' from '@jbrowse/display-ui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:r});var w=p("BottomRightCornerContext");var c=p("TrackOverlayPortal");var L=p("useChromeOverlayOverride");var j=t&&t.__esModule?t.default:t;var D={TooLarge:f,ErrorBar:h,Loading:O,BackgroundProgress:v};function d({model:r,phase:o,drawn:u,testid:_,style:C,children:E,...B}){let{TooLarge:G,ErrorBar:S,Loading:b,BackgroundProgress:m}=L()??D,[P,A]=y(null),x={...B,"data-testid":_,"data-display-id":r.configuration.displayId,"data-display-drawn":u,"data-display-phase":o};return o==="tooLarge"?e("div",{style:{display:"contents"},...x,children:e(c,{children:e("div",{style:{pointerEvents:"auto"},children:e(G,{model:r})})})}):l("div",{style:{position:"relative",height:r.height,...C},...x,children:[e(w,{value:P,children:E}),l(c,{children:[e(S,{model:r,visible:o==="error"}),e(b,{model:r,visible:o==="loading"||o==="canceled",immediate:!u}),e("div",{ref:A,style:{position:"absolute",bottom:2,right:2,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none"},children:e(m,{model:r,visible:o==="ready"})})]})]})}var I=T(function({model:o}){return e(d,{model:o,phase:o.displayPhase,drawn:o.painted&&o.geometryPainted,testid:"linear-graph-display","data-layout":o.chosenLayoutMode,"data-cut-tier":o.cutTier,"data-recuts":o.recuts,"data-node-count":o.hasGraph?o.nodeCount:void 0,"data-loading":o.isLoading?"":void 0,style:{width:o.paneWidth,height:o.height,overflow:"hidden"},children:e(g,{model:o,ownChrome:!1})})}),Q=I;export{Q as default};
|
|
2
|
+
//# sourceMappingURL=LinearGraphDisplay-WIBVWRQE.js.map
|
package/dist/chunks/{LinearGraphDisplay-MQ4LD2RQ.js.map → LinearGraphDisplay-WIBVWRQE.js.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["host:@jbrowse/display-kit/DisplayBackgroundProgress", "host:@jbrowse/display-kit/DisplayErrorBar", "host:@jbrowse/display-kit/DisplayLoadingOverlay", "host:@jbrowse/display-kit/TooLargeMessage", "host:@jbrowse/display-ui", "../../src/LinearGraphDisplay/components/GraphStatusChrome.tsx", "../../src/LinearGraphDisplay/components/LinearGraphDisplay.tsx"],
|
|
4
4
|
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/display-kit/DisplayBackgroundProgress\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayBackgroundProgress\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayErrorBar\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayErrorBar\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayLoadingOverlay\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayLoadingOverlay\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/TooLargeMessage\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/TooLargeMessage\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-ui\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-ui\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport const AXIS_GUTTER_WIDTH_PX = /* @__PURE__ */ read(\"AXIS_GUTTER_WIDTH_PX\")\nexport const AXIS_RIGHT_INSET_PX = /* @__PURE__ */ read(\"AXIS_RIGHT_INSET_PX\")\nexport const AxisCaption = /* @__PURE__ */ read(\"AxisCaption\")\nexport const AxisCaptionOverlay = /* @__PURE__ */ read(\"AxisCaptionOverlay\")\nexport const AxisGutter = /* @__PURE__ */ read(\"AxisGutter\")\nexport const BOTTOM_RIGHT_CONTROLS_ORDER = /* @__PURE__ */ read(\"BOTTOM_RIGHT_CONTROLS_ORDER\")\nexport const BottomRightCornerContext = /* @__PURE__ */ read(\"BottomRightCornerContext\")\nexport const COMPACT_AXIS_HEIGHT = /* @__PURE__ */ read(\"COMPACT_AXIS_HEIGHT\")\nexport const CrossHatchLines = /* @__PURE__ */ read(\"CrossHatchLines\")\nexport const CrossHatches = /* @__PURE__ */ read(\"CrossHatches\")\nexport const DEFAULT_RULE_COLOR = /* @__PURE__ */ read(\"DEFAULT_RULE_COLOR\")\nexport const DisplayChromeOverlayProvider = /* @__PURE__ */ read(\"DisplayChromeOverlayProvider\")\nexport const DisplayUIProvider = /* @__PURE__ */ read(\"DisplayUIProvider\")\nexport const FLOATING_LEGEND_RIGHT_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_RIGHT_PX\")\nexport const FLOATING_LEGEND_TOP_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_TOP_PX\")\nexport const FloatingLegend = /* @__PURE__ */ read(\"FloatingLegend\")\nexport const FloatingSvgOverlay = /* @__PURE__ */ read(\"FloatingSvgOverlay\")\nexport const FloatingText = /* @__PURE__ */ read(\"FloatingText\")\nexport const PointerLayer = /* @__PURE__ */ read(\"PointerLayer\")\nexport const SCORE_CAPTION_HEIGHT = /* @__PURE__ */ read(\"SCORE_CAPTION_HEIGHT\")\nexport const ScoreDomainCaption = /* @__PURE__ */ read(\"ScoreDomainCaption\")\nexport const ScoreRuleLines = /* @__PURE__ */ read(\"ScoreRuleLines\")\nexport const ScoreRules = /* @__PURE__ */ read(\"ScoreRules\")\nexport const SvgHaloText = /* @__PURE__ */ read(\"SvgHaloText\")\nexport const TEXT_BASELINE_RATIO = /* @__PURE__ */ read(\"TEXT_BASELINE_RATIO\")\nexport const Tooltip = /* @__PURE__ */ read(\"Tooltip\")\nexport const TrackControlProvider = /* @__PURE__ */ read(\"TrackControlProvider\")\nexport const TrackOverlayContext = /* @__PURE__ */ read(\"TrackOverlayContext\")\nexport const TrackOverlayPortal = /* @__PURE__ */ read(\"TrackOverlayPortal\")\nexport const TrackOverlaySlot = /* @__PURE__ */ read(\"TrackOverlaySlot\")\nexport const YSCALEBAR_LABEL_OFFSET = /* @__PURE__ */ read(\"YSCALEBAR_LABEL_OFFSET\")\nexport const YScaleBar = /* @__PURE__ */ read(\"YScaleBar\")\nexport const YScaleBarOverlay = /* @__PURE__ */ read(\"YScaleBarOverlay\")\nexport const axisDrawn = /* @__PURE__ */ read(\"axisDrawn\")\nexport const axisGutterLeft = /* @__PURE__ */ read(\"axisGutterLeft\")\nexport const axisGutterWidth = /* @__PURE__ */ read(\"axisGutterWidth\")\nexport const axisPlotBox = /* @__PURE__ */ read(\"axisPlotBox\")\nexport const clampStrokeInsideAxis = /* @__PURE__ */ read(\"clampStrokeInsideAxis\")\nexport const cullOverlappingLabels = /* @__PURE__ */ read(\"cullOverlappingLabels\")\nexport const formatScore = /* @__PURE__ */ read(\"formatScore\")\nexport const isLiveModel = /* @__PURE__ */ read(\"isLiveModel\")\nexport const leftAxisGutterWidth = /* @__PURE__ */ read(\"leftAxisGutterWidth\")\nexport const plainChromeOverlays = /* @__PURE__ */ read(\"plainChromeOverlays\")\nexport const plainTrackControl = /* @__PURE__ */ read(\"plainTrackControl\")\nexport const resolveOverlays = /* @__PURE__ */ read(\"resolveOverlays\")\nexport const scoreToAxisY = /* @__PURE__ */ read(\"scoreToAxisY\")\nexport const textHalo = /* @__PURE__ */ read(\"textHalo\")\nexport const tooLargeBannerText = /* @__PURE__ */ read(\"tooLargeBannerText\")\nexport const useChromeOverlayOverride = /* @__PURE__ */ read(\"useChromeOverlayOverride\")\nexport const useTooltip = /* @__PURE__ */ read(\"useTooltip\")\nexport const useTrackControlMenu = /* @__PURE__ */ read(\"useTrackControlMenu\")\nexport const useTrackControlOverride = /* @__PURE__ */ read(\"useTrackControlOverride\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\nimport type { CSSProperties, ReactNode } from 'react'\n\nimport DisplayBackgroundProgress from '@jbrowse/display-kit/DisplayBackgroundProgress'\nimport DisplayErrorBar from '@jbrowse/display-kit/DisplayErrorBar'\nimport DisplayLoadingOverlay from '@jbrowse/display-kit/DisplayLoadingOverlay'\nimport TooLargeMessage from '@jbrowse/display-kit/TooLargeMessage'\nimport {\n BottomRightCornerContext,\n TrackOverlayPortal,\n useChromeOverlayOverride,\n} from '@jbrowse/display-ui'\n\nimport type { LinearGraphDisplayModel } from '../model'\nimport type { DisplayStatusPhase } from '@jbrowse/render-core/displayPhase'\n\nconst muiOverlays = {\n TooLarge: TooLargeMessage,\n ErrorBar: DisplayErrorBar,\n Loading: DisplayLoadingOverlay,\n BackgroundProgress: DisplayBackgroundProgress,\n}\n\n/**\n * The status chrome of a display that owns its canvas: the zoom-in notice in\n * place of the display, and the error bar, loading overlay and progress chip\n * over it in the track's overlay layer. Core's `DisplayStatusChrome` drew this\n * until jbrowse-web main removed it on 2026-10-08 (d8db736896), and its named\n * import came back undefined there, failing the track with React error #130.\n * Built here from the overlays every host from 5.0.0-beta.11 serves.\n */\nexport default function GraphStatusChrome({\n model,\n phase,\n drawn,\n testid,\n style,\n children,\n ...dataProps\n}: {\n model: LinearGraphDisplayModel\n phase: DisplayStatusPhase\n drawn: boolean\n testid: string\n style?: CSSProperties\n children: ReactNode\n} & Record<`data-${string}`, unknown>) {\n const { TooLarge, ErrorBar, Loading, BackgroundProgress } =\n useChromeOverlayOverride() ?? muiOverlays\n const [corner, setCorner] = useState<HTMLDivElement | null>(null)\n const attributes = {\n ...dataProps,\n 'data-testid': testid,\n 'data-display-id': model.configuration.displayId,\n 'data-display-drawn': drawn,\n 'data-display-phase': phase,\n }\n if (phase === 'tooLarge') {\n return (\n <div style={{ display: 'contents' }} {...attributes}>\n <TrackOverlayPortal>\n <div style={{ pointerEvents: 'auto' }}>\n <TooLarge model={model} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n }\n return (\n <div\n style={{ position: 'relative', height: model.height, ...style }}\n {...attributes}\n >\n <BottomRightCornerContext value={corner}>\n {children}\n </BottomRightCornerContext>\n <TrackOverlayPortal>\n <ErrorBar model={model} visible={phase === 'error'} />\n <Loading\n model={model}\n visible={phase === 'loading' || phase === 'canceled'}\n immediate={!drawn}\n />\n <div\n ref={setCorner}\n style={{\n position: 'absolute',\n bottom: 2,\n right: 2,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: 4,\n pointerEvents: 'none',\n }}\n >\n <BackgroundProgress model={model} visible={phase === 'ready'} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n}\n", "import { observer } from 'mobx-react'\n\nimport GraphStatusChrome from './GraphStatusChrome'\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <GraphStatusChrome\n model={model}\n phase={model.displayPhase}\n drawn={model.painted && model.geometryPainted}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n <GraphCanvas model={model} ownChrome={false} />\n </GraphStatusChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "0pBAAA,IA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AS,UAAW,EAAI,GAAGD,EACvC,SAAAC,EAACC,EAAA,CACC,SAAAD,EAAC,OAAI,MAAO,CAAE,cAAe,MAAO,EAClC,SAAAA,EAACT,EAAA,CAAS,MAAOP,EAAO,EAC1B,EACF,EACF,EAIFkB,EAAC,OACC,MAAO,CAAE,SAAU,WAAY,OAAQlB,EAAM,OAAQ,GAAGI,CAAM,EAC7D,GAAGW,EAEJ,UAAAC,EAACG,EAAA,CAAyB,MAAOP,EAC9B,SAAAP,EACH,EACAa,EAACD,EAAA,CACC,UAAAD,EAACR,EAAA,CAAS,MAAOR,EAAO,QAASC,IAAU,QAAS,EACpDe,EAACP,EAAA,CACC,MAAOT,EACP,QAASC,IAAU,WAAaA,IAAU,WAC1C,UAAW,CAACC,EACd,EACAc,EAAC,OACC,IAAKH,EACL,MAAO,CACL,SAAU,WACV,OAAQ,EACR,MAAO,EACP,QAAS,OACT,cAAe,SACf,WAAY,WACZ,IAAK,EACL,cAAe,MACjB,EAEA,SAAAG,EAACN,EAAA,CAAmB,MAAOV,EAAO,QAASC,IAAU,QAAS,EAChE,GACF,GACF,CAEJ,CC9FA,IAAMmB,EAAqBC,EAAS,SAA4B,CAC9D,MAAAC,CACF,EAEG,CACD,OACEC,EAACC,EAAA,CACC,MAAOF,EACP,MAAOA,EAAM,aACb,MAAOA,EAAM,SAAWA,EAAM,gBAC9B,OAAO,uBACP,cAAaA,EAAM,iBACnB,gBAAeA,EAAM,QACrB,cAAaA,EAAM,OACnB,kBAAiBA,EAAM,SAAWA,EAAM,UAAY,OACpD,eAAcA,EAAM,UAAY,GAAK,OACrC,MAAO,CACL,MAAOA,EAAM,UACb,OAAQA,EAAM,OACd,SAAU,QACZ,EAEA,SAAAC,EAACE,EAAA,CAAY,MAAOH,EAAO,UAAW,GAAO,EAC/C,CAEJ,CAAC,EAEMI,EAAQN",
|
|
6
6
|
"names": ["host", "DisplayBackgroundProgress_default", "host", "host", "DisplayErrorBar_default", "host", "host", "DisplayLoadingOverlay_default", "host", "host", "TooLargeMessage_default", "host", "host", "read", "name", "BottomRightCornerContext", "read", "TrackOverlayPortal", "read", "useChromeOverlayOverride", "read", "display_ui_default", "host", "muiOverlays", "TooLargeMessage_default", "DisplayErrorBar_default", "DisplayLoadingOverlay_default", "DisplayBackgroundProgress_default", "GraphStatusChrome", "model", "phase", "drawn", "testid", "style", "children", "dataProps", "TooLarge", "ErrorBar", "Loading", "BackgroundProgress", "useChromeOverlayOverride", "corner", "setCorner", "useState", "attributes", "jsx", "TrackOverlayPortal", "jsxs", "BottomRightCornerContext", "LinearGraphDisplay", "observer", "model", "jsx", "GraphStatusChrome", "GraphCanvas_default", "LinearGraphDisplay_default"]
|
|
7
7
|
}
|