@jbrowse/bandage-core 10.3.1 → 11.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 +5 -0
- package/dist/chunks/{chunk-DBLV7PGG.js → chunk-3XSRT7RQ.js} +16 -2
- package/dist/chunks/{chunk-BS6HPYCZ.js → chunk-77EGQQJU.js} +3 -1
- package/dist/chunks/chunk-7BTO7MZS.js +46 -0
- package/dist/chunks/{chunk-BKEZLETL.js → chunk-AI5PTOSV.js} +1 -1
- package/dist/chunks/{chunk-CGFPFBT2.js → chunk-D4ZFRBB4.js} +11 -2
- package/dist/chunks/{chunk-OOIOX36I.js → chunk-DEDD7TFJ.js} +40 -9
- package/dist/chunks/{chunk-YZQI35UJ.js → chunk-DR24UTRS.js} +23 -2
- package/dist/chunks/{chunk-Z6XZWPXK.js → chunk-DZR37KXT.js} +51 -2
- package/dist/chunks/chunk-EIY2SKD3.js +164 -0
- package/dist/chunks/{chunk-NZTYV3JL.js → chunk-FFHJGWDK.js} +5 -1
- package/dist/chunks/{chunk-QH2MIXBA.js → chunk-IVOK5V3H.js} +6 -6
- package/dist/chunks/{chunk-SFP3E4RI.js → chunk-IZ6Y5D23.js} +2 -2
- package/dist/chunks/{chunk-EWLXU3UG.js → chunk-JFHYG25O.js} +13 -13
- package/dist/chunks/{chunk-KMBE2Q42.js → chunk-KDU4EF66.js} +3 -3
- package/dist/chunks/{chunk-FW2R7UDZ.js → chunk-LMH5KVJZ.js} +1 -1
- package/dist/chunks/{chunk-AZ4EEF6Q.js → chunk-NGUM77EP.js} +5 -5
- package/dist/chunks/{chunk-GIHTHYXY.js → chunk-NMWQUFPF.js} +1 -1
- package/dist/chunks/{chunk-CHNESV7L.js → chunk-OI4YVAMM.js} +56 -9
- package/dist/chunks/{chunk-R2PJKD3Y.js → chunk-RETNT73O.js} +1 -1
- package/dist/chunks/{chunk-OXRUPNSV.js → chunk-RNYPCQZ3.js} +1 -1
- package/dist/chunks/{chunk-DO62DG26.js → chunk-TABI4JEU.js} +6 -4
- package/dist/chunks/{chunk-M5NPD55W.js → chunk-TUQKGAK3.js} +1 -1
- package/dist/chunks/{chunk-MWOVW4AH.js → chunk-V5MAL7LU.js} +1 -1
- package/dist/chunks/{chunk-D7WIYPG3.js → chunk-W6EXQDV5.js} +1 -1
- package/dist/chunks/{chunk-ZJBOM73S.js → chunk-XZ6PQBU6.js} +58 -12
- package/dist/chunks/{chunk-AQCOIE5R.js → chunk-Y3FDMDNT.js} +1 -1
- package/dist/chunks/{chunk-A2TJ5UX6.js → chunk-YHJ5JLBI.js} +1 -1
- package/dist/chunks/{chunk-WYJQIC75.js → chunk-ZUL52ZX2.js} +4 -4
- package/dist/cli/figure.js +42 -67
- package/dist/cli/fold.js +5 -4
- package/dist/figure.js +18 -17
- package/dist/figureData.js +21 -19
- package/dist/figureScene.js +12 -11
- package/dist/figureSettings.js +6 -5
- package/dist/gbzCut.js +4 -3
- package/dist/gbzWindow.js +3 -2
- package/dist/genes/backboneGenes.js +12 -0
- package/dist/genes/genePins.js +1 -1
- package/dist/gfa/gfaConverter.js +2 -1
- 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 -38
- package/dist/layout/forceCache.js +6 -5
- package/dist/layout/tubeMapLayout.js +3 -2
- package/dist/layout/walkRowDraw.js +10 -1
- package/dist/layout/walkRowLayout.js +3 -2
- package/dist/layout/walkRows.js +2 -1
- package/dist/layout/walkStrip.js +5 -4
- package/dist/layoutModes.js +6 -5
- package/dist/pipeline.js +5 -4
- package/dist/tubeMap/bundle.js +4 -3
- package/dist/tubeMap/coarsen.js +4 -3
- package/dist/tubeMap/deviations.js +4 -3
- package/dist/tubeMap/draw.js +4 -3
- package/dist/types/figureData.d.ts +31 -2
- package/dist/types/genes/backboneGenes.d.ts +25 -0
- package/dist/types/genes/genePins.d.ts +1 -0
- package/dist/types/gfa/graphTables.d.ts +3 -0
- package/dist/types/gfa/walkStops.d.ts +59 -0
- package/dist/types/index.d.ts +7 -3
- package/dist/types/layout/walkRowDraw.d.ts +14 -1
- package/dist/types/layout/walkRows.d.ts +10 -1
- package/dist/types/types.d.ts +19 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/walkEncoding.d.ts +1 -0
- 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 +6 -5
- package/dist/walkEncoding.js +1 -1
- package/dist/walkHighlight.js +3 -2
- package/dist/walkKey.js +2 -1
- package/package.json +1 -1
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
stripGeneGaps,
|
|
6
6
|
walkStripFrame,
|
|
7
7
|
walkStripLabelsTree
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IZ6Y5D23.js";
|
|
9
9
|
import {
|
|
10
10
|
walkRowsKey,
|
|
11
11
|
walkRowsKeyTree,
|
|
12
12
|
walkRowsTree
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XZ6PQBU6.js";
|
|
14
14
|
import {
|
|
15
15
|
Canvas2DRenderer
|
|
16
16
|
} from "./chunk-EJRJAAN7.js";
|
|
@@ -19,9 +19,6 @@ import {
|
|
|
19
19
|
exonOutlineTree,
|
|
20
20
|
exonStretches
|
|
21
21
|
} from "./chunk-JSUCGZ6K.js";
|
|
22
|
-
import {
|
|
23
|
-
genePins
|
|
24
|
-
} from "./chunk-BS6HPYCZ.js";
|
|
25
22
|
import {
|
|
26
23
|
geneLabelCandidates
|
|
27
24
|
} from "./chunk-PSCSZSVK.js";
|
|
@@ -32,34 +29,37 @@ import {
|
|
|
32
29
|
escapeAttr,
|
|
33
30
|
serializeEl
|
|
34
31
|
} from "./chunk-H2H4Y3TV.js";
|
|
32
|
+
import {
|
|
33
|
+
genePins
|
|
34
|
+
} from "./chunk-77EGQQJU.js";
|
|
35
35
|
import {
|
|
36
36
|
version
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-Y3FDMDNT.js";
|
|
38
38
|
import {
|
|
39
39
|
axisScaleOf
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-AI5PTOSV.js";
|
|
41
41
|
import {
|
|
42
42
|
figureScene
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-IVOK5V3H.js";
|
|
44
44
|
import {
|
|
45
45
|
encodingStops
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-TABI4JEU.js";
|
|
47
47
|
import {
|
|
48
48
|
rangeText
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-D4ZFRBB4.js";
|
|
50
50
|
import {
|
|
51
51
|
walkRowLabels
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-YHJ5JLBI.js";
|
|
53
53
|
import {
|
|
54
54
|
nodeInk
|
|
55
55
|
} from "./chunk-CRCD3ODN.js";
|
|
56
56
|
import {
|
|
57
57
|
FIGURE_DEFAULTS
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-W6EXQDV5.js";
|
|
59
59
|
import {
|
|
60
60
|
FIT_PADDING,
|
|
61
61
|
fitTransform
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-KDU4EF66.js";
|
|
63
63
|
import {
|
|
64
64
|
LABEL_CHAR_PX,
|
|
65
65
|
LABEL_PAD,
|
|
@@ -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
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,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
sampleRowLayout
|
|
3
|
-
} from "./chunk-GJU6BJJA.js";
|
|
4
1
|
import {
|
|
5
2
|
hasTubeMapBackbone,
|
|
6
3
|
hasTubeMapPaths,
|
|
7
4
|
tubeMapLayout,
|
|
8
5
|
tubeMapReferenceLayout
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LMH5KVJZ.js";
|
|
7
|
+
import {
|
|
8
|
+
sampleRowLayout
|
|
9
|
+
} from "./chunk-GJU6BJJA.js";
|
|
10
10
|
import {
|
|
11
11
|
anchoredLayout
|
|
12
12
|
} from "./chunk-GJLZ2MKE.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-UAFATXYA.js";
|
|
16
16
|
import {
|
|
17
17
|
walkRowLayout
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YHJ5JLBI.js";
|
|
19
19
|
import {
|
|
20
20
|
isBackbone,
|
|
21
21
|
isOffReference
|
|
@@ -3,19 +3,25 @@ import {
|
|
|
3
3
|
} from "./chunk-JMABOQWL.js";
|
|
4
4
|
import {
|
|
5
5
|
layoutModeByValue
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NGUM77EP.js";
|
|
7
7
|
import {
|
|
8
8
|
parseRegion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TUQKGAK3.js";
|
|
10
|
+
import {
|
|
11
|
+
genePins
|
|
12
|
+
} from "./chunk-77EGQQJU.js";
|
|
10
13
|
import {
|
|
11
14
|
version
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Y3FDMDNT.js";
|
|
13
16
|
import {
|
|
14
17
|
axisScaleOf
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AI5PTOSV.js";
|
|
16
19
|
import {
|
|
17
20
|
figureScene
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IVOK5V3H.js";
|
|
22
|
+
import {
|
|
23
|
+
encodingStops
|
|
24
|
+
} from "./chunk-TABI4JEU.js";
|
|
19
25
|
import {
|
|
20
26
|
abgrAlpha,
|
|
21
27
|
abgrBlue,
|
|
@@ -24,13 +30,13 @@ import {
|
|
|
24
30
|
} from "./chunk-G2FD7S3C.js";
|
|
25
31
|
import {
|
|
26
32
|
FIGURE_DEFAULTS
|
|
27
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-W6EXQDV5.js";
|
|
28
34
|
import {
|
|
29
35
|
engineSettingsOf,
|
|
30
36
|
fitTransform,
|
|
31
37
|
forceLayout,
|
|
32
38
|
loadGraph
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KDU4EF66.js";
|
|
34
40
|
import {
|
|
35
41
|
isBackbone
|
|
36
42
|
} from "./chunk-RJWPJCIB.js";
|
|
@@ -76,21 +82,58 @@ function figureData(graph, layout, o = {}) {
|
|
|
76
82
|
}
|
|
77
83
|
const axis = axisScaleOf(fit.scale, pixelRows);
|
|
78
84
|
const panels = [];
|
|
85
|
+
const keys = columns(["panel", "walk", "note", "scale", "stops"]);
|
|
86
|
+
const pushKey = (walk, panel) => {
|
|
87
|
+
const key = keyText(walk);
|
|
88
|
+
keys.push({
|
|
89
|
+
panel,
|
|
90
|
+
walk: labelOf(walk.name),
|
|
91
|
+
note: key.note,
|
|
92
|
+
scale: key.scale ?? "",
|
|
93
|
+
stops: encodingStops(walk.encoding).map((s) => cssHex(s.abgr)).join(",")
|
|
94
|
+
});
|
|
95
|
+
return key;
|
|
96
|
+
};
|
|
79
97
|
if (facets) {
|
|
80
98
|
const ordered = facets.panels.map((panel, i) => ({ panel, cell: facets.place.cells[i] })).sort((a, b) => a.cell - b.cell);
|
|
81
99
|
for (const { panel } of ordered) {
|
|
82
100
|
const walk = panel.walks[0];
|
|
83
|
-
const
|
|
101
|
+
const name = labelOf(walk.name);
|
|
102
|
+
const key = pushKey(walk, name);
|
|
84
103
|
panels.push({
|
|
85
104
|
highlight: panel,
|
|
86
|
-
name
|
|
105
|
+
name,
|
|
87
106
|
key: key.note,
|
|
88
107
|
range: key.scale ?? ""
|
|
89
108
|
});
|
|
90
109
|
}
|
|
91
110
|
} else {
|
|
111
|
+
for (const walk of lift?.walks ?? []) {
|
|
112
|
+
pushKey(walk, "");
|
|
113
|
+
}
|
|
92
114
|
panels.push({ highlight: lift, name: "", key: "", range: "" });
|
|
93
115
|
}
|
|
116
|
+
const pins = columns(["gene", "x", "y", "covered", "bp"]);
|
|
117
|
+
const exons = columns(["gene", "node", "stretch", "x", "y"]);
|
|
118
|
+
let stretch = 0;
|
|
119
|
+
for (const pin of o.genes?.length ? genePins(graph, o.genes, layout.nodePositions) : []) {
|
|
120
|
+
const gene = pin.gene.name;
|
|
121
|
+
pins.push({
|
|
122
|
+
gene,
|
|
123
|
+
x: pin.at.x,
|
|
124
|
+
y: pin.at.y,
|
|
125
|
+
covered: pin.covered,
|
|
126
|
+
bp: pin.gene.end - pin.gene.start
|
|
127
|
+
});
|
|
128
|
+
for (const { nodeId, stretches } of pin.exonsByNode) {
|
|
129
|
+
for (const points of stretches) {
|
|
130
|
+
stretch++;
|
|
131
|
+
for (const { x, y } of points) {
|
|
132
|
+
exons.push({ gene, node: nodeId, stretch, x, y });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
94
137
|
const nodes = columns([
|
|
95
138
|
"panel",
|
|
96
139
|
"node",
|
|
@@ -198,6 +241,10 @@ function figureData(graph, layout, o = {}) {
|
|
|
198
241
|
key: panels.map((p) => p.key),
|
|
199
242
|
range: panels.map((p) => p.range)
|
|
200
243
|
},
|
|
244
|
+
keys: keys.out,
|
|
245
|
+
pins: pins.out,
|
|
246
|
+
exons: exons.out,
|
|
247
|
+
walkNames: [...new Set((graph.paths ?? []).map((p) => p.name))],
|
|
201
248
|
nodes: nodes.out,
|
|
202
249
|
edges: edges.out,
|
|
203
250
|
arrows: arrows.out,
|
|
@@ -88,10 +88,12 @@ function encodedColor({ field, scheme }, t) {
|
|
|
88
88
|
}
|
|
89
89
|
var NO_VALUE_COLOR = REFERENCE_RAMP_ALT_COLOR;
|
|
90
90
|
function encodingStops({ field, scheme }) {
|
|
91
|
-
|
|
92
|
-
offset
|
|
93
|
-
color: schemeCss(scheme,
|
|
94
|
-
|
|
91
|
+
const stop = (offset, t) => ({
|
|
92
|
+
offset,
|
|
93
|
+
color: schemeCss(scheme, t),
|
|
94
|
+
abgr: schemeColor(scheme, t)
|
|
95
|
+
});
|
|
96
|
+
return field === "walk" ? [stop(0, BASE_T)] : Array.from({ length: 7 }, (_, i) => stop(i / 6, i / 6));
|
|
95
97
|
}
|
|
96
98
|
function encodingSwatchCss(encoding) {
|
|
97
99
|
const stops = encodingStops(encoding);
|
|
@@ -10,20 +10,30 @@ import {
|
|
|
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,
|
|
@@ -1,15 +1,15 @@
|
|
|
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-DEDD7TFJ.js";
|
|
13
13
|
import {
|
|
14
14
|
pathOrigin
|
|
15
15
|
} from "./chunk-B5X2RLJG.js";
|