@jbrowse/bandage-core 11.5.0 → 11.7.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/alleleProjection/projectAlleles.js +1 -1
- package/dist/bubbles/bubbleHalos.js +9 -6
- package/dist/bubbles/classifyBubble.js +8 -5
- package/dist/bubbles/popBubble.js +3 -3
- package/dist/bubbles/superbubbles.js +11 -11
- package/dist/chunks/{chunk-4XWZNPQ2.js → chunk-2JL2JVZ2.js} +1 -1
- package/dist/chunks/{chunk-BZFOFC4D.js → chunk-2VMKQKVO.js} +17 -7
- package/dist/chunks/{chunk-HN3WHMPJ.js → chunk-2XEAITWM.js} +15 -5
- package/dist/chunks/{chunk-7BTO7MZS.js → chunk-376YFQOY.js} +2 -2
- package/dist/chunks/{chunk-B5X2RLJG.js → chunk-3YBP46PB.js} +27 -2
- package/dist/chunks/{chunk-EJRJAAN7.js → chunk-4DMSPNYV.js} +47 -27
- package/dist/chunks/{chunk-OMUPUB4J.js → chunk-56L6R6D2.js} +2 -2
- package/dist/chunks/{chunk-C44YRP5F.js → chunk-5OJZV6YT.js} +3 -2
- package/dist/chunks/{chunk-234NFZS4.js → chunk-5ORP7EFJ.js} +1 -1
- package/dist/chunks/{chunk-XKZ56L5A.js → chunk-5ZQKQ24Z.js} +1 -1
- package/dist/chunks/{chunk-VD4MLYEK.js → chunk-65YCFVS4.js} +2 -2
- package/dist/chunks/{chunk-3VCKBSML.js → chunk-6YRSOL4K.js} +2 -2
- package/dist/chunks/{chunk-NJGYLYU7.js → chunk-7L7MN2OM.js} +6 -3
- package/dist/chunks/{chunk-TRGKMLXT.js → chunk-A7Q7RTWX.js} +26 -19
- package/dist/chunks/{chunk-77EGQQJU.js → chunk-BFUS3ENH.js} +2 -2
- package/dist/chunks/{chunk-TGUFT6KK.js → chunk-BLUEFYIR.js} +4 -1
- package/dist/chunks/{chunk-3GP3KT5L.js → chunk-BW2NMXRV.js} +5 -5
- package/dist/chunks/{chunk-IOWLTUEB.js → chunk-BXE3SBBN.js} +1 -1
- package/dist/chunks/{chunk-2E25TX4G.js → chunk-C6E6HXP5.js} +4 -4
- package/dist/chunks/{chunk-5I3K4R2G.js → chunk-CFXXFHRK.js} +2 -1
- package/dist/chunks/{chunk-JMABOQWL.js → chunk-CO6RGQAD.js} +1 -6
- package/dist/chunks/{chunk-5F4D35U5.js → chunk-DD5EZG3T.js} +3 -3
- package/dist/chunks/{chunk-AKLSY4GD.js → chunk-DTEXQ65J.js} +1 -1
- package/dist/chunks/{chunk-VQ7474EH.js → chunk-DUREQSOJ.js} +9 -8
- package/dist/chunks/{chunk-CGMSKIEO.js → chunk-DV5B5UU7.js} +55 -8
- package/dist/chunks/{chunk-KOJKFNCW.js → chunk-EH5JZETS.js} +26 -12
- package/dist/chunks/{chunk-G6UIYQZR.js → chunk-EQDQ7P4Y.js} +3 -2
- package/dist/chunks/{chunk-J3JODFDF.js → chunk-FNDNSDKW.js} +3 -3
- package/dist/chunks/{chunk-64FCX424.js → chunk-G7SG4XMK.js} +62 -14
- package/dist/chunks/{chunk-6EOB6ANX.js → chunk-GZ36HNPJ.js} +1 -1
- package/dist/chunks/{chunk-A32ZKSHN.js → chunk-HELOUO6K.js} +5 -5
- package/dist/chunks/{chunk-PQBALYSO.js → chunk-HERVZPWA.js} +16 -16
- package/dist/chunks/{chunk-3U3C4PRK.js → chunk-HMEAGAGC.js} +3 -3
- package/dist/chunks/{chunk-WC6HX6GJ.js → chunk-IJCSW6MV.js} +2 -2
- package/dist/chunks/{chunk-JOWKKQAL.js → chunk-JGHZ3N34.js} +14 -9
- package/dist/chunks/{chunk-PSCSZSVK.js → chunk-KA4F3N55.js} +4 -4
- package/dist/chunks/{chunk-SOMZGDVS.js → chunk-KJDERUQF.js} +1 -1
- package/dist/chunks/{chunk-E4ZM4OOJ.js → chunk-KZMSSPS6.js} +2 -2
- package/dist/chunks/{chunk-EIY2SKD3.js → chunk-LG2UK4MB.js} +2 -1
- package/dist/chunks/{chunk-PNMJFFNB.js → chunk-MHZTTLBU.js} +1 -1
- package/dist/chunks/{chunk-K5LDBMLX.js → chunk-NTKWT6XL.js} +1 -1
- package/dist/chunks/{chunk-WA5WNP6V.js → chunk-OYCQVJYY.js} +1 -1
- package/dist/chunks/{chunk-JOLLU34X.js → chunk-PQIFYQVI.js} +1 -1
- package/dist/chunks/{chunk-EGBBIXTG.js → chunk-QCOVHLJO.js} +1 -1
- package/dist/chunks/{chunk-A7H753BA.js → chunk-SDI6BVG7.js} +5 -6
- package/dist/chunks/{chunk-FWSERUJV.js → chunk-SENPGW4O.js} +1 -1
- package/dist/chunks/{chunk-RK3HRRCW.js → chunk-SIA75TEG.js} +6 -7
- package/dist/chunks/{chunk-A4JDEUAI.js → chunk-SNF2MIEF.js} +1 -1
- package/dist/chunks/{chunk-D4ZFRBB4.js → chunk-SVPR7IZO.js} +4 -4
- package/dist/chunks/{chunk-PFRQBCGC.js → chunk-T3H5ELLA.js} +4 -4
- package/dist/chunks/{chunk-FFHJGWDK.js → chunk-TUMJNAOL.js} +5 -5
- package/dist/chunks/{chunk-UBQSRCWR.js → chunk-VACK24HF.js} +43 -3
- package/dist/chunks/{chunk-HSVFCA2J.js → chunk-VO6FKNZE.js} +1 -1
- package/dist/chunks/{chunk-DZR37KXT.js → chunk-VSSIYQYF.js} +1 -1
- package/dist/chunks/{chunk-3BCVMZUT.js → chunk-WWIUC4N4.js} +10 -10
- package/dist/chunks/{chunk-GJU6BJJA.js → chunk-XR2HMGAS.js} +1 -1
- package/dist/chunks/{chunk-WG5D2H7X.js → chunk-YER6TUXV.js} +11 -11
- package/dist/chunks/{chunk-7EDGWT67.js → chunk-YEYQFNFQ.js} +1 -1
- package/dist/chunks/{chunk-UFUSPK2A.js → chunk-YYIU7P73.js} +4 -1
- package/dist/chunks/{chunk-CRCD3ODN.js → chunk-ZANALBSX.js} +11 -3
- package/dist/chunks/{chunk-WLR4KJVI.js → chunk-ZHZRAYEM.js} +1 -1
- package/dist/chunks/{chunk-NMWQUFPF.js → chunk-ZKSC7QVE.js} +3 -3
- package/dist/cli/figure.js +53 -48
- package/dist/cli/fold.js +13 -13
- package/dist/deletionEdges.js +5 -2
- package/dist/facetGrid.js +2 -2
- package/dist/figure.js +37 -37
- package/dist/figureData.js +39 -39
- package/dist/figureScene.js +27 -27
- package/dist/figureSettings.js +13 -13
- package/dist/foldVariants.js +2 -2
- package/dist/gaf/parseGaf.js +1 -1
- package/dist/gbzCut.js +6 -6
- package/dist/gbzWindow.js +5 -5
- package/dist/genes/backboneGenes.js +4 -4
- package/dist/genes/geneFiles.js +1 -1
- package/dist/genes/genePins.js +3 -3
- package/dist/gfa/gfaConverter.js +5 -5
- package/dist/gfa/gfaTables.js +2 -2
- package/dist/gfa/graphTables.js +3 -3
- package/dist/gfa/walkStops.js +1 -1
- package/dist/gfa-core/gfaParser.js +1 -1
- package/dist/gfa-core/index.js +1 -1
- package/dist/graphLabels.js +7 -4
- package/dist/index.js +64 -64
- package/dist/labelLayout.js +11 -8
- package/dist/layout/anchoredLayout.js +1 -1
- package/dist/layout/forceCache.js +13 -13
- package/dist/layout/mergeRuns.js +2 -2
- package/dist/layout/placeOffReference.js +1 -1
- package/dist/layout/sampleRowLayout.js +2 -2
- package/dist/layout/trimToWindow.js +2 -2
- package/dist/layout/tubeMapLayout.js +15 -15
- package/dist/layout/walkRowDraw.js +15 -13
- package/dist/layout/walkRowLayout.js +8 -8
- package/dist/layout/walkRowLinks.js +1 -1
- package/dist/layout/walkRowRuns.js +5 -5
- package/dist/layout/walkRows.js +6 -6
- package/dist/layout/walkStrip.js +18 -18
- package/dist/layoutEngines.js +1 -1
- package/dist/layoutModes.js +18 -18
- package/dist/locus.js +1 -1
- package/dist/nodeWidths.js +5 -3
- package/dist/pansn.js +1 -1
- package/dist/pathAnchoring.js +4 -2
- package/dist/pathColors.js +8 -8
- package/dist/pipeline.js +12 -12
- package/dist/reference.js +2 -2
- package/dist/referenceStrip.js +12 -12
- package/dist/renderer/Canvas2DRenderer.js +1 -1
- package/dist/renderer/GeometryBuilder.js +11 -11
- package/dist/tubeMap/axis.js +8 -5
- package/dist/tubeMap/bundle.js +16 -16
- package/dist/tubeMap/coarsen.js +16 -16
- package/dist/tubeMap/deviations.js +19 -19
- package/dist/tubeMap/draw.js +11 -9
- package/dist/tubeMap/genes.js +9 -6
- package/dist/tubeMap/nodeColors.js +12 -12
- package/dist/tubeMap/reads.js +4 -4
- package/dist/types/figureData.d.ts +12 -0
- package/dist/types/gaf/parseGaf.d.ts +1 -1
- package/dist/types/gfa/graphTables.d.ts +2 -0
- package/dist/types/gfa/walkStops.d.ts +1 -1
- package/dist/types/layout/walkRowDraw.d.ts +2 -1
- package/dist/types/layout/walkRows.d.ts +1 -0
- package/dist/types/nodeWidths.d.ts +2 -1
- package/dist/types/pathAnchoring.d.ts +2 -0
- package/dist/types/renderer/Canvas2DRenderer.d.ts +2 -0
- package/dist/types/tubeMap/reads.d.ts +0 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types/util/geometry.d.ts +7 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/util/SpatialIndex.js +7 -4
- package/dist/util/edgeCurves.js +6 -3
- package/dist/util/geometry.js +1 -1
- package/dist/util/hitDetection.js +8 -5
- package/dist/version.js +1 -1
- package/dist/viewport.js +13 -13
- package/dist/walkEncoding.js +12 -12
- package/dist/walkHighlight.js +14 -14
- package/dist/walkKey.js +9 -6
- package/package.json +1 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bubbleHalos,
|
|
3
3
|
coversGraph
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-KZMSSPS6.js";
|
|
5
|
+
import "../chunks/chunk-SNF2MIEF.js";
|
|
6
6
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-T3H5ELLA.js";
|
|
8
8
|
import "../chunks/chunk-HMXCN6PG.js";
|
|
9
9
|
import "../chunks/chunk-AB35TJST.js";
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-
|
|
12
|
-
import "../chunks/chunk-
|
|
10
|
+
import "../chunks/chunk-2VMKQKVO.js";
|
|
11
|
+
import "../chunks/chunk-DV5B5UU7.js";
|
|
12
|
+
import "../chunks/chunk-3YBP46PB.js";
|
|
13
|
+
import "../chunks/chunk-VACK24HF.js";
|
|
13
14
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
15
|
+
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
14
16
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
15
17
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
16
18
|
import "../chunks/chunk-HOAIOEI7.js";
|
|
19
|
+
import "../chunks/chunk-2JL2JVZ2.js";
|
|
17
20
|
export {
|
|
18
21
|
bubbleHalos,
|
|
19
22
|
coversGraph
|
|
@@ -3,18 +3,21 @@ import {
|
|
|
3
3
|
BUBBLE_KIND_NAMES,
|
|
4
4
|
bubbleSegmentIds,
|
|
5
5
|
classifyBubble
|
|
6
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-SNF2MIEF.js";
|
|
7
7
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
8
|
-
import "../chunks/chunk-
|
|
8
|
+
import "../chunks/chunk-T3H5ELLA.js";
|
|
9
9
|
import "../chunks/chunk-HMXCN6PG.js";
|
|
10
10
|
import "../chunks/chunk-AB35TJST.js";
|
|
11
|
-
import "../chunks/chunk-
|
|
12
|
-
import "../chunks/chunk-
|
|
13
|
-
import "../chunks/chunk-
|
|
11
|
+
import "../chunks/chunk-2VMKQKVO.js";
|
|
12
|
+
import "../chunks/chunk-DV5B5UU7.js";
|
|
13
|
+
import "../chunks/chunk-3YBP46PB.js";
|
|
14
|
+
import "../chunks/chunk-VACK24HF.js";
|
|
14
15
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
16
|
+
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
15
17
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
16
18
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
17
19
|
import "../chunks/chunk-HOAIOEI7.js";
|
|
20
|
+
import "../chunks/chunk-2JL2JVZ2.js";
|
|
18
21
|
export {
|
|
19
22
|
BUBBLE_KIND_COLORS,
|
|
20
23
|
BUBBLE_KIND_NAMES,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bubbleSubgraph
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-MHZTTLBU.js";
|
|
4
|
+
import "../chunks/chunk-3YBP46PB.js";
|
|
5
5
|
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
6
6
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
7
7
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
8
8
|
import "../chunks/chunk-HOAIOEI7.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-2JL2JVZ2.js";
|
|
10
10
|
export {
|
|
11
11
|
bubbleSubgraph
|
|
12
12
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
graphBubbles,
|
|
3
3
|
superbubblesFromGraph
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-C6E6HXP5.js";
|
|
5
|
+
import "../chunks/chunk-KZMSSPS6.js";
|
|
6
6
|
import "../chunks/chunk-RFG42VIO.js";
|
|
7
|
-
import "../chunks/chunk-
|
|
7
|
+
import "../chunks/chunk-SNF2MIEF.js";
|
|
8
8
|
import "../chunks/chunk-FX4RDMDN.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-MHZTTLBU.js";
|
|
10
10
|
import "../chunks/chunk-UAFATXYA.js";
|
|
11
|
-
import "../chunks/chunk-B5X2RLJG.js";
|
|
12
11
|
import "../chunks/chunk-VX656OAZ.js";
|
|
13
|
-
import "../chunks/chunk-
|
|
14
|
-
import "../chunks/chunk-PFRQBCGC.js";
|
|
12
|
+
import "../chunks/chunk-T3H5ELLA.js";
|
|
15
13
|
import "../chunks/chunk-HMXCN6PG.js";
|
|
16
14
|
import "../chunks/chunk-AB35TJST.js";
|
|
17
|
-
import "../chunks/chunk-
|
|
18
|
-
import "../chunks/chunk-
|
|
19
|
-
import "../chunks/chunk-
|
|
15
|
+
import "../chunks/chunk-2VMKQKVO.js";
|
|
16
|
+
import "../chunks/chunk-DV5B5UU7.js";
|
|
17
|
+
import "../chunks/chunk-3YBP46PB.js";
|
|
18
|
+
import "../chunks/chunk-VACK24HF.js";
|
|
20
19
|
import "../chunks/chunk-CPMHA4W5.js";
|
|
20
|
+
import "../chunks/chunk-ZPZ7GNBT.js";
|
|
21
21
|
import "../chunks/chunk-BSOZW3FC.js";
|
|
22
22
|
import "../chunks/chunk-RJWPJCIB.js";
|
|
23
23
|
import "../chunks/chunk-HOAIOEI7.js";
|
|
24
|
-
import "../chunks/chunk-
|
|
24
|
+
import "../chunks/chunk-2JL2JVZ2.js";
|
|
25
25
|
export {
|
|
26
26
|
graphBubbles,
|
|
27
27
|
superbubblesFromGraph
|
|
@@ -21,7 +21,7 @@ function panSNFields(name) {
|
|
|
21
21
|
}
|
|
22
22
|
function parsePanSN(refName) {
|
|
23
23
|
const parts = refName.split(SEP);
|
|
24
|
-
const haplotype = parts.length >= 2 ? Number(parts[1]) : Number.NaN;
|
|
24
|
+
const haplotype = parts.length >= 2 && parts[1] !== "" ? Number(parts[1]) : Number.NaN;
|
|
25
25
|
return {
|
|
26
26
|
sample: parts[0],
|
|
27
27
|
haplotype: Number.isFinite(haplotype) ? haplotype : void 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ownStrand,
|
|
3
3
|
strandSides
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VACK24HF.js";
|
|
5
5
|
import {
|
|
6
6
|
pushTo
|
|
7
7
|
} from "./chunk-BSOZW3FC.js";
|
|
@@ -151,14 +151,24 @@ function arcPrefix(line) {
|
|
|
151
151
|
}
|
|
152
152
|
return arc;
|
|
153
153
|
}
|
|
154
|
+
function firstReaching(arc, s) {
|
|
155
|
+
let lo = 0;
|
|
156
|
+
let hi = arc.length;
|
|
157
|
+
while (lo < hi) {
|
|
158
|
+
const mid = lo + hi >> 1;
|
|
159
|
+
if (arc[mid] < s) {
|
|
160
|
+
lo = mid + 1;
|
|
161
|
+
} else {
|
|
162
|
+
hi = mid;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return lo;
|
|
166
|
+
}
|
|
154
167
|
function pointAt(line, arc, s) {
|
|
155
168
|
if (s <= 0) {
|
|
156
169
|
return { ...line[0] };
|
|
157
170
|
}
|
|
158
|
-
|
|
159
|
-
while (i < arc.length && arc[i] < s) {
|
|
160
|
-
i++;
|
|
161
|
-
}
|
|
171
|
+
const i = firstReaching(arc, s);
|
|
162
172
|
if (i >= arc.length) {
|
|
163
173
|
return { ...line.at(-1) };
|
|
164
174
|
}
|
|
@@ -170,8 +180,8 @@ function pointAt(line, arc, s) {
|
|
|
170
180
|
}
|
|
171
181
|
function slice(line, arc, from, to) {
|
|
172
182
|
const points = [pointAt(line, arc, from)];
|
|
173
|
-
for (let i =
|
|
174
|
-
if (arc[i] > from
|
|
183
|
+
for (let i = firstReaching(arc, from); i < line.length && arc[i] < to; i++) {
|
|
184
|
+
if (arc[i] > from) {
|
|
175
185
|
points.push({ ...line[i] });
|
|
176
186
|
}
|
|
177
187
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REFERENCE_RAMP_ALT_COLOR,
|
|
3
3
|
hslToRgb
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JGHZ3N34.js";
|
|
5
5
|
import {
|
|
6
6
|
packAbgr
|
|
7
7
|
} from "./chunk-G2FD7S3C.js";
|
|
@@ -61,18 +61,28 @@ function oklabToRgb([L, a, b]) {
|
|
|
61
61
|
-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
|
|
62
62
|
].map((c) => toGamma(Math.max(0, Math.min(1, c))) * 255);
|
|
63
63
|
}
|
|
64
|
+
var endsCache = /* @__PURE__ */ new Map();
|
|
65
|
+
function oklabEnds(scheme) {
|
|
66
|
+
if (!endsCache.has(scheme)) {
|
|
67
|
+
const family = WALK_SCHEMES.find((s) => s.value === scheme);
|
|
68
|
+
endsCache.set(
|
|
69
|
+
scheme,
|
|
70
|
+
family && "ends" in family ? family.ends.map(oklab) : void 0
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return endsCache.get(scheme);
|
|
74
|
+
}
|
|
64
75
|
function schemeRgb(scheme, t) {
|
|
65
76
|
const x = Math.max(0, Math.min(1, t));
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
77
|
+
const ends = oklabEnds(scheme);
|
|
78
|
+
if (!ends) {
|
|
68
79
|
return hslToRgb(
|
|
69
80
|
rampHueAt(x),
|
|
70
81
|
REFERENCE_RAMP_SATURATION,
|
|
71
82
|
REFERENCE_RAMP_LIGHTNESS
|
|
72
83
|
).map((c) => c * 255);
|
|
73
84
|
}
|
|
74
|
-
const from =
|
|
75
|
-
const to = oklab(family.ends[1]);
|
|
85
|
+
const [from, to] = ends;
|
|
76
86
|
return oklabToRgb(from.map((v, i) => v + (to[i] - v) * x));
|
|
77
87
|
}
|
|
78
88
|
function schemeCss(scheme, t) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
genesFromText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EQDQ7P4Y.js";
|
|
4
4
|
import {
|
|
5
5
|
featuresOnBackbone,
|
|
6
6
|
graphBackbone,
|
|
7
7
|
refNameBinding
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5ORP7EFJ.js";
|
|
9
9
|
|
|
10
10
|
// src/genes/backboneGenes.ts
|
|
11
11
|
async function backboneGenes(graph, source) {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-RJWPJCIB.js";
|
|
10
10
|
import {
|
|
11
11
|
panSNSample
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2JL2JVZ2.js";
|
|
13
13
|
|
|
14
14
|
// src/pathAnchoring.ts
|
|
15
15
|
var RANGE_SUFFIX = /:(\d+)-\d+$/;
|
|
@@ -155,6 +155,30 @@ function trimOrigins(graph, kept) {
|
|
|
155
155
|
} : o;
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
+
function referenceVisitStarts(graph) {
|
|
159
|
+
const { pathVisits } = graph;
|
|
160
|
+
const cache = /* @__PURE__ */ new Map();
|
|
161
|
+
return (node) => {
|
|
162
|
+
let starts = cache.get(node.id);
|
|
163
|
+
if (!starts) {
|
|
164
|
+
starts = [];
|
|
165
|
+
const slot = pathVisits ? pathVisits.slot(node.name) : -1;
|
|
166
|
+
const p = slot >= 0 ? pathVisits.pathIndex(node.stable.refName) : -1;
|
|
167
|
+
if (p >= 0) {
|
|
168
|
+
for (let i = pathVisits.offsets[slot]; i < pathVisits.offsets[slot + 1]; i++) {
|
|
169
|
+
if (pathVisits.path[i] === p) {
|
|
170
|
+
starts.push(pathVisits.start[i]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (starts.length < 2) {
|
|
175
|
+
starts = [node.stable.start];
|
|
176
|
+
}
|
|
177
|
+
cache.set(node.id, starts);
|
|
178
|
+
}
|
|
179
|
+
return starts;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
158
182
|
|
|
159
183
|
export {
|
|
160
184
|
pathOrigin,
|
|
@@ -162,5 +186,6 @@ export {
|
|
|
162
186
|
chooseReferencePath,
|
|
163
187
|
anchorFromPaths,
|
|
164
188
|
anchorGraph,
|
|
165
|
-
trimOrigins
|
|
189
|
+
trimOrigins,
|
|
190
|
+
referenceVisitStarts
|
|
166
191
|
};
|
|
@@ -17,6 +17,7 @@ var Canvas2DRenderer = class {
|
|
|
17
17
|
this.highlightedEdge = null;
|
|
18
18
|
this.highlightFactor = 1;
|
|
19
19
|
this.fit = 1;
|
|
20
|
+
this.painted = null;
|
|
20
21
|
const ctx = canvas.getContext("2d");
|
|
21
22
|
if (!ctx) {
|
|
22
23
|
throw new Error("Canvas 2D context not available");
|
|
@@ -37,13 +38,16 @@ var Canvas2DRenderer = class {
|
|
|
37
38
|
uploadGeometry(batch) {
|
|
38
39
|
this.batch = batch;
|
|
39
40
|
this.highlightedEdge = null;
|
|
41
|
+
this.painted = null;
|
|
40
42
|
}
|
|
41
43
|
setNodeHighlights(factors) {
|
|
42
44
|
this.nodeHighlights = factors;
|
|
45
|
+
this.painted = null;
|
|
43
46
|
}
|
|
44
47
|
setEdgeHighlight(edgeIndex, factor) {
|
|
45
48
|
this.highlightedEdge = edgeIndex;
|
|
46
49
|
this.highlightFactor = factor;
|
|
50
|
+
this.painted = null;
|
|
47
51
|
}
|
|
48
52
|
updateTransform(transform) {
|
|
49
53
|
this.transform = transform;
|
|
@@ -70,46 +74,61 @@ var Canvas2DRenderer = class {
|
|
|
70
74
|
if (clearColor[3] < 1) {
|
|
71
75
|
ctx.clearRect(0, 0, width, height);
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
if (clearColor[3] > 0) {
|
|
78
|
+
ctx.fillStyle = normalizedRgbToCssRgba(
|
|
79
|
+
[clearColor[0], clearColor[1], clearColor[2]],
|
|
80
|
+
clearColor[3]
|
|
81
|
+
);
|
|
82
|
+
ctx.fillRect(0, 0, width, height);
|
|
83
|
+
}
|
|
78
84
|
const batch = this.batch;
|
|
79
85
|
if (!batch) {
|
|
80
86
|
return;
|
|
81
87
|
}
|
|
82
88
|
ctx.lineCap = "round";
|
|
83
89
|
ctx.lineJoin = "round";
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
for (const { color, items } of groupByPaint(batch.edgeCurves, (e, i) => ({
|
|
87
|
-
color: inRun(edgeRun, i) ? brightenAbgr(e.color, factor) : e.color,
|
|
88
|
-
weight: e.thickness,
|
|
89
|
-
last: inRun(edgeRun, i)
|
|
90
|
-
}))) {
|
|
90
|
+
const { edges, nodes, arrows } = this.paintedGroups(batch);
|
|
91
|
+
for (const { color, items } of edges) {
|
|
91
92
|
this.strokeCurves(items, color, t);
|
|
92
93
|
}
|
|
93
|
-
const
|
|
94
|
-
for (const { color, items } of groupByPaint(batch.nodeStrokes, (s, i) => {
|
|
95
|
-
const f = lifted.get(i);
|
|
96
|
-
return {
|
|
97
|
-
color: f === void 0 ? s.color : brightenAbgr(s.color, f),
|
|
98
|
-
weight: s.thickness,
|
|
99
|
-
last: f !== void 0
|
|
100
|
-
};
|
|
101
|
-
})) {
|
|
94
|
+
for (const { color, items } of nodes) {
|
|
102
95
|
this.strokeNodes(items, color, t);
|
|
103
96
|
}
|
|
104
|
-
const
|
|
105
|
-
for (const { color, items } of groupByPaint(batch.arrows, (a, i) => ({
|
|
106
|
-
color: inRun(arrowRun, i) ? brightenAbgr(a.color, factor) : a.color,
|
|
107
|
-
weight: 0,
|
|
108
|
-
last: inRun(arrowRun, i)
|
|
109
|
-
}))) {
|
|
97
|
+
for (const { color, items } of arrows) {
|
|
110
98
|
this.fillArrows(items, color, t);
|
|
111
99
|
}
|
|
112
100
|
}
|
|
101
|
+
// Grouping depends on the batch and the highlights, not on the transform, so
|
|
102
|
+
// a pan or zoom redraws from the groups it already has
|
|
103
|
+
paintedGroups(batch) {
|
|
104
|
+
if (this.painted) {
|
|
105
|
+
return this.painted;
|
|
106
|
+
}
|
|
107
|
+
const factor = this.highlightFactor;
|
|
108
|
+
const edgeRun = this.edgeRun(batch.edgeCurveRuns);
|
|
109
|
+
const arrowRun = this.edgeRun(batch.arrowRuns);
|
|
110
|
+
const lifted = this.liftedStrokes(batch);
|
|
111
|
+
return this.painted = {
|
|
112
|
+
edges: groupByPaint(batch.edgeCurves, (e, i) => ({
|
|
113
|
+
color: inRun(edgeRun, i) ? brightenAbgr(e.color, factor) : e.color,
|
|
114
|
+
weight: e.thickness,
|
|
115
|
+
last: inRun(edgeRun, i)
|
|
116
|
+
})),
|
|
117
|
+
nodes: groupByPaint(batch.nodeStrokes, (s, i) => {
|
|
118
|
+
const f = lifted.get(i);
|
|
119
|
+
return {
|
|
120
|
+
color: f === void 0 ? s.color : brightenAbgr(s.color, f),
|
|
121
|
+
weight: s.thickness,
|
|
122
|
+
last: f !== void 0
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
125
|
+
arrows: groupByPaint(batch.arrows, (a, i) => ({
|
|
126
|
+
color: inRun(arrowRun, i) ? brightenAbgr(a.color, factor) : a.color,
|
|
127
|
+
weight: 0,
|
|
128
|
+
last: inRun(arrowRun, i)
|
|
129
|
+
}))
|
|
130
|
+
};
|
|
131
|
+
}
|
|
113
132
|
// Only what the highlights lift, over a transparent clear, for a hover layer
|
|
114
133
|
// stacked on a canvas that drew the batch without them: a pointer move then
|
|
115
134
|
// repaints one node or edge rather than the whole drawing
|
|
@@ -226,6 +245,7 @@ var Canvas2DRenderer = class {
|
|
|
226
245
|
this.batch = null;
|
|
227
246
|
this.nodeHighlights = /* @__PURE__ */ new Map();
|
|
228
247
|
this.highlightedEdge = null;
|
|
248
|
+
this.painted = null;
|
|
229
249
|
}
|
|
230
250
|
};
|
|
231
251
|
var ARROW_NOTCH = 0.25;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EdgeSpatialIndex,
|
|
3
3
|
SpatialIndex
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6YRSOL4K.js";
|
|
5
5
|
import {
|
|
6
6
|
weakMemo
|
|
7
7
|
} from "./chunk-HMXCN6PG.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
pathRibbonOffsets,
|
|
10
10
|
translateCurves,
|
|
11
11
|
yToXOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VACK24HF.js";
|
|
13
13
|
|
|
14
14
|
// src/util/hitDetection.ts
|
|
15
15
|
function distanceToSegment(px, py, x1, y1, x2, y2) {
|
|
@@ -10,7 +10,8 @@ function parseGafPath(column) {
|
|
|
10
10
|
}
|
|
11
11
|
return steps;
|
|
12
12
|
}
|
|
13
|
-
function parseGafLine(
|
|
13
|
+
function parseGafLine(text) {
|
|
14
|
+
const line = text.trimEnd();
|
|
14
15
|
const columns = line.split(" ");
|
|
15
16
|
if (columns.length < 12 || line.startsWith("#")) {
|
|
16
17
|
return void 0;
|
|
@@ -49,7 +50,7 @@ function parseGafLine(line) {
|
|
|
49
50
|
function parseGaf(text) {
|
|
50
51
|
const records = [];
|
|
51
52
|
for (const line of text.split("\n")) {
|
|
52
|
-
const record = parseGafLine(line
|
|
53
|
+
const record = parseGafLine(line);
|
|
53
54
|
if (record) {
|
|
54
55
|
records.push(record);
|
|
55
56
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
baseEdgeCurves
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OYCQVJYY.js";
|
|
4
4
|
import {
|
|
5
5
|
curveBounds,
|
|
6
6
|
pathRibbonOffsets
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VACK24HF.js";
|
|
8
8
|
|
|
9
9
|
// src/util/SpatialIndex.ts
|
|
10
10
|
var FALLBACK_CELL_SIZE = 50;
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
stopAt,
|
|
3
3
|
stopFields,
|
|
4
4
|
walkStopTags
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LG2UK4MB.js";
|
|
6
6
|
import {
|
|
7
7
|
PathVisits
|
|
8
8
|
} from "./chunk-ZPZ7GNBT.js";
|
|
9
9
|
import {
|
|
10
10
|
panSNFields,
|
|
11
11
|
panSNSample
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2JL2JVZ2.js";
|
|
13
13
|
|
|
14
14
|
// src/gfa/graphTables.ts
|
|
15
15
|
function pLineName(name, start, end) {
|
|
@@ -19,6 +19,8 @@ function tablePath(w, p) {
|
|
|
19
19
|
const walkName = w.names[p];
|
|
20
20
|
const fields = panSNFields(walkName);
|
|
21
21
|
const start = w.starts[p];
|
|
22
|
+
const steps = w.abridgedSteps?.[p] ?? Number.NaN;
|
|
23
|
+
const abridged = Number.isNaN(steps) ? {} : { abridged: { steps, bp: w.abridgedBp?.[p] ?? 0 } };
|
|
22
24
|
return fields ? {
|
|
23
25
|
name: `${fields.sample}#${fields.haplotype}#${fields.contig}`,
|
|
24
26
|
start,
|
|
@@ -26,7 +28,8 @@ function tablePath(w, p) {
|
|
|
26
28
|
...stopFields(
|
|
27
29
|
w.before && stopAt(w.before, p),
|
|
28
30
|
w.after && stopAt(w.after, p)
|
|
29
|
-
)
|
|
31
|
+
),
|
|
32
|
+
...abridged
|
|
30
33
|
} : { name: pLineName(walkName, start, w.ends[p]), start };
|
|
31
34
|
}
|
|
32
35
|
function namesByList(lists, names, listCount, pathNames) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-H2H4Y3TV.js";
|
|
4
4
|
import {
|
|
5
5
|
REFERENCE_RAMP_ALT_CSS
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JGHZ3N34.js";
|
|
7
7
|
import {
|
|
8
8
|
RAMP_GRADIENT_CSS,
|
|
9
9
|
RAMP_GRADIENT_STOPS,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
GAP_CAUSE_TEXT,
|
|
15
15
|
OUTSIDE_TEXT
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LG2UK4MB.js";
|
|
17
17
|
import {
|
|
18
18
|
LABEL_CHAR_PX
|
|
19
19
|
} from "./chunk-AB35TJST.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-CPMHA4W5.js";
|
|
23
23
|
import {
|
|
24
24
|
panSNContig
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2JL2JVZ2.js";
|
|
26
26
|
|
|
27
27
|
// src/layout/walkRowDraw.ts
|
|
28
28
|
var ON_REFERENCE = "#2f8fd6";
|
|
@@ -30,6 +30,7 @@ var OFF_REFERENCE = "#8e3fbf";
|
|
|
30
30
|
var OUTSIDE_CUT = "#bdbdbd";
|
|
31
31
|
var MISSING_INK = "#8a8a8a";
|
|
32
32
|
var UNKNOWN_GAP = "#e2e2e2";
|
|
33
|
+
var ABRIDGED_GAP = "#d9a441";
|
|
33
34
|
var GENE_INK = "#1c1c22";
|
|
34
35
|
var BAR_PX = 12;
|
|
35
36
|
var GAP_PX = 4;
|
|
@@ -48,11 +49,14 @@ function units(bp, unit) {
|
|
|
48
49
|
return unit ? ` \u2248 ${Math.round(bp / unit)} units` : "";
|
|
49
50
|
}
|
|
50
51
|
var near = ({ refName, start }) => `${panSNContig(refName)}:${start < 1e6 ? `${Math.round(start / 1e3)} kb` : `${(start / 1e6).toFixed(1)} Mb`}`;
|
|
51
|
-
function
|
|
52
|
-
|
|
52
|
+
function stepsText(steps) {
|
|
53
|
+
return steps < 1e3 ? `${steps}` : `${Math.round(steps / 1e3)} k`;
|
|
54
|
+
}
|
|
55
|
+
function gapsText(gapBp, runs, abridgedSteps = 0) {
|
|
53
56
|
if (gapBp <= 0) {
|
|
54
57
|
return "";
|
|
55
58
|
}
|
|
59
|
+
const gaps = (runs ?? []).filter((r) => r.gap);
|
|
56
60
|
if (!gaps.some((g) => g.cause)) {
|
|
57
61
|
return ` \xB7 ${kb(gapBp)} ${OUTSIDE_TEXT}`;
|
|
58
62
|
}
|
|
@@ -69,14 +73,15 @@ function gapsText(gapBp, runs) {
|
|
|
69
73
|
[bpOf("unknown"), GAP_CAUSE_TEXT.unknown],
|
|
70
74
|
[bpOf(void 0), OUTSIDE_TEXT]
|
|
71
75
|
];
|
|
72
|
-
|
|
76
|
+
const abridged = bpOf("abridged");
|
|
77
|
+
return (abridged > 0 ? ` \xB7 ${stepsText(abridgedSteps)} steps, ${kb(abridged)} not loaded` : "") + parts.filter(([bp]) => bp > 0).map(([bp, text]) => ` \xB7 ${kb(bp)} ${text}`).join("");
|
|
73
78
|
}
|
|
74
79
|
function walkRowReadout(row, reference, unit, call) {
|
|
75
80
|
const { bp, gapBp, complete, stop } = row;
|
|
76
81
|
if (!reference) {
|
|
77
82
|
return `${kb(bp)}${units(bp, unit)}`;
|
|
78
83
|
}
|
|
79
|
-
const outside = gapsText(gapBp, row.runs);
|
|
84
|
+
const outside = gapsText(gapBp, row.runs, row.abridgedSteps);
|
|
80
85
|
const called = call ? ` \xB7 called ${kb(call.bp)}${call.spanningReads === 0 ? " \xB7 no spanning read" : ""}` : "";
|
|
81
86
|
if (complete) {
|
|
82
87
|
const delta = bp - reference.bp;
|
|
@@ -107,7 +112,7 @@ function unitTicks(bp, unit, pxPerBp) {
|
|
|
107
112
|
return ticks;
|
|
108
113
|
}
|
|
109
114
|
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 };
|
|
115
|
+
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 } : cause === "abridged" ? { fill: ABRIDGED_GAP, px: GAP_PX, label: GAP_CAUSE_TEXT.abridged } : { fill: OUTSIDE_CUT, px: GAP_PX, label: OUTSIDE_TEXT };
|
|
111
116
|
}
|
|
112
117
|
function runPaint(run, ramp) {
|
|
113
118
|
if (run.gap) {
|
|
@@ -221,7 +226,7 @@ function walkRowsKey(bars, o = {}) {
|
|
|
221
226
|
(row) => row.runs.filter((run) => run.gap)
|
|
222
227
|
);
|
|
223
228
|
const labels = new Set(gaps.map((run) => gapStyle(run.cause).label));
|
|
224
|
-
for (const cause of [void 0, "missing", "unknown"]) {
|
|
229
|
+
for (const cause of [void 0, "missing", "unknown", "abridged"]) {
|
|
225
230
|
const { fill, px, label } = gapStyle(cause);
|
|
226
231
|
if (labels.has(label)) {
|
|
227
232
|
entries.push({ swatch: { kind: "gap", fill, px }, label });
|
|
@@ -477,14 +482,15 @@ function walkRowsTree(bars, frame, o = {}) {
|
|
|
477
482
|
})
|
|
478
483
|
) : [];
|
|
479
484
|
const { call } = row;
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
485
|
+
const readout = frame.readouts ?? true ? {
|
|
486
|
+
text: walkRowReadout(
|
|
487
|
+
row,
|
|
488
|
+
i === 0 ? void 0 : reference,
|
|
489
|
+
unit,
|
|
490
|
+
call
|
|
491
|
+
)
|
|
492
|
+
} : void 0;
|
|
493
|
+
const at = readout && readoutPlacement(readout.text, along(row.bp), frame.width);
|
|
488
494
|
return el(
|
|
489
495
|
"g",
|
|
490
496
|
{
|
|
@@ -504,7 +510,7 @@ function walkRowsTree(bars, frame, o = {}) {
|
|
|
504
510
|
height: barPx + 2 * overhang,
|
|
505
511
|
fill: callTickInk(call)
|
|
506
512
|
}),
|
|
507
|
-
|
|
513
|
+
readout && at && el(
|
|
508
514
|
"text",
|
|
509
515
|
{
|
|
510
516
|
x: at.x,
|
|
@@ -517,7 +523,7 @@ function walkRowsTree(bars, frame, o = {}) {
|
|
|
517
523
|
"paint-order": "stroke",
|
|
518
524
|
"text-anchor": at.anchor
|
|
519
525
|
},
|
|
520
|
-
text
|
|
526
|
+
readout.text
|
|
521
527
|
)
|
|
522
528
|
);
|
|
523
529
|
};
|
|
@@ -530,6 +536,7 @@ export {
|
|
|
530
536
|
OUTSIDE_CUT,
|
|
531
537
|
MISSING_INK,
|
|
532
538
|
UNKNOWN_GAP,
|
|
539
|
+
ABRIDGED_GAP,
|
|
533
540
|
GENE_INK,
|
|
534
541
|
BAR_PX,
|
|
535
542
|
GAP_PX,
|