@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
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bubbleSubgraph
|
|
3
|
+
} from "./chunk-VHW7FDHU.js";
|
|
4
|
+
import {
|
|
5
|
+
coversGraph
|
|
6
|
+
} from "./chunk-2AWUWGAD.js";
|
|
7
|
+
import {
|
|
8
|
+
bubbleSegmentIds
|
|
9
|
+
} from "./chunk-XKWD2RY3.js";
|
|
10
|
+
import {
|
|
11
|
+
bubblesFromGraph,
|
|
12
|
+
walkIndexOf,
|
|
13
|
+
walkRoutes
|
|
14
|
+
} from "./chunk-GOZYKNQ2.js";
|
|
15
|
+
import {
|
|
16
|
+
SATURATED_PATH_COUNT
|
|
17
|
+
} from "./chunk-FX4RDMDN.js";
|
|
18
|
+
import {
|
|
19
|
+
strandSides
|
|
20
|
+
} from "./chunk-2CVHXFK7.js";
|
|
21
|
+
import {
|
|
22
|
+
isBackbone
|
|
23
|
+
} from "./chunk-FYQWPEEY.js";
|
|
24
|
+
|
|
25
|
+
// src/bubbles/superbubbles.ts
|
|
26
|
+
var MAX_SUPERBUBBLES = 50;
|
|
27
|
+
function slotGraph(graph, index) {
|
|
28
|
+
const slots = graph.nodes.length * 2;
|
|
29
|
+
const seen = /* @__PURE__ */ new Set();
|
|
30
|
+
const pairs = [];
|
|
31
|
+
const degree = new Int32Array(slots);
|
|
32
|
+
for (const e of graph.edges) {
|
|
33
|
+
const a = index.get(e.from);
|
|
34
|
+
const b = index.get(e.to);
|
|
35
|
+
if (a === void 0 || b === void 0) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const sides = strandSides(e);
|
|
39
|
+
const ka = a * 2 + (sides.from === "end" ? 1 : 0);
|
|
40
|
+
const kb = b * 2 + (sides.to === "end" ? 1 : 0);
|
|
41
|
+
const id = Math.min(ka, kb) * slots + Math.max(ka, kb);
|
|
42
|
+
if (seen.has(id)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
seen.add(id);
|
|
46
|
+
pairs.push(ka, kb);
|
|
47
|
+
degree[ka]++;
|
|
48
|
+
if (ka !== kb) {
|
|
49
|
+
degree[kb]++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const offset = new Int32Array(slots + 1);
|
|
53
|
+
for (let k = 0; k < slots; k++) {
|
|
54
|
+
offset[k + 1] = offset[k] + degree[k];
|
|
55
|
+
}
|
|
56
|
+
const next = new Int32Array(offset[slots]);
|
|
57
|
+
const fill = offset.slice(0, slots);
|
|
58
|
+
for (let i = 0; i < pairs.length; i += 2) {
|
|
59
|
+
const ka = pairs[i];
|
|
60
|
+
const kb = pairs[i + 1];
|
|
61
|
+
next[fill[ka]++] = kb;
|
|
62
|
+
if (ka !== kb) {
|
|
63
|
+
next[fill[kb]++] = ka;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { offset, next };
|
|
67
|
+
}
|
|
68
|
+
function searcher(nodes, offset, next) {
|
|
69
|
+
const visited = new Int32Array(nodes);
|
|
70
|
+
const pending = new Uint8Array(nodes * 2);
|
|
71
|
+
const stack = new Int32Array(nodes * 2);
|
|
72
|
+
const inside = new Int32Array(nodes);
|
|
73
|
+
const touched = [];
|
|
74
|
+
let stamp = 0;
|
|
75
|
+
return (start) => {
|
|
76
|
+
const s = start >> 1;
|
|
77
|
+
stamp++;
|
|
78
|
+
touched.length = 0;
|
|
79
|
+
let open = 0;
|
|
80
|
+
let top = 0;
|
|
81
|
+
let count = 0;
|
|
82
|
+
let found;
|
|
83
|
+
const expect = (k) => {
|
|
84
|
+
if (!pending[k]) {
|
|
85
|
+
pending[k] = 1;
|
|
86
|
+
open++;
|
|
87
|
+
touched.push(k);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
expect(start);
|
|
91
|
+
stack[top++] = start;
|
|
92
|
+
search: while (top > 0) {
|
|
93
|
+
const k = stack[--top];
|
|
94
|
+
const v = k >> 1;
|
|
95
|
+
visited[v] = stamp;
|
|
96
|
+
if (v !== s) {
|
|
97
|
+
inside[count++] = k;
|
|
98
|
+
}
|
|
99
|
+
if (pending[k]) {
|
|
100
|
+
pending[k] = 0;
|
|
101
|
+
open--;
|
|
102
|
+
}
|
|
103
|
+
if (offset[k] === offset[k + 1]) {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
for (let p = offset[k]; p < offset[k + 1]; p++) {
|
|
107
|
+
const entry = next[p];
|
|
108
|
+
const u = entry >> 1;
|
|
109
|
+
if (u === s) {
|
|
110
|
+
break search;
|
|
111
|
+
}
|
|
112
|
+
expect(entry ^ 1);
|
|
113
|
+
if (visited[u] === stamp) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
let ready = true;
|
|
117
|
+
for (let q = offset[entry]; q < offset[entry + 1]; q++) {
|
|
118
|
+
if (visited[next[q] >> 1] !== stamp) {
|
|
119
|
+
ready = false;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (ready) {
|
|
124
|
+
stack[top++] = entry ^ 1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (top === 1 && open === 1) {
|
|
128
|
+
if (count > 0) {
|
|
129
|
+
found = {
|
|
130
|
+
source: start,
|
|
131
|
+
sink: stack[0],
|
|
132
|
+
inside: inside.slice(0, count)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
for (const k of touched) {
|
|
139
|
+
pending[k] = 0;
|
|
140
|
+
}
|
|
141
|
+
return found;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function reversed(f) {
|
|
145
|
+
return {
|
|
146
|
+
source: f.sink ^ 1,
|
|
147
|
+
sink: f.source ^ 1,
|
|
148
|
+
inside: f.inside.map((k) => k ^ 1).reverse()
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
var collator = new Intl.Collator(void 0, { numeric: true });
|
|
152
|
+
function onReference(a, b) {
|
|
153
|
+
return isBackbone(a) && isBackbone(b) && a.stable.refName === b.stable.refName;
|
|
154
|
+
}
|
|
155
|
+
function forward(f, nodes) {
|
|
156
|
+
const a = nodes[f.source >> 1];
|
|
157
|
+
const b = nodes[f.sink >> 1];
|
|
158
|
+
const byRef = onReference(a, b) ? a.stable.start - b.stable.start : 0;
|
|
159
|
+
const bySide = ((f.sink ^ 1) & 1) - (f.source & 1);
|
|
160
|
+
return (byRef || bySide || collator.compare(a.name, b.name)) < 0;
|
|
161
|
+
}
|
|
162
|
+
function nodesOf(f) {
|
|
163
|
+
return [f.source >> 1, ...Array.from(f.inside, (k) => k >> 1), f.sink >> 1];
|
|
164
|
+
}
|
|
165
|
+
function allSuperbubbles(graph) {
|
|
166
|
+
const { nodes } = graph;
|
|
167
|
+
const index = new Map(nodes.map((n, i) => [n.id, i]));
|
|
168
|
+
const { offset, next } = slotGraph(graph, index);
|
|
169
|
+
const find = searcher(nodes.length, offset, next);
|
|
170
|
+
const byEnds = /* @__PURE__ */ new Map();
|
|
171
|
+
for (let k = 0; k < nodes.length * 2; k++) {
|
|
172
|
+
const hit = find(k);
|
|
173
|
+
if (!hit) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const a = hit.source >> 1;
|
|
177
|
+
const b = hit.sink >> 1;
|
|
178
|
+
const id = Math.min(a, b) * nodes.length + Math.max(a, b);
|
|
179
|
+
if (forward(hit, nodes) || !byEnds.has(id)) {
|
|
180
|
+
byEnds.set(id, hit);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const found = [...byEnds.values()].map(
|
|
184
|
+
(f) => forward(f, nodes) ? f : reversed(f)
|
|
185
|
+
);
|
|
186
|
+
return { found, offset, next };
|
|
187
|
+
}
|
|
188
|
+
function routesThrough(nodes, offset, next, f) {
|
|
189
|
+
const sink = f.sink >> 1;
|
|
190
|
+
const best = /* @__PURE__ */ new Map([
|
|
191
|
+
[f.source >> 1, { min: 0, max: 0, n: 1 }]
|
|
192
|
+
]);
|
|
193
|
+
for (const k of [f.source, ...f.inside]) {
|
|
194
|
+
const cur = best.get(k >> 1);
|
|
195
|
+
if (!cur) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
for (let p = offset[k]; p < offset[k + 1]; p++) {
|
|
199
|
+
const u = next[p] >> 1;
|
|
200
|
+
const add = u === sink ? 0 : nodes[u].length;
|
|
201
|
+
const prev = best.get(u);
|
|
202
|
+
best.set(u, {
|
|
203
|
+
min: Math.min(prev?.min ?? Infinity, cur.min + add),
|
|
204
|
+
max: Math.max(prev?.max ?? -Infinity, cur.max + add),
|
|
205
|
+
n: Math.min(SATURATED_PATH_COUNT, cur.n + (prev?.n ?? 0))
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return best.get(sink) ?? { min: 0, max: 0, n: 0 };
|
|
210
|
+
}
|
|
211
|
+
function superbubblesFromGraph(graph, span) {
|
|
212
|
+
const { nodes } = graph;
|
|
213
|
+
const { found, offset, next } = allSuperbubbles(graph);
|
|
214
|
+
const covers = found.map((f) => coversGraph(f.inside.length, nodes.length));
|
|
215
|
+
const members = found.map(nodesOf);
|
|
216
|
+
const holders = /* @__PURE__ */ new Map();
|
|
217
|
+
members.forEach((vs, i) => {
|
|
218
|
+
for (const v of vs) {
|
|
219
|
+
;
|
|
220
|
+
(holders.get(v) ?? holders.set(v, []).get(v)).push(i);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const nested = (f, i) => holders.get(f.inside[0] >> 1).some(
|
|
224
|
+
(j) => j !== i && !covers[j] && members[j].length > members[i].length && members[i].every((v) => holders.get(v).includes(j))
|
|
225
|
+
);
|
|
226
|
+
const placed = (f) => span !== void 0 || onReference(nodes[f.source >> 1], nodes[f.sink >> 1]);
|
|
227
|
+
const outermost = found.filter((f, i) => !covers[i] && placed(f) && !nested(f, i)).sort((a, b) => b.inside.length - a.inside.length).slice(0, MAX_SUPERBUBBLES);
|
|
228
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
229
|
+
const walkIndex = walkIndexOf(graph);
|
|
230
|
+
return outermost.map((f) => {
|
|
231
|
+
const source = nodes[f.source >> 1];
|
|
232
|
+
const sink = nodes[f.sink >> 1];
|
|
233
|
+
const walked = walkIndex && walkRoutes(graph, byId, walkIndex, source.id, sink.id);
|
|
234
|
+
const crossed = walked?.n ? walked : void 0;
|
|
235
|
+
const routes = crossed ?? routesThrough(nodes, offset, next, f);
|
|
236
|
+
const placedOn = onReference(source, sink);
|
|
237
|
+
return {
|
|
238
|
+
refName: placedOn ? source.stable.refName : span.refName,
|
|
239
|
+
start: placedOn ? source.stable.start + source.length : span.start,
|
|
240
|
+
end: placedOn ? sink.stable.start : span.end,
|
|
241
|
+
segmentCount: f.inside.length + 2,
|
|
242
|
+
pathCount: routes.n,
|
|
243
|
+
inversion: false,
|
|
244
|
+
shortestAlleleLength: routes.min,
|
|
245
|
+
longestAlleleLength: routes.max,
|
|
246
|
+
segments: nodesOf(f).map((v) => nodes[v].name).join(","),
|
|
247
|
+
shortestAllele: void 0,
|
|
248
|
+
longestAllele: void 0,
|
|
249
|
+
partial: walked !== void 0 && walked.left > 0,
|
|
250
|
+
routes: crossed?.routes,
|
|
251
|
+
key: `${source.name}>${sink.name}`,
|
|
252
|
+
...placedOn ? {} : { offReference: true }
|
|
253
|
+
};
|
|
254
|
+
}).sort(
|
|
255
|
+
(a, b) => a.start - b.start || a.end - b.end || collator.compare(a.key, b.key)
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function graphBubbles(graph, span) {
|
|
259
|
+
const n = graph.nodes.length;
|
|
260
|
+
const reach = bubblesFromGraph(graph);
|
|
261
|
+
return reach.length === 0 ? superbubblesFromGraph(graph, span) : reach.flatMap(
|
|
262
|
+
(b) => coversGraph(b.segmentCount - 2, n) ? superbubblesFromGraph(
|
|
263
|
+
b.segmentCount === n ? graph : bubbleSubgraph(graph, bubbleSegmentIds(b)),
|
|
264
|
+
b
|
|
265
|
+
) : [b]
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
MAX_SUPERBUBBLES,
|
|
271
|
+
superbubblesFromGraph,
|
|
272
|
+
graphBubbles
|
|
273
|
+
};
|
package/dist/cli/figure.js
CHANGED
|
@@ -4,18 +4,26 @@ import {
|
|
|
4
4
|
genesFromGff3Lines,
|
|
5
5
|
genesFromText
|
|
6
6
|
} from "../chunks/chunk-BXEPA4KS.js";
|
|
7
|
+
import {
|
|
8
|
+
LAYOUT_ENGINE_VALUES,
|
|
9
|
+
isLayoutEngineKind,
|
|
10
|
+
layoutEngine
|
|
11
|
+
} from "../chunks/chunk-6EJIU6IA.js";
|
|
12
|
+
import "../chunks/chunk-UNOE2NDN.js";
|
|
13
|
+
import "../chunks/chunk-LYJ4US66.js";
|
|
7
14
|
import {
|
|
8
15
|
LAYOUT_MODES,
|
|
9
16
|
layoutModeByValue
|
|
10
|
-
} from "../chunks/chunk-
|
|
17
|
+
} from "../chunks/chunk-M7SRZJ32.js";
|
|
18
|
+
import "../chunks/chunk-LOEA5IHZ.js";
|
|
11
19
|
import "../chunks/chunk-INJ2UVOT.js";
|
|
12
20
|
import "../chunks/chunk-CWFNEKST.js";
|
|
13
|
-
import "../chunks/chunk-LOEA5IHZ.js";
|
|
14
21
|
import "../chunks/chunk-L3O7AWLI.js";
|
|
15
22
|
import "../chunks/chunk-TZFWUT2C.js";
|
|
16
23
|
import "../chunks/chunk-C44YRP5F.js";
|
|
17
24
|
import "../chunks/chunk-RVS2QCOX.js";
|
|
18
25
|
import "../chunks/chunk-HNQPEMYE.js";
|
|
26
|
+
import "../chunks/chunk-7XHHVYG7.js";
|
|
19
27
|
import {
|
|
20
28
|
HPRC_GBZ,
|
|
21
29
|
cutGbzRegion,
|
|
@@ -25,43 +33,35 @@ import {
|
|
|
25
33
|
} from "../chunks/chunk-73RSLGZT.js";
|
|
26
34
|
import "../chunks/chunk-LTUWJKHD.js";
|
|
27
35
|
import "../chunks/chunk-WSIFAZU7.js";
|
|
28
|
-
import {
|
|
29
|
-
LAYOUT_ENGINE_VALUES,
|
|
30
|
-
isLayoutEngineKind,
|
|
31
|
-
layoutEngine
|
|
32
|
-
} from "../chunks/chunk-6EJIU6IA.js";
|
|
33
|
-
import "../chunks/chunk-UNOE2NDN.js";
|
|
34
|
-
import "../chunks/chunk-LYJ4US66.js";
|
|
35
|
-
import "../chunks/chunk-7XHHVYG7.js";
|
|
36
36
|
import {
|
|
37
37
|
figureSvg
|
|
38
|
-
} from "../chunks/chunk-
|
|
38
|
+
} from "../chunks/chunk-HOOVOF2Y.js";
|
|
39
|
+
import "../chunks/chunk-UD5FOCI2.js";
|
|
40
|
+
import "../chunks/chunk-WBCOREDZ.js";
|
|
41
|
+
import "../chunks/chunk-4BYTEJGW.js";
|
|
39
42
|
import "../chunks/chunk-LOCJN3BZ.js";
|
|
40
43
|
import "../chunks/chunk-47DYCZOK.js";
|
|
41
|
-
import "../chunks/chunk-WDTXW7T2.js";
|
|
42
44
|
import {
|
|
43
45
|
genesOnRow,
|
|
44
46
|
placeRowGenes
|
|
45
|
-
} from "../chunks/chunk-
|
|
46
|
-
import "../chunks/chunk-2WNBVB55.js";
|
|
47
|
-
import "../chunks/chunk-4BYTEJGW.js";
|
|
48
|
-
import "../chunks/chunk-3S3YVOJ7.js";
|
|
47
|
+
} from "../chunks/chunk-GFRPX6M2.js";
|
|
49
48
|
import "../chunks/chunk-BUBZ32IC.js";
|
|
50
|
-
import "../chunks/chunk-
|
|
51
|
-
import "../chunks/chunk-
|
|
49
|
+
import "../chunks/chunk-3S3YVOJ7.js";
|
|
50
|
+
import "../chunks/chunk-XKM5OHQQ.js";
|
|
51
|
+
import "../chunks/chunk-LFKMASER.js";
|
|
52
|
+
import "../chunks/chunk-XPT66H6H.js";
|
|
52
53
|
import "../chunks/chunk-2LQ5BWT7.js";
|
|
53
|
-
import "../chunks/chunk-
|
|
54
|
-
import "../chunks/chunk-
|
|
54
|
+
import "../chunks/chunk-OXTR3BVF.js";
|
|
55
|
+
import "../chunks/chunk-BR25DGIJ.js";
|
|
55
56
|
import "../chunks/chunk-G2FD7S3C.js";
|
|
56
|
-
import "../chunks/chunk-
|
|
57
|
-
import "../chunks/chunk-TL4B342F.js";
|
|
57
|
+
import "../chunks/chunk-FM6XRXPX.js";
|
|
58
58
|
import "../chunks/chunk-3C5UXR2U.js";
|
|
59
59
|
import {
|
|
60
60
|
filterSamples,
|
|
61
61
|
walkRows
|
|
62
62
|
} from "../chunks/chunk-MAUEPAMG.js";
|
|
63
|
-
import "../chunks/chunk-PBENCR5L.js";
|
|
64
63
|
import "../chunks/chunk-7GBL7SJY.js";
|
|
64
|
+
import "../chunks/chunk-PBENCR5L.js";
|
|
65
65
|
import {
|
|
66
66
|
featuresOnBackbone,
|
|
67
67
|
graphBackbone,
|
|
@@ -80,18 +80,18 @@ import {
|
|
|
80
80
|
engineSettingsOf,
|
|
81
81
|
forceLayout,
|
|
82
82
|
loadGraph
|
|
83
|
-
} from "../chunks/chunk-
|
|
83
|
+
} from "../chunks/chunk-ZGRYFUXE.js";
|
|
84
84
|
import "../chunks/chunk-PUG7LXDF.js";
|
|
85
85
|
import "../chunks/chunk-IGVV37VI.js";
|
|
86
86
|
import "../chunks/chunk-OCMBULGN.js";
|
|
87
|
+
import "../chunks/chunk-OA7RIMZ2.js";
|
|
87
88
|
import "../chunks/chunk-QYBZZI5H.js";
|
|
88
89
|
import "../chunks/chunk-CDLPYR5O.js";
|
|
89
|
-
import "../chunks/chunk-
|
|
90
|
+
import "../chunks/chunk-JVLURPFW.js";
|
|
90
91
|
import "../chunks/chunk-ES2N6V56.js";
|
|
91
92
|
import "../chunks/chunk-ST2IBUAN.js";
|
|
92
93
|
import "../chunks/chunk-BPLIXMH7.js";
|
|
93
94
|
import "../chunks/chunk-TAMCZHLW.js";
|
|
94
|
-
import "../chunks/chunk-JVLURPFW.js";
|
|
95
95
|
import "../chunks/chunk-UVBGRJQX.js";
|
|
96
96
|
import "../chunks/chunk-6JEWNXCQ.js";
|
|
97
97
|
import "../chunks/chunk-N6FECAXP.js";
|
package/dist/cli/fold.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
writeRgfa
|
|
4
|
+
} from "../chunks/chunk-B4YH42OP.js";
|
|
5
|
+
import {
|
|
6
|
+
foldVariants
|
|
7
|
+
} from "../chunks/chunk-B4645SM2.js";
|
|
8
|
+
import {
|
|
9
|
+
loadGraph
|
|
10
|
+
} from "../chunks/chunk-ZGRYFUXE.js";
|
|
11
|
+
import "../chunks/chunk-PUG7LXDF.js";
|
|
12
|
+
import "../chunks/chunk-IGVV37VI.js";
|
|
13
|
+
import "../chunks/chunk-OCMBULGN.js";
|
|
14
|
+
import "../chunks/chunk-OA7RIMZ2.js";
|
|
15
|
+
import "../chunks/chunk-QYBZZI5H.js";
|
|
16
|
+
import "../chunks/chunk-CDLPYR5O.js";
|
|
17
|
+
import "../chunks/chunk-JVLURPFW.js";
|
|
18
|
+
import "../chunks/chunk-ES2N6V56.js";
|
|
19
|
+
import "../chunks/chunk-ST2IBUAN.js";
|
|
20
|
+
import "../chunks/chunk-BPLIXMH7.js";
|
|
21
|
+
import "../chunks/chunk-TAMCZHLW.js";
|
|
22
|
+
import "../chunks/chunk-UVBGRJQX.js";
|
|
23
|
+
import "../chunks/chunk-6JEWNXCQ.js";
|
|
24
|
+
import "../chunks/chunk-N6FECAXP.js";
|
|
25
|
+
import "../chunks/chunk-2CVHXFK7.js";
|
|
26
|
+
import "../chunks/chunk-CPMHA4W5.js";
|
|
27
|
+
import "../chunks/chunk-FYQWPEEY.js";
|
|
28
|
+
|
|
29
|
+
// src/cli/fold.ts
|
|
30
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
31
|
+
import { parseArgs } from "node:util";
|
|
32
|
+
import { gunzipSync } from "node:zlib";
|
|
33
|
+
var USAGE = "usage: bandage-fold <graph.gfa[.gz] | -> --below <bp> [-o out.gfa]";
|
|
34
|
+
async function readInput(location) {
|
|
35
|
+
const bytes = await readFile(location === "-" ? "/dev/stdin" : location);
|
|
36
|
+
const gzipped = bytes[0] === 31 && bytes[1] === 139;
|
|
37
|
+
return new TextDecoder().decode(gzipped ? gunzipSync(bytes) : bytes);
|
|
38
|
+
}
|
|
39
|
+
async function main() {
|
|
40
|
+
const { values, positionals } = parseArgs({
|
|
41
|
+
allowPositionals: true,
|
|
42
|
+
options: {
|
|
43
|
+
below: { type: "string" },
|
|
44
|
+
out: { type: "string", short: "o" },
|
|
45
|
+
reference: { type: "string" }
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const below = Number(values.below);
|
|
49
|
+
const input = positionals[0];
|
|
50
|
+
if (!input || !(below > 0)) {
|
|
51
|
+
throw new Error(USAGE);
|
|
52
|
+
}
|
|
53
|
+
const graph = loadGraph(await readInput(input), input, {
|
|
54
|
+
referencePath: values.reference
|
|
55
|
+
});
|
|
56
|
+
const folded = foldVariants({ ...graph, paths: void 0 }, below);
|
|
57
|
+
const text = writeRgfa(folded);
|
|
58
|
+
if (values.out) {
|
|
59
|
+
await writeFile(values.out, text);
|
|
60
|
+
} else {
|
|
61
|
+
process.stdout.write(text);
|
|
62
|
+
}
|
|
63
|
+
process.stderr.write(
|
|
64
|
+
`${graph.nodes.length} segments, ${graph.edges.length} links -> ${folded.nodes.length} segments, ${folded.edges.length} links
|
|
65
|
+
`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
main().catch((e) => {
|
|
69
|
+
process.stderr.write(`${e instanceof Error ? e.message : String(e)}
|
|
70
|
+
`);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
});
|
package/dist/figure.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureSvg
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-HOOVOF2Y.js";
|
|
4
|
+
import "./chunks/chunk-UD5FOCI2.js";
|
|
5
|
+
import "./chunks/chunk-WBCOREDZ.js";
|
|
6
|
+
import "./chunks/chunk-4BYTEJGW.js";
|
|
4
7
|
import "./chunks/chunk-LOCJN3BZ.js";
|
|
5
8
|
import "./chunks/chunk-47DYCZOK.js";
|
|
6
|
-
import "./chunks/chunk-
|
|
7
|
-
import "./chunks/chunk-MIW3HYPE.js";
|
|
8
|
-
import "./chunks/chunk-2WNBVB55.js";
|
|
9
|
-
import "./chunks/chunk-4BYTEJGW.js";
|
|
10
|
-
import "./chunks/chunk-3S3YVOJ7.js";
|
|
9
|
+
import "./chunks/chunk-GFRPX6M2.js";
|
|
11
10
|
import "./chunks/chunk-BUBZ32IC.js";
|
|
12
|
-
import "./chunks/chunk-
|
|
13
|
-
import "./chunks/chunk-
|
|
11
|
+
import "./chunks/chunk-3S3YVOJ7.js";
|
|
12
|
+
import "./chunks/chunk-XKM5OHQQ.js";
|
|
13
|
+
import "./chunks/chunk-LFKMASER.js";
|
|
14
|
+
import "./chunks/chunk-XPT66H6H.js";
|
|
14
15
|
import "./chunks/chunk-2LQ5BWT7.js";
|
|
15
|
-
import "./chunks/chunk-
|
|
16
|
-
import "./chunks/chunk-
|
|
16
|
+
import "./chunks/chunk-OXTR3BVF.js";
|
|
17
|
+
import "./chunks/chunk-BR25DGIJ.js";
|
|
17
18
|
import "./chunks/chunk-G2FD7S3C.js";
|
|
18
|
-
import "./chunks/chunk-
|
|
19
|
-
import "./chunks/chunk-TL4B342F.js";
|
|
19
|
+
import "./chunks/chunk-FM6XRXPX.js";
|
|
20
20
|
import "./chunks/chunk-3C5UXR2U.js";
|
|
21
21
|
import "./chunks/chunk-MAUEPAMG.js";
|
|
22
|
-
import "./chunks/chunk-PBENCR5L.js";
|
|
23
22
|
import "./chunks/chunk-7GBL7SJY.js";
|
|
23
|
+
import "./chunks/chunk-PBENCR5L.js";
|
|
24
24
|
import "./chunks/chunk-RAKOB6IV.js";
|
|
25
25
|
import "./chunks/chunk-GJMC3PGM.js";
|
|
26
26
|
import "./chunks/chunk-FP4H7SFT.js";
|
|
@@ -31,18 +31,18 @@ import "./chunks/chunk-AB35TJST.js";
|
|
|
31
31
|
import "./chunks/chunk-JKJWSY4V.js";
|
|
32
32
|
import "./chunks/chunk-NNODIW4U.js";
|
|
33
33
|
import "./chunks/chunk-XV4P5KEQ.js";
|
|
34
|
-
import "./chunks/chunk-
|
|
34
|
+
import "./chunks/chunk-ZGRYFUXE.js";
|
|
35
35
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
36
36
|
import "./chunks/chunk-IGVV37VI.js";
|
|
37
37
|
import "./chunks/chunk-OCMBULGN.js";
|
|
38
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
38
39
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
39
40
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
40
|
-
import "./chunks/chunk-
|
|
41
|
+
import "./chunks/chunk-JVLURPFW.js";
|
|
41
42
|
import "./chunks/chunk-ES2N6V56.js";
|
|
42
43
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
43
44
|
import "./chunks/chunk-BPLIXMH7.js";
|
|
44
45
|
import "./chunks/chunk-TAMCZHLW.js";
|
|
45
|
-
import "./chunks/chunk-JVLURPFW.js";
|
|
46
46
|
import "./chunks/chunk-UVBGRJQX.js";
|
|
47
47
|
import "./chunks/chunk-6JEWNXCQ.js";
|
|
48
48
|
import "./chunks/chunk-N6FECAXP.js";
|
package/dist/figureSettings.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FIGURE_DEFAULTS,
|
|
3
3
|
figureSpecSettings
|
|
4
|
-
} from "./chunks/chunk-
|
|
5
|
-
import "./chunks/chunk-
|
|
4
|
+
} from "./chunks/chunk-BLRJ6IGK.js";
|
|
5
|
+
import "./chunks/chunk-ZGRYFUXE.js";
|
|
6
6
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
7
7
|
import "./chunks/chunk-IGVV37VI.js";
|
|
8
8
|
import "./chunks/chunk-OCMBULGN.js";
|
|
9
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
9
10
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
10
11
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
11
|
-
import "./chunks/chunk-
|
|
12
|
+
import "./chunks/chunk-JVLURPFW.js";
|
|
12
13
|
import "./chunks/chunk-ES2N6V56.js";
|
|
13
14
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
14
15
|
import "./chunks/chunk-BPLIXMH7.js";
|
|
15
16
|
import "./chunks/chunk-TAMCZHLW.js";
|
|
16
|
-
import "./chunks/chunk-JVLURPFW.js";
|
|
17
17
|
import "./chunks/chunk-UVBGRJQX.js";
|
|
18
18
|
import "./chunks/chunk-6JEWNXCQ.js";
|
|
19
19
|
import "./chunks/chunk-N6FECAXP.js";
|