@jbrowse/bandage-core 11.1.0 → 11.3.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 +4 -2
- package/dist/chunks/{chunk-ZUL52ZX2.js → chunk-3HGYGISG.js} +4 -4
- package/dist/chunks/{chunk-LMH5KVJZ.js → chunk-3LZ334X4.js} +1 -1
- package/dist/chunks/{chunk-V5MAL7LU.js → chunk-7O7EGTYG.js} +1 -1
- package/dist/chunks/{chunk-3XSRT7RQ.js → chunk-B5ARSBOH.js} +36 -30
- package/dist/chunks/{chunk-RNYPCQZ3.js → chunk-BXLLMWC3.js} +1 -1
- package/dist/chunks/{chunk-AI5PTOSV.js → chunk-CE6ZIKJX.js} +1 -1
- package/dist/chunks/{chunk-W6EXQDV5.js → chunk-EFD753MS.js} +1 -1
- package/dist/chunks/chunk-JDZ5GTZT.js +20 -0
- package/dist/chunks/chunk-M75QPZNJ.js +502 -0
- package/dist/chunks/{chunk-IZ6Y5D23.js → chunk-PNM6Z3IE.js} +1 -1
- package/dist/chunks/{chunk-KDU4EF66.js → chunk-REOWLPH4.js} +1 -1
- package/dist/chunks/{chunk-JFHYG25O.js → chunk-RNNYRNDU.js} +10 -10
- package/dist/chunks/{chunk-OI4YVAMM.js → chunk-SLDCKMIP.js} +6 -6
- package/dist/chunks/{chunk-IVOK5V3H.js → chunk-T35BSLW5.js} +3 -3
- package/dist/chunks/{chunk-NGUM77EP.js → chunk-TEXAKEJX.js} +2 -2
- package/dist/chunks/{chunk-RETNT73O.js → chunk-TJOOHTJ6.js} +1 -1
- package/dist/chunks/{chunk-YHJ5JLBI.js → chunk-TZLEHZVC.js} +8 -4
- package/dist/chunks/chunk-UFUSPK2A.js +227 -0
- package/dist/chunks/{chunk-Y3FDMDNT.js → chunk-XEWPWCML.js} +1 -1
- package/dist/cli/figure.js +16 -15
- package/dist/cli/fold.js +2 -2
- package/dist/figure.js +13 -12
- package/dist/figureData.js +12 -11
- package/dist/figureScene.js +7 -6
- package/dist/figureSettings.js +3 -3
- package/dist/gfa/graphTables.js +7 -3
- package/dist/index.js +47 -27
- package/dist/layout/forceCache.js +3 -3
- package/dist/layout/tubeMapLayout.js +4 -2
- package/dist/layout/walkRowLayout.js +6 -2
- package/dist/layout/walkRowLinks.js +12 -0
- package/dist/layout/walkRowRuns.js +20 -0
- package/dist/layout/walkRows.js +5 -2
- package/dist/layout/walkStrip.js +5 -3
- package/dist/layoutModes.js +6 -4
- package/dist/pipeline.js +2 -2
- package/dist/tubeMap/bundle.js +5 -3
- package/dist/tubeMap/coarsen.js +5 -3
- package/dist/tubeMap/deviations.js +5 -3
- package/dist/tubeMap/draw.js +5 -3
- package/dist/types/gfa/graphTables.d.ts +10 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/types/layout/walkRowLayout.d.ts +4 -0
- package/dist/types/layout/walkRowLinks.d.ts +32 -0
- package/dist/types/layout/walkRowRuns.d.ts +56 -0
- package/dist/types/layout/walkRows.d.ts +6 -3
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/chunk-DEDD7TFJ.js +0 -322
package/README.md
CHANGED
|
@@ -61,8 +61,10 @@ against it. An API change lands with the consumer's side on a `core-next` branch
|
|
|
61
61
|
in that repo, which CI tests in place of `main` until the release.
|
|
62
62
|
|
|
63
63
|
Release with `pnpm version patch`: it lints, tests, stamps `src/version.ts`,
|
|
64
|
-
writes the changelog with git-cliff and pushes the `v*` tag
|
|
65
|
-
publishes to npm with trusted publishing
|
|
64
|
+
writes the changelog with git-cliff and pushes the `v*` tag. `publish.yml` then
|
|
65
|
+
runs CI, consumers included, and publishes to npm with trusted publishing only
|
|
66
|
+
if it passes. When a consumer fails, land its side on `core-next` and rerun the
|
|
67
|
+
failed jobs.
|
|
66
68
|
|
|
67
69
|
## See also
|
|
68
70
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MAX_GAP_PX
|
|
3
|
-
} from "./chunk-MYDHU2UV.js";
|
|
4
1
|
import {
|
|
5
2
|
tubeMapMismatches
|
|
6
3
|
} from "./chunk-BX4AUMZE.js";
|
|
4
|
+
import {
|
|
5
|
+
MAX_GAP_PX
|
|
6
|
+
} from "./chunk-MYDHU2UV.js";
|
|
7
7
|
import {
|
|
8
8
|
readColor
|
|
9
9
|
} from "./chunk-A7H753BA.js";
|
|
10
10
|
import {
|
|
11
11
|
referenceWalkName
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M75QPZNJ.js";
|
|
13
13
|
import {
|
|
14
14
|
pathOrigin
|
|
15
15
|
} from "./chunk-B5X2RLJG.js";
|
|
@@ -15,6 +15,20 @@ import {
|
|
|
15
15
|
function pLineName(name, start, end) {
|
|
16
16
|
return start === 0 ? name : `${name}:${start}-${end}`;
|
|
17
17
|
}
|
|
18
|
+
function tablePath(w, p) {
|
|
19
|
+
const walkName = w.names[p];
|
|
20
|
+
const fields = panSNFields(walkName);
|
|
21
|
+
const start = w.starts[p];
|
|
22
|
+
return fields ? {
|
|
23
|
+
name: `${fields.sample}#${fields.haplotype}#${fields.contig}`,
|
|
24
|
+
start,
|
|
25
|
+
...fields,
|
|
26
|
+
...stopFields(
|
|
27
|
+
w.before && stopAt(w.before, p),
|
|
28
|
+
w.after && stopAt(w.after, p)
|
|
29
|
+
)
|
|
30
|
+
} : { name: pLineName(walkName, start, w.ends[p]), start };
|
|
31
|
+
}
|
|
18
32
|
function namesByList(lists, names, listCount, pathNames) {
|
|
19
33
|
const starts = new Int32Array(listCount + 1);
|
|
20
34
|
for (const list of lists) {
|
|
@@ -41,10 +55,8 @@ function namesByList(lists, names, listCount, pathNames) {
|
|
|
41
55
|
return out;
|
|
42
56
|
});
|
|
43
57
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
const declared = n.lengths.length;
|
|
47
|
-
const canonical = new Uint8Array(count);
|
|
58
|
+
function tableNodeIds({ nodes: n, links: l, walks: w }) {
|
|
59
|
+
const canonical = new Uint8Array(n.names.length);
|
|
48
60
|
const claim = (node, reversed) => {
|
|
49
61
|
if (canonical[node] === 0) {
|
|
50
62
|
canonical[node] = reversed ? 2 : 1;
|
|
@@ -54,6 +66,17 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
|
|
|
54
66
|
claim(l.from[i], l.strands[i] & 1);
|
|
55
67
|
claim(l.to[i], l.strands[i] & 2);
|
|
56
68
|
}
|
|
69
|
+
const stepCount = w.offsets[w.names.length] ?? 0;
|
|
70
|
+
for (let s = 0; s < stepCount; s++) {
|
|
71
|
+
claim(w.steps[s], w.reversed[s]);
|
|
72
|
+
}
|
|
73
|
+
return n.names.map(
|
|
74
|
+
(segment, i) => `${segment}${canonical[i] === 2 ? "-" : "+"}`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA") {
|
|
78
|
+
const count = n.names.length;
|
|
79
|
+
const declared = n.lengths.length;
|
|
57
80
|
const drawnWalks = [];
|
|
58
81
|
for (let p = 0; p < w.names.length; p++) {
|
|
59
82
|
if (w.offsets[p + 1] > w.offsets[p]) {
|
|
@@ -61,18 +84,10 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
|
|
|
61
84
|
}
|
|
62
85
|
}
|
|
63
86
|
const traversals = new Int32Array(count);
|
|
64
|
-
for (const
|
|
65
|
-
|
|
66
|
-
const node = w.steps[s];
|
|
67
|
-
if (traversals[node] === 0) {
|
|
68
|
-
claim(node, w.reversed[s]);
|
|
69
|
-
}
|
|
70
|
-
traversals[node]++;
|
|
71
|
-
}
|
|
87
|
+
for (const node of w.steps.subarray(0, w.offsets[w.names.length])) {
|
|
88
|
+
traversals[node]++;
|
|
72
89
|
}
|
|
73
|
-
const ids = n
|
|
74
|
-
(segment, i) => `${segment}${canonical[i] === 2 ? "-" : "+"}`
|
|
75
|
-
);
|
|
90
|
+
const ids = tableNodeIds({ nodes: n, links: l, walks: w });
|
|
76
91
|
const nodes = [];
|
|
77
92
|
for (let i = 0; i < declared; i++) {
|
|
78
93
|
const ref = n.refs[i];
|
|
@@ -168,11 +183,9 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
|
|
|
168
183
|
const edgeNameIndex = /* @__PURE__ */ new Map();
|
|
169
184
|
const edgeNames = [];
|
|
170
185
|
for (const p of drawnWalks) {
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
const visitName = fields ? `${fields.sample}#${fields.haplotype}#${fields.contig}` : walkName;
|
|
175
|
-
const pathName = fields ? visitName : pLineName(walkName, start, w.ends[p]);
|
|
186
|
+
const head = tablePath(w, p);
|
|
187
|
+
const { start, name: pathName } = head;
|
|
188
|
+
const visitName = head.sample === void 0 ? w.names[p] : pathName;
|
|
176
189
|
let named = nameIndex.get(visitName);
|
|
177
190
|
if (named === void 0) {
|
|
178
191
|
named = pathNames.length;
|
|
@@ -214,16 +227,7 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
|
|
|
214
227
|
}
|
|
215
228
|
prev = node;
|
|
216
229
|
}
|
|
217
|
-
paths.push({
|
|
218
|
-
name: pathName,
|
|
219
|
-
nodeIds,
|
|
220
|
-
start,
|
|
221
|
-
...fields,
|
|
222
|
-
...fields ? stopFields(
|
|
223
|
-
w.before && stopAt(w.before, p),
|
|
224
|
-
w.after && stopAt(w.after, p)
|
|
225
|
-
) : {}
|
|
226
|
-
});
|
|
230
|
+
paths.push({ ...head, nodeIds });
|
|
227
231
|
anchorPaths.push({
|
|
228
232
|
name: visitName,
|
|
229
233
|
sample: visitSample,
|
|
@@ -293,6 +297,8 @@ function graphTablesGFA({ nodes, links, walks }) {
|
|
|
293
297
|
}
|
|
294
298
|
|
|
295
299
|
export {
|
|
300
|
+
tablePath,
|
|
301
|
+
tableNodeIds,
|
|
296
302
|
graphFromTables,
|
|
297
303
|
graphTablesGFA
|
|
298
304
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
walkRowRuns,
|
|
3
|
+
walkRowsOf
|
|
4
|
+
} from "./chunk-M75QPZNJ.js";
|
|
5
|
+
|
|
6
|
+
// src/layout/walkRows.ts
|
|
7
|
+
function filterSamples(rows, samples) {
|
|
8
|
+
return samples ? rows.filter((r) => samples.includes(r.sample)).sort(
|
|
9
|
+
(a, b) => samples.indexOf(a.sample) - samples.indexOf(b.sample) || a.label.localeCompare(b.label)
|
|
10
|
+
) : rows;
|
|
11
|
+
}
|
|
12
|
+
function walkRows(graph, region, unit, o = {}) {
|
|
13
|
+
const runs = walkRowRuns(graph, region, o);
|
|
14
|
+
return runs && walkRowsOf(runs, unit);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
filterSamples,
|
|
19
|
+
walkRows
|
|
20
|
+
};
|