@jbrowse/bandage-core 8.0.2 → 8.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/README.md +2 -1
- package/dist/chunks/{chunk-MP7LXLWV.js → chunk-3C5UXR2U.js} +1 -1
- package/dist/chunks/{chunk-XNE4UNSJ.js → chunk-3FXPFVKJ.js} +1 -1
- package/dist/chunks/{chunk-XRPU24OP.js → chunk-5OIVTEF7.js} +8 -5
- package/dist/chunks/{chunk-WC3Y3TD2.js → chunk-6VBDMZBZ.js} +1 -1
- package/dist/chunks/{chunk-ZJQ6H3AR.js → chunk-CF62U3QS.js} +4 -4
- package/dist/chunks/{chunk-H5ABLOPB.js → chunk-DE4UFDUZ.js} +6 -6
- package/dist/chunks/{chunk-SZNZ2T6D.js → chunk-MAUEPAMG.js} +37 -9
- package/dist/chunks/{chunk-V3MD3IZB.js → chunk-MIW3HYPE.js} +13 -4
- package/dist/chunks/chunk-OA7RIMZ2.js +211 -0
- package/dist/chunks/{chunk-WBFYKGXL.js → chunk-SKKYLBRA.js} +1 -1
- package/dist/chunks/{chunk-AO2VAMA4.js → chunk-TL4B342F.js} +1 -1
- package/dist/chunks/{chunk-O2ANJQVH.js → chunk-WDTXW7T2.js} +1 -1
- package/dist/cli/figure.js +12 -11
- package/dist/figure.js +10 -9
- package/dist/figureSettings.js +4 -3
- package/dist/gfa/graphTables.js +9 -0
- package/dist/index.js +19 -13
- package/dist/layout/forceCache.js +4 -3
- package/dist/layout/walkRowDraw.js +1 -1
- package/dist/layout/walkRowLayout.js +2 -2
- package/dist/layout/walkRows.js +1 -1
- package/dist/layout/walkStrip.js +2 -2
- package/dist/layoutModes.js +4 -4
- package/dist/pipeline.js +3 -2
- package/dist/types/gfa/graphTables.d.ts +41 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/layout/walkRowDraw.d.ts +1 -1
- package/dist/types/layout/walkRows.d.ts +5 -0
- package/dist/types/pipeline.d.ts +2 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ and [BandageJS](https://github.com/cmdcolin/BandageJS).
|
|
|
8
8
|
npm install @jbrowse/bandage-core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
- GFA and rGFA text in (`loadGraph`)
|
|
11
|
+
- GFA and rGFA text in (`loadGraph`), or the same graph as typed arrays a worker
|
|
12
|
+
can transfer (`GraphTables`)
|
|
12
13
|
- Layouts: Bandage's FMMM engine as WASM (`loadBandage`, `forceLayout`),
|
|
13
14
|
ordered, anchored, sample rows, walk rows, tube map
|
|
14
15
|
- A Canvas2D renderer (`buildGeometry`, `Canvas2DRenderer`), hit testing and
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
seededNodes
|
|
3
|
-
} from "./chunk-IGVV37VI.js";
|
|
4
1
|
import {
|
|
5
2
|
orientToReference
|
|
6
3
|
} from "./chunk-PUG7LXDF.js";
|
|
4
|
+
import {
|
|
5
|
+
seededNodes
|
|
6
|
+
} from "./chunk-IGVV37VI.js";
|
|
7
7
|
import {
|
|
8
8
|
convertGFAToGraph
|
|
9
9
|
} from "./chunk-OCMBULGN.js";
|
|
10
10
|
import {
|
|
11
11
|
parseGFA
|
|
12
12
|
} from "./chunk-CDLPYR5O.js";
|
|
13
|
+
import {
|
|
14
|
+
graphFromTables
|
|
15
|
+
} from "./chunk-OA7RIMZ2.js";
|
|
13
16
|
import {
|
|
14
17
|
anchorGraph
|
|
15
18
|
} from "./chunk-ST2IBUAN.js";
|
|
@@ -39,9 +42,9 @@ import {
|
|
|
39
42
|
} from "./chunk-FYQWPEEY.js";
|
|
40
43
|
|
|
41
44
|
// src/pipeline.ts
|
|
42
|
-
function loadGraph(
|
|
45
|
+
function loadGraph(source, name, opts = {}) {
|
|
43
46
|
const graph = anchorGraph(
|
|
44
|
-
convertGFAToGraph(parseGFA(
|
|
47
|
+
typeof source === "string" ? convertGFAToGraph(parseGFA(source), name) : graphFromTables(source, name),
|
|
45
48
|
opts.referencePath
|
|
46
49
|
);
|
|
47
50
|
if (graph.nodes.length === 0) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
sampleRowLayout
|
|
3
|
-
} from "./chunk-LOEA5IHZ.js";
|
|
4
1
|
import {
|
|
5
2
|
hasTubeMapPaths,
|
|
6
3
|
tubeMapLayout,
|
|
7
4
|
tubeMapReferenceLayout
|
|
8
5
|
} from "./chunk-W2I4DOL4.js";
|
|
6
|
+
import {
|
|
7
|
+
sampleRowLayout
|
|
8
|
+
} from "./chunk-LOEA5IHZ.js";
|
|
9
9
|
import {
|
|
10
10
|
anchoredLayout
|
|
11
11
|
} from "./chunk-L3O7AWLI.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-HNQPEMYE.js";
|
|
15
15
|
import {
|
|
16
16
|
walkRowLayout
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3C5UXR2U.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackbone,
|
|
20
20
|
isOffReference
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
stripGeneGaps,
|
|
9
9
|
walkStripFrame,
|
|
10
10
|
walkStripLabelsTree
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WDTXW7T2.js";
|
|
12
12
|
import {
|
|
13
13
|
walkRowsKey,
|
|
14
14
|
walkRowsKeyTree,
|
|
15
15
|
walkRowsTree
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MIW3HYPE.js";
|
|
17
17
|
import {
|
|
18
18
|
Canvas2DRenderer
|
|
19
19
|
} from "./chunk-2WNBVB55.js";
|
|
@@ -42,14 +42,14 @@ import {
|
|
|
42
42
|
} from "./chunk-HBEKUQO4.js";
|
|
43
43
|
import {
|
|
44
44
|
version
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-3FXPFVKJ.js";
|
|
46
46
|
import {
|
|
47
47
|
axisScaleOf
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TL4B342F.js";
|
|
49
49
|
import {
|
|
50
50
|
walkRowLabels,
|
|
51
51
|
walkRowsExtent
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-3C5UXR2U.js";
|
|
53
53
|
import {
|
|
54
54
|
nodeInk
|
|
55
55
|
} from "./chunk-PBENCR5L.js";
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
FIT_PADDING,
|
|
92
92
|
drawingBounds,
|
|
93
93
|
fitTransform
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-5OIVTEF7.js";
|
|
95
95
|
import {
|
|
96
96
|
deletionDrawing,
|
|
97
97
|
deletionEdges
|
|
@@ -53,12 +53,16 @@ function sliceBetween(steps, span, region, flanked = true) {
|
|
|
53
53
|
if (!region || !flanked) {
|
|
54
54
|
return { ids: steps, complete: true, from: -1, to: -1 };
|
|
55
55
|
}
|
|
56
|
+
const spanAt = (i) => {
|
|
57
|
+
const id = steps[i];
|
|
58
|
+
return typeof id === "string" ? span.get(id) : void 0;
|
|
59
|
+
};
|
|
56
60
|
let i0 = -1;
|
|
57
61
|
let i1 = -1;
|
|
58
62
|
let bestEnd = -Infinity;
|
|
59
63
|
let bestStart = Infinity;
|
|
60
|
-
steps.forEach((
|
|
61
|
-
const s =
|
|
64
|
+
steps.forEach((_, i) => {
|
|
65
|
+
const s = spanAt(i);
|
|
62
66
|
if (s) {
|
|
63
67
|
if (s.end <= region.start && s.end > bestEnd) {
|
|
64
68
|
bestEnd = s.end;
|
|
@@ -70,15 +74,38 @@ function sliceBetween(steps, span, region, flanked = true) {
|
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
});
|
|
73
|
-
if (i0
|
|
77
|
+
if (i0 >= 0 && i1 >= 0) {
|
|
78
|
+
const ids2 = steps.slice(Math.min(i0, i1) + 1, Math.max(i0, i1));
|
|
79
|
+
return {
|
|
80
|
+
ids: i0 < i1 ? ids2 : ids2.reverse(),
|
|
81
|
+
complete: true,
|
|
82
|
+
from: i0,
|
|
83
|
+
to: i1
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const flank = i0 >= 0 ? i0 : i1;
|
|
87
|
+
let near = -1;
|
|
88
|
+
for (let d = 1; flank >= 0 && near < 0 && d < steps.length; d++) {
|
|
89
|
+
near = [flank - d, flank + d].find((j) => spanAt(j) !== void 0) ?? -1;
|
|
90
|
+
}
|
|
91
|
+
if (near < 0) {
|
|
74
92
|
return { ids: steps, complete: false, from: -1, to: -1 };
|
|
75
93
|
}
|
|
76
|
-
const
|
|
94
|
+
const forward = near > flank === spanAt(near).start > spanAt(flank).start;
|
|
95
|
+
const after = forward === (flank === i0);
|
|
96
|
+
const ids = after ? steps.slice(flank + 1) : steps.slice(0, flank).reverse();
|
|
97
|
+
const last = ids.length > 0 ? ids.length - 1 : -1;
|
|
98
|
+
const end = last < 0 ? spanAt(flank) : spanAt(after ? flank + 1 + last : 0);
|
|
99
|
+
const stop = {
|
|
100
|
+
contigEnds: end !== void 0,
|
|
101
|
+
shortBp: !end ? 0 : Math.max(0, region.start - end.end, end.start - region.end)
|
|
102
|
+
};
|
|
77
103
|
return {
|
|
78
|
-
ids
|
|
79
|
-
complete:
|
|
80
|
-
from:
|
|
81
|
-
to:
|
|
104
|
+
ids,
|
|
105
|
+
complete: false,
|
|
106
|
+
from: flank,
|
|
107
|
+
to: after ? steps.length : -1,
|
|
108
|
+
stop
|
|
82
109
|
};
|
|
83
110
|
}
|
|
84
111
|
function filterSamples(rows, samples) {
|
|
@@ -117,7 +144,7 @@ function walkRows(graph, region, unit) {
|
|
|
117
144
|
const rowOf = (pieces) => {
|
|
118
145
|
const path = pieces[0];
|
|
119
146
|
const ordered = [...pieces].sort((a, b) => (a.start ?? 0) - (b.start ?? 0));
|
|
120
|
-
const { ids, complete, from, to } = sliceBetween(
|
|
147
|
+
const { ids, complete, from, to, stop } = sliceBetween(
|
|
121
148
|
stepsOf(ordered, lengthOf),
|
|
122
149
|
span,
|
|
123
150
|
cut,
|
|
@@ -177,6 +204,7 @@ function walkRows(graph, region, unit) {
|
|
|
177
204
|
offReferenceBp,
|
|
178
205
|
gapBp,
|
|
179
206
|
complete,
|
|
207
|
+
stop,
|
|
180
208
|
runs,
|
|
181
209
|
axis
|
|
182
210
|
};
|
|
@@ -34,15 +34,24 @@ function units(bp, unit) {
|
|
|
34
34
|
return unit ? ` \u2248 ${Math.round(bp / unit)} units` : "";
|
|
35
35
|
}
|
|
36
36
|
function walkRowReadout(row, reference, unit, call) {
|
|
37
|
-
const { bp, gapBp, complete } = row;
|
|
37
|
+
const { bp, gapBp, complete, stop } = row;
|
|
38
38
|
if (!reference) {
|
|
39
39
|
return `${kb(bp)}${units(bp, unit)}`;
|
|
40
40
|
}
|
|
41
|
-
const delta = bp - reference.bp;
|
|
42
|
-
const against = delta === 0 ? "" : ` (${delta > 0 ? "+" : "\u2212"}${kb(Math.abs(delta))})`;
|
|
43
41
|
const outside = gapBp > 0 ? ` \xB7 ${kb(gapBp)} outside the cut` : "";
|
|
44
42
|
const called = call ? ` \xB7 called ${kb(call.bp)}${call.spanningReads === 0 ? " \xB7 no spanning read" : ""}` : "";
|
|
45
|
-
|
|
43
|
+
if (complete) {
|
|
44
|
+
const delta = bp - reference.bp;
|
|
45
|
+
const against = delta === 0 ? "" : ` (${delta > 0 ? "+" : "\u2212"}${kb(Math.abs(delta))})`;
|
|
46
|
+
return `${kb(bp)}${units(bp, unit)}${against}${outside}${called}`;
|
|
47
|
+
}
|
|
48
|
+
const region = unit ? "repeat" : "window";
|
|
49
|
+
if (stop?.contigEnds && bp === 0) {
|
|
50
|
+
const where = stop.shortBp > 0 ? `${kb(stop.shortBp)} before` : "at";
|
|
51
|
+
return `contig ends ${where} the ${region}${called}`;
|
|
52
|
+
}
|
|
53
|
+
const why = !stop ? "partial walk" : stop.contigEnds ? `contig ends inside the ${region}` : "does not rejoin the reference within the cut";
|
|
54
|
+
return `\u2265 ${kb(bp)}${units(bp, unit)} \xB7 ${why}${outside}${called}`;
|
|
46
55
|
}
|
|
47
56
|
function readoutPlacement(text, endX, width) {
|
|
48
57
|
const x = endX + 6;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
panSNSample
|
|
3
|
+
} from "./chunk-BPLIXMH7.js";
|
|
4
|
+
|
|
5
|
+
// src/gfa/graphTables.ts
|
|
6
|
+
function walkFields(panSN) {
|
|
7
|
+
const [sample = "", haplotype = "", ...contig] = panSN.split("#");
|
|
8
|
+
return { sample, haplotype, contig: contig.join("#") };
|
|
9
|
+
}
|
|
10
|
+
function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA") {
|
|
11
|
+
const count = n.names.length;
|
|
12
|
+
const declared = n.lengths.length;
|
|
13
|
+
const canonical = new Uint8Array(count);
|
|
14
|
+
const claim = (node, reversed) => {
|
|
15
|
+
if (canonical[node] === 0) {
|
|
16
|
+
canonical[node] = reversed ? 2 : 1;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
for (let i = 0; i < l.from.length; i++) {
|
|
20
|
+
claim(l.from[i], l.strands[i] & 1);
|
|
21
|
+
claim(l.to[i], l.strands[i] & 2);
|
|
22
|
+
}
|
|
23
|
+
const drawnWalks = [];
|
|
24
|
+
for (let p = 0; p < w.names.length; p++) {
|
|
25
|
+
if (w.offsets[p + 1] > w.offsets[p]) {
|
|
26
|
+
drawnWalks.push(p);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const traversals = new Int32Array(count);
|
|
30
|
+
for (const p of drawnWalks) {
|
|
31
|
+
for (let s = w.offsets[p]; s < w.offsets[p + 1]; s++) {
|
|
32
|
+
const node = w.steps[s];
|
|
33
|
+
if (traversals[node] === 0) {
|
|
34
|
+
claim(node, w.reversed[s]);
|
|
35
|
+
}
|
|
36
|
+
traversals[node]++;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const ids = n.names.map(
|
|
40
|
+
(segment, i) => `${segment}${canonical[i] === 2 ? "-" : "+"}`
|
|
41
|
+
);
|
|
42
|
+
const nodes = [];
|
|
43
|
+
for (let i = 0; i < declared; i++) {
|
|
44
|
+
const ref = n.refs[i];
|
|
45
|
+
nodes.push({
|
|
46
|
+
id: ids[i],
|
|
47
|
+
name: n.names[i],
|
|
48
|
+
length: n.lengths[i],
|
|
49
|
+
depth: Math.max(traversals[i], 1),
|
|
50
|
+
stable: ref < 0 ? void 0 : {
|
|
51
|
+
refName: n.refNames[ref],
|
|
52
|
+
start: n.starts[i],
|
|
53
|
+
rank: n.ranks[i]
|
|
54
|
+
},
|
|
55
|
+
samples: void 0
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const edges = [];
|
|
59
|
+
const neighbours = new Array(count);
|
|
60
|
+
const pairList = (a, b) => {
|
|
61
|
+
const near = neighbours[a];
|
|
62
|
+
if (near) {
|
|
63
|
+
for (let j = 0; j < near.length; j += 2) {
|
|
64
|
+
if (near[j] === b) {
|
|
65
|
+
return near[j + 1];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return void 0;
|
|
70
|
+
};
|
|
71
|
+
const addPair = (a, b, list) => {
|
|
72
|
+
const near = neighbours[a];
|
|
73
|
+
if (near) {
|
|
74
|
+
near.push(b, list);
|
|
75
|
+
} else {
|
|
76
|
+
neighbours[a] = [b, list];
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const edgeLists = [];
|
|
80
|
+
let lists = 0;
|
|
81
|
+
for (let i = 0; i < l.from.length; i++) {
|
|
82
|
+
const a = l.from[i];
|
|
83
|
+
const b = l.to[i];
|
|
84
|
+
edges.push({
|
|
85
|
+
from: ids[a],
|
|
86
|
+
to: ids[b],
|
|
87
|
+
fromStrand: l.strands[i] & 1 ? "-" : "+",
|
|
88
|
+
toStrand: l.strands[i] & 2 ? "-" : "+"
|
|
89
|
+
});
|
|
90
|
+
let list = pairList(a, b);
|
|
91
|
+
if (list === void 0) {
|
|
92
|
+
list = lists++;
|
|
93
|
+
addPair(a, b, list);
|
|
94
|
+
addPair(b, a, list);
|
|
95
|
+
}
|
|
96
|
+
edgeLists.push(list);
|
|
97
|
+
}
|
|
98
|
+
const nameIndex = /* @__PURE__ */ new Map();
|
|
99
|
+
const pathNames = [];
|
|
100
|
+
const crossing = Array.from({ length: lists }, () => []);
|
|
101
|
+
const lastWalk = new Int32Array(lists).fill(-1);
|
|
102
|
+
const paths = [];
|
|
103
|
+
const anchorPaths = [];
|
|
104
|
+
const visits = new Array(count);
|
|
105
|
+
const filled = new Int32Array(count);
|
|
106
|
+
const visitOrder = [];
|
|
107
|
+
for (const p of drawnWalks) {
|
|
108
|
+
const { sample, haplotype, contig } = walkFields(w.names[p]);
|
|
109
|
+
const pathName = `${sample}#${+haplotype}#${contig}`;
|
|
110
|
+
let named = nameIndex.get(pathName);
|
|
111
|
+
const repeat = named !== void 0;
|
|
112
|
+
if (named === void 0) {
|
|
113
|
+
named = pathNames.length;
|
|
114
|
+
nameIndex.set(pathName, named);
|
|
115
|
+
pathNames.push(pathName);
|
|
116
|
+
}
|
|
117
|
+
const start = w.starts[p];
|
|
118
|
+
const visitSample = panSNSample(pathName);
|
|
119
|
+
const first = w.offsets[p];
|
|
120
|
+
const nodeIds = new Array(w.offsets[p + 1] - first);
|
|
121
|
+
let pos = start;
|
|
122
|
+
let prev = -1;
|
|
123
|
+
for (let s = first; s < w.offsets[p + 1]; s++) {
|
|
124
|
+
const node = w.steps[s];
|
|
125
|
+
nodeIds[s - first] = ids[node];
|
|
126
|
+
if (filled[node] === 0) {
|
|
127
|
+
visits[node] = new Array(traversals[node]);
|
|
128
|
+
visitOrder.push(node);
|
|
129
|
+
}
|
|
130
|
+
visits[node][filled[node]++] = {
|
|
131
|
+
path: pathName,
|
|
132
|
+
sample: visitSample,
|
|
133
|
+
start: pos,
|
|
134
|
+
strand: w.reversed[s] ? "-" : "+"
|
|
135
|
+
};
|
|
136
|
+
pos += node < declared ? n.lengths[node] : 0;
|
|
137
|
+
if (prev >= 0) {
|
|
138
|
+
const list = pairList(prev, node);
|
|
139
|
+
if (list !== void 0 && lastWalk[list] !== p) {
|
|
140
|
+
lastWalk[list] = p;
|
|
141
|
+
const names = crossing[list];
|
|
142
|
+
if (!repeat || !names.includes(named)) {
|
|
143
|
+
names.push(named);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
prev = node;
|
|
148
|
+
}
|
|
149
|
+
paths.push({
|
|
150
|
+
name: pathName,
|
|
151
|
+
nodeIds,
|
|
152
|
+
start,
|
|
153
|
+
sample,
|
|
154
|
+
haplotype: +haplotype,
|
|
155
|
+
contig
|
|
156
|
+
});
|
|
157
|
+
anchorPaths.push({
|
|
158
|
+
name: pathName,
|
|
159
|
+
sample: visitSample,
|
|
160
|
+
start,
|
|
161
|
+
length: pos - start
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
edges.forEach((edge, i) => {
|
|
165
|
+
const names = crossing[edgeLists[i]];
|
|
166
|
+
if (names.length > 0) {
|
|
167
|
+
edge.pathIds = names.map((k) => pathNames[k]);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const walked = drawnWalks.length > 0;
|
|
171
|
+
return {
|
|
172
|
+
name,
|
|
173
|
+
nodes,
|
|
174
|
+
edges,
|
|
175
|
+
paths: walked ? paths : void 0,
|
|
176
|
+
anchorPaths: walked ? anchorPaths : void 0,
|
|
177
|
+
pathVisits: walked ? new Map(visitOrder.map((node) => [n.names[node], visits[node]])) : void 0,
|
|
178
|
+
anchoredBy: nodes.some((node) => node.stable) ? "tags" : void 0
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function graphTablesGFA({ nodes, links, walks }) {
|
|
182
|
+
const { names } = nodes;
|
|
183
|
+
const lines = ["H VN:Z:1.1"];
|
|
184
|
+
for (let i = 0; i < nodes.lengths.length; i++) {
|
|
185
|
+
const ref = nodes.refs[i];
|
|
186
|
+
const stable = ref < 0 ? "" : ` SN:Z:${nodes.refNames[ref]} SO:i:${nodes.starts[i]} SR:i:${nodes.ranks[i]}`;
|
|
187
|
+
lines.push(`S ${names[i]} * LN:i:${nodes.lengths[i]}${stable}`);
|
|
188
|
+
}
|
|
189
|
+
for (let i = 0; i < links.from.length; i++) {
|
|
190
|
+
const strands = links.strands[i];
|
|
191
|
+
lines.push(
|
|
192
|
+
`L ${names[links.from[i]]} ${strands & 1 ? "-" : "+"} ${names[links.to[i]]} ${strands & 2 ? "-" : "+"} 0M`
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
for (let p = 0; p < walks.names.length; p++) {
|
|
196
|
+
const { sample, haplotype, contig } = walkFields(walks.names[p]);
|
|
197
|
+
let body = "";
|
|
198
|
+
for (let s = walks.offsets[p]; s < walks.offsets[p + 1]; s++) {
|
|
199
|
+
body += (walks.reversed[s] ? "<" : ">") + names[walks.steps[s]];
|
|
200
|
+
}
|
|
201
|
+
lines.push(
|
|
202
|
+
`W ${sample} ${haplotype} ${contig} ${walks.starts[p]} ${walks.ends[p]} ${body}`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
return lines.join("\n");
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export {
|
|
209
|
+
graphFromTables,
|
|
210
|
+
graphTablesGFA
|
|
211
|
+
};
|
package/dist/cli/figure.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
LAYOUT_MODES,
|
|
9
9
|
layoutModeByValue
|
|
10
|
-
} from "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-LOEA5IHZ.js";
|
|
10
|
+
} from "../chunks/chunk-CF62U3QS.js";
|
|
12
11
|
import "../chunks/chunk-W2I4DOL4.js";
|
|
13
12
|
import "../chunks/chunk-TEDQJPMI.js";
|
|
13
|
+
import "../chunks/chunk-LOEA5IHZ.js";
|
|
14
14
|
import "../chunks/chunk-L3O7AWLI.js";
|
|
15
15
|
import "../chunks/chunk-TZFWUT2C.js";
|
|
16
16
|
import "../chunks/chunk-C44YRP5F.js";
|
|
@@ -35,14 +35,14 @@ import "../chunks/chunk-LYJ4US66.js";
|
|
|
35
35
|
import "../chunks/chunk-7XHHVYG7.js";
|
|
36
36
|
import {
|
|
37
37
|
figureSvg
|
|
38
|
-
} from "../chunks/chunk-
|
|
38
|
+
} from "../chunks/chunk-DE4UFDUZ.js";
|
|
39
39
|
import "../chunks/chunk-LOCJN3BZ.js";
|
|
40
40
|
import "../chunks/chunk-47DYCZOK.js";
|
|
41
|
-
import "../chunks/chunk-
|
|
41
|
+
import "../chunks/chunk-WDTXW7T2.js";
|
|
42
42
|
import {
|
|
43
43
|
genesOnRow,
|
|
44
44
|
placeRowGenes
|
|
45
|
-
} from "../chunks/chunk-
|
|
45
|
+
} from "../chunks/chunk-MIW3HYPE.js";
|
|
46
46
|
import "../chunks/chunk-2WNBVB55.js";
|
|
47
47
|
import "../chunks/chunk-4BYTEJGW.js";
|
|
48
48
|
import "../chunks/chunk-3S3YVOJ7.js";
|
|
@@ -53,13 +53,13 @@ import "../chunks/chunk-2LQ5BWT7.js";
|
|
|
53
53
|
import "../chunks/chunk-6ZNQJ5ZD.js";
|
|
54
54
|
import "../chunks/chunk-HBEKUQO4.js";
|
|
55
55
|
import "../chunks/chunk-G2FD7S3C.js";
|
|
56
|
-
import "../chunks/chunk-
|
|
57
|
-
import "../chunks/chunk-
|
|
58
|
-
import "../chunks/chunk-
|
|
56
|
+
import "../chunks/chunk-3FXPFVKJ.js";
|
|
57
|
+
import "../chunks/chunk-TL4B342F.js";
|
|
58
|
+
import "../chunks/chunk-3C5UXR2U.js";
|
|
59
59
|
import {
|
|
60
60
|
filterSamples,
|
|
61
61
|
walkRows
|
|
62
|
-
} from "../chunks/chunk-
|
|
62
|
+
} from "../chunks/chunk-MAUEPAMG.js";
|
|
63
63
|
import "../chunks/chunk-PBENCR5L.js";
|
|
64
64
|
import "../chunks/chunk-7GBL7SJY.js";
|
|
65
65
|
import {
|
|
@@ -80,12 +80,13 @@ import {
|
|
|
80
80
|
engineSettingsOf,
|
|
81
81
|
forceLayout,
|
|
82
82
|
loadGraph
|
|
83
|
-
} from "../chunks/chunk-
|
|
84
|
-
import "../chunks/chunk-IGVV37VI.js";
|
|
83
|
+
} from "../chunks/chunk-5OIVTEF7.js";
|
|
85
84
|
import "../chunks/chunk-PUG7LXDF.js";
|
|
85
|
+
import "../chunks/chunk-IGVV37VI.js";
|
|
86
86
|
import "../chunks/chunk-OCMBULGN.js";
|
|
87
87
|
import "../chunks/chunk-QYBZZI5H.js";
|
|
88
88
|
import "../chunks/chunk-CDLPYR5O.js";
|
|
89
|
+
import "../chunks/chunk-OA7RIMZ2.js";
|
|
89
90
|
import "../chunks/chunk-ES2N6V56.js";
|
|
90
91
|
import "../chunks/chunk-ST2IBUAN.js";
|
|
91
92
|
import "../chunks/chunk-BPLIXMH7.js";
|
package/dist/figure.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureSvg
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-DE4UFDUZ.js";
|
|
4
4
|
import "./chunks/chunk-LOCJN3BZ.js";
|
|
5
5
|
import "./chunks/chunk-47DYCZOK.js";
|
|
6
|
-
import "./chunks/chunk-
|
|
7
|
-
import "./chunks/chunk-
|
|
6
|
+
import "./chunks/chunk-WDTXW7T2.js";
|
|
7
|
+
import "./chunks/chunk-MIW3HYPE.js";
|
|
8
8
|
import "./chunks/chunk-2WNBVB55.js";
|
|
9
9
|
import "./chunks/chunk-4BYTEJGW.js";
|
|
10
10
|
import "./chunks/chunk-3S3YVOJ7.js";
|
|
@@ -15,10 +15,10 @@ import "./chunks/chunk-2LQ5BWT7.js";
|
|
|
15
15
|
import "./chunks/chunk-6ZNQJ5ZD.js";
|
|
16
16
|
import "./chunks/chunk-HBEKUQO4.js";
|
|
17
17
|
import "./chunks/chunk-G2FD7S3C.js";
|
|
18
|
-
import "./chunks/chunk-
|
|
19
|
-
import "./chunks/chunk-
|
|
20
|
-
import "./chunks/chunk-
|
|
21
|
-
import "./chunks/chunk-
|
|
18
|
+
import "./chunks/chunk-3FXPFVKJ.js";
|
|
19
|
+
import "./chunks/chunk-TL4B342F.js";
|
|
20
|
+
import "./chunks/chunk-3C5UXR2U.js";
|
|
21
|
+
import "./chunks/chunk-MAUEPAMG.js";
|
|
22
22
|
import "./chunks/chunk-PBENCR5L.js";
|
|
23
23
|
import "./chunks/chunk-7GBL7SJY.js";
|
|
24
24
|
import "./chunks/chunk-RAKOB6IV.js";
|
|
@@ -31,12 +31,13 @@ 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-
|
|
35
|
-
import "./chunks/chunk-IGVV37VI.js";
|
|
34
|
+
import "./chunks/chunk-5OIVTEF7.js";
|
|
36
35
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
36
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
37
37
|
import "./chunks/chunk-OCMBULGN.js";
|
|
38
38
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
39
39
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
40
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
40
41
|
import "./chunks/chunk-ES2N6V56.js";
|
|
41
42
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
42
43
|
import "./chunks/chunk-BPLIXMH7.js";
|
package/dist/figureSettings.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FIGURE_DEFAULTS,
|
|
3
3
|
figureSpecSettings
|
|
4
|
-
} from "./chunks/chunk-
|
|
5
|
-
import "./chunks/chunk-
|
|
6
|
-
import "./chunks/chunk-IGVV37VI.js";
|
|
4
|
+
} from "./chunks/chunk-6VBDMZBZ.js";
|
|
5
|
+
import "./chunks/chunk-5OIVTEF7.js";
|
|
7
6
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
7
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
8
8
|
import "./chunks/chunk-OCMBULGN.js";
|
|
9
9
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
10
10
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
11
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
11
12
|
import "./chunks/chunk-ES2N6V56.js";
|
|
12
13
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
13
14
|
import "./chunks/chunk-BPLIXMH7.js";
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "./chunks/chunk-GQ2AOHU4.js";
|
|
36
36
|
import {
|
|
37
37
|
createForceLayoutCache
|
|
38
|
-
} from "./chunks/chunk-
|
|
38
|
+
} from "./chunks/chunk-SKKYLBRA.js";
|
|
39
39
|
import {
|
|
40
40
|
bubbleSubgraph
|
|
41
41
|
} from "./chunks/chunk-VHW7FDHU.js";
|
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
LAYOUT_MODES,
|
|
70
70
|
layoutModeByValue,
|
|
71
71
|
modeUsesLayoutEngine
|
|
72
|
-
} from "./chunks/chunk-
|
|
73
|
-
import "./chunks/chunk-LOEA5IHZ.js";
|
|
72
|
+
} from "./chunks/chunk-CF62U3QS.js";
|
|
74
73
|
import "./chunks/chunk-W2I4DOL4.js";
|
|
75
74
|
import "./chunks/chunk-TEDQJPMI.js";
|
|
75
|
+
import "./chunks/chunk-LOEA5IHZ.js";
|
|
76
76
|
import "./chunks/chunk-L3O7AWLI.js";
|
|
77
77
|
import "./chunks/chunk-TZFWUT2C.js";
|
|
78
78
|
import "./chunks/chunk-C44YRP5F.js";
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
} from "./chunks/chunk-7XHHVYG7.js";
|
|
113
113
|
import {
|
|
114
114
|
figureSvg
|
|
115
|
-
} from "./chunks/chunk-
|
|
115
|
+
} from "./chunks/chunk-DE4UFDUZ.js";
|
|
116
116
|
import {
|
|
117
117
|
layoutGeometryInputs
|
|
118
118
|
} from "./chunks/chunk-LOCJN3BZ.js";
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
walkStripApplies,
|
|
131
131
|
walkStripFrame,
|
|
132
132
|
walkStripLabelsTree
|
|
133
|
-
} from "./chunks/chunk-
|
|
133
|
+
} from "./chunks/chunk-WDTXW7T2.js";
|
|
134
134
|
import {
|
|
135
135
|
BAR_PX,
|
|
136
136
|
CALL_TICK,
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
walkRowsKey,
|
|
158
158
|
walkRowsKeyTree,
|
|
159
159
|
walkRowsTree
|
|
160
|
-
} from "./chunks/chunk-
|
|
160
|
+
} from "./chunks/chunk-MIW3HYPE.js";
|
|
161
161
|
import {
|
|
162
162
|
Canvas2DRenderer
|
|
163
163
|
} from "./chunks/chunk-2WNBVB55.js";
|
|
@@ -204,7 +204,7 @@ import {
|
|
|
204
204
|
import "./chunks/chunk-G2FD7S3C.js";
|
|
205
205
|
import {
|
|
206
206
|
version
|
|
207
|
-
} from "./chunks/chunk-
|
|
207
|
+
} from "./chunks/chunk-3FXPFVKJ.js";
|
|
208
208
|
import {
|
|
209
209
|
axisScaleOf,
|
|
210
210
|
contains,
|
|
@@ -212,15 +212,15 @@ import {
|
|
|
212
212
|
screenToLayout,
|
|
213
213
|
viewportOf,
|
|
214
214
|
zoomAbout
|
|
215
|
-
} from "./chunks/chunk-
|
|
215
|
+
} from "./chunks/chunk-TL4B342F.js";
|
|
216
216
|
import {
|
|
217
217
|
walkRowLabels,
|
|
218
218
|
walkRowsExtent
|
|
219
|
-
} from "./chunks/chunk-
|
|
219
|
+
} from "./chunks/chunk-3C5UXR2U.js";
|
|
220
220
|
import {
|
|
221
221
|
filterSamples,
|
|
222
222
|
walkRows
|
|
223
|
-
} from "./chunks/chunk-
|
|
223
|
+
} from "./chunks/chunk-MAUEPAMG.js";
|
|
224
224
|
import {
|
|
225
225
|
NODE_WIDTHS,
|
|
226
226
|
maxNodeWidthPx,
|
|
@@ -283,7 +283,7 @@ import {
|
|
|
283
283
|
import {
|
|
284
284
|
FIGURE_DEFAULTS,
|
|
285
285
|
figureSpecSettings
|
|
286
|
-
} from "./chunks/chunk-
|
|
286
|
+
} from "./chunks/chunk-6VBDMZBZ.js";
|
|
287
287
|
import {
|
|
288
288
|
ENGINE_DEFAULTS,
|
|
289
289
|
FIT_PADDING,
|
|
@@ -296,12 +296,16 @@ import {
|
|
|
296
296
|
forceLayout,
|
|
297
297
|
layoutExtent,
|
|
298
298
|
loadGraph
|
|
299
|
-
} from "./chunks/chunk-
|
|
300
|
-
import "./chunks/chunk-IGVV37VI.js";
|
|
299
|
+
} from "./chunks/chunk-5OIVTEF7.js";
|
|
301
300
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
301
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
302
302
|
import "./chunks/chunk-OCMBULGN.js";
|
|
303
303
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
304
304
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
305
|
+
import {
|
|
306
|
+
graphFromTables,
|
|
307
|
+
graphTablesGFA
|
|
308
|
+
} from "./chunks/chunk-OA7RIMZ2.js";
|
|
305
309
|
import "./chunks/chunk-ES2N6V56.js";
|
|
306
310
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
307
311
|
import {
|
|
@@ -425,6 +429,8 @@ export {
|
|
|
425
429
|
genesOnRow,
|
|
426
430
|
getDpr,
|
|
427
431
|
graphBackbone,
|
|
432
|
+
graphFromTables,
|
|
433
|
+
graphTablesGFA,
|
|
428
434
|
haplotypeWanted,
|
|
429
435
|
layoutEngine,
|
|
430
436
|
layoutExtent,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createForceLayoutCache
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-IGVV37VI.js";
|
|
3
|
+
} from "../chunks/chunk-SKKYLBRA.js";
|
|
4
|
+
import "../chunks/chunk-5OIVTEF7.js";
|
|
6
5
|
import "../chunks/chunk-PUG7LXDF.js";
|
|
6
|
+
import "../chunks/chunk-IGVV37VI.js";
|
|
7
7
|
import "../chunks/chunk-OCMBULGN.js";
|
|
8
8
|
import "../chunks/chunk-QYBZZI5H.js";
|
|
9
9
|
import "../chunks/chunk-CDLPYR5O.js";
|
|
10
|
+
import "../chunks/chunk-OA7RIMZ2.js";
|
|
10
11
|
import "../chunks/chunk-ES2N6V56.js";
|
|
11
12
|
import "../chunks/chunk-ST2IBUAN.js";
|
|
12
13
|
import "../chunks/chunk-BPLIXMH7.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
walkRowsKey,
|
|
27
27
|
walkRowsKeyTree,
|
|
28
28
|
walkRowsTree
|
|
29
|
-
} from "../chunks/chunk-
|
|
29
|
+
} from "../chunks/chunk-MIW3HYPE.js";
|
|
30
30
|
import "../chunks/chunk-6ZNQJ5ZD.js";
|
|
31
31
|
import "../chunks/chunk-HBEKUQO4.js";
|
|
32
32
|
import "../chunks/chunk-G2FD7S3C.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
walkRowLabels,
|
|
3
3
|
walkRowLayout,
|
|
4
4
|
walkRowsExtent
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-3C5UXR2U.js";
|
|
6
|
+
import "../chunks/chunk-MAUEPAMG.js";
|
|
7
7
|
import "../chunks/chunk-ST2IBUAN.js";
|
|
8
8
|
import "../chunks/chunk-BPLIXMH7.js";
|
|
9
9
|
import "../chunks/chunk-CPMHA4W5.js";
|
package/dist/layout/walkRows.js
CHANGED
package/dist/layout/walkStrip.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
walkStripApplies,
|
|
10
10
|
walkStripFrame,
|
|
11
11
|
walkStripLabelsTree
|
|
12
|
-
} from "../chunks/chunk-
|
|
12
|
+
} from "../chunks/chunk-WDTXW7T2.js";
|
|
13
13
|
import {
|
|
14
14
|
LABELLED_ROW_PX
|
|
15
|
-
} from "../chunks/chunk-
|
|
15
|
+
} from "../chunks/chunk-MIW3HYPE.js";
|
|
16
16
|
import "../chunks/chunk-6ZNQJ5ZD.js";
|
|
17
17
|
import "../chunks/chunk-HBEKUQO4.js";
|
|
18
18
|
import "../chunks/chunk-G2FD7S3C.js";
|
package/dist/layoutModes.js
CHANGED
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
LAYOUT_MODE_VALUES,
|
|
5
5
|
layoutModeByValue,
|
|
6
6
|
modeUsesLayoutEngine
|
|
7
|
-
} from "./chunks/chunk-
|
|
8
|
-
import "./chunks/chunk-LOEA5IHZ.js";
|
|
7
|
+
} from "./chunks/chunk-CF62U3QS.js";
|
|
9
8
|
import "./chunks/chunk-W2I4DOL4.js";
|
|
10
9
|
import "./chunks/chunk-TEDQJPMI.js";
|
|
10
|
+
import "./chunks/chunk-LOEA5IHZ.js";
|
|
11
11
|
import "./chunks/chunk-L3O7AWLI.js";
|
|
12
12
|
import "./chunks/chunk-TZFWUT2C.js";
|
|
13
13
|
import "./chunks/chunk-C44YRP5F.js";
|
|
14
14
|
import "./chunks/chunk-RVS2QCOX.js";
|
|
15
15
|
import "./chunks/chunk-HNQPEMYE.js";
|
|
16
|
-
import "./chunks/chunk-
|
|
17
|
-
import "./chunks/chunk-
|
|
16
|
+
import "./chunks/chunk-3C5UXR2U.js";
|
|
17
|
+
import "./chunks/chunk-MAUEPAMG.js";
|
|
18
18
|
import "./chunks/chunk-7GBL7SJY.js";
|
|
19
19
|
import "./chunks/chunk-3ZZSX5HN.js";
|
|
20
20
|
import "./chunks/chunk-AB35TJST.js";
|
package/dist/pipeline.js
CHANGED
|
@@ -11,12 +11,13 @@ import {
|
|
|
11
11
|
forceLayout,
|
|
12
12
|
layoutExtent,
|
|
13
13
|
loadGraph
|
|
14
|
-
} from "./chunks/chunk-
|
|
15
|
-
import "./chunks/chunk-IGVV37VI.js";
|
|
14
|
+
} from "./chunks/chunk-5OIVTEF7.js";
|
|
16
15
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
16
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
17
17
|
import "./chunks/chunk-OCMBULGN.js";
|
|
18
18
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
19
19
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
20
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
20
21
|
import "./chunks/chunk-ES2N6V56.js";
|
|
21
22
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
22
23
|
import "./chunks/chunk-BPLIXMH7.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Graph } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A graph as typed arrays, the shape a worker can hand across postMessage
|
|
4
|
+
* without copying: what a GFA of S lines tagged LN/SN/SO/SR, L lines and W
|
|
5
|
+
* lines states, with every link end and walk step an index into the node
|
|
6
|
+
* table. `graphFromTables` builds the Graph that converting that GFA builds,
|
|
7
|
+
* and `graphTablesGFA` writes the GFA.
|
|
8
|
+
*/
|
|
9
|
+
export interface GraphTables {
|
|
10
|
+
nodes: {
|
|
11
|
+
names: string[];
|
|
12
|
+
lengths: Int32Array;
|
|
13
|
+
refs: Int32Array;
|
|
14
|
+
starts: Float64Array;
|
|
15
|
+
ranks: Int32Array;
|
|
16
|
+
refNames: string[];
|
|
17
|
+
};
|
|
18
|
+
links: {
|
|
19
|
+
from: Int32Array;
|
|
20
|
+
to: Int32Array;
|
|
21
|
+
strands: Uint8Array;
|
|
22
|
+
};
|
|
23
|
+
walks: {
|
|
24
|
+
names: string[];
|
|
25
|
+
starts: Float64Array;
|
|
26
|
+
ends: Float64Array;
|
|
27
|
+
offsets: Int32Array;
|
|
28
|
+
steps: Int32Array;
|
|
29
|
+
reversed: Uint8Array;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Graph `convertGFAToGraph` builds from `graphTablesGFA(tables)`, deep
|
|
34
|
+
* equal, built by index: a step costs a few array reads and its visit, where
|
|
35
|
+
* the text costs a string and several map lookups.
|
|
36
|
+
*/
|
|
37
|
+
export declare function graphFromTables({ nodes: n, links: l, walks: w }: GraphTables, name?: string): Graph;
|
|
38
|
+
/**
|
|
39
|
+
* The tables as GFA text: S lines in table order, then L lines, then W lines
|
|
40
|
+
*/
|
|
41
|
+
export declare function graphTablesGFA({ nodes, links, walks }: GraphTables): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export { BUBBLE_KIND_COLORS, BUBBLE_KIND_NAMES, bubbleSegmentIds, classifyBubble
|
|
|
68
68
|
export { bubbleSubgraph } from './bubbles/popBubble.js';
|
|
69
69
|
export type { MinigraphBubble } from './bubbles/bubbleLine.js';
|
|
70
70
|
export { filterSamples, walkRows } from './layout/walkRows.js';
|
|
71
|
-
export type { WalkAxis, WalkRow, WalkRows, WalkRun } from './layout/walkRows.js';
|
|
71
|
+
export type { WalkAxis, WalkRow, WalkRows, WalkRun, WalkStop, } from './layout/walkRows.js';
|
|
72
72
|
export { BAR_PX as WALK_BAR_PX, CALL_TICK as WALK_CALL_TICK, DISAGREES as WALK_DISAGREES, GAP_PX as WALK_GAP_PX, GENE_INK as WALK_GENE_INK, OFF_REFERENCE as WALK_OFF_REFERENCE, ON_REFERENCE as WALK_ON_REFERENCE, OUTSIDE_CUT as WALK_OUTSIDE_CUT, UNBACKED_TICK as WALK_UNBACKED_TICK, alongRow, callTickInk, coalesceRuns, genesOnRow, placeRowGenes, readoutPlacement, rowGeneBoxes, rowPitch, rowSpan, runPaint, unitTicks, walkRowReadout, walkRowsKey, walkRowsKeyTree, walkRowsTree, } from './layout/walkRowDraw.js';
|
|
73
73
|
export type { GeneBox, GeneGaps, KeyEntry, KeySwatch, ReadoutCall, RowGene, RowPitch, WalkRowsFrame, WalkRowsWithCalls, } from './layout/walkRowDraw.js';
|
|
74
74
|
export { LABELLED_ROW_PX, WALK_STRIP_CEILING_PX, segmentAt, stripGeneGaps, stripMarks, stripRowAt, walkMarksTree, walkStripFrame, walkStripLabelsTree, } from './layout/walkStrip.js';
|
|
@@ -91,6 +91,8 @@ export { LABEL_CHAR_PX, LABEL_PAD, LABEL_PX } from './overlayLabels.js';
|
|
|
91
91
|
export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment, } from './types.js';
|
|
92
92
|
export { cutWindowGFA, haplotypeWanted, referencePathQuery, referenceSamplesOf, resolveReferenceSample, } from './gbzWindow.js';
|
|
93
93
|
export type { GbzWindowOptions } from './gbzWindow.js';
|
|
94
|
+
export { graphFromTables, graphTablesGFA } from './gfa/graphTables.js';
|
|
95
|
+
export type { GraphTables } from './gfa/graphTables.js';
|
|
94
96
|
export { engineKey } from './pipeline.js';
|
|
95
97
|
export { axisScaleOf, contains, padded, screenToLayout, viewportOf, zoomAbout, } from './viewport.js';
|
|
96
98
|
export type { PaneTransform } from './viewport.js';
|
|
@@ -14,7 +14,7 @@ export interface ReadoutCall {
|
|
|
14
14
|
spanningReads?: number;
|
|
15
15
|
agrees?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete'>, reference: Pick<WalkRow, 'bp'> | undefined, unit?: number, call?: ReadoutCall): string;
|
|
17
|
+
export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete' | 'stop'>, reference: Pick<WalkRow, 'bp'> | undefined, unit?: number, call?: ReadoutCall): string;
|
|
18
18
|
export declare function readoutPlacement(text: string, endX: number, width: number): {
|
|
19
19
|
x: number;
|
|
20
20
|
anchor: "start";
|
|
@@ -12,6 +12,10 @@ export interface WalkAxis {
|
|
|
12
12
|
start: number;
|
|
13
13
|
reversed: boolean;
|
|
14
14
|
}
|
|
15
|
+
export interface WalkStop {
|
|
16
|
+
contigEnds: boolean;
|
|
17
|
+
shortBp: number;
|
|
18
|
+
}
|
|
15
19
|
export interface WalkRow {
|
|
16
20
|
name: string;
|
|
17
21
|
label: string;
|
|
@@ -21,6 +25,7 @@ export interface WalkRow {
|
|
|
21
25
|
offReferenceBp: number;
|
|
22
26
|
gapBp: number;
|
|
23
27
|
complete: boolean;
|
|
28
|
+
stop?: WalkStop;
|
|
24
29
|
runs: WalkRun[];
|
|
25
30
|
axis?: WalkAxis;
|
|
26
31
|
}
|
package/dist/types/pipeline.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BubbleSpread } from './bubbleSpreads.js';
|
|
2
|
+
import type { GraphTables } from './gfa/graphTables.js';
|
|
2
3
|
import type { LayoutScaling } from './layout/drawnScale.js';
|
|
3
4
|
import type { LayoutNode } from './layout/referenceSeeds.js';
|
|
4
5
|
import type { LayoutEngineKind } from './layoutEngines.js';
|
|
@@ -9,7 +10,7 @@ export interface Bounds {
|
|
|
9
10
|
maxX: number;
|
|
10
11
|
maxY: number;
|
|
11
12
|
}
|
|
12
|
-
export declare function loadGraph(
|
|
13
|
+
export declare function loadGraph(source: string | GraphTables, name: string, opts?: {
|
|
13
14
|
referencePath?: string;
|
|
14
15
|
maxNodes?: number;
|
|
15
16
|
}): Graph;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.0
|
|
1
|
+
export declare const version = "8.2.0";
|
package/dist/version.js
CHANGED
package/dist/viewport.js
CHANGED
|
@@ -5,13 +5,14 @@ import {
|
|
|
5
5
|
screenToLayout,
|
|
6
6
|
viewportOf,
|
|
7
7
|
zoomAbout
|
|
8
|
-
} from "./chunks/chunk-
|
|
9
|
-
import "./chunks/chunk-
|
|
10
|
-
import "./chunks/chunk-IGVV37VI.js";
|
|
8
|
+
} from "./chunks/chunk-TL4B342F.js";
|
|
9
|
+
import "./chunks/chunk-5OIVTEF7.js";
|
|
11
10
|
import "./chunks/chunk-PUG7LXDF.js";
|
|
11
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
12
12
|
import "./chunks/chunk-OCMBULGN.js";
|
|
13
13
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
14
14
|
import "./chunks/chunk-CDLPYR5O.js";
|
|
15
|
+
import "./chunks/chunk-OA7RIMZ2.js";
|
|
15
16
|
import "./chunks/chunk-ES2N6V56.js";
|
|
16
17
|
import "./chunks/chunk-ST2IBUAN.js";
|
|
17
18
|
import "./chunks/chunk-BPLIXMH7.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/bandage-core",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "Pangenome graph layout and drawing with no host: GFA in, the Bandage force-directed engine and reference-anchored layouts, a Canvas2D renderer, hit testing and labels out",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|