@jbrowse/bandage-core 10.2.7 → 10.3.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/dist/alleleProjection/projectAlleles.js +8 -4
- package/dist/anchoredNodes.js +2 -1
- package/dist/bubbleSpreads.js +2 -2
- package/dist/bubbles/bubbleHalos.js +10 -11
- package/dist/bubbles/bubblesFromGraph.js +8 -3
- package/dist/bubbles/classifyBubble.js +9 -6
- package/dist/bubbles/popBubble.js +7 -5
- package/dist/bubbles/superbubbles.js +18 -14
- package/dist/chunks/{chunk-RAKOB6IV.js → chunk-234NFZS4.js} +8 -6
- package/dist/chunks/{chunk-A4PFFC4Q.js → chunk-2XEQR54X.js} +60 -102
- package/dist/chunks/{chunk-6JEWNXCQ.js → chunk-34BOZKIE.js} +0 -2
- package/dist/chunks/{chunk-RVS2QCOX.js → chunk-3GLG3ZLE.js} +2 -11
- package/dist/chunks/{chunk-PUG7LXDF.js → chunk-3PZSBNLI.js} +4 -1
- package/dist/chunks/{chunk-KBEP7VYK.js → chunk-3VCKBSML.js} +4 -4
- package/dist/chunks/{chunk-BPLIXMH7.js → chunk-4XWZNPQ2.js} +14 -0
- package/dist/chunks/{chunk-LKW2TP4N.js → chunk-5YILQTHE.js} +18 -16
- package/dist/chunks/{chunk-B6IW3IRE.js → chunk-65ILXEIN.js} +14 -15
- package/dist/chunks/{chunk-4DRQTBBE.js → chunk-6EOB6ANX.js} +1 -1
- package/dist/chunks/{chunk-QBHPHLAQ.js → chunk-7JGLJK44.js} +41 -36
- package/dist/chunks/{chunk-T2PCSAFY.js → chunk-7XR26JST.js} +2 -2
- package/dist/chunks/{chunk-URZ3CH2R.js → chunk-A4JDEUAI.js} +1 -1
- package/dist/chunks/{chunk-JLSJMCDJ.js → chunk-A54O52XZ.js} +3 -3
- package/dist/chunks/chunk-A55OZVYX.js +327 -0
- package/dist/chunks/{chunk-CWFNEKST.js → chunk-A7H753BA.js} +3 -3
- package/dist/chunks/{chunk-VV6KGJ7M.js → chunk-AMX4OQAW.js} +18 -27
- package/dist/chunks/{chunk-RPRHR56C.js → chunk-BS6HPYCZ.js} +3 -3
- package/dist/chunks/chunk-BSOZW3FC.js +30 -0
- package/dist/chunks/{chunk-CU6P5RUG.js → chunk-BVYR7IFN.js} +22 -16
- package/dist/chunks/{chunk-XXT2JCAC.js → chunk-BX4AUMZE.js} +11 -13
- package/dist/chunks/{chunk-N73TI3VG.js → chunk-BZFOFC4D.js} +6 -9
- package/dist/chunks/{chunk-4ETPXDO6.js → chunk-CGFPFBT2.js} +1 -1
- package/dist/chunks/{chunk-24WITXQY.js → chunk-CGMSKIEO.js} +9 -25
- package/dist/chunks/{chunk-IGVV37VI.js → chunk-CKUVEHSS.js} +3 -3
- package/dist/chunks/{chunk-JBCZIBFC.js → chunk-CRCD3ODN.js} +0 -1
- package/dist/chunks/{chunk-OIV2GBAJ.js → chunk-DBLV7PGG.js} +27 -17
- package/dist/chunks/{chunk-JA2HJIYS.js → chunk-E4ZM4OOJ.js} +3 -5
- package/dist/chunks/{chunk-ABUIN5AK.js → chunk-EHXBZ5JZ.js} +29 -24
- package/dist/chunks/{chunk-QLWI2PZ3.js → chunk-EJRJAAN7.js} +24 -21
- package/dist/chunks/{chunk-Q7LYHGGQ.js → chunk-GIHTHYXY.js} +5 -4
- package/dist/chunks/{chunk-L3O7AWLI.js → chunk-GJLZ2MKE.js} +2 -2
- package/dist/chunks/{chunk-LOEA5IHZ.js → chunk-GJU6BJJA.js} +8 -8
- package/dist/chunks/{chunk-XL472HHD.js → chunk-GQZVR5DW.js} +12 -7
- package/dist/chunks/{chunk-UVBGRJQX.js → chunk-HKYXWZQS.js} +1 -1
- package/dist/chunks/chunk-HMXCN6PG.js +17 -0
- package/dist/chunks/{chunk-WSIFAZU7.js → chunk-HNWJ4B7S.js} +12 -13
- package/dist/chunks/chunk-HOAIOEI7.js +18 -0
- package/dist/chunks/{chunk-XMW266WS.js → chunk-HSVFCA2J.js} +18 -20
- package/dist/chunks/{chunk-3XSM4OZU.js → chunk-IYALCKNB.js} +5 -5
- package/dist/chunks/{chunk-QXUEF3AJ.js → chunk-KWHWNOTY.js} +22 -17
- package/dist/chunks/{chunk-M6LK4GII.js → chunk-LGJBB5BP.js} +8 -9
- package/dist/chunks/{chunk-VQWHMWLF.js → chunk-M5NPD55W.js} +18 -14
- package/dist/chunks/{chunk-TKIJ5535.js → chunk-MD5VPXXT.js} +6 -6
- package/dist/chunks/{chunk-HK5Y2YWV.js → chunk-MYDHU2UV.js} +6 -11
- package/dist/chunks/{chunk-TZFWUT2C.js → chunk-MYLAJDKB.js} +2 -2
- package/dist/chunks/{chunk-4HWM3FNK.js → chunk-OMUPUB4J.js} +39 -56
- package/dist/chunks/{chunk-PTABFYQ7.js → chunk-PFRQBCGC.js} +49 -60
- package/dist/chunks/{chunk-T6V4KI2L.js → chunk-PPDE4IVT.js} +1 -1
- package/dist/chunks/{chunk-KC7T5RWG.js → chunk-PSCSZSVK.js} +9 -16
- package/dist/chunks/{chunk-CG35S2S2.js → chunk-PTQPTDZH.js} +1 -1
- package/dist/chunks/{chunk-L2HDM2R3.js → chunk-QQCOVMMT.js} +7 -7
- package/dist/chunks/{chunk-CQHUZHET.js → chunk-RFG42VIO.js} +46 -30
- package/dist/chunks/{chunk-FYQWPEEY.js → chunk-RJWPJCIB.js} +5 -11
- package/dist/chunks/{chunk-AR4BUBMU.js → chunk-RWKP7UO4.js} +34 -35
- package/dist/chunks/{chunk-WBSWROE6.js → chunk-SHKGYGM4.js} +14 -18
- package/dist/chunks/{chunk-2CMYNW3E.js → chunk-SI3BB4DO.js} +1 -1
- package/dist/chunks/{chunk-DY3JCAMX.js → chunk-SOMZGDVS.js} +7 -16
- package/dist/chunks/{chunk-EFQLEGWM.js → chunk-SZHQK6GL.js} +7 -8
- package/dist/chunks/{chunk-5GMFEPWR.js → chunk-TCOLHD7N.js} +16 -28
- package/dist/chunks/{chunk-XV4P5KEQ.js → chunk-TGUFT6KK.js} +6 -3
- package/dist/chunks/{chunk-CM6LO6OC.js → chunk-UAFATXYA.js} +10 -14
- package/dist/chunks/{chunk-7SRWJLSC.js → chunk-UBQSRCWR.js} +11 -8
- package/dist/chunks/{chunk-RUCH6ZFL.js → chunk-V4YML3GR.js} +2 -1
- package/dist/chunks/{chunk-VQC7KELB.js → chunk-V7J6U4XC.js} +11 -3
- package/dist/chunks/{chunk-ES2N6V56.js → chunk-VX656OAZ.js} +6 -11
- package/dist/chunks/chunk-WA5WNP6V.js +37 -0
- package/dist/chunks/{chunk-EQ2NIFRH.js → chunk-WJ4TIAVA.js} +1 -1
- package/dist/chunks/{chunk-A7CFWFQS.js → chunk-WONB6LMC.js} +1 -1
- package/dist/chunks/{chunk-23YFB5BB.js → chunk-XUT4HXVE.js} +29 -13
- package/dist/chunks/{chunk-G45YY72K.js → chunk-Z6XZWPXK.js} +17 -25
- package/dist/chunks/{chunk-XI3ZUTWF.js → chunk-ZNJ4JAPT.js} +14 -20
- package/dist/chunks/{chunk-AUFAPUO4.js → chunk-ZPBEUOBM.js} +3 -1
- package/dist/chunks/{chunk-RAEABQNW.js → chunk-ZPZ7GNBT.js} +1 -0
- package/dist/cli/figure.js +59 -56
- package/dist/cli/fold.js +19 -17
- package/dist/deletionEdges.js +5 -7
- package/dist/facetGrid.js +2 -1
- package/dist/figure.js +45 -42
- package/dist/figureData.js +48 -44
- package/dist/figureScene.js +34 -29
- package/dist/figureSettings.js +19 -17
- package/dist/foldVariants.js +5 -3
- package/dist/gbzCut.js +12 -7
- package/dist/gbzJoin.js +2 -1
- package/dist/gbzWindow.js +11 -6
- package/dist/genes/genePins.js +6 -4
- package/dist/gfa/gfaConverter.js +7 -5
- package/dist/gfa/gfaTables.js +2 -1
- package/dist/gfa/graphTables.js +3 -3
- package/dist/graphLabels.js +8 -5
- package/dist/index.js +88 -85
- package/dist/labelLayout.js +12 -9
- package/dist/layout/anchoredLayout.js +8 -5
- package/dist/layout/drawnScale.js +1 -5
- package/dist/layout/forceCache.js +19 -17
- package/dist/layout/mergeRuns.js +5 -3
- package/dist/layout/orderedLayout.js +5 -2
- package/dist/layout/orientToReference.js +3 -2
- package/dist/layout/placeOffReference.js +7 -4
- package/dist/layout/referenceSeeds.js +6 -4
- package/dist/layout/sampleRowLayout.js +8 -5
- package/dist/layout/trimToWindow.js +6 -4
- package/dist/layout/tubeMapLayout.js +17 -19
- package/dist/layout/walkRowDraw.js +18 -17
- package/dist/layout/walkRowLayout.js +10 -6
- package/dist/layout/walkRows.js +9 -5
- package/dist/layout/walkStrip.js +21 -18
- package/dist/layoutModes.js +23 -20
- package/dist/nodeWidths.js +1 -3
- package/dist/pansn.js +5 -1
- package/dist/pathAnchoring.js +6 -4
- package/dist/pathColors.js +12 -9
- package/dist/pathVisits.js +3 -1
- package/dist/pipeline.js +18 -16
- package/dist/reference.js +5 -3
- package/dist/referenceRampCss.js +9 -17
- package/dist/referenceSpan.js +4 -2
- package/dist/referenceStrip.js +18 -14
- package/dist/renderer/Canvas2DRenderer.js +1 -1
- package/dist/renderer/GeometryBuilder.js +19 -14
- package/dist/renderer/svgCanvas.js +1 -1
- package/dist/tubeMap/axis.js +11 -6
- package/dist/tubeMap/bundle.js +16 -12
- package/dist/tubeMap/coarsen.js +20 -345
- package/dist/tubeMap/deviations.js +53 -23
- package/dist/tubeMap/draw.js +11 -8
- package/dist/tubeMap/frame.js +3 -2
- package/dist/tubeMap/genes.js +10 -7
- package/dist/tubeMap/mismatches.js +1 -1
- package/dist/tubeMap/nodeColors.js +18 -14
- package/dist/tubeMap/reads.js +1 -1
- package/dist/tubeMap/warp.js +2 -1
- package/dist/types/alleleProjection/projectAlleles.d.ts +1 -4
- package/dist/types/bubbles/bubbleHalos.d.ts +0 -2
- package/dist/types/bubbles/bubblesFromGraph.d.ts +6 -4
- package/dist/types/bubbles/classifyBubble.d.ts +2 -1
- package/dist/types/deletionEdges.d.ts +0 -8
- package/dist/types/figureScene.d.ts +17 -7
- package/dist/types/figureSettings.d.ts +2 -0
- package/dist/types/gbzCut.d.ts +4 -0
- package/dist/types/gbzWindow.d.ts +1 -0
- package/dist/types/gfa-core/gfaParser.d.ts +1 -1
- package/dist/types/graphLabels.d.ts +2 -1
- package/dist/types/layout/drawnScale.d.ts +0 -2
- package/dist/types/layout/referenceSeeds.d.ts +2 -1
- package/dist/types/layout/tubeMapLayout.d.ts +0 -7
- package/dist/types/layout/walkRowDraw.d.ts +0 -1
- package/dist/types/layout/walkRowLayout.d.ts +1 -0
- package/dist/types/layout/walkRows.d.ts +1 -0
- package/dist/types/nodeWidths.d.ts +0 -1
- package/dist/types/pansn.d.ts +9 -0
- package/dist/types/pathVisits.d.ts +6 -0
- package/dist/types/referenceRampCss.d.ts +4 -0
- package/dist/types/renderer/Canvas2DRenderer.d.ts +1 -0
- package/dist/types/renderer/GeometryBuilder.d.ts +3 -2
- package/dist/types/tubeMap/axis.d.ts +3 -1
- package/dist/types/tubeMap/coarsen.d.ts +3 -1
- package/dist/types/tubeMap/deviations.d.ts +2 -1
- package/dist/types/tubeMap/mismatches.d.ts +0 -1
- package/dist/types/tubeMap/warp.d.ts +2 -1
- package/dist/types/util/SpatialIndex.d.ts +1 -1
- package/dist/types/util/geometry.d.ts +4 -0
- package/dist/types/util/groups.d.ts +3 -0
- package/dist/types/util/hitDetection.d.ts +2 -2
- package/dist/types/util/partitionPoint.d.ts +1 -0
- package/dist/types/util/weakMemo.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/util/SpatialIndex.js +8 -5
- package/dist/util/edgeCurves.js +7 -4
- package/dist/util/geometry.js +3 -1
- package/dist/util/groups.js +10 -0
- package/dist/util/hitDetection.js +9 -6
- package/dist/util/partitionPoint.js +6 -0
- package/dist/util/weakMemo.js +6 -0
- package/dist/version.js +1 -1
- package/dist/viewport.js +19 -17
- package/dist/walkEncoding.js +18 -14
- package/dist/walkHighlight.js +19 -15
- package/dist/walkKey.js +9 -6
- package/package.json +2 -2
- package/dist/chunks/chunk-ZY2AFL4Y.js +0 -43
|
@@ -46,18 +46,22 @@ var Canvas2DRenderer = class {
|
|
|
46
46
|
this.highlightFactor = factor;
|
|
47
47
|
}
|
|
48
48
|
updateTransform(transform) {
|
|
49
|
+
this.transform = transform;
|
|
50
|
+
}
|
|
51
|
+
fitted() {
|
|
52
|
+
const t = this.transform;
|
|
49
53
|
const k = this.fit;
|
|
50
|
-
|
|
51
|
-
...
|
|
52
|
-
scaleX:
|
|
53
|
-
scaleY:
|
|
54
|
-
translateX:
|
|
55
|
-
translateY:
|
|
56
|
-
dpr:
|
|
54
|
+
return !t || k === 1 ? t : {
|
|
55
|
+
...t,
|
|
56
|
+
scaleX: t.scaleX * k,
|
|
57
|
+
scaleY: t.scaleY * k,
|
|
58
|
+
translateX: t.translateX * k,
|
|
59
|
+
translateY: t.translateY * k,
|
|
60
|
+
dpr: t.dpr * k
|
|
57
61
|
};
|
|
58
62
|
}
|
|
59
63
|
render(clearColor) {
|
|
60
|
-
const t = this.
|
|
64
|
+
const t = this.fitted();
|
|
61
65
|
if (!t) {
|
|
62
66
|
return;
|
|
63
67
|
}
|
|
@@ -84,7 +88,7 @@ var Canvas2DRenderer = class {
|
|
|
84
88
|
weight: e.thickness,
|
|
85
89
|
last: inRun(edgeRun, i)
|
|
86
90
|
}))) {
|
|
87
|
-
this.strokeCurves(items, color);
|
|
91
|
+
this.strokeCurves(items, color, t);
|
|
88
92
|
}
|
|
89
93
|
const lifted = this.liftedStrokes(batch);
|
|
90
94
|
for (const { color, items } of groupByPaint(batch.nodeStrokes, (s, i) => {
|
|
@@ -95,7 +99,7 @@ var Canvas2DRenderer = class {
|
|
|
95
99
|
last: f !== void 0
|
|
96
100
|
};
|
|
97
101
|
})) {
|
|
98
|
-
this.strokeNodes(items, color);
|
|
102
|
+
this.strokeNodes(items, color, t);
|
|
99
103
|
}
|
|
100
104
|
const arrowRun = this.edgeRun(batch.arrowRuns);
|
|
101
105
|
for (const { color, items } of groupByPaint(batch.arrows, (a, i) => ({
|
|
@@ -103,7 +107,7 @@ var Canvas2DRenderer = class {
|
|
|
103
107
|
weight: 0,
|
|
104
108
|
last: inRun(arrowRun, i)
|
|
105
109
|
}))) {
|
|
106
|
-
this.fillArrows(items, color);
|
|
110
|
+
this.fillArrows(items, color, t);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
// Only what the highlights lift, over a transparent clear, for a hover layer
|
|
@@ -113,7 +117,8 @@ var Canvas2DRenderer = class {
|
|
|
113
117
|
const ctx = this.ctx;
|
|
114
118
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
115
119
|
const batch = this.batch;
|
|
116
|
-
|
|
120
|
+
const t = this.fitted();
|
|
121
|
+
if (!t || !batch) {
|
|
117
122
|
return;
|
|
118
123
|
}
|
|
119
124
|
ctx.lineCap = "round";
|
|
@@ -125,7 +130,7 @@ var Canvas2DRenderer = class {
|
|
|
125
130
|
weight: e.thickness,
|
|
126
131
|
last: false
|
|
127
132
|
}))) {
|
|
128
|
-
this.strokeCurves(items, color);
|
|
133
|
+
this.strokeCurves(items, color, t);
|
|
129
134
|
}
|
|
130
135
|
const lifted = [...this.liftedStrokes(batch)];
|
|
131
136
|
for (const { color, items } of groupByPaint(lifted, ([i, f]) => ({
|
|
@@ -135,7 +140,8 @@ var Canvas2DRenderer = class {
|
|
|
135
140
|
}))) {
|
|
136
141
|
this.strokeNodes(
|
|
137
142
|
items.map(([i]) => batch.nodeStrokes[i]),
|
|
138
|
-
color
|
|
143
|
+
color,
|
|
144
|
+
t
|
|
139
145
|
);
|
|
140
146
|
}
|
|
141
147
|
const arrows = runItems(batch.arrows, this.edgeRun(batch.arrowRuns));
|
|
@@ -144,7 +150,7 @@ var Canvas2DRenderer = class {
|
|
|
144
150
|
weight: 0,
|
|
145
151
|
last: false
|
|
146
152
|
}))) {
|
|
147
|
-
this.fillArrows(items, color);
|
|
153
|
+
this.fillArrows(items, color, t);
|
|
148
154
|
}
|
|
149
155
|
}
|
|
150
156
|
edgeRun(runs) {
|
|
@@ -163,8 +169,7 @@ var Canvas2DRenderer = class {
|
|
|
163
169
|
}
|
|
164
170
|
return lifted;
|
|
165
171
|
}
|
|
166
|
-
strokeCurves(items, color) {
|
|
167
|
-
const t = this.transform;
|
|
172
|
+
strokeCurves(items, color, t) {
|
|
168
173
|
const ctx = this.ctx;
|
|
169
174
|
ctx.strokeStyle = abgrToCssRgba(color);
|
|
170
175
|
ctx.lineWidth = items[0].thickness * 2 * t.dpr;
|
|
@@ -188,8 +193,7 @@ var Canvas2DRenderer = class {
|
|
|
188
193
|
}
|
|
189
194
|
ctx.stroke();
|
|
190
195
|
}
|
|
191
|
-
strokeNodes(items, color) {
|
|
192
|
-
const t = this.transform;
|
|
196
|
+
strokeNodes(items, color, t) {
|
|
193
197
|
const ctx = this.ctx;
|
|
194
198
|
ctx.strokeStyle = abgrToCssRgba(color);
|
|
195
199
|
ctx.lineWidth = items[0].thickness * 2 * t.dpr;
|
|
@@ -204,8 +208,7 @@ var Canvas2DRenderer = class {
|
|
|
204
208
|
}
|
|
205
209
|
ctx.stroke();
|
|
206
210
|
}
|
|
207
|
-
fillArrows(items, color) {
|
|
208
|
-
const t = this.transform;
|
|
211
|
+
fillArrows(items, color, t) {
|
|
209
212
|
const ctx = this.ctx;
|
|
210
213
|
ctx.fillStyle = abgrToCssRgba(color);
|
|
211
214
|
ctx.beginPath();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
joinCuts
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HNWJ4B7S.js";
|
|
4
4
|
import {
|
|
5
5
|
wellKnownSample
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-234NFZS4.js";
|
|
7
7
|
import {
|
|
8
8
|
gfaTables
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6XZWPXK.js";
|
|
10
10
|
import {
|
|
11
11
|
panSNMatchesPrefix,
|
|
12
12
|
panSNSample
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
14
14
|
|
|
15
15
|
// src/gbzWindow.ts
|
|
16
16
|
import { isReverse, nodeId } from "@gmod/gbz-base";
|
|
@@ -210,6 +210,7 @@ export {
|
|
|
210
210
|
haplotypePrefix,
|
|
211
211
|
haplotypeWanted,
|
|
212
212
|
referenceSamplesOf,
|
|
213
|
+
aliasedSample,
|
|
213
214
|
resolveReferenceSample,
|
|
214
215
|
referencePathQuery,
|
|
215
216
|
nodeLimitError,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
placeOffReference
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MYLAJDKB.js";
|
|
4
4
|
import {
|
|
5
5
|
ROW_HEIGHT_PX
|
|
6
6
|
} from "./chunk-CPMHA4W5.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
backboneNodes,
|
|
9
9
|
backbonePositions,
|
|
10
10
|
referenceSpan
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RJWPJCIB.js";
|
|
12
12
|
|
|
13
13
|
// src/layout/anchoredLayout.ts
|
|
14
14
|
function rankRows(graph) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
placeOffReference
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
parsePanSN
|
|
6
|
-
} from "./chunk-RVS2QCOX.js";
|
|
3
|
+
} from "./chunk-MYLAJDKB.js";
|
|
7
4
|
import {
|
|
8
5
|
ROW_HEIGHT_PX
|
|
9
6
|
} from "./chunk-CPMHA4W5.js";
|
|
@@ -12,14 +9,17 @@ import {
|
|
|
12
9
|
backbonePositions,
|
|
13
10
|
isOffReference,
|
|
14
11
|
referenceSpan
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RJWPJCIB.js";
|
|
13
|
+
import {
|
|
14
|
+
panSNSample
|
|
15
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
16
16
|
|
|
17
17
|
// src/layout/sampleRowLayout.ts
|
|
18
18
|
function contributingSamples(graph, keep) {
|
|
19
19
|
const carried = /* @__PURE__ */ new Map();
|
|
20
20
|
for (const node of graph.nodes) {
|
|
21
21
|
if (isOffReference(node)) {
|
|
22
|
-
const
|
|
22
|
+
const sample = panSNSample(node.stable.refName);
|
|
23
23
|
carried.set(sample, (carried.get(sample) ?? 0) + node.length);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -43,12 +43,12 @@ function sampleRowLayout(graph, region, keep = []) {
|
|
|
43
43
|
span,
|
|
44
44
|
rowY: (node) => {
|
|
45
45
|
const stable = node.stable;
|
|
46
|
-
const row = stable ? rowOf.get(
|
|
46
|
+
const row = stable ? rowOf.get(panSNSample(stable.refName)) : void 0;
|
|
47
47
|
return (row ?? spareRow) * ROW_HEIGHT_PX;
|
|
48
48
|
},
|
|
49
49
|
positions: nodePositions
|
|
50
50
|
});
|
|
51
|
-
const referenceSample =
|
|
51
|
+
const referenceSample = panSNSample(backbone[0].stable.refName);
|
|
52
52
|
const rowLabels = [
|
|
53
53
|
{ label: referenceSample, y: 0 },
|
|
54
54
|
...samples.map((sample) => ({
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REFERENCE_RAMP_MAX_HUE
|
|
3
|
-
} from "./chunk-A4PFFC4Q.js";
|
|
4
|
-
|
|
5
1
|
// src/referenceRampCss.ts
|
|
2
|
+
var REFERENCE_RAMP_MAX_HUE = 300;
|
|
3
|
+
var REFERENCE_RAMP_SATURATION = 0.7;
|
|
4
|
+
var REFERENCE_RAMP_LIGHTNESS = 0.5;
|
|
6
5
|
function rampHueCss(hue) {
|
|
7
|
-
return `hsl(${hue},
|
|
6
|
+
return `hsl(${hue}, ${REFERENCE_RAMP_SATURATION * 100}%, ${REFERENCE_RAMP_LIGHTNESS * 100}%)`;
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
const frac = (bp - domain.start) / (domain.end - domain.start);
|
|
8
|
+
function rampHueAt(frac) {
|
|
11
9
|
return Math.max(0, Math.min(1, frac)) * REFERENCE_RAMP_MAX_HUE;
|
|
12
10
|
}
|
|
11
|
+
function rampHue(bp, domain) {
|
|
12
|
+
return rampHueAt((bp - domain.start) / (domain.end - domain.start));
|
|
13
|
+
}
|
|
13
14
|
var HUE_STOP_DEG = 30;
|
|
14
15
|
function rampStops({ start, bp, reversed }, domain) {
|
|
15
16
|
const low = rampHue(start, domain);
|
|
@@ -32,7 +33,11 @@ var RAMP_GRADIENT_CSS = `linear-gradient(to right, ${RAMP_GRADIENT_STOPS.map(
|
|
|
32
33
|
).join(", ")})`;
|
|
33
34
|
|
|
34
35
|
export {
|
|
36
|
+
REFERENCE_RAMP_MAX_HUE,
|
|
37
|
+
REFERENCE_RAMP_SATURATION,
|
|
38
|
+
REFERENCE_RAMP_LIGHTNESS,
|
|
35
39
|
rampHueCss,
|
|
40
|
+
rampHueAt,
|
|
36
41
|
rampHue,
|
|
37
42
|
rampStops,
|
|
38
43
|
RAMP_GRADIENT_STOPS,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/util/weakMemo.ts
|
|
2
|
+
function weakMemo() {
|
|
3
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
return (key, deps, compute) => {
|
|
5
|
+
const hit = cache.get(key);
|
|
6
|
+
if (hit?.deps.length === deps.length && hit.deps.every((d, i) => Object.is(d, deps[i]))) {
|
|
7
|
+
return hit.value;
|
|
8
|
+
}
|
|
9
|
+
const value = compute();
|
|
10
|
+
cache.set(key, { deps, value });
|
|
11
|
+
return value;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
weakMemo
|
|
17
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
groupBy
|
|
3
|
+
} from "./chunk-BSOZW3FC.js";
|
|
4
|
+
|
|
1
5
|
// src/gbzJoin.ts
|
|
2
6
|
var UNKNOWN_SAMPLE = "unknown";
|
|
3
7
|
function parseWalk(line) {
|
|
@@ -18,7 +22,7 @@ function segmentLengths(lines) {
|
|
|
18
22
|
const ln = tags.find((tag) => tag.startsWith("LN:i:"));
|
|
19
23
|
lengths.set(
|
|
20
24
|
id,
|
|
21
|
-
sequence
|
|
25
|
+
sequence !== "*" ? sequence.length : ln ? +ln.slice("LN:i:".length) : 0
|
|
22
26
|
);
|
|
23
27
|
}
|
|
24
28
|
}
|
|
@@ -94,18 +98,13 @@ function joinCuts(gfas, startsPath) {
|
|
|
94
98
|
}
|
|
95
99
|
return walks2;
|
|
96
100
|
});
|
|
97
|
-
const byName =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
pieces.push(walk);
|
|
105
|
-
} else {
|
|
106
|
-
byName.set(walk.name, [walk]);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
101
|
+
const byName = groupBy(
|
|
102
|
+
[
|
|
103
|
+
...walksByCut.flatMap((walks2) => walks2.slice(0, 1)),
|
|
104
|
+
...walksByCut.flatMap((walks2) => walks2.slice(1))
|
|
105
|
+
],
|
|
106
|
+
(walk) => walk.name
|
|
107
|
+
);
|
|
109
108
|
const walks = [...byName.values()].flatMap(
|
|
110
109
|
(pieces) => joinPieces(pieces, lengths, startsPath)
|
|
111
110
|
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/util/partitionPoint.ts
|
|
2
|
+
function partitionPoint(n, pred) {
|
|
3
|
+
let lo = 0;
|
|
4
|
+
let hi = n;
|
|
5
|
+
while (lo < hi) {
|
|
6
|
+
const mid = lo + hi >> 1;
|
|
7
|
+
if (pred(mid)) {
|
|
8
|
+
lo = mid + 1;
|
|
9
|
+
} else {
|
|
10
|
+
hi = mid;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return lo;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
partitionPoint
|
|
18
|
+
};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatBp
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PFRQBCGC.js";
|
|
4
|
+
import {
|
|
5
|
+
pushTo
|
|
6
|
+
} from "./chunk-BSOZW3FC.js";
|
|
4
7
|
import {
|
|
5
8
|
isBackbone
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RJWPJCIB.js";
|
|
10
|
+
import {
|
|
11
|
+
partitionPoint
|
|
12
|
+
} from "./chunk-HOAIOEI7.js";
|
|
7
13
|
|
|
8
14
|
// src/tubeMap/axis.ts
|
|
9
15
|
function referenceBoxes({
|
|
@@ -16,8 +22,7 @@ function referenceBoxes({
|
|
|
16
22
|
const graphNode = nodeById.get(node.name);
|
|
17
23
|
if (node.order >= 0 && graphNode && isBackbone(graphNode)) {
|
|
18
24
|
const { refName, start } = graphNode.stable;
|
|
19
|
-
|
|
20
|
-
boxes.push({
|
|
25
|
+
pushTo(byRefName, refName, {
|
|
21
26
|
name: node.name,
|
|
22
27
|
index,
|
|
23
28
|
bp0: start,
|
|
@@ -33,23 +38,15 @@ function referenceBoxes({
|
|
|
33
38
|
return byRefName;
|
|
34
39
|
}
|
|
35
40
|
function tubeX(boxes, bp, isEnd = false) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} else {
|
|
44
|
-
hi = mid;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const box = boxes[lo];
|
|
48
|
-
if (bp <= box.bp0) {
|
|
49
|
-
return box.x0;
|
|
50
|
-
}
|
|
41
|
+
const i = partitionPoint(
|
|
42
|
+
boxes.length - 1,
|
|
43
|
+
(j) => isEnd ? boxes[j].bp1 < bp : boxes[j].bp1 <= bp
|
|
44
|
+
);
|
|
45
|
+
return boxX(boxes[i], bp);
|
|
46
|
+
}
|
|
47
|
+
function boxX(box, bp) {
|
|
51
48
|
const span = box.bp1 - box.bp0;
|
|
52
|
-
return span
|
|
49
|
+
return bp <= box.bp0 || span <= 0 ? box.x0 : box.x0 + (Math.min(bp, box.bp1) - box.bp0) / span * (box.x1 - box.x0);
|
|
53
50
|
}
|
|
54
51
|
function tubeSpan(boxes, start, end) {
|
|
55
52
|
const a = tubeX(boxes, start);
|
|
@@ -199,6 +196,7 @@ function drawTubeMapRuler(ctx, boxes, frame, top, referenceAxis = false) {
|
|
|
199
196
|
export {
|
|
200
197
|
referenceBoxes,
|
|
201
198
|
tubeX,
|
|
199
|
+
boxX,
|
|
202
200
|
tubeSpan,
|
|
203
201
|
rulerBoxes,
|
|
204
202
|
rulerInk,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pathOrigin
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
isGenericSample
|
|
6
|
-
} from "./chunk-BPLIXMH7.js";
|
|
3
|
+
} from "./chunk-LGJBB5BP.js";
|
|
7
4
|
import {
|
|
8
5
|
groupDigits
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PFRQBCGC.js";
|
|
7
|
+
import {
|
|
8
|
+
isGenericSample
|
|
9
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
10
10
|
|
|
11
11
|
// src/pathColors.ts
|
|
12
12
|
function nameHue(name) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
orientToReference
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3PZSBNLI.js";
|
|
4
4
|
import {
|
|
5
5
|
seededNodes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CKUVEHSS.js";
|
|
7
7
|
import {
|
|
8
8
|
smoothChain
|
|
9
9
|
} from "./chunk-OPPVSPEF.js";
|
|
@@ -14,38 +14,38 @@ import {
|
|
|
14
14
|
} from "./chunk-VPE4AYP7.js";
|
|
15
15
|
import {
|
|
16
16
|
convertGFAToGraph
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RWKP7UO4.js";
|
|
18
18
|
import {
|
|
19
19
|
parseGFA
|
|
20
20
|
} from "./chunk-5I3K4R2G.js";
|
|
21
21
|
import {
|
|
22
22
|
graphFromTables
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DBLV7PGG.js";
|
|
24
24
|
import {
|
|
25
25
|
anchorGraph
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LGJBB5BP.js";
|
|
27
27
|
import {
|
|
28
28
|
gfaTables
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Z6XZWPXK.js";
|
|
30
30
|
import {
|
|
31
31
|
mergeRuns,
|
|
32
32
|
splitRuns
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-BZFOFC4D.js";
|
|
34
34
|
import {
|
|
35
35
|
spreadFor
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HKYXWZQS.js";
|
|
37
37
|
import {
|
|
38
38
|
drawnLengthOf,
|
|
39
39
|
drawnNodeLength,
|
|
40
40
|
layoutScaling
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-34BOZKIE.js";
|
|
42
42
|
import {
|
|
43
43
|
deletionDrawing,
|
|
44
44
|
deletionEdges
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-CGMSKIEO.js";
|
|
46
46
|
import {
|
|
47
47
|
isBackbone
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-RJWPJCIB.js";
|
|
49
49
|
|
|
50
50
|
// src/pipeline.ts
|
|
51
51
|
function graphOf(source, name) {
|
|
@@ -90,11 +90,12 @@ function engineSettingsOf(s = {}) {
|
|
|
90
90
|
var COMPONENT_SEPARATION = 15;
|
|
91
91
|
function engineRequest(graph, scaling, settings) {
|
|
92
92
|
const anchored = graph.nodes.some(isBackbone);
|
|
93
|
+
const s = engineSettingsOf(settings);
|
|
93
94
|
const spaced = {
|
|
94
95
|
...scaling,
|
|
95
96
|
opts: {
|
|
96
97
|
...scaling.opts,
|
|
97
|
-
edgeLength: scaling.opts.edgeLength *
|
|
98
|
+
edgeLength: scaling.opts.edgeLength * s.spacing
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
101
|
return {
|
|
@@ -103,18 +104,22 @@ function engineRequest(graph, scaling, settings) {
|
|
|
103
104
|
edges: graph.edges
|
|
104
105
|
},
|
|
105
106
|
options: {
|
|
106
|
-
quality:
|
|
107
|
-
linearLayout:
|
|
107
|
+
quality: s.quality,
|
|
108
|
+
linearLayout: s.linearLayout,
|
|
108
109
|
...spaced.opts,
|
|
109
|
-
componentSeparation: COMPONENT_SEPARATION *
|
|
110
|
+
componentSeparation: COMPONENT_SEPARATION * s.componentSeparation,
|
|
110
111
|
...anchored ? { rotateComponents: false } : {},
|
|
111
|
-
engine:
|
|
112
|
+
engine: s.engine
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
function engineKey(graph, settings) {
|
|
116
117
|
const anchored = graph.nodes.some(isBackbone);
|
|
117
|
-
return
|
|
118
|
+
return [
|
|
119
|
+
...Object.values(engineSettingsOf(settings)),
|
|
120
|
+
anchored,
|
|
121
|
+
graph.referencePath ?? ""
|
|
122
|
+
].join("|");
|
|
118
123
|
}
|
|
119
124
|
async function forceLayout(graph, settings, engine) {
|
|
120
125
|
const spread = spreadFor(settings.bubbleSpread);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PathVisitsBuilder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZPZ7GNBT.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
groupBy
|
|
6
|
+
} from "./chunk-BSOZW3FC.js";
|
|
7
7
|
import {
|
|
8
8
|
REFERENCE_RANK
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RJWPJCIB.js";
|
|
10
|
+
import {
|
|
11
|
+
panSNSample
|
|
12
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
10
13
|
|
|
11
14
|
// src/pathAnchoring.ts
|
|
12
15
|
var RANGE_SUFFIX = /:(\d+)-\d+$/;
|
|
@@ -132,11 +135,7 @@ function trimOrigins(graph, kept) {
|
|
|
132
135
|
}
|
|
133
136
|
return sum;
|
|
134
137
|
};
|
|
135
|
-
const byOrigin =
|
|
136
|
-
for (const path of graph.paths ?? []) {
|
|
137
|
-
const origin = pathOrigin(path.name).name;
|
|
138
|
-
byOrigin.set(origin, [...byOrigin.get(origin) ?? [], path]);
|
|
139
|
-
}
|
|
138
|
+
const byOrigin = groupBy(graph.paths ?? [], (p) => pathOrigin(p.name).name);
|
|
140
139
|
return graph.anchorPaths.map((o) => {
|
|
141
140
|
const pieces = byOrigin.get(o.name);
|
|
142
141
|
const path = pieces?.length === 1 ? pieces[0] : void 0;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GBZ_CUT_DEFAULTS,
|
|
3
|
+
NoReferenceSampleError,
|
|
4
|
+
aliasedSample,
|
|
3
5
|
cutWindowGFA,
|
|
4
6
|
haplotypeWanted,
|
|
5
7
|
referencePathQuery,
|
|
6
|
-
referenceSamplesOf
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
referenceSamplesOf
|
|
9
|
+
} from "./chunk-GIHTHYXY.js";
|
|
10
|
+
import {
|
|
11
|
+
panSNSample
|
|
12
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
9
13
|
|
|
10
14
|
// src/gbzCut.ts
|
|
11
15
|
import { GBZBase } from "@gmod/gbz-base";
|
|
@@ -13,6 +17,9 @@ var HPRC_GBZ = {
|
|
|
13
17
|
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",
|
|
14
18
|
index: "https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.haplotype-index.f3.db"
|
|
15
19
|
};
|
|
20
|
+
function gbzLocations({ db, index }) {
|
|
21
|
+
return db === "hprc" ? { db: HPRC_GBZ.db, index: index ?? HPRC_GBZ.index } : { db, index };
|
|
22
|
+
}
|
|
16
23
|
function haplotypeIndexBeside(db) {
|
|
17
24
|
const GBZ_DB = /\.gbz\.db$/i;
|
|
18
25
|
return GBZ_DB.test(db) ? db.replace(GBZ_DB, ".haplotype-index.db") : void 0;
|
|
@@ -36,18 +43,14 @@ async function openGbz(db, index) {
|
|
|
36
43
|
return { base, referenceSamples: await referenceSamplesOf(base) };
|
|
37
44
|
}
|
|
38
45
|
function referenceSample(ref, samples) {
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} catch (e) {
|
|
46
|
-
if (ref) {
|
|
47
|
-
return ref;
|
|
48
|
-
}
|
|
49
|
-
throw e;
|
|
46
|
+
if (ref) {
|
|
47
|
+
return aliasedSample(panSNSample(ref), samples) ?? ref;
|
|
48
|
+
}
|
|
49
|
+
const first = samples[0];
|
|
50
|
+
if (first === void 0) {
|
|
51
|
+
throw new NoReferenceSampleError("", samples);
|
|
50
52
|
}
|
|
53
|
+
return first;
|
|
51
54
|
}
|
|
52
55
|
async function cutGbzRegion({ base, referenceSamples }, src, signal) {
|
|
53
56
|
const region = parseRegion(src.region);
|
|
@@ -70,6 +73,7 @@ async function cutGbzRegion({ base, referenceSamples }, src, signal) {
|
|
|
70
73
|
|
|
71
74
|
export {
|
|
72
75
|
HPRC_GBZ,
|
|
76
|
+
gbzLocations,
|
|
73
77
|
haplotypeIndexBeside,
|
|
74
78
|
parseRegion,
|
|
75
79
|
openGbz,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sampleRowLayout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GJU6BJJA.js";
|
|
4
4
|
import {
|
|
5
5
|
hasTubeMapBackbone,
|
|
6
6
|
hasTubeMapPaths,
|
|
7
7
|
tubeMapLayout,
|
|
8
8
|
tubeMapReferenceLayout
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZNJ4JAPT.js";
|
|
10
10
|
import {
|
|
11
11
|
anchoredLayout
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GJLZ2MKE.js";
|
|
13
13
|
import {
|
|
14
14
|
orderedLayout
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UAFATXYA.js";
|
|
16
16
|
import {
|
|
17
17
|
walkRowLayout
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QQCOVMMT.js";
|
|
19
19
|
import {
|
|
20
20
|
isBackbone,
|
|
21
21
|
isOffReference
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RJWPJCIB.js";
|
|
23
23
|
|
|
24
24
|
// src/layoutModes.ts
|
|
25
25
|
var FORCE_LAYOUT_LABEL = "Force-directed layout";
|