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