@jbrowse/bandage-core 10.1.0 → 10.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/chunks/{chunk-YPYWYPHX.js → chunk-AFP3NWSL.js} +42 -13
- package/dist/chunks/{chunk-VIERZJO2.js → chunk-CPVZGVDL.js} +2 -2
- package/dist/chunks/{chunk-FLUQODT2.js → chunk-DT2GGH4D.js} +1 -1
- package/dist/chunks/{chunk-CFPER2S2.js → chunk-EDR4CGCQ.js} +1 -1
- package/dist/chunks/{chunk-MZIOBJZB.js → chunk-M3NPTHSE.js} +1 -1
- package/dist/cli/figure.js +3 -3
- package/dist/cli/fold.js +1 -1
- package/dist/figure.js +2 -2
- package/dist/figureData.js +3 -3
- package/dist/foldVariants.js +1 -1
- package/dist/index.js +4 -4
- package/dist/layoutEngines.js +1 -1
- package/dist/types/layoutEngines.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ function foldVariants(graph, belowBp) {
|
|
|
10
10
|
if (!(belowBp > 0) || graph.paths?.length || !graph.nodes.some((node) => isBackbone(node))) {
|
|
11
11
|
return graph;
|
|
12
12
|
}
|
|
13
|
-
const { nodes, edges } = graph;
|
|
13
|
+
const { nodes, edges } = readForward(graph);
|
|
14
14
|
const index = new Map(nodes.map((node, i) => [node.id, i]));
|
|
15
15
|
const sides = edges.map(forwardSides);
|
|
16
16
|
const links = linksAt(nodes.length, edges, sides, index);
|
|
@@ -47,7 +47,34 @@ function foldVariants(graph, belowBp) {
|
|
|
47
47
|
const skip = skipped(nodes[a], sides[k].from, nodes[b], sides[k].to);
|
|
48
48
|
return kept[a] && kept[b] && !(skip > 0 && skip < belowBp);
|
|
49
49
|
});
|
|
50
|
-
return mergeAlleleRuns({ ...graph, edges: keptEdges }, kept, allele);
|
|
50
|
+
return mergeAlleleRuns({ ...graph, nodes, edges: keptEdges }, kept, allele);
|
|
51
|
+
}
|
|
52
|
+
function readForward({ nodes, edges }) {
|
|
53
|
+
const reversed = new Set(
|
|
54
|
+
nodes.filter((node) => node.stable?.strand === "-").map((node) => node.id)
|
|
55
|
+
);
|
|
56
|
+
if (reversed.size === 0) {
|
|
57
|
+
return { nodes, edges };
|
|
58
|
+
}
|
|
59
|
+
const read = (id, strand) => {
|
|
60
|
+
const own = strand ?? ownStrand(id);
|
|
61
|
+
return reversed.has(id) ? complement(own) : own;
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
nodes: nodes.map(
|
|
65
|
+
(node) => reversed.has(node.id) ? { ...node, stable: { ...node.stable, strand: "+" } } : node
|
|
66
|
+
),
|
|
67
|
+
edges: edges.map(
|
|
68
|
+
(edge) => reversed.has(edge.from) || reversed.has(edge.to) ? {
|
|
69
|
+
...edge,
|
|
70
|
+
fromStrand: read(edge.from, edge.fromStrand),
|
|
71
|
+
toStrand: read(edge.to, edge.toStrand)
|
|
72
|
+
} : edge
|
|
73
|
+
)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function complement(strand) {
|
|
77
|
+
return strand === "+" ? "-" : "+";
|
|
51
78
|
}
|
|
52
79
|
function forwardSides(edge) {
|
|
53
80
|
return {
|
|
@@ -61,8 +88,9 @@ function linksAt(count, edges, sides, index) {
|
|
|
61
88
|
const a = index.get(edge.from);
|
|
62
89
|
const b = index.get(edge.to);
|
|
63
90
|
if (a !== void 0 && b !== void 0) {
|
|
64
|
-
|
|
65
|
-
links[
|
|
91
|
+
const { from, to } = sides[k];
|
|
92
|
+
links[a].push({ other: b, side: from, otherSide: to });
|
|
93
|
+
links[b].push({ other: a, side: to, otherSide: from });
|
|
66
94
|
}
|
|
67
95
|
});
|
|
68
96
|
return links;
|
|
@@ -74,11 +102,11 @@ function onOneSequence(a, b) {
|
|
|
74
102
|
}
|
|
75
103
|
function continues(a, aSide, b, bSide) {
|
|
76
104
|
const pair = onOneSequence(a, b);
|
|
77
|
-
if (!pair
|
|
105
|
+
if (!pair) {
|
|
78
106
|
return false;
|
|
79
107
|
}
|
|
80
108
|
const [sa, sb] = pair;
|
|
81
|
-
return sa.start + a.length === sb.start || sb.start + b.length === sa.start;
|
|
109
|
+
return aSide === "e" && bSide === "s" && sa.start + a.length === sb.start || bSide === "e" && aSide === "s" && sb.start + b.length === sa.start;
|
|
82
110
|
}
|
|
83
111
|
function skipped(a, aSide, b, bSide) {
|
|
84
112
|
const pair = onOneSequence(a, b);
|
|
@@ -86,10 +114,10 @@ function skipped(a, aSide, b, bSide) {
|
|
|
86
114
|
return 0;
|
|
87
115
|
}
|
|
88
116
|
const [sa, sb] = pair;
|
|
89
|
-
return Math.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
return Math.abs(position(sb, b, bSide) - position(sa, a, aSide));
|
|
118
|
+
}
|
|
119
|
+
function position({ start }, node, side) {
|
|
120
|
+
return side === "s" ? start : start + node.length;
|
|
93
121
|
}
|
|
94
122
|
function alleleOf(nodes, edges, sides, index) {
|
|
95
123
|
const parent = nodes.map((_, i) => i);
|
|
@@ -132,13 +160,14 @@ function alleleContent(group, nodes, links, allele) {
|
|
|
132
160
|
let oneSequence = true;
|
|
133
161
|
for (const i of group) {
|
|
134
162
|
length += nodes[i].length;
|
|
135
|
-
for (const { other } of links[i]) {
|
|
163
|
+
for (const { other, otherSide } of links[i]) {
|
|
136
164
|
const node = nodes[other];
|
|
137
165
|
if (allele[other] !== allele[i] && isBackbone(node)) {
|
|
138
166
|
refName ??= node.stable.refName;
|
|
139
167
|
oneSequence &&= node.stable.refName === refName;
|
|
140
|
-
|
|
141
|
-
|
|
168
|
+
const at = position(node.stable, node, otherSide);
|
|
169
|
+
lo = Math.min(lo, at);
|
|
170
|
+
hi = Math.max(hi, at);
|
|
142
171
|
}
|
|
143
172
|
}
|
|
144
173
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layoutEngine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DT2GGH4D.js";
|
|
4
4
|
import {
|
|
5
5
|
layoutModeByValue
|
|
6
6
|
} from "./chunk-4R6QNG23.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-LOCJN3BZ.js";
|
|
13
13
|
import {
|
|
14
14
|
version
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-M3NPTHSE.js";
|
|
16
16
|
import {
|
|
17
17
|
axisScaleOf
|
|
18
18
|
} from "./chunk-L5WF4ZPS.js";
|
|
@@ -13,7 +13,7 @@ var LAYOUT_ENGINES = [
|
|
|
13
13
|
{
|
|
14
14
|
value: "stress",
|
|
15
15
|
label: "Stress",
|
|
16
|
-
description: "
|
|
16
|
+
description: "Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference."
|
|
17
17
|
}
|
|
18
18
|
];
|
|
19
19
|
var LAYOUT_ENGINE_VALUES = LAYOUT_ENGINES.map((e) => e.value);
|
package/dist/cli/figure.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../chunks/chunk-BXEPA4KS.js";
|
|
7
7
|
import {
|
|
8
8
|
figureSvg
|
|
9
|
-
} from "../chunks/chunk-
|
|
9
|
+
} from "../chunks/chunk-EDR4CGCQ.js";
|
|
10
10
|
import "../chunks/chunk-47DYCZOK.js";
|
|
11
11
|
import "../chunks/chunk-RPDXZLCG.js";
|
|
12
12
|
import "../chunks/chunk-WBCOREDZ.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
LAYOUT_ENGINE_VALUES,
|
|
27
27
|
isLayoutEngineKind,
|
|
28
28
|
layoutEngine
|
|
29
|
-
} from "../chunks/chunk-
|
|
29
|
+
} from "../chunks/chunk-DT2GGH4D.js";
|
|
30
30
|
import {
|
|
31
31
|
LAYOUT_MODES,
|
|
32
32
|
layoutModeByValue
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
import "../chunks/chunk-Q7LYHGGQ.js";
|
|
51
51
|
import "../chunks/chunk-WSIFAZU7.js";
|
|
52
52
|
import "../chunks/chunk-LOCJN3BZ.js";
|
|
53
|
-
import "../chunks/chunk-
|
|
53
|
+
import "../chunks/chunk-M3NPTHSE.js";
|
|
54
54
|
import "../chunks/chunk-L5WF4ZPS.js";
|
|
55
55
|
import "../chunks/chunk-R456ME6J.js";
|
|
56
56
|
import "../chunks/chunk-ALDGONEI.js";
|
package/dist/cli/fold.js
CHANGED
package/dist/figure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureSvg
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-EDR4CGCQ.js";
|
|
4
4
|
import "./chunks/chunk-47DYCZOK.js";
|
|
5
5
|
import "./chunks/chunk-RPDXZLCG.js";
|
|
6
6
|
import "./chunks/chunk-WBCOREDZ.js";
|
|
@@ -14,7 +14,7 @@ import "./chunks/chunk-FP4H7SFT.js";
|
|
|
14
14
|
import "./chunks/chunk-MLSWIMZO.js";
|
|
15
15
|
import "./chunks/chunk-NNODIW4U.js";
|
|
16
16
|
import "./chunks/chunk-LOCJN3BZ.js";
|
|
17
|
-
import "./chunks/chunk-
|
|
17
|
+
import "./chunks/chunk-M3NPTHSE.js";
|
|
18
18
|
import "./chunks/chunk-L5WF4ZPS.js";
|
|
19
19
|
import "./chunks/chunk-R456ME6J.js";
|
|
20
20
|
import "./chunks/chunk-ALDGONEI.js";
|
package/dist/figureData.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureData,
|
|
3
3
|
gfaFigureData
|
|
4
|
-
} from "./chunks/chunk-
|
|
5
|
-
import "./chunks/chunk-
|
|
4
|
+
} from "./chunks/chunk-CPVZGVDL.js";
|
|
5
|
+
import "./chunks/chunk-DT2GGH4D.js";
|
|
6
6
|
import "./chunks/chunk-4R6QNG23.js";
|
|
7
7
|
import "./chunks/chunk-LOEA5IHZ.js";
|
|
8
8
|
import "./chunks/chunk-DK5P2YOL.js";
|
|
@@ -17,7 +17,7 @@ import "./chunks/chunk-FLFBYSJO.js";
|
|
|
17
17
|
import "./chunks/chunk-Q7LYHGGQ.js";
|
|
18
18
|
import "./chunks/chunk-WSIFAZU7.js";
|
|
19
19
|
import "./chunks/chunk-LOCJN3BZ.js";
|
|
20
|
-
import "./chunks/chunk-
|
|
20
|
+
import "./chunks/chunk-M3NPTHSE.js";
|
|
21
21
|
import "./chunks/chunk-L5WF4ZPS.js";
|
|
22
22
|
import "./chunks/chunk-R456ME6J.js";
|
|
23
23
|
import "./chunks/chunk-ALDGONEI.js";
|
package/dist/foldVariants.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
} from "./chunks/chunk-AZFVORTC.js";
|
|
88
88
|
import {
|
|
89
89
|
figureSvg
|
|
90
|
-
} from "./chunks/chunk-
|
|
90
|
+
} from "./chunks/chunk-EDR4CGCQ.js";
|
|
91
91
|
import {
|
|
92
92
|
svgCanvas
|
|
93
93
|
} from "./chunks/chunk-47DYCZOK.js";
|
|
@@ -168,11 +168,11 @@ import {
|
|
|
168
168
|
import {
|
|
169
169
|
figureData,
|
|
170
170
|
gfaFigureData
|
|
171
|
-
} from "./chunks/chunk-
|
|
171
|
+
} from "./chunks/chunk-CPVZGVDL.js";
|
|
172
172
|
import {
|
|
173
173
|
LAYOUT_ENGINES,
|
|
174
174
|
layoutEngine
|
|
175
|
-
} from "./chunks/chunk-
|
|
175
|
+
} from "./chunks/chunk-DT2GGH4D.js";
|
|
176
176
|
import {
|
|
177
177
|
FORCE_LAYOUT_LABEL,
|
|
178
178
|
LAYOUT_MODES,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
} from "./chunks/chunk-LOCJN3BZ.js";
|
|
212
212
|
import {
|
|
213
213
|
version
|
|
214
|
-
} from "./chunks/chunk-
|
|
214
|
+
} from "./chunks/chunk-M3NPTHSE.js";
|
|
215
215
|
import {
|
|
216
216
|
axisScaleOf,
|
|
217
217
|
contains,
|
package/dist/layoutEngines.js
CHANGED
|
@@ -6,7 +6,7 @@ export declare const LAYOUT_ENGINES: readonly [{
|
|
|
6
6
|
}, {
|
|
7
7
|
readonly value: "stress";
|
|
8
8
|
readonly label: "Stress";
|
|
9
|
-
readonly description: "
|
|
9
|
+
readonly description: "Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference.";
|
|
10
10
|
}];
|
|
11
11
|
export type LayoutEngineKind = (typeof LAYOUT_ENGINES)[number]['value'];
|
|
12
12
|
export declare const LAYOUT_ENGINE_VALUES: ("fmmm" | "stress")[];
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "10.
|
|
1
|
+
export declare const version = "10.2.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/bandage-core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.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": {
|