@jbrowse/bandage-core 10.2.2 → 10.2.3
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 -7
- package/dist/bubbles/bubbleHalos.js +7 -3
- package/dist/bubbles/bubblesFromGraph.js +4 -2
- package/dist/bubbles/classifyBubble.js +10 -5
- package/dist/bubbles/superbubbles.js +10 -6
- package/dist/chunks/{chunk-N6FECAXP.js → chunk-24WITXQY.js} +17 -8
- package/dist/chunks/{chunk-XTCNEKO5.js → chunk-2QLLQJ72.js} +15 -13
- package/dist/chunks/{chunk-ASSNZXCF.js → chunk-3AOGOCCQ.js} +44 -103
- package/dist/chunks/{chunk-TWRLC3KK.js → chunk-3XSM4OZU.js} +1 -1
- package/dist/chunks/{chunk-WEDZ76AK.js → chunk-4DRQTBBE.js} +1 -1
- package/dist/chunks/{chunk-2LQ5BWT7.js → chunk-4ETPXDO6.js} +1 -1
- package/dist/chunks/{chunk-FP4H7SFT.js → chunk-4HWM3FNK.js} +2 -2
- package/dist/chunks/{chunk-C7MZJSPT.js → chunk-54POIBVC.js} +2 -8
- package/dist/chunks/{chunk-PKFMP65V.js → chunk-5GMFEPWR.js} +1 -1
- package/dist/chunks/{chunk-CDLPYR5O.js → chunk-5I3K4R2G.js} +7 -6
- package/dist/chunks/{chunk-TICYLD5F.js → chunk-7CC7N3XC.js} +35 -78
- package/dist/chunks/{chunk-2CVHXFK7.js → chunk-7SRWJLSC.js} +19 -22
- package/dist/chunks/{chunk-SBMJNRTV.js → chunk-A4PFFC4Q.js} +37 -27
- package/dist/chunks/{chunk-IW6CYVX2.js → chunk-AR4BUBMU.js} +6 -1
- package/dist/chunks/{chunk-IUDJKOLB.js → chunk-B6IW3IRE.js} +15 -33
- package/dist/chunks/{chunk-JUIJI7RC.js → chunk-BAETMD3J.js} +9 -4
- package/dist/chunks/{chunk-L5WF4ZPS.js → chunk-BS4UZ44I.js} +1 -1
- package/dist/chunks/{chunk-HNQPEMYE.js → chunk-CM6LO6OC.js} +0 -1
- package/dist/chunks/{chunk-CLOP7UVD.js → chunk-CQHUZHET.js} +11 -8
- package/dist/chunks/{chunk-R456ME6J.js → chunk-CU6P5RUG.js} +17 -6
- package/dist/chunks/chunk-D5D36ZF6.js +107 -0
- package/dist/chunks/{chunk-AFP3NWSL.js → chunk-DY3JCAMX.js} +1 -1
- package/dist/chunks/{chunk-NRV7R36Q.js → chunk-EFQLEGWM.js} +3 -3
- package/dist/chunks/{chunk-BXEPA4KS.js → chunk-G6UIYQZR.js} +5 -2
- package/dist/chunks/{chunk-NNODIW4U.js → chunk-H2H4Y3TV.js} +1 -0
- package/dist/chunks/{chunk-MVFDSFV2.js → chunk-HNCXR2VS.js} +1 -1
- package/dist/chunks/{chunk-EYK7DJZV.js → chunk-J5FWKGOY.js} +1 -1
- package/dist/chunks/{chunk-PBENCR5L.js → chunk-JBCZIBFC.js} +0 -2
- package/dist/chunks/{chunk-EHUBJDDB.js → chunk-JFY5PWQC.js} +5 -3
- package/dist/chunks/{chunk-5BGP5Z64.js → chunk-JLSJMCDJ.js} +1 -1
- package/dist/chunks/{chunk-DT2GGH4D.js → chunk-JMABOQWL.js} +2 -6
- package/dist/chunks/{chunk-3S3YVOJ7.js → chunk-JSUCGZ6K.js} +1 -1
- package/dist/chunks/{chunk-MLSWIMZO.js → chunk-KBEP7VYK.js} +2 -2
- package/dist/chunks/{chunk-TAMCZHLW.js → chunk-N73TI3VG.js} +2 -2
- package/dist/chunks/chunk-O4EGE27I.js +10 -0
- package/dist/chunks/{chunk-3ZZSX5HN.js → chunk-PTABFYQ7.js} +10 -6
- package/dist/chunks/{chunk-WBCOREDZ.js → chunk-QLWI2PZ3.js} +16 -7
- package/dist/chunks/chunk-RBCE2OQH.js +32 -0
- package/dist/chunks/{chunk-BUBZ32IC.js → chunk-RPRHR56C.js} +4 -8
- package/dist/chunks/{chunk-47DYCZOK.js → chunk-RUCH6ZFL.js} +4 -0
- package/dist/chunks/{chunk-GNTTI6LA.js → chunk-T2PCSAFY.js} +1 -1
- package/dist/chunks/{chunk-XKWD2RY3.js → chunk-URZ3CH2R.js} +3 -10
- package/dist/chunks/{chunk-ALDGONEI.js → chunk-VQC7KELB.js} +1 -1
- package/dist/chunks/{chunk-FLFBYSJO.js → chunk-VQWHMWLF.js} +5 -1
- package/dist/chunks/{chunk-4R6QNG23.js → chunk-WL6ZKUVC.js} +3 -3
- package/dist/chunks/{chunk-CRTD2SBP.js → chunk-WZNPX7Q6.js} +6 -2
- package/dist/chunks/{chunk-FNGIQF43.js → chunk-XA5A27CS.js} +6 -14
- package/dist/chunks/{chunk-DK5P2YOL.js → chunk-XI3ZUTWF.js} +2 -2
- package/dist/chunks/{chunk-ZIUKZUPJ.js → chunk-XL472HHD.js} +1 -1
- package/dist/chunks/{chunk-BPRXQ2SS.js → chunk-XMW266WS.js} +1 -1
- package/dist/chunks/{chunk-DRG4236Y.js → chunk-YN6FDIBT.js} +2 -2
- package/dist/chunks/{chunk-WFB5TXRA.js → chunk-ZY2AFL4Y.js} +13 -31
- package/dist/cli/decodeText.js +6 -0
- package/dist/cli/figure.js +59 -60
- package/dist/cli/fold.js +13 -13
- package/dist/deletionEdges.js +6 -4
- package/dist/el.js +3 -1
- package/dist/figure.js +33 -31
- package/dist/figureData.js +32 -27
- package/dist/figureScene.js +43 -0
- package/dist/figureSettings.js +8 -8
- package/dist/foldVariants.js +2 -2
- package/dist/gbzCut.js +1 -1
- package/dist/genes/exonOutline.js +2 -2
- package/dist/genes/geneFiles.js +1 -1
- package/dist/genes/genePins.js +3 -3
- package/dist/gfa/gfaConverter.js +2 -2
- package/dist/gfa-core/gfaParser.js +1 -1
- package/dist/gfa-core/index.js +1 -1
- package/dist/graphLabels.js +4 -4
- package/dist/index.js +72 -73
- package/dist/labelLayout.js +8 -8
- package/dist/layout/forceCache.js +8 -8
- package/dist/layout/mergeRuns.js +2 -2
- package/dist/layout/orderedLayout.js +1 -3
- package/dist/layout/tubeMapLayout.js +6 -6
- package/dist/layout/walkRowDraw.js +11 -11
- package/dist/layout/walkRowLayout.js +3 -1
- package/dist/layout/walkStrip.js +14 -12
- package/dist/layoutEngines.js +1 -2
- package/dist/layoutModes.js +9 -9
- package/dist/nodeWidths.js +1 -3
- package/dist/pathColors.js +5 -5
- package/dist/pipeline.js +7 -7
- package/dist/referenceRampCss.js +9 -9
- package/dist/referenceStrip.js +9 -9
- package/dist/renderer/Canvas2DRenderer.js +2 -2
- package/dist/renderer/GeometryBuilder.js +8 -8
- package/dist/renderer/canvas.js +1 -1
- package/dist/renderer/svgCanvas.js +1 -1
- package/dist/tubeMap/axis.js +5 -5
- package/dist/tubeMap/bundle.js +7 -7
- package/dist/tubeMap/coarsen.js +6 -6
- package/dist/tubeMap/deviations.js +5 -5
- package/dist/tubeMap/draw.js +1 -1
- package/dist/tubeMap/genes.js +6 -6
- package/dist/tubeMap/nodeColors.js +9 -9
- package/dist/types/bubbles/bubblesFromGraph.d.ts +1 -0
- package/dist/types/bubbles/classifyBubble.d.ts +0 -1
- package/dist/types/cli/decodeText.d.ts +1 -0
- package/dist/types/cli/figure.d.ts +4 -15
- package/dist/types/deletionEdges.d.ts +3 -5
- package/dist/types/el.d.ts +1 -0
- package/dist/types/figureData.d.ts +7 -26
- package/dist/types/figureScene.d.ts +31 -0
- package/dist/types/genes/geneFiles.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/layout/deletionRoutes.d.ts +1 -1
- package/dist/types/layout/orderedLayout.d.ts +0 -6
- package/dist/types/layout/walkRowLayout.d.ts +1 -0
- package/dist/types/nodeWidths.d.ts +0 -1
- package/dist/types/renderer/Canvas2DRenderer.d.ts +1 -0
- package/dist/types/renderer/canvas.d.ts +2 -2
- package/dist/types/tubeMap/draw.d.ts +1 -0
- package/dist/types/util/geometry.d.ts +3 -3
- package/dist/types/version.d.ts +1 -1
- package/dist/util/SpatialIndex.js +4 -4
- package/dist/util/edgeCurves.js +3 -3
- package/dist/util/geometry.js +3 -3
- package/dist/util/hitDetection.js +5 -5
- package/dist/version.js +1 -1
- package/dist/viewport.js +8 -8
- package/dist/walkEncoding.js +9 -9
- package/dist/walkHighlight.js +10 -10
- package/dist/walkKey.js +5 -5
- package/package.json +3 -6
- package/dist/chunks/bandage-layout-3AR6BCUD.js +0 -4694
- package/dist/chunks/chunk-4BYTEJGW.js +0 -44
- package/dist/chunks/chunk-7XHHVYG7.js +0 -13
- package/dist/loadBandage.js +0 -6
- package/dist/types/bandage/bandage-layout.d.ts +0 -14
- package/dist/types/loadBandage.d.ts +0 -3
package/README.md
CHANGED
|
@@ -10,8 +10,10 @@ npm install @jbrowse/bandage-core
|
|
|
10
10
|
|
|
11
11
|
- GFA and rGFA text in (`loadGraph`), or the same graph as typed arrays a worker
|
|
12
12
|
can transfer (`GraphTables`)
|
|
13
|
-
- Layouts: Bandage's FMMM engine as WASM
|
|
14
|
-
|
|
13
|
+
- Layouts: Bandage's FMMM engine as WASM from
|
|
14
|
+
[@jbrowse/graph-fmmm-layout](https://github.com/GMOD/graph-fmmm-layout)
|
|
15
|
+
(`loadBandage`, `forceLayout`), ordered, anchored, sample rows, walk rows,
|
|
16
|
+
tube map
|
|
15
17
|
- A Canvas2D renderer (`buildGeometry`, `Canvas2DRenderer`), hit testing and
|
|
16
18
|
label placement
|
|
17
19
|
- Bubbles, deletion edges, path colors, gbz-base windows cut to GFA
|
|
@@ -42,13 +44,10 @@ the worked example.
|
|
|
42
44
|
pnpm install
|
|
43
45
|
pnpm test # unit tests
|
|
44
46
|
pnpm build # dist/ with declarations
|
|
45
|
-
pnpm test:wasm # the committed layout engine still loads
|
|
46
47
|
```
|
|
47
48
|
|
|
48
|
-
The
|
|
49
|
-
|
|
50
|
-
says how to rebuild it from `src/bandage/native` and the vendored `vendor/ogdf`.
|
|
51
|
-
A weekly workflow proves the committed artifact still reproduces.
|
|
49
|
+
The FMMM engine and its wasm build live in
|
|
50
|
+
[graph-fmmm-layout](https://github.com/GMOD/graph-fmmm-layout).
|
|
52
51
|
|
|
53
52
|
CI also packs the core and runs
|
|
54
53
|
[BandageJS](https://github.com/cmdcolin/BandageJS) and
|
|
@@ -3,10 +3,14 @@ import {
|
|
|
3
3
|
WHOLE_FRACTION,
|
|
4
4
|
bubbleHalos,
|
|
5
5
|
coversGraph
|
|
6
|
-
} from "../chunks/chunk-
|
|
7
|
-
import "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-JFY5PWQC.js";
|
|
7
|
+
import "../chunks/chunk-URZ3CH2R.js";
|
|
8
8
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-PTABFYQ7.js";
|
|
10
|
+
import "../chunks/chunk-AB35TJST.js";
|
|
11
|
+
import "../chunks/chunk-N73TI3VG.js";
|
|
12
|
+
import "../chunks/chunk-24WITXQY.js";
|
|
13
|
+
import "../chunks/chunk-7SRWJLSC.js";
|
|
10
14
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
11
15
|
import "../chunks/chunk-FYQWPEEY.js";
|
|
12
16
|
export {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bubblesFromGraph,
|
|
3
|
+
relax,
|
|
3
4
|
walkIndexOf,
|
|
4
5
|
walkRoutes
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-CQHUZHET.js";
|
|
6
7
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
+
import "../chunks/chunk-CM6LO6OC.js";
|
|
8
9
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
9
10
|
import "../chunks/chunk-FYQWPEEY.js";
|
|
10
11
|
export {
|
|
11
12
|
bubblesFromGraph,
|
|
13
|
+
relax,
|
|
12
14
|
walkIndexOf,
|
|
13
15
|
walkRoutes
|
|
14
16
|
};
|
|
@@ -2,14 +2,19 @@ import {
|
|
|
2
2
|
BUBBLE_KIND_COLORS,
|
|
3
3
|
BUBBLE_KIND_NAMES,
|
|
4
4
|
bubbleSegmentIds,
|
|
5
|
-
classifyBubble
|
|
6
|
-
|
|
7
|
-
} from "../chunks/chunk-XKWD2RY3.js";
|
|
5
|
+
classifyBubble
|
|
6
|
+
} from "../chunks/chunk-URZ3CH2R.js";
|
|
8
7
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
8
|
+
import "../chunks/chunk-PTABFYQ7.js";
|
|
9
|
+
import "../chunks/chunk-AB35TJST.js";
|
|
10
|
+
import "../chunks/chunk-N73TI3VG.js";
|
|
11
|
+
import "../chunks/chunk-24WITXQY.js";
|
|
12
|
+
import "../chunks/chunk-7SRWJLSC.js";
|
|
13
|
+
import "../chunks/chunk-CPMHA4W5.js";
|
|
14
|
+
import "../chunks/chunk-FYQWPEEY.js";
|
|
9
15
|
export {
|
|
10
16
|
BUBBLE_KIND_COLORS,
|
|
11
17
|
BUBBLE_KIND_NAMES,
|
|
12
18
|
bubbleSegmentIds,
|
|
13
|
-
classifyBubble
|
|
14
|
-
formatBp
|
|
19
|
+
classifyBubble
|
|
15
20
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
graphBubbles,
|
|
3
3
|
superbubblesFromGraph
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-XA5A27CS.js";
|
|
5
|
+
import "../chunks/chunk-CQHUZHET.js";
|
|
6
6
|
import "../chunks/chunk-T6V4KI2L.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-JFY5PWQC.js";
|
|
8
|
+
import "../chunks/chunk-URZ3CH2R.js";
|
|
9
9
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
10
|
-
import "../chunks/chunk-
|
|
10
|
+
import "../chunks/chunk-CM6LO6OC.js";
|
|
11
11
|
import "../chunks/chunk-M6LK4GII.js";
|
|
12
12
|
import "../chunks/chunk-RAEABQNW.js";
|
|
13
13
|
import "../chunks/chunk-BPLIXMH7.js";
|
|
14
|
-
import "../chunks/chunk-
|
|
14
|
+
import "../chunks/chunk-PTABFYQ7.js";
|
|
15
|
+
import "../chunks/chunk-AB35TJST.js";
|
|
16
|
+
import "../chunks/chunk-N73TI3VG.js";
|
|
17
|
+
import "../chunks/chunk-24WITXQY.js";
|
|
18
|
+
import "../chunks/chunk-7SRWJLSC.js";
|
|
15
19
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
16
20
|
import "../chunks/chunk-FYQWPEEY.js";
|
|
17
21
|
export {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
edgeJoinOf,
|
|
4
4
|
routedEdgeCurves,
|
|
5
5
|
strandSides
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7SRWJLSC.js";
|
|
7
7
|
import {
|
|
8
8
|
firstNodeAtOrAfter,
|
|
9
9
|
isBackbone
|
|
@@ -15,8 +15,18 @@ function bypassedPoints(nodePositions, bypassed) {
|
|
|
15
15
|
return bypassed.flatMap((id) => nodePositions[id] ?? []);
|
|
16
16
|
}
|
|
17
17
|
function deletionArcCurves(nodePositions, deletion, axis, route, stranded = false) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
return edgeCurvesOf(
|
|
19
|
+
nodePositions,
|
|
20
|
+
deletion,
|
|
21
|
+
axis,
|
|
22
|
+
deletion.bypassed,
|
|
23
|
+
route,
|
|
24
|
+
stranded
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function edgeCurvesOf(nodePositions, edge, axis, bypassed, route, stranded) {
|
|
28
|
+
const from = nodePositions[edge.from];
|
|
29
|
+
const to = nodePositions[edge.to];
|
|
20
30
|
if (!from?.length || !to?.length) {
|
|
21
31
|
return void 0;
|
|
22
32
|
}
|
|
@@ -24,15 +34,13 @@ function deletionArcCurves(nodePositions, deletion, axis, route, stranded = fals
|
|
|
24
34
|
from,
|
|
25
35
|
to,
|
|
26
36
|
route,
|
|
27
|
-
stranded ? strandSides(
|
|
37
|
+
stranded ? strandSides(edge) : void 0
|
|
28
38
|
) : computeEdgeCurves(
|
|
29
39
|
from,
|
|
30
40
|
to,
|
|
31
|
-
edgeJoinOf(
|
|
32
|
-
0,
|
|
33
|
-
0,
|
|
41
|
+
edgeJoinOf(edge, stranded),
|
|
34
42
|
axis,
|
|
35
|
-
bypassedPoints(nodePositions,
|
|
43
|
+
bypassed ? bypassedPoints(nodePositions, bypassed) : []
|
|
36
44
|
);
|
|
37
45
|
}
|
|
38
46
|
function backboneBySequence(graph) {
|
|
@@ -161,6 +169,7 @@ function deletionDrawing(graph, deletions, show = true) {
|
|
|
161
169
|
export {
|
|
162
170
|
bypassedPoints,
|
|
163
171
|
deletionArcCurves,
|
|
172
|
+
edgeCurvesOf,
|
|
164
173
|
deletionEdges,
|
|
165
174
|
closableDeletions,
|
|
166
175
|
deletionDrawing
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
orientToReference
|
|
3
|
+
} from "./chunk-PUG7LXDF.js";
|
|
1
4
|
import {
|
|
2
5
|
seededNodes
|
|
3
6
|
} from "./chunk-IGVV37VI.js";
|
|
@@ -9,18 +12,15 @@ import {
|
|
|
9
12
|
takeRoutes,
|
|
10
13
|
withDeletionRoutes
|
|
11
14
|
} from "./chunk-VPE4AYP7.js";
|
|
12
|
-
import {
|
|
13
|
-
orientToReference
|
|
14
|
-
} from "./chunk-PUG7LXDF.js";
|
|
15
15
|
import {
|
|
16
16
|
convertGFAToGraph
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AR4BUBMU.js";
|
|
18
|
+
import {
|
|
19
|
+
parseGFA
|
|
20
|
+
} from "./chunk-5I3K4R2G.js";
|
|
18
21
|
import {
|
|
19
22
|
graphFromTables
|
|
20
23
|
} from "./chunk-PSMKPSO4.js";
|
|
21
|
-
import {
|
|
22
|
-
parseGFA
|
|
23
|
-
} from "./chunk-CDLPYR5O.js";
|
|
24
24
|
import {
|
|
25
25
|
anchorGraph
|
|
26
26
|
} from "./chunk-M6LK4GII.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
mergeRuns,
|
|
32
32
|
splitRuns
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-N73TI3VG.js";
|
|
34
34
|
import {
|
|
35
35
|
spreadFor
|
|
36
36
|
} from "./chunk-UVBGRJQX.js";
|
|
@@ -40,9 +40,9 @@ import {
|
|
|
40
40
|
layoutScaling
|
|
41
41
|
} from "./chunk-6JEWNXCQ.js";
|
|
42
42
|
import {
|
|
43
|
-
|
|
43
|
+
deletionDrawing,
|
|
44
44
|
deletionEdges
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-24WITXQY.js";
|
|
46
46
|
import {
|
|
47
47
|
isBackbone
|
|
48
48
|
} from "./chunk-FYQWPEEY.js";
|
|
@@ -118,9 +118,11 @@ function engineKey(graph, settings) {
|
|
|
118
118
|
}
|
|
119
119
|
async function forceLayout(graph, settings, engine) {
|
|
120
120
|
const spread = spreadFor(settings.bubbleSpread);
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
const { shown: deletions, hidden: dropped } = deletionDrawing(
|
|
122
|
+
graph,
|
|
123
|
+
deletionEdges(graph),
|
|
124
|
+
settings.showDeletionEdges !== false
|
|
125
|
+
);
|
|
124
126
|
const routed = withDeletionRoutes(graph, deletions, dropped);
|
|
125
127
|
const merged = mergeRuns(routed.graph, routed.ids);
|
|
126
128
|
const runs = {
|
|
@@ -1,79 +1,63 @@
|
|
|
1
1
|
import {
|
|
2
2
|
svgCanvas
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RUCH6ZFL.js";
|
|
4
4
|
import {
|
|
5
5
|
stripGeneGaps,
|
|
6
6
|
walkStripFrame,
|
|
7
7
|
walkStripLabelsTree
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
Canvas2DRenderer
|
|
11
|
-
} from "./chunk-WBCOREDZ.js";
|
|
8
|
+
} from "./chunk-BAETMD3J.js";
|
|
12
9
|
import {
|
|
13
10
|
walkRowsKey,
|
|
14
11
|
walkRowsKeyTree,
|
|
15
12
|
walkRowsTree
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EFQLEGWM.js";
|
|
14
|
+
import {
|
|
15
|
+
Canvas2DRenderer
|
|
16
|
+
} from "./chunk-QLWI2PZ3.js";
|
|
17
17
|
import {
|
|
18
18
|
EXON_COLOR,
|
|
19
19
|
exonOutlineTree,
|
|
20
20
|
exonStretches
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JSUCGZ6K.js";
|
|
22
22
|
import {
|
|
23
23
|
genePins
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-RPRHR56C.js";
|
|
25
25
|
import {
|
|
26
26
|
geneLabelCandidates
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YN6FDIBT.js";
|
|
28
28
|
import {
|
|
29
29
|
nodesUnderBox
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4HWM3FNK.js";
|
|
31
31
|
import {
|
|
32
|
+
escapeAttr,
|
|
32
33
|
serializeEl
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
layoutGeometryInputs
|
|
36
|
-
} from "./chunk-LOCJN3BZ.js";
|
|
34
|
+
} from "./chunk-H2H4Y3TV.js";
|
|
37
35
|
import {
|
|
38
36
|
version
|
|
39
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-J5FWKGOY.js";
|
|
40
38
|
import {
|
|
41
39
|
axisScaleOf
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import {
|
|
44
|
-
facetLifts,
|
|
45
|
-
walkLift
|
|
46
|
-
} from "./chunk-R456ME6J.js";
|
|
47
|
-
import {
|
|
48
|
-
encodingStops
|
|
49
|
-
} from "./chunk-ALDGONEI.js";
|
|
40
|
+
} from "./chunk-BS4UZ44I.js";
|
|
50
41
|
import {
|
|
51
42
|
rangeText,
|
|
52
43
|
walkKey
|
|
53
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-4ETPXDO6.js";
|
|
54
45
|
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} from "./chunk-SBMJNRTV.js";
|
|
46
|
+
figureScene
|
|
47
|
+
} from "./chunk-D5D36ZF6.js";
|
|
58
48
|
import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} from "./chunk-C7MZJSPT.js";
|
|
49
|
+
encodingStops
|
|
50
|
+
} from "./chunk-VQC7KELB.js";
|
|
62
51
|
import {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} from "./chunk-TWRLC3KK.js";
|
|
52
|
+
walkRowLabels
|
|
53
|
+
} from "./chunk-54POIBVC.js";
|
|
66
54
|
import {
|
|
67
55
|
nodeInk
|
|
68
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-JBCZIBFC.js";
|
|
69
57
|
import {
|
|
70
58
|
FIT_PADDING,
|
|
71
|
-
drawingBounds,
|
|
72
59
|
fitTransform
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import {
|
|
75
|
-
referenceLabel
|
|
76
|
-
} from "./chunk-RAKOB6IV.js";
|
|
60
|
+
} from "./chunk-2QLLQJ72.js";
|
|
77
61
|
import {
|
|
78
62
|
LABEL_CHAR_PX,
|
|
79
63
|
LABEL_PAD,
|
|
@@ -81,20 +65,12 @@ import {
|
|
|
81
65
|
occupancy,
|
|
82
66
|
placeLabels
|
|
83
67
|
} from "./chunk-AB35TJST.js";
|
|
84
|
-
import {
|
|
85
|
-
resolveColorScheme
|
|
86
|
-
} from "./chunk-JKJWSY4V.js";
|
|
87
|
-
import {
|
|
88
|
-
deletionDrawing,
|
|
89
|
-
deletionEdges
|
|
90
|
-
} from "./chunk-N6FECAXP.js";
|
|
91
68
|
import {
|
|
92
69
|
FACET_GAP_PX,
|
|
93
70
|
FACET_PAD_PX,
|
|
94
71
|
FACET_TITLE_PX,
|
|
95
72
|
facetCells,
|
|
96
|
-
facetGrid
|
|
97
|
-
facetSettingOf
|
|
73
|
+
facetGrid
|
|
98
74
|
} from "./chunk-XV4P5KEQ.js";
|
|
99
75
|
|
|
100
76
|
// src/figure.ts
|
|
@@ -105,9 +81,6 @@ var KEY_GAP_PX = 16;
|
|
|
105
81
|
var STRIP_KEY_PX = 22;
|
|
106
82
|
var FADED = "rgb(160,160,160)";
|
|
107
83
|
var GENE_INK = "#1c1c22";
|
|
108
|
-
function esc(s) {
|
|
109
|
-
return s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
110
|
-
}
|
|
111
84
|
function keySvg(id, x, y, stops, label, after, under, opacity = 1) {
|
|
112
85
|
const bar = stops.length > 1 ? BAR_PX : SWATCH_PX;
|
|
113
86
|
const fill = stops.length > 1 ? `fill="url(#${id})"` : `fill="${stops[0].color}"${opacity < 1 ? ` fill-opacity="${opacity}"` : ""}`;
|
|
@@ -118,7 +91,7 @@ function keySvg(id, x, y, stops, label, after, under, opacity = 1) {
|
|
|
118
91
|
);
|
|
119
92
|
return {
|
|
120
93
|
width,
|
|
121
|
-
markup: `${defs}<g transform="translate(${x} ${y})" ${FONT}><rect y="5" width="${bar}" height="8" rx="2" ${fill}/><text x="${bar + 5}" y="13"><tspan font-weight="bold">${
|
|
94
|
+
markup: `${defs}<g transform="translate(${x} ${y})" ${FONT}><rect y="5" width="${bar}" height="8" rx="2" ${fill}/><text x="${bar + 5}" y="13"><tspan font-weight="bold">${escapeAttr(label)}</tspan>${escapeAttr(after)}</text>${under ? `<text y="28">${escapeAttr(under)}</text>` : ""}</g>`
|
|
122
95
|
};
|
|
123
96
|
}
|
|
124
97
|
function exonKeySvg(x, y) {
|
|
@@ -146,47 +119,32 @@ function screenPath(d, t) {
|
|
|
146
119
|
);
|
|
147
120
|
}
|
|
148
121
|
function chip(x, y, w, name, note) {
|
|
149
|
-
return `<rect x="${x - w / 2}" y="${y - LABEL_PX - LABEL_PAD + 2}" width="${w}" height="${LABEL_PX + LABEL_PAD * 2 - 2}" rx="3" fill="#fff" fill-opacity="0.85" stroke="${EXON_COLOR}"/><text x="${x}" y="${y}" font-family="Helvetica, Arial, sans-serif" font-size="${LABEL_PX}" fill="${GENE_INK}" text-anchor="middle"><tspan font-style="italic" font-weight="600">${
|
|
122
|
+
return `<rect x="${x - w / 2}" y="${y - LABEL_PX - LABEL_PAD + 2}" width="${w}" height="${LABEL_PX + LABEL_PAD * 2 - 2}" rx="3" fill="#fff" fill-opacity="0.85" stroke="${EXON_COLOR}"/><text x="${x}" y="${y}" font-family="Helvetica, Arial, sans-serif" font-size="${LABEL_PX}" fill="${GENE_INK}" text-anchor="middle"><tspan font-style="italic" font-weight="600">${escapeAttr(name)}</tspan>${note ? escapeAttr(note) : ""}</text>`;
|
|
150
123
|
}
|
|
151
124
|
function figureSvg(graph, layout, o = {}) {
|
|
152
125
|
const width = o.width ?? 1200;
|
|
153
126
|
const room = o.height ?? 800;
|
|
154
|
-
const region = o.region;
|
|
155
|
-
const rampDomain = o.colorDomain ?? region;
|
|
156
127
|
const rows = o.walkRows;
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
128
|
+
const {
|
|
129
|
+
bounds,
|
|
130
|
+
nodeById,
|
|
131
|
+
referenceRamp,
|
|
132
|
+
layers,
|
|
133
|
+
lift,
|
|
134
|
+
facet,
|
|
135
|
+
panels,
|
|
136
|
+
labelOf,
|
|
137
|
+
referenceName,
|
|
138
|
+
reference,
|
|
139
|
+
contigThickness,
|
|
140
|
+
nodeWidth,
|
|
141
|
+
geometry
|
|
142
|
+
} = figureScene(graph, layout, o);
|
|
161
143
|
const pixelRows = layout.pixelRows ?? false;
|
|
162
|
-
const nodeById = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
163
|
-
const colorScheme = resolveColorScheme(o.colorScheme ?? "auto", graph);
|
|
164
|
-
const referenceRamp = colorScheme === "reference-position" && !layout.tubeMap ? computeReferenceRamp(graph, rampDomain) : void 0;
|
|
165
144
|
const rampInterval = referenceRamp && {
|
|
166
145
|
start: referenceRamp.start,
|
|
167
146
|
end: referenceRamp.start + referenceRamp.span
|
|
168
147
|
};
|
|
169
|
-
const drawnDeletions = deletionDrawing(
|
|
170
|
-
graph,
|
|
171
|
-
layout.tubeMap ? [] : deletionEdges(graph),
|
|
172
|
-
o.showDeletionEdges
|
|
173
|
-
);
|
|
174
|
-
const layers = o.walks ?? [];
|
|
175
|
-
const walkRamp = layers.some((l) => l.color?.field === "reference") ? referenceRamp ?? computeReferenceRamp(graph, rampDomain) : void 0;
|
|
176
|
-
const lift = layers.length > 0 && !layout.tubeMap ? walkLift(graph, layers, walkRamp) : void 0;
|
|
177
|
-
const facet = facetSettingOf(o.facet);
|
|
178
|
-
const panels = facet.field && lift && lift.walks.length > 1 ? facetLifts(graph, lift, layers, walkRamp) : void 0;
|
|
179
|
-
const labels = walkLabelsOf(
|
|
180
|
-
graph.paths?.length ? pathLegend(graph.paths) : []
|
|
181
|
-
);
|
|
182
|
-
const labelOf = (name) => labels.get(name) ?? name;
|
|
183
|
-
const referenceName = o.referenceName ?? referenceLabel(graph, region);
|
|
184
|
-
const reference = lift?.referenceDomain && {
|
|
185
|
-
...lift.referenceDomain,
|
|
186
|
-
name: referenceName
|
|
187
|
-
};
|
|
188
|
-
const contigThickness = o.contigThickness ?? 6;
|
|
189
|
-
const nodeWidth = o.nodeWidth ?? "depth";
|
|
190
148
|
const pins = o.genes?.length && !layout.tubeMap && !rows ? genePins(graph, o.genes, layout.nodePositions) : [];
|
|
191
149
|
const ink = nodeInk(graph, nodeById, contigThickness, nodeWidth);
|
|
192
150
|
let masks = 0;
|
|
@@ -239,7 +197,7 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
239
197
|
const sy = y * t.scaleY + t.translateY;
|
|
240
198
|
if (sy >= 0 && sy <= h) {
|
|
241
199
|
out.push(
|
|
242
|
-
`<text x="6" y="${sy + 4}" ${FONT} stroke="#fff" stroke-width="3" paint-order="stroke">${
|
|
200
|
+
`<text x="6" y="${sy + 4}" ${FONT} stroke="#fff" stroke-width="3" paint-order="stroke">${escapeAttr(label)}</text>`
|
|
243
201
|
);
|
|
244
202
|
}
|
|
245
203
|
}
|
|
@@ -264,24 +222,7 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
264
222
|
const axis = axisScaleOf(fit.scale, pixelRows);
|
|
265
223
|
const { canvas, markup } = svgCanvas(w, h);
|
|
266
224
|
const renderer = new Canvas2DRenderer(canvas);
|
|
267
|
-
renderer.uploadGeometry(
|
|
268
|
-
buildGeometry({
|
|
269
|
-
...layoutGeometryInputs(layout, drawnDeletions, {
|
|
270
|
-
drawsRows: !!rows
|
|
271
|
-
}),
|
|
272
|
-
graph,
|
|
273
|
-
nodeById,
|
|
274
|
-
colorScheme,
|
|
275
|
-
contigThickness,
|
|
276
|
-
connectorThickness: o.connectorThickness ?? 2,
|
|
277
|
-
drawPaths: false,
|
|
278
|
-
nodeWidth,
|
|
279
|
-
linearLayout: o.linearLayout,
|
|
280
|
-
highlight,
|
|
281
|
-
axis,
|
|
282
|
-
referenceRamp
|
|
283
|
-
})
|
|
284
|
-
);
|
|
225
|
+
renderer.uploadGeometry(geometry(highlight, axis));
|
|
285
226
|
const t = {
|
|
286
227
|
scaleX: axis.scaleX,
|
|
287
228
|
scaleY: axis.scaleY,
|
|
@@ -420,7 +361,7 @@ function figureSvg(graph, layout, o = {}) {
|
|
|
420
361
|
generator: `@jbrowse/bandage-core@${version}`,
|
|
421
362
|
...o.spec === void 0 ? {} : { spec: o.spec }
|
|
422
363
|
});
|
|
423
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}"><metadata>${
|
|
364
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}"><metadata>${escapeAttr(metadata)}</metadata><rect width="${width}" height="${height}" fill="#fff"/>${parts.join("")}</svg>
|
|
424
365
|
`;
|
|
425
366
|
}
|
|
426
367
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EdgeSpatialIndex,
|
|
3
3
|
SpatialIndex
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KBEP7VYK.js";
|
|
5
5
|
import {
|
|
6
6
|
pathRibbonOffsets,
|
|
7
7
|
translateCurves,
|
|
8
8
|
yToXOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7SRWJLSC.js";
|
|
10
10
|
|
|
11
11
|
// src/util/hitDetection.ts
|
|
12
12
|
function distanceToSegment(px, py, x1, y1, x2, y2) {
|
|
@@ -47,16 +47,9 @@ function walkRowLayout(graph, region) {
|
|
|
47
47
|
const nodePositions = backbonePositions(
|
|
48
48
|
overWindow.length > 0 ? overWindow : backbone
|
|
49
49
|
);
|
|
50
|
-
const rowLabels = [
|
|
51
|
-
{ label: walks.reference.label, y: 0 },
|
|
52
|
-
...walks.rows.map((row, i) => ({
|
|
53
|
-
label: row.label,
|
|
54
|
-
y: (i + 1) * ROW_HEIGHT_PX
|
|
55
|
-
}))
|
|
56
|
-
];
|
|
57
50
|
return {
|
|
58
51
|
nodePositions,
|
|
59
|
-
rowLabels,
|
|
52
|
+
rowLabels: walkRowLabels(walks),
|
|
60
53
|
referenceAxis: true,
|
|
61
54
|
pixelRows: true,
|
|
62
55
|
extent: walkRowsExtent(walks)
|
|
@@ -64,6 +57,7 @@ function walkRowLayout(graph, region) {
|
|
|
64
57
|
}
|
|
65
58
|
|
|
66
59
|
export {
|
|
60
|
+
READOUT_ROOM,
|
|
67
61
|
walkRowsExtent,
|
|
68
62
|
walkRowLabels,
|
|
69
63
|
walkRowLayout
|
|
@@ -57,10 +57,11 @@ function parseGFA(file) {
|
|
|
57
57
|
};
|
|
58
58
|
for (const rawLine of file.split("\n")) {
|
|
59
59
|
const line = rawLine.endsWith("\r") ? rawLine.slice(0, -1) : rawLine;
|
|
60
|
-
|
|
60
|
+
const type = line.split(" ", 1)[0];
|
|
61
|
+
if (type === "H") {
|
|
61
62
|
const [, ...rest] = line.split(" ");
|
|
62
63
|
graph.header.push(parseTags(rest));
|
|
63
|
-
} else if (
|
|
64
|
+
} else if (type === "S") {
|
|
64
65
|
const [, name, ...rest] = line.split(" ");
|
|
65
66
|
let len;
|
|
66
67
|
let seq;
|
|
@@ -82,7 +83,7 @@ function parseGFA(file) {
|
|
|
82
83
|
len = +tags.LN;
|
|
83
84
|
}
|
|
84
85
|
graph.nodes.push({ id: name, length: len, sequence: seq, tags });
|
|
85
|
-
} else if (
|
|
86
|
+
} else if (type === "E") {
|
|
86
87
|
const [, , source, target, , , , , cigar, ...rest] = line.split(" ");
|
|
87
88
|
if (source && target) {
|
|
88
89
|
graph.links.push({
|
|
@@ -94,7 +95,7 @@ function parseGFA(file) {
|
|
|
94
95
|
tags: parseTags(rest)
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
} else if (
|
|
98
|
+
} else if (type === "L") {
|
|
98
99
|
const [, source, strand1, target, strand2, cigar, ...rest] = line.split(" ");
|
|
99
100
|
if (source && target && strand2) {
|
|
100
101
|
graph.links.push({
|
|
@@ -106,7 +107,7 @@ function parseGFA(file) {
|
|
|
106
107
|
tags: parseTags(rest)
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
|
-
} else if (
|
|
110
|
+
} else if (type === "W") {
|
|
110
111
|
const [, sample, hap, contig, start, end, body, ...rest] = line.split(" ");
|
|
111
112
|
if (sample && hap && contig && start && end && body) {
|
|
112
113
|
graph.walks.push({
|
|
@@ -119,7 +120,7 @@ function parseGFA(file) {
|
|
|
119
120
|
tags: parseTags(rest)
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
|
-
} else if (
|
|
123
|
+
} else if (type === "P") {
|
|
123
124
|
const [, name, path, ...rest] = line.split(" ");
|
|
124
125
|
if (name && path) {
|
|
125
126
|
graph.paths.push({ name, path, rest });
|