@jbrowse/bandage-core 9.0.0 → 9.2.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/bubbles/bubbleHalos.js +9 -5
- package/dist/bubbles/bubbleLine.js +3 -1
- package/dist/bubbles/bubblesFromGraph.js +8 -4
- package/dist/bubbles/classifyBubble.js +2 -2
- package/dist/bubbles/superbubbles.js +21 -0
- package/dist/chunks/{chunk-ISEI2FH3.js → chunk-2AWUWGAD.js} +10 -4
- package/dist/chunks/{chunk-YOYLCLIG.js → chunk-2ZT7ZF7A.js} +6 -2
- package/dist/chunks/{chunk-LLP3FXPM.js → chunk-75HR3756.js} +24 -7
- package/dist/chunks/{chunk-FFFQNQUI.js → chunk-A4MYLGKG.js} +1 -1
- package/dist/chunks/chunk-B4645SM2.js +358 -0
- package/dist/chunks/chunk-B4YH42OP.js +24 -0
- package/dist/chunks/{chunk-6VBDMZBZ.js → chunk-BLRJ6IGK.js} +1 -1
- package/dist/chunks/{chunk-SKKYLBRA.js → chunk-BV64PQ2C.js} +1 -1
- package/dist/chunks/{chunk-W253V6RR.js → chunk-CVYDR2OP.js} +1 -1
- package/dist/chunks/{chunk-AMS3MAFP.js → chunk-FM6XRXPX.js} +1 -1
- package/dist/chunks/{chunk-MFKORG3F.js → chunk-FX4RDMDN.js} +5 -1
- package/dist/chunks/{chunk-MIW3HYPE.js → chunk-GFRPX6M2.js} +2 -2
- package/dist/chunks/{chunk-4S47XRYA.js → chunk-GOZYKNQ2.js} +16 -11
- package/dist/chunks/{chunk-TLQ7F2ZT.js → chunk-HOOVOF2Y.js} +21 -21
- package/dist/chunks/{chunk-MBB7ATM6.js → chunk-LFKMASER.js} +1 -1
- package/dist/chunks/{chunk-6ZNQJ5ZD.js → chunk-OXTR3BVF.js} +1 -1
- package/dist/chunks/{chunk-WDTXW7T2.js → chunk-UD5FOCI2.js} +1 -1
- package/dist/chunks/{chunk-2WNBVB55.js → chunk-WBCOREDZ.js} +121 -74
- package/dist/chunks/{chunk-TL4B342F.js → chunk-XKM5OHQQ.js} +1 -1
- package/dist/chunks/{chunk-WOO7QYKB.js → chunk-XKWD2RY3.js} +8 -2
- package/dist/chunks/{chunk-DPV2CUIE.js → chunk-XPT66H6H.js} +1 -1
- package/dist/chunks/chunk-ZDJDM77V.js +273 -0
- package/dist/cli/figure.js +26 -26
- package/dist/cli/fold.js +72 -0
- package/dist/figure.js +16 -16
- package/dist/figureSettings.js +4 -4
- package/dist/foldVariants.js +9 -0
- package/dist/gfa/writeRgfa.js +6 -0
- package/dist/index.js +84 -74
- package/dist/layout/forceCache.js +4 -4
- package/dist/layout/trimToWindow.js +13 -0
- package/dist/layout/walkRowDraw.js +4 -4
- package/dist/layout/walkStrip.js +5 -5
- package/dist/layoutModes.js +2 -2
- package/dist/pipeline.js +3 -3
- package/dist/referenceRampCss.js +3 -3
- package/dist/referenceStrip.js +3 -3
- package/dist/renderer/Canvas2DRenderer.js +1 -1
- package/dist/renderer/GeometryBuilder.js +2 -2
- package/dist/renderer/recordingCanvas.js +12 -1
- package/dist/tubeMap/connectors.js +3 -1
- package/dist/tubeMap/draw.js +3 -1
- package/dist/tubeMap/nodeColors.js +3 -3
- package/dist/types/bubbles/bubbleHalos.d.ts +2 -0
- package/dist/types/bubbles/bubbleLine.d.ts +3 -0
- package/dist/types/bubbles/bubblesFromGraph.d.ts +12 -2
- package/dist/types/bubbles/superbubbles.d.ts +5 -0
- package/dist/types/cli/fold.d.ts +1 -0
- package/dist/types/foldVariants.d.ts +2 -0
- package/dist/types/gfa/writeRgfa.d.ts +2 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/layout/trimToWindow.d.ts +4 -0
- package/dist/types/renderer/Canvas2DRenderer.d.ts +6 -3
- package/dist/types/tubeMap/connectors.d.ts +1 -0
- package/dist/types/tubeMap/draw.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +4 -4
- package/dist/walkEncoding.js +3 -3
- package/dist/walkHighlight.js +4 -4
- package/package.json +3 -2
- package/dist/chunks/{chunk-HBEKUQO4.js → chunk-BR25DGIJ.js} +4 -4
- package/dist/chunks/{chunk-WNUZP3WQ.js → chunk-M7SRZJ32.js} +3 -3
- package/dist/chunks/{chunk-5OIVTEF7.js → chunk-ZGRYFUXE.js} +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SATURATED_PATH_COUNT
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FX4RDMDN.js";
|
|
4
4
|
import {
|
|
5
5
|
referenceOrder
|
|
6
6
|
} from "./chunk-HNQPEMYE.js";
|
|
@@ -38,15 +38,7 @@ function bubblesFromGraph(graph) {
|
|
|
38
38
|
const backbone = graph.nodes.filter(isBackbone).sort((a, b) => a.stable.start - b.stable.start);
|
|
39
39
|
const ends = /* @__PURE__ */ new Set([backbone[0].id, backbone.at(-1).id]);
|
|
40
40
|
const boundaries = backbone.map((node) => [node, indexOf.get(node.id)]).filter(([node, i]) => ends.has(node.id) || reach[i] === 0).sort(([a, ia], [b, ib]) => ia - ib || a.stable.start - b.stable.start);
|
|
41
|
-
const walkIndex = graph
|
|
42
|
-
const at = /* @__PURE__ */ new Map();
|
|
43
|
-
p.nodeIds.forEach((id, i) => {
|
|
44
|
-
if (!at.has(id)) {
|
|
45
|
-
at.set(id, i);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return at;
|
|
49
|
-
});
|
|
41
|
+
const walkIndex = walkIndexOf(graph);
|
|
50
42
|
const bubbles = [];
|
|
51
43
|
for (let i = 0; i + 1 < boundaries.length; i++) {
|
|
52
44
|
const [start, i0] = boundaries[i];
|
|
@@ -112,6 +104,17 @@ function bubblesFromGraph(graph) {
|
|
|
112
104
|
}
|
|
113
105
|
return bubbles;
|
|
114
106
|
}
|
|
107
|
+
function walkIndexOf(graph) {
|
|
108
|
+
return graph.paths?.map((p) => {
|
|
109
|
+
const at = /* @__PURE__ */ new Map();
|
|
110
|
+
p.nodeIds.forEach((id, i) => {
|
|
111
|
+
if (!at.has(id)) {
|
|
112
|
+
at.set(id, i);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return at;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
115
118
|
function walkRoutes(graph, byId, walkIndex, startId, endId) {
|
|
116
119
|
const seen = /* @__PURE__ */ new Map();
|
|
117
120
|
let min = Infinity;
|
|
@@ -145,5 +148,7 @@ function walkRoutes(graph, byId, walkIndex, startId, endId) {
|
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
export {
|
|
148
|
-
bubblesFromGraph
|
|
151
|
+
bubblesFromGraph,
|
|
152
|
+
walkIndexOf,
|
|
153
|
+
walkRoutes
|
|
149
154
|
};
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
stripGeneGaps,
|
|
3
|
+
walkStripFrame,
|
|
4
|
+
walkStripLabelsTree
|
|
5
|
+
} from "./chunk-UD5FOCI2.js";
|
|
6
|
+
import {
|
|
7
|
+
Canvas2DRenderer
|
|
8
|
+
} from "./chunk-WBCOREDZ.js";
|
|
1
9
|
import {
|
|
2
10
|
layoutGeometryInputs
|
|
3
11
|
} from "./chunk-LOCJN3BZ.js";
|
|
4
12
|
import {
|
|
5
13
|
svgCanvas
|
|
6
14
|
} from "./chunk-47DYCZOK.js";
|
|
7
|
-
import {
|
|
8
|
-
stripGeneGaps,
|
|
9
|
-
walkStripFrame,
|
|
10
|
-
walkStripLabelsTree
|
|
11
|
-
} from "./chunk-WDTXW7T2.js";
|
|
12
15
|
import {
|
|
13
16
|
walkRowsKey,
|
|
14
17
|
walkRowsKeyTree,
|
|
15
18
|
walkRowsTree
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GFRPX6M2.js";
|
|
17
20
|
import {
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
genePins
|
|
22
|
+
} from "./chunk-BUBZ32IC.js";
|
|
20
23
|
import {
|
|
21
24
|
EXON_COLOR,
|
|
22
25
|
exonOutlineTree,
|
|
23
26
|
exonStretches
|
|
24
27
|
} from "./chunk-3S3YVOJ7.js";
|
|
25
28
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
axisScaleOf
|
|
30
|
+
} from "./chunk-XKM5OHQQ.js";
|
|
28
31
|
import {
|
|
29
32
|
facetLifts,
|
|
30
33
|
walkLift
|
|
31
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LFKMASER.js";
|
|
32
35
|
import {
|
|
33
36
|
encodingStops
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-XPT66H6H.js";
|
|
35
38
|
import {
|
|
36
39
|
rangeText,
|
|
37
40
|
walkKey
|
|
@@ -39,24 +42,21 @@ import {
|
|
|
39
42
|
import {
|
|
40
43
|
buildGeometry,
|
|
41
44
|
computeReferenceRamp
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-BR25DGIJ.js";
|
|
43
46
|
import {
|
|
44
47
|
version
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import {
|
|
47
|
-
axisScaleOf
|
|
48
|
-
} from "./chunk-TL4B342F.js";
|
|
48
|
+
} from "./chunk-FM6XRXPX.js";
|
|
49
49
|
import {
|
|
50
50
|
walkRowLabels,
|
|
51
51
|
walkRowsExtent
|
|
52
52
|
} from "./chunk-3C5UXR2U.js";
|
|
53
|
-
import {
|
|
54
|
-
nodeInk
|
|
55
|
-
} from "./chunk-PBENCR5L.js";
|
|
56
53
|
import {
|
|
57
54
|
pathLegend,
|
|
58
55
|
walkLabelsOf
|
|
59
56
|
} from "./chunk-7GBL7SJY.js";
|
|
57
|
+
import {
|
|
58
|
+
nodeInk
|
|
59
|
+
} from "./chunk-PBENCR5L.js";
|
|
60
60
|
import {
|
|
61
61
|
referenceLabel
|
|
62
62
|
} from "./chunk-RAKOB6IV.js";
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
FIT_PADDING,
|
|
92
92
|
drawingBounds,
|
|
93
93
|
fitTransform
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-ZGRYFUXE.js";
|
|
95
95
|
import {
|
|
96
96
|
deletionDrawing,
|
|
97
97
|
deletionEdges
|
|
@@ -68,45 +68,81 @@ var Canvas2DRenderer = class {
|
|
|
68
68
|
}
|
|
69
69
|
ctx.lineCap = "round";
|
|
70
70
|
ctx.lineJoin = "round";
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.renderArrows(batch);
|
|
74
|
-
}
|
|
75
|
-
renderEdges(batch) {
|
|
76
|
-
const t = this.transform;
|
|
77
|
-
const ctx = this.ctx;
|
|
78
|
-
const hl = this.highlightedEdge === null ? void 0 : batch.edgeCurveRuns.get(this.highlightedEdge);
|
|
71
|
+
const factor = this.highlightFactor;
|
|
72
|
+
const edgeRun = this.edgeRun(batch.edgeCurveRuns);
|
|
79
73
|
for (const { color, items } of groupByPaint(batch.edgeCurves, (e, i) => ({
|
|
80
|
-
color: inRun(
|
|
74
|
+
color: inRun(edgeRun, i) ? brightenAbgr(e.color, factor) : e.color,
|
|
81
75
|
weight: e.thickness,
|
|
82
|
-
last: inRun(
|
|
76
|
+
last: inRun(edgeRun, i)
|
|
83
77
|
}))) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ctx.stroke();
|
|
78
|
+
this.strokeCurves(items, color);
|
|
79
|
+
}
|
|
80
|
+
const lifted = this.liftedStrokes(batch);
|
|
81
|
+
for (const { color, items } of groupByPaint(batch.nodeStrokes, (s, i) => {
|
|
82
|
+
const f = lifted.get(i);
|
|
83
|
+
return {
|
|
84
|
+
color: f === void 0 ? s.color : brightenAbgr(s.color, f),
|
|
85
|
+
weight: s.thickness,
|
|
86
|
+
last: f !== void 0
|
|
87
|
+
};
|
|
88
|
+
})) {
|
|
89
|
+
this.strokeNodes(items, color);
|
|
90
|
+
}
|
|
91
|
+
const arrowRun = this.edgeRun(batch.arrowRuns);
|
|
92
|
+
for (const { color, items } of groupByPaint(batch.arrows, (a, i) => ({
|
|
93
|
+
color: inRun(arrowRun, i) ? brightenAbgr(a.color, factor) : a.color,
|
|
94
|
+
weight: 0,
|
|
95
|
+
last: inRun(arrowRun, i)
|
|
96
|
+
}))) {
|
|
97
|
+
this.fillArrows(items, color);
|
|
105
98
|
}
|
|
106
99
|
}
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
// Only what the highlights lift, over a transparent clear, for a hover layer
|
|
101
|
+
// stacked on a canvas that drew the batch without them: a pointer move then
|
|
102
|
+
// repaints one node or edge rather than the whole drawing
|
|
103
|
+
renderHighlights() {
|
|
109
104
|
const ctx = this.ctx;
|
|
105
|
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
106
|
+
const batch = this.batch;
|
|
107
|
+
if (!this.transform || !batch) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
ctx.lineCap = "round";
|
|
111
|
+
ctx.lineJoin = "round";
|
|
112
|
+
const factor = this.highlightFactor;
|
|
113
|
+
const curves = runItems(batch.edgeCurves, this.edgeRun(batch.edgeCurveRuns));
|
|
114
|
+
for (const { color, items } of groupByPaint(curves, (e) => ({
|
|
115
|
+
color: brightenAbgr(e.color, factor),
|
|
116
|
+
weight: e.thickness,
|
|
117
|
+
last: false
|
|
118
|
+
}))) {
|
|
119
|
+
this.strokeCurves(items, color);
|
|
120
|
+
}
|
|
121
|
+
const lifted = [...this.liftedStrokes(batch)];
|
|
122
|
+
for (const { color, items } of groupByPaint(lifted, ([i, f]) => ({
|
|
123
|
+
color: brightenAbgr(batch.nodeStrokes[i].color, f),
|
|
124
|
+
weight: batch.nodeStrokes[i].thickness,
|
|
125
|
+
last: false
|
|
126
|
+
}))) {
|
|
127
|
+
this.strokeNodes(
|
|
128
|
+
items.map(([i]) => batch.nodeStrokes[i]),
|
|
129
|
+
color
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
const arrows = runItems(batch.arrows, this.edgeRun(batch.arrowRuns));
|
|
133
|
+
for (const { color, items } of groupByPaint(arrows, (a) => ({
|
|
134
|
+
color: brightenAbgr(a.color, factor),
|
|
135
|
+
weight: 0,
|
|
136
|
+
last: false
|
|
137
|
+
}))) {
|
|
138
|
+
this.fillArrows(items, color);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
edgeRun(runs) {
|
|
142
|
+
return this.highlightedEdge === null ? void 0 : runs.get(this.highlightedEdge);
|
|
143
|
+
}
|
|
144
|
+
// stroke index -> brighten factor, for the nodes the model lifted
|
|
145
|
+
liftedStrokes(batch) {
|
|
110
146
|
const lifted = /* @__PURE__ */ new Map();
|
|
111
147
|
for (const [nodeId, factor] of this.nodeHighlights) {
|
|
112
148
|
const run = batch.nodeStrokeRuns.get(nodeId);
|
|
@@ -116,55 +152,63 @@ var Canvas2DRenderer = class {
|
|
|
116
152
|
}
|
|
117
153
|
}
|
|
118
154
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
ctx.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
155
|
+
return lifted;
|
|
156
|
+
}
|
|
157
|
+
strokeCurves(items, color) {
|
|
158
|
+
const t = this.transform;
|
|
159
|
+
const ctx = this.ctx;
|
|
160
|
+
ctx.strokeStyle = abgrToCssRgba(color);
|
|
161
|
+
ctx.lineWidth = items[0].thickness * 2 * t.dpr;
|
|
162
|
+
ctx.beginPath();
|
|
163
|
+
for (const e of items) {
|
|
164
|
+
const first = e.curves[0];
|
|
165
|
+
ctx.moveTo(
|
|
166
|
+
first.x0 * t.scaleX + t.translateX,
|
|
167
|
+
first.y0 * t.scaleY + t.translateY
|
|
168
|
+
);
|
|
169
|
+
for (const c of e.curves) {
|
|
170
|
+
ctx.bezierCurveTo(
|
|
171
|
+
c.cx0 * t.scaleX + t.translateX,
|
|
172
|
+
c.cy0 * t.scaleY + t.translateY,
|
|
173
|
+
c.cx1 * t.scaleX + t.translateX,
|
|
174
|
+
c.cy1 * t.scaleY + t.translateY,
|
|
175
|
+
c.x1 * t.scaleX + t.translateX,
|
|
176
|
+
c.y1 * t.scaleY + t.translateY
|
|
135
177
|
);
|
|
136
|
-
for (let i = 1, l = s.points.length; i < l; i++) {
|
|
137
|
-
const p = s.points[i];
|
|
138
|
-
ctx.lineTo(
|
|
139
|
-
p.x * t.scaleX + t.translateX,
|
|
140
|
-
p.y * t.scaleY + t.translateY
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
178
|
}
|
|
144
|
-
ctx.stroke();
|
|
145
179
|
}
|
|
180
|
+
ctx.stroke();
|
|
146
181
|
}
|
|
147
|
-
|
|
182
|
+
strokeNodes(items, color) {
|
|
148
183
|
const t = this.transform;
|
|
149
184
|
const ctx = this.ctx;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const [tip, left, notch, right] = arrowheadOutline(a, t);
|
|
160
|
-
ctx.moveTo(tip.x, tip.y);
|
|
161
|
-
ctx.lineTo(left.x, left.y);
|
|
162
|
-
ctx.lineTo(notch.x, notch.y);
|
|
163
|
-
ctx.lineTo(right.x, right.y);
|
|
164
|
-
ctx.closePath();
|
|
185
|
+
ctx.strokeStyle = abgrToCssRgba(color);
|
|
186
|
+
ctx.lineWidth = items[0].thickness * 2 * t.dpr;
|
|
187
|
+
ctx.beginPath();
|
|
188
|
+
for (const s of items) {
|
|
189
|
+
const p0 = s.points[0];
|
|
190
|
+
ctx.moveTo(p0.x * t.scaleX + t.translateX, p0.y * t.scaleY + t.translateY);
|
|
191
|
+
for (let i = 1, l = s.points.length; i < l; i++) {
|
|
192
|
+
const p = s.points[i];
|
|
193
|
+
ctx.lineTo(p.x * t.scaleX + t.translateX, p.y * t.scaleY + t.translateY);
|
|
165
194
|
}
|
|
166
|
-
ctx.fill();
|
|
167
195
|
}
|
|
196
|
+
ctx.stroke();
|
|
197
|
+
}
|
|
198
|
+
fillArrows(items, color) {
|
|
199
|
+
const t = this.transform;
|
|
200
|
+
const ctx = this.ctx;
|
|
201
|
+
ctx.fillStyle = abgrToCssRgba(color);
|
|
202
|
+
ctx.beginPath();
|
|
203
|
+
for (const a of items) {
|
|
204
|
+
const [tip, left, notch, right] = arrowheadOutline(a, t);
|
|
205
|
+
ctx.moveTo(tip.x, tip.y);
|
|
206
|
+
ctx.lineTo(left.x, left.y);
|
|
207
|
+
ctx.lineTo(notch.x, notch.y);
|
|
208
|
+
ctx.lineTo(right.x, right.y);
|
|
209
|
+
ctx.closePath();
|
|
210
|
+
}
|
|
211
|
+
ctx.fill();
|
|
168
212
|
}
|
|
169
213
|
dispose() {
|
|
170
214
|
this.batch = null;
|
|
@@ -190,6 +234,9 @@ function arrowheadOutline(a, t) {
|
|
|
190
234
|
{ x: backX + uy * halfWidth, y: backY - ux * halfWidth }
|
|
191
235
|
];
|
|
192
236
|
}
|
|
237
|
+
function runItems(items, run) {
|
|
238
|
+
return run ? items.slice(run.start, run.start + run.count) : [];
|
|
239
|
+
}
|
|
193
240
|
function inRun(run, i) {
|
|
194
241
|
return run !== void 0 && i >= run.start && i < run.start + run.count;
|
|
195
242
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SATURATED_PATH_COUNT
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FX4RDMDN.js";
|
|
4
4
|
|
|
5
5
|
// src/bubbles/classifyBubble.ts
|
|
6
6
|
var REPEAT_GROWTH = 10;
|
|
@@ -59,6 +59,9 @@ function classifyShape(b, repeats) {
|
|
|
59
59
|
if (inversion) {
|
|
60
60
|
return { kind: "inversion", label: `${formatBp(longest)} inv` };
|
|
61
61
|
}
|
|
62
|
+
if (b.offReference) {
|
|
63
|
+
return shortest === longest ? sameLength(shortest) : { kind: "complex", label: `${range}, ${routes(pathCount)}` };
|
|
64
|
+
}
|
|
62
65
|
const repeat = longest !== shortest ? coveringRepeat(b, repeats) : void 0;
|
|
63
66
|
if (repeat) {
|
|
64
67
|
const name = repeat.name ? ` (${repeat.name})` : "";
|
|
@@ -69,7 +72,7 @@ function classifyShape(b, repeats) {
|
|
|
69
72
|
}
|
|
70
73
|
const alleles = pathCount > 2 ? `, ${pathCount} alleles` : "";
|
|
71
74
|
if (shortest === longest && shortest === refSpan) {
|
|
72
|
-
return
|
|
75
|
+
return sameLength(refSpan);
|
|
73
76
|
}
|
|
74
77
|
if (refSpan === 0 || shortest === refSpan) {
|
|
75
78
|
return {
|
|
@@ -88,6 +91,9 @@ function classifyShape(b, repeats) {
|
|
|
88
91
|
label: `${formatBp(refSpan)} ref \u2192 ${range}, ${pathCount} alleles`
|
|
89
92
|
};
|
|
90
93
|
}
|
|
94
|
+
function sameLength(bp) {
|
|
95
|
+
return bp <= 1 ? { kind: "snp", label: "SNP" } : { kind: "substitution", label: `${formatBp(bp)} sub` };
|
|
96
|
+
}
|
|
91
97
|
var BUBBLE_KIND_COLORS = {
|
|
92
98
|
snp: "#5b6b7a",
|
|
93
99
|
substitution: "#5b6b7a",
|