@jbrowse/bandage-core 10.3.0 → 11.0.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 +5 -0
- package/dist/bubbles/popBubble.js +2 -2
- package/dist/bubbles/superbubbles.js +3 -3
- package/dist/chunks/{chunk-EHXBZ5JZ.js → chunk-2Q22S52W.js} +1 -1
- package/dist/chunks/{chunk-IYALCKNB.js → chunk-3GP3KT5L.js} +1 -1
- package/dist/chunks/{chunk-A54O52XZ.js → chunk-3UST3ZQE.js} +1 -1
- package/dist/chunks/{chunk-DBLV7PGG.js → chunk-3XSRT7RQ.js} +16 -2
- package/dist/chunks/{chunk-7JGLJK44.js → chunk-5LTZVKZQ.js} +10 -10
- package/dist/chunks/{chunk-PTQPTDZH.js → chunk-6OP4HPXG.js} +1 -1
- package/dist/chunks/{chunk-WONB6LMC.js → chunk-AI5PTOSV.js} +1 -1
- package/dist/chunks/{chunk-LGJBB5BP.js → chunk-B5X2RLJG.js} +9 -1
- package/dist/chunks/{chunk-TCOLHD7N.js → chunk-BIOKXS3M.js} +2 -2
- package/dist/chunks/{chunk-BVYR7IFN.js → chunk-C3NT37C3.js} +24 -3
- package/dist/chunks/{chunk-5YILQTHE.js → chunk-CIDSF47D.js} +29 -9
- package/dist/chunks/{chunk-AMX4OQAW.js → chunk-CTZRIDMY.js} +7 -7
- package/dist/chunks/{chunk-XUT4HXVE.js → chunk-CZT33FZG.js} +8 -8
- package/dist/chunks/{chunk-CGFPFBT2.js → chunk-D4ZFRBB4.js} +11 -2
- package/dist/chunks/{chunk-V7J6U4XC.js → chunk-DO62DG26.js} +1 -1
- package/dist/chunks/{chunk-Z6XZWPXK.js → chunk-DZR37KXT.js} +51 -2
- package/dist/chunks/{chunk-MD5VPXXT.js → chunk-EDWU7OM4.js} +5 -5
- package/dist/chunks/chunk-EIY2SKD3.js +164 -0
- package/dist/chunks/{chunk-A55OZVYX.js → chunk-EY2ZGSCP.js} +2 -2
- package/dist/chunks/{chunk-RWKP7UO4.js → chunk-FFHJGWDK.js} +6 -2
- package/dist/chunks/{chunk-KWHWNOTY.js → chunk-KDU4EF66.js} +4 -4
- package/dist/chunks/{chunk-65ILXEIN.js → chunk-L5IETLWP.js} +5 -5
- package/dist/chunks/{chunk-GIHTHYXY.js → chunk-NMWQUFPF.js} +1 -1
- package/dist/chunks/{chunk-QQCOVMMT.js → chunk-OLKXMZ6J.js} +1 -1
- package/dist/chunks/{chunk-ZNJ4JAPT.js → chunk-PK5QQOMN.js} +3 -3
- package/dist/chunks/{chunk-PPDE4IVT.js → chunk-PNMJFFNB.js} +1 -1
- package/dist/chunks/{chunk-WJ4TIAVA.js → chunk-RNYPCQZ3.js} +1 -1
- package/dist/chunks/{chunk-2XEQR54X.js → chunk-SWCULW6S.js} +1 -1
- package/dist/chunks/{chunk-SHKGYGM4.js → chunk-TEF3NBG3.js} +3 -3
- package/dist/chunks/{chunk-M5NPD55W.js → chunk-TUQKGAK3.js} +1 -1
- package/dist/chunks/{chunk-ZPBEUOBM.js → chunk-W6EXQDV5.js} +1 -1
- package/dist/chunks/{chunk-7XR26JST.js → chunk-XVS52NMZ.js} +1 -1
- package/dist/chunks/{chunk-SZHQK6GL.js → chunk-XZ6PQBU6.js} +59 -13
- package/dist/cli/figure.js +26 -25
- package/dist/cli/fold.js +6 -5
- package/dist/figure.js +20 -19
- package/dist/figureData.js +23 -22
- package/dist/figureScene.js +15 -14
- package/dist/figureSettings.js +7 -6
- package/dist/gbzCut.js +4 -3
- package/dist/gbzWindow.js +3 -2
- package/dist/gfa/gfaConverter.js +3 -2
- package/dist/gfa/gfaTables.js +2 -1
- package/dist/gfa/graphTables.js +2 -1
- package/dist/gfa/walkStops.js +28 -0
- package/dist/index.js +60 -42
- package/dist/layout/forceCache.js +7 -6
- package/dist/layout/trimToWindow.js +1 -1
- package/dist/layout/tubeMapLayout.js +5 -4
- package/dist/layout/walkRowDraw.js +13 -4
- package/dist/layout/walkRowLayout.js +4 -3
- package/dist/layout/walkRows.js +3 -2
- package/dist/layout/walkStrip.js +8 -7
- package/dist/layoutModes.js +8 -7
- package/dist/pathAnchoring.js +1 -1
- package/dist/pathColors.js +2 -2
- package/dist/pipeline.js +6 -5
- package/dist/referenceStrip.js +4 -4
- package/dist/renderer/GeometryBuilder.js +3 -3
- package/dist/tubeMap/bundle.js +6 -5
- package/dist/tubeMap/coarsen.js +6 -5
- package/dist/tubeMap/deviations.js +6 -5
- package/dist/tubeMap/draw.js +5 -4
- package/dist/tubeMap/nodeColors.js +4 -4
- package/dist/types/gfa/graphTables.d.ts +3 -0
- package/dist/types/gfa/walkStops.d.ts +59 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/layout/walkRowDraw.d.ts +14 -1
- package/dist/types/layout/walkRows.d.ts +4 -1
- package/dist/types/types.d.ts +19 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/walkHighlight.d.ts +2 -0
- package/dist/types/walkKey.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +7 -6
- package/dist/walkEncoding.js +4 -4
- package/dist/walkHighlight.js +6 -5
- package/dist/walkKey.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// src/gfa/walkStops.ts
|
|
2
|
+
var START_STOP_TAG = "ws";
|
|
3
|
+
var END_STOP_TAG = "we";
|
|
4
|
+
var STOP_KINDS = ["elsewhere", "break", "end"];
|
|
5
|
+
var GAP_CAUSE_TEXT = {
|
|
6
|
+
missing: "not in the graph",
|
|
7
|
+
elsewhere: "on nodes filed elsewhere",
|
|
8
|
+
unknown: "gap, cause unknown"
|
|
9
|
+
};
|
|
10
|
+
var OUTSIDE_TEXT = "outside the extracted subgraph";
|
|
11
|
+
function gapParts(bp, after, before) {
|
|
12
|
+
if (!after && !before) {
|
|
13
|
+
return [{ bp }];
|
|
14
|
+
}
|
|
15
|
+
const left = Math.min(after?.trimmed ?? 0, bp);
|
|
16
|
+
const right = Math.min(before?.trimmed ?? 0, bp - left);
|
|
17
|
+
let rest = bp - left - right;
|
|
18
|
+
const lead = after?.kind === "break" ? Math.min(after.bp, rest) : 0;
|
|
19
|
+
rest -= lead;
|
|
20
|
+
const trail = before?.kind === "break" ? Math.min(before.bp, rest) : 0;
|
|
21
|
+
rest -= trail;
|
|
22
|
+
const elsewhere = [after, before].find((s) => s?.kind === "elsewhere");
|
|
23
|
+
const parts = [
|
|
24
|
+
{ bp: left },
|
|
25
|
+
{ bp: lead, cause: "missing" },
|
|
26
|
+
elsewhere?.kind === "elsewhere" ? { bp: rest, cause: "elsewhere", chunk: elsewhere.chunk } : { bp: rest, cause: "unknown" },
|
|
27
|
+
{ bp: trail, cause: "missing" },
|
|
28
|
+
{ bp: right }
|
|
29
|
+
];
|
|
30
|
+
return parts.filter((part) => part.bp > 0);
|
|
31
|
+
}
|
|
32
|
+
function stopAt(table, i) {
|
|
33
|
+
const bp = table.bp[i];
|
|
34
|
+
const ref = table.chunkRefs[i];
|
|
35
|
+
return stopOf(
|
|
36
|
+
table.kindNames[table.kinds[i]],
|
|
37
|
+
Number.isNaN(bp) ? void 0 : bp,
|
|
38
|
+
table.trimmed[i],
|
|
39
|
+
ref < 0 ? void 0 : { refName: table.chunkRefNames[ref], start: table.chunkStarts[i] }
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function stopOf(kind, bp, trimmed, chunk) {
|
|
43
|
+
const cut = trimmed > 0 ? { trimmed } : {};
|
|
44
|
+
if (kind === "elsewhere" && chunk) {
|
|
45
|
+
return { kind, chunk, ...bp === void 0 ? {} : { bp }, ...cut };
|
|
46
|
+
}
|
|
47
|
+
if (kind === "break" && bp !== void 0) {
|
|
48
|
+
return { kind, bp, ...chunk ? { chunk } : {}, ...cut };
|
|
49
|
+
}
|
|
50
|
+
return kind === "end" ? { kind, ...cut } : void 0;
|
|
51
|
+
}
|
|
52
|
+
function stopTag(stop) {
|
|
53
|
+
const parts = [stop.kind];
|
|
54
|
+
if ("bp" in stop && stop.bp !== void 0) {
|
|
55
|
+
parts.push(`bp=${stop.bp}`);
|
|
56
|
+
}
|
|
57
|
+
if (stop.trimmed) {
|
|
58
|
+
parts.push(`trimmed=${stop.trimmed}`);
|
|
59
|
+
}
|
|
60
|
+
if ("chunk" in stop && stop.chunk) {
|
|
61
|
+
parts.push(`chunk=${stop.chunk.refName}:${stop.chunk.start}`);
|
|
62
|
+
}
|
|
63
|
+
return parts.join(",");
|
|
64
|
+
}
|
|
65
|
+
function parseStopTag(value) {
|
|
66
|
+
const [kind, ...fields] = value.split(",");
|
|
67
|
+
let bp;
|
|
68
|
+
let trimmed = 0;
|
|
69
|
+
let chunk;
|
|
70
|
+
for (const field of fields) {
|
|
71
|
+
if (field.startsWith("bp=")) {
|
|
72
|
+
bp = +field.slice(3);
|
|
73
|
+
} else if (field.startsWith("trimmed=")) {
|
|
74
|
+
trimmed = +field.slice(8);
|
|
75
|
+
} else if (field.startsWith("chunk=")) {
|
|
76
|
+
const at = field.lastIndexOf(":");
|
|
77
|
+
chunk = { refName: field.slice(6, at), start: +field.slice(at + 1) };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return stopOf(kind, bp, trimmed, chunk);
|
|
81
|
+
}
|
|
82
|
+
function stopFields(before, after) {
|
|
83
|
+
return {
|
|
84
|
+
...before ? { before } : {},
|
|
85
|
+
...after ? { after } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function walkStopFields(tags) {
|
|
89
|
+
const before = tags[START_STOP_TAG];
|
|
90
|
+
const after = tags[END_STOP_TAG];
|
|
91
|
+
return stopFields(
|
|
92
|
+
typeof before === "string" ? parseStopTag(before) : void 0,
|
|
93
|
+
typeof after === "string" ? parseStopTag(after) : void 0
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function walkStopTags(walks, p) {
|
|
97
|
+
const tags = [];
|
|
98
|
+
for (const [tag, table] of [
|
|
99
|
+
[START_STOP_TAG, walks.before],
|
|
100
|
+
[END_STOP_TAG, walks.after]
|
|
101
|
+
]) {
|
|
102
|
+
const stop = table && stopAt(table, p);
|
|
103
|
+
if (stop) {
|
|
104
|
+
tags.push(` ${tag}:Z:${stopTag(stop)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return tags.join("");
|
|
108
|
+
}
|
|
109
|
+
var StopColumns = class {
|
|
110
|
+
constructor() {
|
|
111
|
+
this.kinds = [];
|
|
112
|
+
this.bp = [];
|
|
113
|
+
this.trimmed = [];
|
|
114
|
+
this.chunkRefs = [];
|
|
115
|
+
this.chunkStarts = [];
|
|
116
|
+
this.chunkRefNames = [];
|
|
117
|
+
this.refIndex = /* @__PURE__ */ new Map();
|
|
118
|
+
}
|
|
119
|
+
push(stop) {
|
|
120
|
+
this.kinds.push(STOP_KINDS.indexOf(stop.kind));
|
|
121
|
+
this.bp.push("bp" in stop && stop.bp !== void 0 ? stop.bp : NaN);
|
|
122
|
+
this.trimmed.push(stop.trimmed ?? 0);
|
|
123
|
+
const chunk = "chunk" in stop ? stop.chunk : void 0;
|
|
124
|
+
if (chunk) {
|
|
125
|
+
let ref = this.refIndex.get(chunk.refName);
|
|
126
|
+
if (ref === void 0) {
|
|
127
|
+
ref = this.chunkRefNames.length;
|
|
128
|
+
this.refIndex.set(chunk.refName, ref);
|
|
129
|
+
this.chunkRefNames.push(chunk.refName);
|
|
130
|
+
}
|
|
131
|
+
this.chunkRefs.push(ref);
|
|
132
|
+
this.chunkStarts.push(chunk.start);
|
|
133
|
+
} else {
|
|
134
|
+
this.chunkRefs.push(-1);
|
|
135
|
+
this.chunkStarts.push(NaN);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
table() {
|
|
139
|
+
return {
|
|
140
|
+
kinds: Uint8Array.from(this.kinds),
|
|
141
|
+
kindNames: [...STOP_KINDS],
|
|
142
|
+
bp: Float64Array.from(this.bp),
|
|
143
|
+
trimmed: Float64Array.from(this.trimmed),
|
|
144
|
+
chunkRefs: Int32Array.from(this.chunkRefs),
|
|
145
|
+
chunkStarts: Float64Array.from(this.chunkStarts),
|
|
146
|
+
chunkRefNames: this.chunkRefNames
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
START_STOP_TAG,
|
|
153
|
+
END_STOP_TAG,
|
|
154
|
+
GAP_CAUSE_TEXT,
|
|
155
|
+
OUTSIDE_TEXT,
|
|
156
|
+
gapParts,
|
|
157
|
+
stopAt,
|
|
158
|
+
stopTag,
|
|
159
|
+
parseStopTag,
|
|
160
|
+
stopFields,
|
|
161
|
+
walkStopFields,
|
|
162
|
+
walkStopTags,
|
|
163
|
+
StopColumns
|
|
164
|
+
};
|
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
pathOrigin,
|
|
6
6
|
surveyPaths
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B5X2RLJG.js";
|
|
8
|
+
import {
|
|
9
|
+
walkStopFields
|
|
10
|
+
} from "./chunk-EIY2SKD3.js";
|
|
8
11
|
|
|
9
12
|
// src/gfa/gfaConverter.ts
|
|
10
13
|
function surveySegments(gfaGraph, pathSteps) {
|
|
@@ -152,7 +155,8 @@ function convertGFAToGraph(gfaGraph, name = "Imported GFA") {
|
|
|
152
155
|
start: walkStart(walk),
|
|
153
156
|
sample: walk.sample,
|
|
154
157
|
haplotype: walk.haplotype,
|
|
155
|
-
contig: walk.contig
|
|
158
|
+
contig: walk.contig,
|
|
159
|
+
...walkStopFields(walk.tags)
|
|
156
160
|
});
|
|
157
161
|
recordPathEdges(nodeIds2, name2);
|
|
158
162
|
}
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-VPE4AYP7.js";
|
|
15
15
|
import {
|
|
16
16
|
convertGFAToGraph
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FFHJGWDK.js";
|
|
18
18
|
import {
|
|
19
19
|
parseGFA
|
|
20
20
|
} from "./chunk-5I3K4R2G.js";
|
|
21
21
|
import {
|
|
22
22
|
graphFromTables
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3XSRT7RQ.js";
|
|
24
24
|
import {
|
|
25
25
|
anchorGraph
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-B5X2RLJG.js";
|
|
27
27
|
import {
|
|
28
28
|
gfaTables
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DZR37KXT.js";
|
|
30
30
|
import {
|
|
31
31
|
mergeRuns,
|
|
32
32
|
splitRuns
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
tubeMapMismatches
|
|
3
|
-
} from "./chunk-BX4AUMZE.js";
|
|
4
1
|
import {
|
|
5
2
|
MAX_GAP_PX
|
|
6
3
|
} from "./chunk-MYDHU2UV.js";
|
|
4
|
+
import {
|
|
5
|
+
tubeMapMismatches
|
|
6
|
+
} from "./chunk-BX4AUMZE.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-CIDSF47D.js";
|
|
13
13
|
import {
|
|
14
14
|
pathOrigin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B5X2RLJG.js";
|
|
16
16
|
import {
|
|
17
17
|
pushTo
|
|
18
18
|
} from "./chunk-BSOZW3FC.js";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
} from "./chunk-A7H753BA.js";
|
|
6
6
|
import {
|
|
7
7
|
referenceWalkName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CIDSF47D.js";
|
|
9
9
|
import {
|
|
10
10
|
pathCssColor,
|
|
11
11
|
pathGreyCssColor
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3GP3KT5L.js";
|
|
13
13
|
import {
|
|
14
14
|
pathOrigin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B5X2RLJG.js";
|
|
16
16
|
import {
|
|
17
17
|
ownStrand,
|
|
18
18
|
strandSides
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
boxesGenes,
|
|
4
4
|
rowPitch,
|
|
5
5
|
rowSpan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XZ6PQBU6.js";
|
|
7
7
|
import {
|
|
8
8
|
el
|
|
9
9
|
} from "./chunk-H2H4Y3TV.js";
|
|
10
10
|
import {
|
|
11
11
|
READOUT_ROOM,
|
|
12
12
|
longestBar
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OLKXMZ6J.js";
|
|
14
14
|
import {
|
|
15
15
|
pathOrigin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-B5X2RLJG.js";
|
|
17
17
|
import {
|
|
18
18
|
LABEL_CHAR_PX
|
|
19
19
|
} from "./chunk-AB35TJST.js";
|
|
@@ -3,27 +3,37 @@ import {
|
|
|
3
3
|
} from "./chunk-H2H4Y3TV.js";
|
|
4
4
|
import {
|
|
5
5
|
REFERENCE_RAMP_ALT_CSS
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SWCULW6S.js";
|
|
7
7
|
import {
|
|
8
8
|
RAMP_GRADIENT_CSS,
|
|
9
9
|
RAMP_GRADIENT_STOPS,
|
|
10
10
|
rampHueCss,
|
|
11
11
|
rampStops
|
|
12
12
|
} from "./chunk-GQZVR5DW.js";
|
|
13
|
+
import {
|
|
14
|
+
GAP_CAUSE_TEXT,
|
|
15
|
+
OUTSIDE_TEXT
|
|
16
|
+
} from "./chunk-EIY2SKD3.js";
|
|
13
17
|
import {
|
|
14
18
|
LABEL_CHAR_PX
|
|
15
19
|
} from "./chunk-AB35TJST.js";
|
|
16
20
|
import {
|
|
17
21
|
ROW_HEIGHT_PX
|
|
18
22
|
} from "./chunk-CPMHA4W5.js";
|
|
23
|
+
import {
|
|
24
|
+
panSNContig
|
|
25
|
+
} from "./chunk-4XWZNPQ2.js";
|
|
19
26
|
|
|
20
27
|
// src/layout/walkRowDraw.ts
|
|
21
28
|
var ON_REFERENCE = "#2f8fd6";
|
|
22
29
|
var OFF_REFERENCE = "#8e3fbf";
|
|
23
30
|
var OUTSIDE_CUT = "#bdbdbd";
|
|
31
|
+
var MISSING_INK = "#8a8a8a";
|
|
32
|
+
var UNKNOWN_GAP = "#e2e2e2";
|
|
24
33
|
var GENE_INK = "#1c1c22";
|
|
25
34
|
var BAR_PX = 12;
|
|
26
35
|
var GAP_PX = 4;
|
|
36
|
+
var MISSING_PX = 1;
|
|
27
37
|
var LABELLED_ROW_PX = 12;
|
|
28
38
|
var MIN_TILED_BAR_PX = 6;
|
|
29
39
|
var MIN_TILE_PX = 3;
|
|
@@ -37,12 +47,36 @@ function signedLength(delta) {
|
|
|
37
47
|
function units(bp, unit) {
|
|
38
48
|
return unit ? ` \u2248 ${Math.round(bp / unit)} units` : "";
|
|
39
49
|
}
|
|
50
|
+
var near = ({ refName, start }) => `${panSNContig(refName)}:${start < 1e6 ? `${Math.round(start / 1e3)} kb` : `${(start / 1e6).toFixed(1)} Mb`}`;
|
|
51
|
+
function gapsText(gapBp, runs) {
|
|
52
|
+
const gaps = (runs ?? []).filter((r) => r.gap);
|
|
53
|
+
if (gapBp <= 0) {
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
if (!gaps.some((g) => g.cause)) {
|
|
57
|
+
return ` \xB7 ${kb(gapBp)} ${OUTSIDE_TEXT}`;
|
|
58
|
+
}
|
|
59
|
+
const bpOf = (cause) => gaps.filter((g) => g.cause === cause).reduce((sum, g) => sum + g.bp, 0);
|
|
60
|
+
const places = [
|
|
61
|
+
...new Set(gaps.flatMap((g) => g.chunk ? [near(g.chunk)] : []))
|
|
62
|
+
];
|
|
63
|
+
const parts = [
|
|
64
|
+
[bpOf("missing"), GAP_CAUSE_TEXT.missing],
|
|
65
|
+
[
|
|
66
|
+
bpOf("elsewhere"),
|
|
67
|
+
`on nodes filed near ${places[0]}${places.length > 1 ? ` and ${places.length - 1} more place${places.length > 2 ? "s" : ""}` : ""}`
|
|
68
|
+
],
|
|
69
|
+
[bpOf("unknown"), GAP_CAUSE_TEXT.unknown],
|
|
70
|
+
[bpOf(void 0), OUTSIDE_TEXT]
|
|
71
|
+
];
|
|
72
|
+
return parts.filter(([bp]) => bp > 0).map(([bp, text]) => ` \xB7 ${kb(bp)} ${text}`).join("");
|
|
73
|
+
}
|
|
40
74
|
function walkRowReadout(row, reference, unit, call) {
|
|
41
75
|
const { bp, gapBp, complete, stop } = row;
|
|
42
76
|
if (!reference) {
|
|
43
77
|
return `${kb(bp)}${units(bp, unit)}`;
|
|
44
78
|
}
|
|
45
|
-
const outside = gapBp
|
|
79
|
+
const outside = gapsText(gapBp, row.runs);
|
|
46
80
|
const called = call ? ` \xB7 called ${kb(call.bp)}${call.spanningReads === 0 ? " \xB7 no spanning read" : ""}` : "";
|
|
47
81
|
if (complete) {
|
|
48
82
|
const delta = bp - reference.bp;
|
|
@@ -54,7 +88,7 @@ function walkRowReadout(row, reference, unit, call) {
|
|
|
54
88
|
const where = stop.shortBp > 0 ? `${kb(stop.shortBp)} before` : "at";
|
|
55
89
|
return `contig ends ${where} the ${region}${called}`;
|
|
56
90
|
}
|
|
57
|
-
const why = !stop ? "partial walk" : stop.contigEnds ? `contig ends inside the ${region}` : "does not rejoin the reference within the
|
|
91
|
+
const why = !stop ? "partial walk" : stop.contigEnds ? `contig ends inside the ${region}` : "does not rejoin the reference within the extracted subgraph";
|
|
58
92
|
return `\u2265 ${kb(bp)}${units(bp, unit)} \xB7 ${why}${outside}${called}`;
|
|
59
93
|
}
|
|
60
94
|
function readoutPlacement(text, endX, width) {
|
|
@@ -72,9 +106,12 @@ function unitTicks(bp, unit, pxPerBp) {
|
|
|
72
106
|
}
|
|
73
107
|
return ticks;
|
|
74
108
|
}
|
|
109
|
+
function gapStyle(cause) {
|
|
110
|
+
return cause === "missing" ? { fill: MISSING_INK, px: MISSING_PX, label: GAP_CAUSE_TEXT.missing } : cause === "unknown" ? { fill: UNKNOWN_GAP, px: GAP_PX, label: GAP_CAUSE_TEXT.unknown } : { fill: OUTSIDE_CUT, px: GAP_PX, label: OUTSIDE_TEXT };
|
|
111
|
+
}
|
|
75
112
|
function runPaint(run, ramp) {
|
|
76
113
|
if (run.gap) {
|
|
77
|
-
return { fill:
|
|
114
|
+
return { fill: gapStyle(run.cause).fill };
|
|
78
115
|
}
|
|
79
116
|
if (!ramp) {
|
|
80
117
|
return { fill: run.onReference ? ON_REFERENCE : OFF_REFERENCE };
|
|
@@ -180,11 +217,15 @@ function walkRowsKey(bars, o = {}) {
|
|
|
180
217
|
label: `off ${bars.reference.label}'s path`
|
|
181
218
|
}
|
|
182
219
|
];
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
220
|
+
const gaps = [bars.reference, ...bars.rows].flatMap(
|
|
221
|
+
(row) => row.runs.filter((run) => run.gap)
|
|
222
|
+
);
|
|
223
|
+
const labels = new Set(gaps.map((run) => gapStyle(run.cause).label));
|
|
224
|
+
for (const cause of [void 0, "missing", "unknown"]) {
|
|
225
|
+
const { fill, px, label } = gapStyle(cause);
|
|
226
|
+
if (labels.has(label)) {
|
|
227
|
+
entries.push({ swatch: { kind: "gap", fill, px }, label });
|
|
228
|
+
}
|
|
188
229
|
}
|
|
189
230
|
if (o.genes?.crowded) {
|
|
190
231
|
entries.push({
|
|
@@ -248,9 +289,9 @@ function walkRowsKeyTree(entries, x, y, idPrefix = "walk-key") {
|
|
|
248
289
|
"stroke-width": 1.5
|
|
249
290
|
}) : el("rect", {
|
|
250
291
|
x: at,
|
|
251
|
-
y: e.swatch.kind === "gap" ?
|
|
292
|
+
y: e.swatch.kind === "gap" ? 9 - e.swatch.px / 2 : 5,
|
|
252
293
|
width: 18,
|
|
253
|
-
height: e.swatch.kind === "gap" ?
|
|
294
|
+
height: e.swatch.kind === "gap" ? e.swatch.px : 8,
|
|
254
295
|
rx: 2,
|
|
255
296
|
fill: ramp ? `url(#${rampId})` : e.swatch.fill
|
|
256
297
|
});
|
|
@@ -399,9 +440,10 @@ function walkRowsTree(bars, frame, o = {}) {
|
|
|
399
440
|
if (y < -barPx || y > frame.height + barPx) {
|
|
400
441
|
return void 0;
|
|
401
442
|
}
|
|
402
|
-
const
|
|
443
|
+
const drawn = frame.bars === false ? [] : row.runs;
|
|
444
|
+
const runs = coalesceRuns(drawn, frame.scaleX).flatMap((run) => {
|
|
403
445
|
const paint = runPaint(run, o.ramp);
|
|
404
|
-
const h = run.gap ? Math.min(
|
|
446
|
+
const h = run.gap ? Math.min(gapStyle(run.cause).px, barPx) : barPx;
|
|
405
447
|
const id = `${prefix}-${i}-${run.start}`;
|
|
406
448
|
const rect = el("rect", {
|
|
407
449
|
x: along(run.start),
|
|
@@ -486,13 +528,17 @@ export {
|
|
|
486
528
|
ON_REFERENCE,
|
|
487
529
|
OFF_REFERENCE,
|
|
488
530
|
OUTSIDE_CUT,
|
|
531
|
+
MISSING_INK,
|
|
532
|
+
UNKNOWN_GAP,
|
|
489
533
|
GENE_INK,
|
|
490
534
|
BAR_PX,
|
|
491
535
|
GAP_PX,
|
|
536
|
+
MISSING_PX,
|
|
492
537
|
LABELLED_ROW_PX,
|
|
493
538
|
walkRowReadout,
|
|
494
539
|
readoutPlacement,
|
|
495
540
|
unitTicks,
|
|
541
|
+
gapStyle,
|
|
496
542
|
runPaint,
|
|
497
543
|
alongRow,
|
|
498
544
|
rowSpan,
|
package/dist/cli/figure.js
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
} from "../chunks/chunk-G6UIYQZR.js";
|
|
8
8
|
import {
|
|
9
9
|
figureSvg
|
|
10
|
-
} from "../chunks/chunk-
|
|
10
|
+
} from "../chunks/chunk-5LTZVKZQ.js";
|
|
11
11
|
import "../chunks/chunk-V4YML3GR.js";
|
|
12
|
-
import "../chunks/chunk-
|
|
12
|
+
import "../chunks/chunk-TEF3NBG3.js";
|
|
13
13
|
import {
|
|
14
14
|
genesOnRow,
|
|
15
15
|
placeRowGenes
|
|
16
|
-
} from "../chunks/chunk-
|
|
16
|
+
} from "../chunks/chunk-XZ6PQBU6.js";
|
|
17
17
|
import "../chunks/chunk-EJRJAAN7.js";
|
|
18
18
|
import "../chunks/chunk-RBCE2OQH.js";
|
|
19
19
|
import "../chunks/chunk-JSUCGZ6K.js";
|
|
@@ -25,17 +25,17 @@ import "../chunks/chunk-H2H4Y3TV.js";
|
|
|
25
25
|
import {
|
|
26
26
|
laidOutGraph,
|
|
27
27
|
walkLayers
|
|
28
|
-
} from "../chunks/chunk-
|
|
28
|
+
} from "../chunks/chunk-CTZRIDMY.js";
|
|
29
29
|
import {
|
|
30
30
|
LAYOUT_ENGINE_VALUES,
|
|
31
31
|
isLayoutEngineKind
|
|
32
32
|
} from "../chunks/chunk-JMABOQWL.js";
|
|
33
33
|
import {
|
|
34
34
|
LAYOUT_MODES
|
|
35
|
-
} from "../chunks/chunk-
|
|
36
|
-
import "../chunks/chunk-
|
|
37
|
-
import "../chunks/chunk-ZNJ4JAPT.js";
|
|
35
|
+
} from "../chunks/chunk-EDWU7OM4.js";
|
|
36
|
+
import "../chunks/chunk-PK5QQOMN.js";
|
|
38
37
|
import "../chunks/chunk-A7H753BA.js";
|
|
38
|
+
import "../chunks/chunk-GJU6BJJA.js";
|
|
39
39
|
import "../chunks/chunk-GJLZ2MKE.js";
|
|
40
40
|
import "../chunks/chunk-MYLAJDKB.js";
|
|
41
41
|
import "../chunks/chunk-C44YRP5F.js";
|
|
@@ -47,45 +47,46 @@ import {
|
|
|
47
47
|
haplotypeIndexBeside,
|
|
48
48
|
openGbz,
|
|
49
49
|
parseRegion
|
|
50
|
-
} from "../chunks/chunk-
|
|
51
|
-
import "../chunks/chunk-
|
|
50
|
+
} from "../chunks/chunk-TUQKGAK3.js";
|
|
51
|
+
import "../chunks/chunk-NMWQUFPF.js";
|
|
52
52
|
import "../chunks/chunk-HNWJ4B7S.js";
|
|
53
|
-
import "../chunks/chunk-
|
|
54
|
-
import "../chunks/chunk-
|
|
55
|
-
import "../chunks/chunk-
|
|
53
|
+
import "../chunks/chunk-6OP4HPXG.js";
|
|
54
|
+
import "../chunks/chunk-AI5PTOSV.js";
|
|
55
|
+
import "../chunks/chunk-CZT33FZG.js";
|
|
56
56
|
import "../chunks/chunk-LOCJN3BZ.js";
|
|
57
|
-
import "../chunks/chunk-
|
|
58
|
-
import "../chunks/chunk-
|
|
59
|
-
import "../chunks/chunk-
|
|
60
|
-
import "../chunks/chunk-
|
|
57
|
+
import "../chunks/chunk-C3NT37C3.js";
|
|
58
|
+
import "../chunks/chunk-DO62DG26.js";
|
|
59
|
+
import "../chunks/chunk-D4ZFRBB4.js";
|
|
60
|
+
import "../chunks/chunk-SWCULW6S.js";
|
|
61
61
|
import "../chunks/chunk-G2FD7S3C.js";
|
|
62
62
|
import "../chunks/chunk-GQZVR5DW.js";
|
|
63
63
|
import "../chunks/chunk-WA5WNP6V.js";
|
|
64
|
-
import "../chunks/chunk-
|
|
64
|
+
import "../chunks/chunk-OLKXMZ6J.js";
|
|
65
65
|
import {
|
|
66
66
|
filterSamples,
|
|
67
67
|
walkRows
|
|
68
|
-
} from "../chunks/chunk-
|
|
69
|
-
import "../chunks/chunk-
|
|
68
|
+
} from "../chunks/chunk-CIDSF47D.js";
|
|
69
|
+
import "../chunks/chunk-3GP3KT5L.js";
|
|
70
70
|
import "../chunks/chunk-CRCD3ODN.js";
|
|
71
|
-
import "../chunks/chunk-
|
|
72
|
-
import "../chunks/chunk-
|
|
71
|
+
import "../chunks/chunk-W6EXQDV5.js";
|
|
72
|
+
import "../chunks/chunk-KDU4EF66.js";
|
|
73
73
|
import "../chunks/chunk-3PZSBNLI.js";
|
|
74
74
|
import "../chunks/chunk-CKUVEHSS.js";
|
|
75
75
|
import "../chunks/chunk-OPPVSPEF.js";
|
|
76
76
|
import "../chunks/chunk-VPE4AYP7.js";
|
|
77
|
-
import "../chunks/chunk-
|
|
77
|
+
import "../chunks/chunk-FFHJGWDK.js";
|
|
78
78
|
import "../chunks/chunk-QYBZZI5H.js";
|
|
79
79
|
import "../chunks/chunk-5I3K4R2G.js";
|
|
80
|
-
import "../chunks/chunk-
|
|
81
|
-
import "../chunks/chunk-
|
|
80
|
+
import "../chunks/chunk-3XSRT7RQ.js";
|
|
81
|
+
import "../chunks/chunk-B5X2RLJG.js";
|
|
82
82
|
import "../chunks/chunk-VX656OAZ.js";
|
|
83
83
|
import {
|
|
84
84
|
featuresOnBackbone,
|
|
85
85
|
graphBackbone,
|
|
86
86
|
refNameBinding
|
|
87
87
|
} from "../chunks/chunk-234NFZS4.js";
|
|
88
|
-
import "../chunks/chunk-
|
|
88
|
+
import "../chunks/chunk-DZR37KXT.js";
|
|
89
|
+
import "../chunks/chunk-EIY2SKD3.js";
|
|
89
90
|
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
90
91
|
import "../chunks/chunk-PFRQBCGC.js";
|
|
91
92
|
import "../chunks/chunk-HMXCN6PG.js";
|
package/dist/cli/fold.js
CHANGED
|
@@ -10,18 +10,19 @@ import {
|
|
|
10
10
|
} from "../chunks/chunk-SOMZGDVS.js";
|
|
11
11
|
import {
|
|
12
12
|
loadGraph
|
|
13
|
-
} from "../chunks/chunk-
|
|
13
|
+
} from "../chunks/chunk-KDU4EF66.js";
|
|
14
14
|
import "../chunks/chunk-3PZSBNLI.js";
|
|
15
15
|
import "../chunks/chunk-CKUVEHSS.js";
|
|
16
16
|
import "../chunks/chunk-OPPVSPEF.js";
|
|
17
17
|
import "../chunks/chunk-VPE4AYP7.js";
|
|
18
|
-
import "../chunks/chunk-
|
|
18
|
+
import "../chunks/chunk-FFHJGWDK.js";
|
|
19
19
|
import "../chunks/chunk-QYBZZI5H.js";
|
|
20
20
|
import "../chunks/chunk-5I3K4R2G.js";
|
|
21
|
-
import "../chunks/chunk-
|
|
22
|
-
import "../chunks/chunk-
|
|
21
|
+
import "../chunks/chunk-3XSRT7RQ.js";
|
|
22
|
+
import "../chunks/chunk-B5X2RLJG.js";
|
|
23
23
|
import "../chunks/chunk-VX656OAZ.js";
|
|
24
|
-
import "../chunks/chunk-
|
|
24
|
+
import "../chunks/chunk-DZR37KXT.js";
|
|
25
|
+
import "../chunks/chunk-EIY2SKD3.js";
|
|
25
26
|
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
26
27
|
import "../chunks/chunk-BZFOFC4D.js";
|
|
27
28
|
import "../chunks/chunk-HKYXWZQS.js";
|