@jbrowse/bandage-core 9.9.1 → 9.9.2
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-JABM3MUS.js → chunk-2CMYNW3E.js} +1 -1
- package/dist/chunks/{chunk-EC4UZHWQ.js → chunk-BQ33OOLC.js} +1 -1
- package/dist/chunks/{chunk-IJYFJVIT.js → chunk-HK5Y2YWV.js} +1 -0
- package/dist/chunks/{chunk-D4I6GGFX.js → chunk-IZ3W5IU2.js} +1 -1
- package/dist/chunks/{chunk-2NROXCK3.js → chunk-PIN7ZMTZ.js} +62 -8
- package/dist/cli/figure.js +2 -2
- package/dist/figure.js +2 -2
- package/dist/index.js +8 -8
- package/dist/tubeMap/draw.js +2 -1
- package/dist/tubeMap/frame.js +2 -2
- package/dist/tubeMap/warp.js +3 -1
- package/dist/types/tubeMap/draw.d.ts +1 -1
- package/dist/types/tubeMap/warp.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tubeMapMismatches
|
|
3
3
|
} from "./chunk-XXT2JCAC.js";
|
|
4
|
+
import {
|
|
5
|
+
MAX_GAP_PX
|
|
6
|
+
} from "./chunk-HK5Y2YWV.js";
|
|
4
7
|
import {
|
|
5
8
|
readColor
|
|
6
9
|
} from "./chunk-CWFNEKST.js";
|
|
@@ -68,7 +71,7 @@ function trackColors(layout, pathColors) {
|
|
|
68
71
|
])
|
|
69
72
|
);
|
|
70
73
|
}
|
|
71
|
-
function layerOf(layout, type, colors, referenceIds) {
|
|
74
|
+
function layerOf(layout, type, colors, referenceIds, gapWidth) {
|
|
72
75
|
const { shapes } = layout;
|
|
73
76
|
const haplotype = type === "haplotype";
|
|
74
77
|
const colorOf = (s) => colors.get(s.id);
|
|
@@ -83,7 +86,7 @@ function layerOf(layout, type, colors, referenceIds) {
|
|
|
83
86
|
y0: r.yStart,
|
|
84
87
|
y1: r.yEnd + 1
|
|
85
88
|
}));
|
|
86
|
-
const curves = curvePaths(shapes.curves, type).map(
|
|
89
|
+
const curves = curvePaths(shapes.curves, type, { gapWidth }).map(
|
|
87
90
|
(c) => shapeOf(c.path, colorOf(c), c.id, haplotype, isReference(c))
|
|
88
91
|
);
|
|
89
92
|
const corners = shapes.corners.filter((c) => c.type === type).map((c) => shapeOf(c.path, colorOf(c), c.id, haplotype, isReference(c)));
|
|
@@ -101,10 +104,12 @@ function referenceTrackIds(graph) {
|
|
|
101
104
|
function tubeMapPicture({
|
|
102
105
|
layout,
|
|
103
106
|
pathColors,
|
|
104
|
-
graph
|
|
107
|
+
graph,
|
|
108
|
+
columns
|
|
105
109
|
}) {
|
|
106
110
|
const colors = trackColors(layout, pathColors);
|
|
107
111
|
const referenceIds = referenceTrackIds(graph);
|
|
112
|
+
const gapWidth = columns ? MAX_GAP_PX : void 0;
|
|
108
113
|
const nodes = [];
|
|
109
114
|
layout.nodes.forEach((node) => {
|
|
110
115
|
if (node.order >= 0) {
|
|
@@ -115,8 +120,8 @@ function tubeMapPicture({
|
|
|
115
120
|
return {
|
|
116
121
|
bounds: layout.bounds,
|
|
117
122
|
layers: [
|
|
118
|
-
layerOf(layout, "haplotype", colors, referenceIds),
|
|
119
|
-
layerOf(layout, "read", colors, referenceIds)
|
|
123
|
+
layerOf(layout, "haplotype", colors, referenceIds, gapWidth),
|
|
124
|
+
layerOf(layout, "read", colors, referenceIds, gapWidth)
|
|
120
125
|
],
|
|
121
126
|
nodes,
|
|
122
127
|
mismatches: tubeMapMismatches(layout).filter(
|
|
@@ -297,11 +302,60 @@ function drawMismatches(ctx, marks, frame) {
|
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
304
|
}
|
|
305
|
+
function outline(commands, x, y) {
|
|
306
|
+
const points = [];
|
|
307
|
+
let cx = 0;
|
|
308
|
+
let cy = 0;
|
|
309
|
+
const STEPS = 12;
|
|
310
|
+
for (const c of commands) {
|
|
311
|
+
if (c.op === "C" || c.op === "Q") {
|
|
312
|
+
for (let i = 1; i <= STEPS; i++) {
|
|
313
|
+
const t = i / STEPS;
|
|
314
|
+
const u = 1 - t;
|
|
315
|
+
const [px, py] = c.op === "C" ? [
|
|
316
|
+
u * u * u * cx + 3 * u * u * t * c.x1 + 3 * u * t * t * c.x2 + t * t * t * c.x,
|
|
317
|
+
u * u * u * cy + 3 * u * u * t * c.y1 + 3 * u * t * t * c.y2 + t * t * t * c.y
|
|
318
|
+
] : [
|
|
319
|
+
u * u * cx + 2 * u * t * c.x1 + t * t * c.x,
|
|
320
|
+
u * u * cy + 2 * u * t * c.y1 + t * t * c.y
|
|
321
|
+
];
|
|
322
|
+
points.push([x(px), y(py)]);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (c.op !== "Z") {
|
|
326
|
+
cx = "x" in c ? c.x : cx;
|
|
327
|
+
cy = "y" in c ? c.y : cy;
|
|
328
|
+
if (c.op !== "C" && c.op !== "Q") {
|
|
329
|
+
points.push([x(cx), y(cy)]);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return points;
|
|
334
|
+
}
|
|
335
|
+
function inside(points, sx, sy) {
|
|
336
|
+
let hit = false;
|
|
337
|
+
for (let i = 0, j = points.length - 1; i < points.length; j = i++) {
|
|
338
|
+
const [xi, yi] = points[i];
|
|
339
|
+
const [xj, yj] = points[j];
|
|
340
|
+
if (yi > sy !== yj > sy && sx < (xj - xi) * (sy - yi) / (yj - yi) + xi) {
|
|
341
|
+
hit = !hit;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return hit;
|
|
345
|
+
}
|
|
300
346
|
function tubeMapTrackAt(picture, { x, y }, sx, sy) {
|
|
301
347
|
for (let l = picture.layers.length - 1; l >= 0; l--) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
348
|
+
const { rects, shapes } = picture.layers[l];
|
|
349
|
+
for (const reference of [true, false]) {
|
|
350
|
+
for (const r of rects) {
|
|
351
|
+
if (r.reference === reference && x(r.x0) <= sx && sx <= x(r.x1) && y(r.y0) <= sy && sy <= y(r.y1)) {
|
|
352
|
+
return r.id;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
for (const s of shapes) {
|
|
356
|
+
if (s.reference === reference && x(s.x0) <= sx && sx <= x(s.x1) && inside(outline(s.commands, x, y), sx, sy)) {
|
|
357
|
+
return s.id;
|
|
358
|
+
}
|
|
305
359
|
}
|
|
306
360
|
}
|
|
307
361
|
}
|
package/dist/cli/figure.js
CHANGED
|
@@ -35,7 +35,7 @@ import "../chunks/chunk-LTUWJKHD.js";
|
|
|
35
35
|
import "../chunks/chunk-WSIFAZU7.js";
|
|
36
36
|
import {
|
|
37
37
|
figureSvg
|
|
38
|
-
} from "../chunks/chunk-
|
|
38
|
+
} from "../chunks/chunk-IZ3W5IU2.js";
|
|
39
39
|
import "../chunks/chunk-47DYCZOK.js";
|
|
40
40
|
import "../chunks/chunk-MECWJY2R.js";
|
|
41
41
|
import "../chunks/chunk-WBCOREDZ.js";
|
|
@@ -54,7 +54,7 @@ import "../chunks/chunk-2LQ5BWT7.js";
|
|
|
54
54
|
import "../chunks/chunk-YS7VA5SI.js";
|
|
55
55
|
import "../chunks/chunk-F4BKWWLS.js";
|
|
56
56
|
import "../chunks/chunk-G2FD7S3C.js";
|
|
57
|
-
import "../chunks/chunk-
|
|
57
|
+
import "../chunks/chunk-BQ33OOLC.js";
|
|
58
58
|
import "../chunks/chunk-TOVOJNT7.js";
|
|
59
59
|
import {
|
|
60
60
|
filterSamples,
|
package/dist/figure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
figureSvg
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-IZ3W5IU2.js";
|
|
4
4
|
import "./chunks/chunk-47DYCZOK.js";
|
|
5
5
|
import "./chunks/chunk-MECWJY2R.js";
|
|
6
6
|
import "./chunks/chunk-WBCOREDZ.js";
|
|
@@ -16,7 +16,7 @@ import "./chunks/chunk-2LQ5BWT7.js";
|
|
|
16
16
|
import "./chunks/chunk-YS7VA5SI.js";
|
|
17
17
|
import "./chunks/chunk-F4BKWWLS.js";
|
|
18
18
|
import "./chunks/chunk-G2FD7S3C.js";
|
|
19
|
-
import "./chunks/chunk-
|
|
19
|
+
import "./chunks/chunk-BQ33OOLC.js";
|
|
20
20
|
import "./chunks/chunk-TOVOJNT7.js";
|
|
21
21
|
import "./chunks/chunk-6PYZYBBF.js";
|
|
22
22
|
import "./chunks/chunk-EDASNMLY.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
tubeMapFrame,
|
|
6
6
|
tubeMapNodeAt
|
|
7
|
-
} from "./chunks/chunk-
|
|
7
|
+
} from "./chunks/chunk-2CMYNW3E.js";
|
|
8
8
|
import {
|
|
9
9
|
drawTubeMapGenes,
|
|
10
10
|
tubeMapGenes
|
|
@@ -12,10 +12,6 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
tubeMapNodeColors
|
|
14
14
|
} from "./chunks/chunk-KJEMKHVB.js";
|
|
15
|
-
import {
|
|
16
|
-
referenceKnots,
|
|
17
|
-
warpX
|
|
18
|
-
} from "./chunks/chunk-IJYFJVIT.js";
|
|
19
15
|
import {
|
|
20
16
|
bundleRoutes
|
|
21
17
|
} from "./chunks/chunk-WVBYR6Y7.js";
|
|
@@ -37,8 +33,12 @@ import {
|
|
|
37
33
|
tubeMapMismatchAt,
|
|
38
34
|
tubeMapPicture,
|
|
39
35
|
tubeMapTrackAt
|
|
40
|
-
} from "./chunks/chunk-
|
|
36
|
+
} from "./chunks/chunk-PIN7ZMTZ.js";
|
|
41
37
|
import "./chunks/chunk-XXT2JCAC.js";
|
|
38
|
+
import {
|
|
39
|
+
referenceKnots,
|
|
40
|
+
warpX
|
|
41
|
+
} from "./chunks/chunk-HK5Y2YWV.js";
|
|
42
42
|
import {
|
|
43
43
|
createForceLayoutCache
|
|
44
44
|
} from "./chunks/chunk-YAN2ZPNV.js";
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
} from "./chunks/chunk-AZFVORTC.js";
|
|
123
123
|
import {
|
|
124
124
|
figureSvg
|
|
125
|
-
} from "./chunks/chunk-
|
|
125
|
+
} from "./chunks/chunk-IZ3W5IU2.js";
|
|
126
126
|
import {
|
|
127
127
|
svgCanvas
|
|
128
128
|
} from "./chunks/chunk-47DYCZOK.js";
|
|
@@ -222,7 +222,7 @@ import {
|
|
|
222
222
|
import "./chunks/chunk-G2FD7S3C.js";
|
|
223
223
|
import {
|
|
224
224
|
version
|
|
225
|
-
} from "./chunks/chunk-
|
|
225
|
+
} from "./chunks/chunk-BQ33OOLC.js";
|
|
226
226
|
import {
|
|
227
227
|
walkRowLabels,
|
|
228
228
|
walkRowsExtent
|
package/dist/tubeMap/draw.js
CHANGED
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
tubeMapMismatchAt,
|
|
9
9
|
tubeMapPicture,
|
|
10
10
|
tubeMapTrackAt
|
|
11
|
-
} from "../chunks/chunk-
|
|
11
|
+
} from "../chunks/chunk-PIN7ZMTZ.js";
|
|
12
12
|
import "../chunks/chunk-XXT2JCAC.js";
|
|
13
|
+
import "../chunks/chunk-HK5Y2YWV.js";
|
|
13
14
|
import "../chunks/chunk-CWFNEKST.js";
|
|
14
15
|
import "../chunks/chunk-C44YRP5F.js";
|
|
15
16
|
import "../chunks/chunk-IGJCTPFB.js";
|
package/dist/tubeMap/frame.js
CHANGED
package/dist/tubeMap/warp.js
CHANGED
|
@@ -61,7 +61,7 @@ export interface TubeMapPicture {
|
|
|
61
61
|
mismatches: TubeMapMismatch[];
|
|
62
62
|
}
|
|
63
63
|
export declare function trackColors(layout: TubeMapLayout, pathColors: readonly string[]): ReadonlyMap<number, string>;
|
|
64
|
-
export declare function tubeMapPicture({ layout, pathColors, graph, }: Pick<TubeMapDrawing, 'layout' | 'pathColors'> & Partial<Pick<TubeMapDrawing, 'graph'>>): TubeMapPicture;
|
|
64
|
+
export declare function tubeMapPicture({ layout, pathColors, graph, columns, }: Pick<TubeMapDrawing, 'layout' | 'pathColors'> & Partial<Pick<TubeMapDrawing, 'graph' | 'columns'>>): TubeMapPicture;
|
|
65
65
|
export interface TubeMapFrame extends TubeMapTransform {
|
|
66
66
|
width: number;
|
|
67
67
|
highlightNode?: string | null;
|
|
@@ -3,5 +3,6 @@ export interface Knot {
|
|
|
3
3
|
tx: number;
|
|
4
4
|
sx: number;
|
|
5
5
|
}
|
|
6
|
+
export declare const MAX_GAP_PX = 24;
|
|
6
7
|
export declare function referenceKnots(columns: readonly TubeMapColumn[], bpToScreen: (bp: number) => number): Knot[];
|
|
7
8
|
export declare function warpX(knots: readonly Knot[], tx: number): number;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "9.9.
|
|
1
|
+
export declare const version = "9.9.2";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/bandage-core",
|
|
3
|
-
"version": "9.9.
|
|
3
|
+
"version": "9.9.2",
|
|
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": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@gmod/gbz-base": "^7.0.0",
|
|
39
39
|
"@gmod/tabix": "^3.9.1",
|
|
40
|
-
"@jbrowse/tubemap-core": "^0.2.
|
|
40
|
+
"@jbrowse/tubemap-core": "^0.2.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@eslint/js": "^10.0.1",
|