@jbrowse/bandage-core 8.0.1 → 8.1.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-WZATPZNH.js → chunk-5OIVTEF7.js} +9 -6
- package/dist/chunks/{chunk-H5S2ONCJ.js → chunk-6VBDMZBZ.js} +1 -1
- package/dist/chunks/{chunk-MRZ7CFBN.js → chunk-DYYIHN3P.js} +3 -3
- package/dist/chunks/chunk-OA7RIMZ2.js +211 -0
- package/dist/chunks/{chunk-72N5DJHZ.js → chunk-OCMBULGN.js} +48 -23
- package/dist/chunks/{chunk-XVSBZ4ZW.js → chunk-SKKYLBRA.js} +1 -1
- package/dist/chunks/{chunk-V5W5E3UN.js → chunk-T4SQ5QGM.js} +1 -1
- package/dist/chunks/{chunk-4UBWXZVX.js → chunk-TL4B342F.js} +1 -1
- package/dist/cli/figure.js +9 -8
- package/dist/figure.js +7 -6
- package/dist/figureSettings.js +5 -4
- package/dist/gfa/gfaConverter.js +1 -1
- package/dist/gfa/graphTables.js +9 -0
- package/dist/index.js +16 -10
- package/dist/layout/forceCache.js +5 -4
- package/dist/layoutModes.js +2 -2
- package/dist/pipeline.js +4 -3
- package/dist/types/gfa/graphTables.d.ts +41 -0
- package/dist/types/index.d.ts +2 -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 +5 -4
- package/package.json +1 -1
- package/dist/chunks/{chunk-ZJQ6H3AR.js → chunk-3PYY7OIP.js} +3 -3
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
|
-
} from "./chunk-
|
|
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) {
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
} from "./chunk-HBEKUQO4.js";
|
|
43
43
|
import {
|
|
44
44
|
version
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-T4SQ5QGM.js";
|
|
46
46
|
import {
|
|
47
47
|
axisScaleOf
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TL4B342F.js";
|
|
49
49
|
import {
|
|
50
50
|
walkRowLabels,
|
|
51
51
|
walkRowsExtent
|
|
@@ -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
|
|
@@ -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
|
+
};
|
|
@@ -16,8 +16,11 @@ function surveySegments(gfaGraph) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
function traverse(id, strand) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const seen = traversals.get(id);
|
|
20
|
+
if (seen === void 0) {
|
|
21
|
+
claim(id, strand);
|
|
22
|
+
}
|
|
23
|
+
traversals.set(id, (seen ?? 0) + 1);
|
|
21
24
|
}
|
|
22
25
|
for (const link of gfaGraph.links) {
|
|
23
26
|
claim(link.source, link.strand1 === "-" ? "-" : "+");
|
|
@@ -36,6 +39,7 @@ function surveySegments(gfaGraph) {
|
|
|
36
39
|
return { canonical, traversals };
|
|
37
40
|
}
|
|
38
41
|
var walkStart = (w) => w.start === -1 ? 0 : w.start;
|
|
42
|
+
var stranded = (s) => s.strand === "+" || s.strand === "-";
|
|
39
43
|
function anchorablePaths(gfaGraph) {
|
|
40
44
|
return [
|
|
41
45
|
...gfaGraph.paths.map((p) => ({
|
|
@@ -48,7 +52,7 @@ function anchorablePaths(gfaGraph) {
|
|
|
48
52
|
...gfaGraph.walks.map((w) => ({
|
|
49
53
|
name: `${w.sample}#${w.haplotype}#${w.contig}`,
|
|
50
54
|
start: walkStart(w),
|
|
51
|
-
steps: w.segments.map((s) => ({
|
|
55
|
+
steps: w.segments.every(stranded) ? w.segments : w.segments.map((s) => ({
|
|
52
56
|
id: s.id,
|
|
53
57
|
strand: s.strand === "-" ? "-" : "+"
|
|
54
58
|
}))
|
|
@@ -82,7 +86,15 @@ function convertGFAToGraph(gfaGraph, name = "Imported GFA") {
|
|
|
82
86
|
const nodes = [];
|
|
83
87
|
const edges = [];
|
|
84
88
|
const { canonical, traversals } = surveySegments(gfaGraph);
|
|
85
|
-
const
|
|
89
|
+
const nodeIds = /* @__PURE__ */ new Map();
|
|
90
|
+
const nodeId = (segmentId) => {
|
|
91
|
+
let id = nodeIds.get(segmentId);
|
|
92
|
+
if (id === void 0) {
|
|
93
|
+
id = `${segmentId}${canonical.get(segmentId) ?? "+"}`;
|
|
94
|
+
nodeIds.set(segmentId, id);
|
|
95
|
+
}
|
|
96
|
+
return id;
|
|
97
|
+
};
|
|
86
98
|
for (const gfaNode of gfaGraph.nodes) {
|
|
87
99
|
const depth = statedDepth(gfaNode) ?? Math.max(traversals.get(gfaNode.id) ?? 1, 1);
|
|
88
100
|
nodes.push(makeNode(gfaNode, canonical.get(gfaNode.id) ?? "+", depth));
|
|
@@ -96,45 +108,58 @@ function convertGFAToGraph(gfaGraph, name = "Imported GFA") {
|
|
|
96
108
|
});
|
|
97
109
|
}
|
|
98
110
|
const paths = [];
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
const pathsByPair = /* @__PURE__ */ new Map();
|
|
112
|
+
const pairPaths = (a, b) => pathsByPair.get(a)?.get(b);
|
|
113
|
+
function addPair(a, b, set) {
|
|
114
|
+
let to = pathsByPair.get(a);
|
|
115
|
+
if (!to) {
|
|
116
|
+
to = /* @__PURE__ */ new Map();
|
|
117
|
+
pathsByPair.set(a, to);
|
|
118
|
+
}
|
|
119
|
+
to.set(b, set);
|
|
120
|
+
}
|
|
121
|
+
const edgePaths = edges.map((edge) => {
|
|
122
|
+
let set = pairPaths(edge.from, edge.to);
|
|
123
|
+
if (!set) {
|
|
124
|
+
set = /* @__PURE__ */ new Set();
|
|
125
|
+
addPair(edge.from, edge.to, set);
|
|
126
|
+
addPair(edge.to, edge.from, set);
|
|
127
|
+
}
|
|
128
|
+
return set;
|
|
129
|
+
});
|
|
130
|
+
function recordPathEdges(nodeIds2, name2) {
|
|
131
|
+
for (let i = 0; i < nodeIds2.length - 1; i++) {
|
|
132
|
+
pairPaths(nodeIds2[i], nodeIds2[i + 1])?.add(name2);
|
|
108
133
|
}
|
|
109
134
|
}
|
|
110
135
|
for (const gfaPath of gfaGraph.paths) {
|
|
111
|
-
const
|
|
136
|
+
const nodeIds2 = gfaPath.path.split(",").map((segment) => nodeId(segment.slice(0, -1)));
|
|
112
137
|
paths.push({
|
|
113
138
|
name: gfaPath.name,
|
|
114
|
-
nodeIds,
|
|
139
|
+
nodeIds: nodeIds2,
|
|
115
140
|
start: pathOrigin(gfaPath.name).start
|
|
116
141
|
});
|
|
117
|
-
recordPathEdges(
|
|
142
|
+
recordPathEdges(nodeIds2, gfaPath.name);
|
|
118
143
|
}
|
|
119
144
|
for (const walk of gfaGraph.walks) {
|
|
120
|
-
const
|
|
145
|
+
const nodeIds2 = walk.segments.map((seg) => nodeId(seg.id));
|
|
121
146
|
const name2 = `${walk.sample}#${walk.haplotype}#${walk.contig}`;
|
|
122
147
|
paths.push({
|
|
123
148
|
name: name2,
|
|
124
|
-
nodeIds,
|
|
149
|
+
nodeIds: nodeIds2,
|
|
125
150
|
start: walkStart(walk),
|
|
126
151
|
sample: walk.sample,
|
|
127
152
|
haplotype: walk.haplotype,
|
|
128
153
|
contig: walk.contig
|
|
129
154
|
});
|
|
130
|
-
recordPathEdges(
|
|
155
|
+
recordPathEdges(nodeIds2, name2);
|
|
131
156
|
}
|
|
132
|
-
|
|
133
|
-
const pathIds =
|
|
134
|
-
if (pathIds
|
|
157
|
+
edges.forEach((edge, i) => {
|
|
158
|
+
const pathIds = edgePaths[i];
|
|
159
|
+
if (pathIds.size > 0) {
|
|
135
160
|
edge.pathIds = [...pathIds];
|
|
136
161
|
}
|
|
137
|
-
}
|
|
162
|
+
});
|
|
138
163
|
const lengths = new Map(gfaGraph.nodes.map((n) => [n.id, n.length]));
|
|
139
164
|
const anchoring = gfaGraph.paths.length > 0 || gfaGraph.walks.length > 0 ? surveyPaths(anchorablePaths(gfaGraph), (id) => lengths.get(id) ?? 0) : void 0;
|
|
140
165
|
return {
|
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-3PYY7OIP.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,7 +35,7 @@ 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-DYYIHN3P.js";
|
|
39
39
|
import "../chunks/chunk-LOCJN3BZ.js";
|
|
40
40
|
import "../chunks/chunk-47DYCZOK.js";
|
|
41
41
|
import "../chunks/chunk-O2ANJQVH.js";
|
|
@@ -53,8 +53,8 @@ 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-
|
|
56
|
+
import "../chunks/chunk-T4SQ5QGM.js";
|
|
57
|
+
import "../chunks/chunk-TL4B342F.js";
|
|
58
58
|
import "../chunks/chunk-MP7LXLWV.js";
|
|
59
59
|
import {
|
|
60
60
|
filterSamples,
|
|
@@ -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";
|
|
86
|
-
import "../chunks/chunk-
|
|
85
|
+
import "../chunks/chunk-IGVV37VI.js";
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureSvg
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-DYYIHN3P.js";
|
|
4
4
|
import "./chunks/chunk-LOCJN3BZ.js";
|
|
5
5
|
import "./chunks/chunk-47DYCZOK.js";
|
|
6
6
|
import "./chunks/chunk-O2ANJQVH.js";
|
|
@@ -15,8 +15,8 @@ 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-
|
|
18
|
+
import "./chunks/chunk-T4SQ5QGM.js";
|
|
19
|
+
import "./chunks/chunk-TL4B342F.js";
|
|
20
20
|
import "./chunks/chunk-MP7LXLWV.js";
|
|
21
21
|
import "./chunks/chunk-SZNZ2T6D.js";
|
|
22
22
|
import "./chunks/chunk-PBENCR5L.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";
|
|
37
|
-
import "./chunks/chunk-
|
|
36
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
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";
|
|
8
|
-
import "./chunks/chunk-
|
|
7
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
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/gfa/gfaConverter.js
CHANGED
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-3PYY7OIP.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-DYYIHN3P.js";
|
|
116
116
|
import {
|
|
117
117
|
layoutGeometryInputs
|
|
118
118
|
} from "./chunks/chunk-LOCJN3BZ.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-T4SQ5QGM.js";
|
|
208
208
|
import {
|
|
209
209
|
axisScaleOf,
|
|
210
210
|
contains,
|
|
@@ -212,7 +212,7 @@ 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
|
|
@@ -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";
|
|
302
|
-
import "./chunks/chunk-
|
|
301
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
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";
|
|
7
|
-
import "../chunks/chunk-
|
|
6
|
+
import "../chunks/chunk-IGVV37VI.js";
|
|
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";
|
package/dist/layoutModes.js
CHANGED
|
@@ -4,10 +4,10 @@ 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-3PYY7OIP.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";
|
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";
|
|
17
|
-
import "./chunks/chunk-
|
|
16
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
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
|
@@ -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';
|
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.1.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";
|
|
12
|
-
import "./chunks/chunk-
|
|
11
|
+
import "./chunks/chunk-IGVV37VI.js";
|
|
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.1.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": {
|
|
@@ -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";
|