@jbrowse/bandage-core 10.2.2 → 10.2.4
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 +8 -7
- package/dist/bubbles/bubbleHalos.js +7 -3
- package/dist/bubbles/bubblesFromGraph.js +4 -2
- package/dist/bubbles/classifyBubble.js +10 -5
- package/dist/bubbles/superbubbles.js +10 -6
- package/dist/chunks/{chunk-N6FECAXP.js → chunk-24WITXQY.js} +17 -8
- package/dist/chunks/{chunk-EYK7DJZV.js → chunk-2CHS5LMM.js} +1 -1
- package/dist/chunks/{chunk-XTCNEKO5.js → chunk-2QLLQJ72.js} +15 -13
- package/dist/chunks/{chunk-TWRLC3KK.js → chunk-3XSM4OZU.js} +1 -1
- package/dist/chunks/{chunk-WEDZ76AK.js → chunk-4DRQTBBE.js} +1 -1
- package/dist/chunks/{chunk-2LQ5BWT7.js → chunk-4ETPXDO6.js} +1 -1
- package/dist/chunks/{chunk-FP4H7SFT.js → chunk-4HWM3FNK.js} +2 -2
- package/dist/chunks/{chunk-C7MZJSPT.js → chunk-54POIBVC.js} +2 -8
- package/dist/chunks/{chunk-PKFMP65V.js → chunk-5GMFEPWR.js} +1 -1
- package/dist/chunks/{chunk-CDLPYR5O.js → chunk-5I3K4R2G.js} +7 -6
- package/dist/chunks/{chunk-2CVHXFK7.js → chunk-7SRWJLSC.js} +19 -22
- package/dist/chunks/{chunk-SBMJNRTV.js → chunk-A4PFFC4Q.js} +37 -27
- package/dist/chunks/{chunk-FNGIQF43.js → chunk-ABUIN5AK.js} +6 -14
- package/dist/chunks/{chunk-IW6CYVX2.js → chunk-AR4BUBMU.js} +6 -1
- package/dist/chunks/{chunk-IUDJKOLB.js → chunk-B6IW3IRE.js} +15 -33
- package/dist/chunks/{chunk-JUIJI7RC.js → chunk-BAETMD3J.js} +9 -4
- package/dist/chunks/{chunk-L5WF4ZPS.js → chunk-BS4UZ44I.js} +1 -1
- package/dist/chunks/{chunk-HNQPEMYE.js → chunk-CM6LO6OC.js} +0 -1
- package/dist/chunks/{chunk-CLOP7UVD.js → chunk-CQHUZHET.js} +11 -8
- package/dist/chunks/{chunk-R456ME6J.js → chunk-CU6P5RUG.js} +17 -6
- package/dist/chunks/chunk-D5D36ZF6.js +107 -0
- package/dist/chunks/{chunk-AFP3NWSL.js → chunk-DY3JCAMX.js} +1 -1
- package/dist/chunks/{chunk-NRV7R36Q.js → chunk-EFQLEGWM.js} +3 -3
- package/dist/chunks/{chunk-BXEPA4KS.js → chunk-G6UIYQZR.js} +5 -2
- package/dist/chunks/{chunk-ASSNZXCF.js → chunk-GINYTQ43.js} +44 -103
- package/dist/chunks/{chunk-NNODIW4U.js → chunk-H2H4Y3TV.js} +1 -0
- package/dist/chunks/{chunk-MVFDSFV2.js → chunk-HNCXR2VS.js} +1 -1
- package/dist/chunks/chunk-JA2HJIYS.js +71 -0
- package/dist/chunks/{chunk-PBENCR5L.js → chunk-JBCZIBFC.js} +0 -2
- package/dist/chunks/{chunk-5BGP5Z64.js → chunk-JLSJMCDJ.js} +1 -1
- package/dist/chunks/{chunk-DT2GGH4D.js → chunk-JMABOQWL.js} +2 -6
- package/dist/chunks/{chunk-3S3YVOJ7.js → chunk-JSUCGZ6K.js} +1 -1
- package/dist/chunks/{chunk-MLSWIMZO.js → chunk-KBEP7VYK.js} +2 -2
- package/dist/chunks/{chunk-DRG4236Y.js → chunk-KC7T5RWG.js} +2 -20
- package/dist/chunks/{chunk-TAMCZHLW.js → chunk-N73TI3VG.js} +2 -2
- package/dist/chunks/chunk-O4EGE27I.js +10 -0
- package/dist/chunks/{chunk-3ZZSX5HN.js → chunk-PTABFYQ7.js} +10 -6
- package/dist/chunks/{chunk-WBCOREDZ.js → chunk-QLWI2PZ3.js} +16 -7
- package/dist/chunks/chunk-RBCE2OQH.js +32 -0
- package/dist/chunks/{chunk-BUBZ32IC.js → chunk-RPRHR56C.js} +4 -8
- package/dist/chunks/{chunk-47DYCZOK.js → chunk-RUCH6ZFL.js} +4 -0
- package/dist/chunks/{chunk-GNTTI6LA.js → chunk-T2PCSAFY.js} +1 -1
- package/dist/chunks/{chunk-XKWD2RY3.js → chunk-URZ3CH2R.js} +3 -10
- package/dist/chunks/{chunk-ALDGONEI.js → chunk-VQC7KELB.js} +1 -1
- package/dist/chunks/{chunk-FLFBYSJO.js → chunk-VQWHMWLF.js} +5 -1
- package/dist/chunks/{chunk-4R6QNG23.js → chunk-WL6ZKUVC.js} +3 -3
- package/dist/chunks/{chunk-CRTD2SBP.js → chunk-WZNPX7Q6.js} +6 -2
- package/dist/chunks/{chunk-TICYLD5F.js → chunk-XAWLIU54.js} +35 -78
- package/dist/chunks/{chunk-DK5P2YOL.js → chunk-XI3ZUTWF.js} +2 -2
- package/dist/chunks/{chunk-ZIUKZUPJ.js → chunk-XL472HHD.js} +1 -1
- package/dist/chunks/{chunk-BPRXQ2SS.js → chunk-XMW266WS.js} +1 -1
- package/dist/chunks/{chunk-WFB5TXRA.js → chunk-ZY2AFL4Y.js} +13 -31
- package/dist/cli/decodeText.js +6 -0
- package/dist/cli/figure.js +59 -60
- package/dist/cli/fold.js +13 -13
- package/dist/deletionEdges.js +6 -4
- package/dist/el.js +3 -1
- package/dist/figure.js +33 -31
- package/dist/figureData.js +32 -27
- package/dist/figureScene.js +43 -0
- package/dist/figureSettings.js +8 -8
- package/dist/foldVariants.js +2 -2
- package/dist/gbzCut.js +1 -1
- package/dist/genes/exonOutline.js +2 -2
- package/dist/genes/geneFiles.js +1 -1
- package/dist/genes/genePins.js +3 -3
- package/dist/gfa/gfaConverter.js +2 -2
- package/dist/gfa-core/gfaParser.js +1 -1
- package/dist/gfa-core/index.js +1 -1
- package/dist/graphLabels.js +4 -4
- package/dist/index.js +72 -73
- package/dist/labelLayout.js +8 -8
- package/dist/layout/forceCache.js +8 -8
- package/dist/layout/mergeRuns.js +2 -2
- package/dist/layout/orderedLayout.js +1 -3
- package/dist/layout/tubeMapLayout.js +6 -6
- package/dist/layout/walkRowDraw.js +11 -11
- package/dist/layout/walkRowLayout.js +3 -1
- package/dist/layout/walkStrip.js +14 -12
- package/dist/layoutEngines.js +1 -2
- package/dist/layoutModes.js +9 -9
- package/dist/nodeWidths.js +1 -3
- package/dist/pathColors.js +5 -5
- package/dist/pipeline.js +7 -7
- package/dist/referenceRampCss.js +9 -9
- package/dist/referenceStrip.js +9 -9
- package/dist/renderer/Canvas2DRenderer.js +2 -2
- package/dist/renderer/GeometryBuilder.js +8 -8
- package/dist/renderer/canvas.js +1 -1
- package/dist/renderer/svgCanvas.js +1 -1
- package/dist/tubeMap/axis.js +5 -5
- package/dist/tubeMap/bundle.js +7 -7
- package/dist/tubeMap/coarsen.js +6 -6
- package/dist/tubeMap/deviations.js +5 -5
- package/dist/tubeMap/draw.js +1 -1
- package/dist/tubeMap/genes.js +6 -6
- package/dist/tubeMap/nodeColors.js +9 -9
- package/dist/types/bubbles/bubbleHalos.d.ts +2 -8
- package/dist/types/bubbles/bubblesFromGraph.d.ts +1 -0
- package/dist/types/bubbles/classifyBubble.d.ts +0 -1
- package/dist/types/cli/decodeText.d.ts +1 -0
- package/dist/types/cli/figure.d.ts +4 -15
- package/dist/types/deletionEdges.d.ts +3 -5
- package/dist/types/el.d.ts +1 -0
- package/dist/types/figureData.d.ts +7 -26
- package/dist/types/figureScene.d.ts +31 -0
- package/dist/types/genes/geneFiles.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/labelLayout.d.ts +1 -5
- package/dist/types/layout/deletionRoutes.d.ts +1 -1
- package/dist/types/layout/orderedLayout.d.ts +0 -6
- package/dist/types/layout/walkRowLayout.d.ts +1 -0
- package/dist/types/nodeWidths.d.ts +0 -1
- package/dist/types/renderer/Canvas2DRenderer.d.ts +1 -0
- package/dist/types/renderer/canvas.d.ts +2 -2
- package/dist/types/tubeMap/draw.d.ts +1 -0
- package/dist/types/util/geometry.d.ts +3 -3
- package/dist/types/version.d.ts +1 -1
- package/dist/util/SpatialIndex.js +4 -4
- package/dist/util/edgeCurves.js +3 -3
- package/dist/util/geometry.js +3 -3
- package/dist/util/hitDetection.js +5 -5
- package/dist/version.js +1 -1
- package/dist/viewport.js +8 -8
- package/dist/walkEncoding.js +9 -9
- package/dist/walkHighlight.js +10 -10
- package/dist/walkKey.js +5 -5
- package/package.json +3 -6
- package/dist/chunks/bandage-layout-3AR6BCUD.js +0 -4694
- package/dist/chunks/chunk-4BYTEJGW.js +0 -44
- package/dist/chunks/chunk-7XHHVYG7.js +0 -13
- package/dist/chunks/chunk-EHUBJDDB.js +0 -135
- package/dist/loadBandage.js +0 -6
- package/dist/types/bandage/bandage-layout.d.ts +0 -14
- package/dist/types/loadBandage.d.ts +0 -3
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// src/renderer/canvas.ts
|
|
2
|
-
var MAX_DPR = 2;
|
|
3
|
-
var MAX_CANVAS_DIM_PX = 8192;
|
|
4
|
-
function getDpr() {
|
|
5
|
-
return typeof devicePixelRatio === "undefined" ? 1 : Math.min(devicePixelRatio, MAX_DPR);
|
|
6
|
-
}
|
|
7
|
-
var warnedCanvasClamp = false;
|
|
8
|
-
function backingPx(cssSize, dpr, axis) {
|
|
9
|
-
const value = Math.round(cssSize * dpr);
|
|
10
|
-
if (value > MAX_CANVAS_DIM_PX) {
|
|
11
|
-
if (!warnedCanvasClamp) {
|
|
12
|
-
warnedCanvasClamp = true;
|
|
13
|
-
console.warn(
|
|
14
|
-
`Canvas ${axis} ${value}px exceeds the safe limit ${MAX_CANVAS_DIM_PX}px and was clamped`
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
return MAX_CANVAS_DIM_PX;
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
function syncCanvasSize(canvas, width, height) {
|
|
22
|
-
const dpr = getDpr();
|
|
23
|
-
const pw = backingPx(width, dpr, "width");
|
|
24
|
-
const ph = backingPx(height, dpr, "height");
|
|
25
|
-
if (canvas.width !== pw || canvas.height !== ph) {
|
|
26
|
-
canvas.width = pw;
|
|
27
|
-
canvas.height = ph;
|
|
28
|
-
}
|
|
29
|
-
const cssWidth = `${width}px`;
|
|
30
|
-
const cssHeight = `${height}px`;
|
|
31
|
-
if (canvas.style.width !== cssWidth) {
|
|
32
|
-
canvas.style.width = cssWidth;
|
|
33
|
-
}
|
|
34
|
-
if (canvas.style.height !== cssHeight) {
|
|
35
|
-
canvas.style.height = cssHeight;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
MAX_DPR,
|
|
41
|
-
MAX_CANVAS_DIM_PX,
|
|
42
|
-
getDpr,
|
|
43
|
-
syncCanvasSize
|
|
44
|
-
};
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bubbleSegmentIds,
|
|
3
|
-
classifyBubble,
|
|
4
|
-
formatBp
|
|
5
|
-
} from "./chunk-XKWD2RY3.js";
|
|
6
|
-
import {
|
|
7
|
-
svgPath
|
|
8
|
-
} from "./chunk-2CVHXFK7.js";
|
|
9
|
-
import {
|
|
10
|
-
isBackbone
|
|
11
|
-
} from "./chunk-FYQWPEEY.js";
|
|
12
|
-
|
|
13
|
-
// src/bubbles/bubbleHalos.ts
|
|
14
|
-
var WHOLE_FRACTION = 0.9;
|
|
15
|
-
function coversGraph(members, nodes) {
|
|
16
|
-
return members + 2 >= nodes || members >= WHOLE_FRACTION * nodes;
|
|
17
|
-
}
|
|
18
|
-
var SMALL_VARIANT_BP = 50;
|
|
19
|
-
var NAMED_WALKS = 2;
|
|
20
|
-
var MIN_CHIPPED_BP = 1e3;
|
|
21
|
-
function bubbleHalos(graph, bubbles, positions, walkLabel = (name) => name, repeats = []) {
|
|
22
|
-
const byName = new Map(graph.nodes.map((n) => [n.name, n]));
|
|
23
|
-
const halos = [];
|
|
24
|
-
for (const bubble of bubbles) {
|
|
25
|
-
const parts = [];
|
|
26
|
-
let minX = Infinity;
|
|
27
|
-
let maxX = -Infinity;
|
|
28
|
-
let minY = Infinity;
|
|
29
|
-
const nodeIds = [];
|
|
30
|
-
const ends = [];
|
|
31
|
-
const names = bubbleSegmentIds(bubble);
|
|
32
|
-
for (const [i, name] of names.entries()) {
|
|
33
|
-
const node = byName.get(name);
|
|
34
|
-
const line = node && positions[node.id];
|
|
35
|
-
if (!node || !line?.length) {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (bubble.key ? i === 0 || i === names.length - 1 : isBackbone(node) && (node.stable.start < bubble.start || node.stable.start >= bubble.end)) {
|
|
39
|
-
ends.push(line[Math.floor(line.length / 2)]);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
nodeIds.push(node.id);
|
|
43
|
-
parts.push(svgPath(line.length === 1 ? [line[0], line[0]] : line));
|
|
44
|
-
for (const p of line) {
|
|
45
|
-
minX = Math.min(minX, p.x);
|
|
46
|
-
maxX = Math.max(maxX, p.x);
|
|
47
|
-
minY = Math.min(minY, p.y);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (nodeIds.length === 0) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
const labelAt = { x: (minX + maxX) / 2, y: minY };
|
|
54
|
-
const anchor = ends.length ? {
|
|
55
|
-
x: ends.reduce((s, p) => s + p.x, 0) / ends.length,
|
|
56
|
-
y: ends.reduce((s, p) => s + p.y, 0) / ends.length
|
|
57
|
-
} : labelAt;
|
|
58
|
-
const routes = [];
|
|
59
|
-
for (const [route, own] of ownStretches(bubble)) {
|
|
60
|
-
let at;
|
|
61
|
-
let far = -1;
|
|
62
|
-
for (const id of own) {
|
|
63
|
-
for (const p of positions[id] ?? []) {
|
|
64
|
-
const d = Math.hypot(p.x - anchor.x, p.y - anchor.y);
|
|
65
|
-
if (d > far) {
|
|
66
|
-
far = d;
|
|
67
|
-
at = p;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (at) {
|
|
72
|
-
routes.push({ route, at, text: routeText(route, walkLabel) });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const whole = bubble.covering === true || coversGraph(nodeIds.length, graph.nodes.length);
|
|
76
|
-
halos.push({
|
|
77
|
-
bubble,
|
|
78
|
-
...classifyBubble(bubble, repeats),
|
|
79
|
-
path: parts.join(""),
|
|
80
|
-
labelAt,
|
|
81
|
-
members: nodeIds.length,
|
|
82
|
-
nodeIds,
|
|
83
|
-
whole,
|
|
84
|
-
// The drawing's own bubble keeps its name however small. A partial
|
|
85
|
-
// bubble's lengths are a floor, so it may be no small variant.
|
|
86
|
-
tick: !whole && !bubble.partial && bubble.longestAlleleLength < SMALL_VARIANT_BP,
|
|
87
|
-
routes
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return halos;
|
|
91
|
-
}
|
|
92
|
-
var stretches = /* @__PURE__ */ new WeakMap();
|
|
93
|
-
function ownStretches(bubble) {
|
|
94
|
-
const cached = stretches.get(bubble);
|
|
95
|
-
if (cached) {
|
|
96
|
-
return cached;
|
|
97
|
-
}
|
|
98
|
-
const chipped = bubble.longestAlleleLength < MIN_CHIPPED_BP ? [] : bubble.routes ?? [];
|
|
99
|
-
const sharing = /* @__PURE__ */ new Map();
|
|
100
|
-
chipped.forEach((route, r) => {
|
|
101
|
-
const counted = /* @__PURE__ */ new Map();
|
|
102
|
-
for (const id of route.steps) {
|
|
103
|
-
if (counted.get(id) !== r) {
|
|
104
|
-
counted.set(id, r);
|
|
105
|
-
sharing.set(id, (sharing.get(id) ?? 0) + 1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
const own = /* @__PURE__ */ new Map();
|
|
110
|
-
for (const route of chipped) {
|
|
111
|
-
let rarest = Infinity;
|
|
112
|
-
for (const id of route.steps) {
|
|
113
|
-
rarest = Math.min(rarest, sharing.get(id));
|
|
114
|
-
}
|
|
115
|
-
const steps = new Set(route.steps.filter((id) => sharing.get(id) === rarest));
|
|
116
|
-
if (steps.size > 0) {
|
|
117
|
-
own.set(route, [...steps]);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
stretches.set(bubble, own);
|
|
121
|
-
return own;
|
|
122
|
-
}
|
|
123
|
-
function routeText(route, walkLabel) {
|
|
124
|
-
const names = [...new Set(route.walks.map(walkLabel))].sort();
|
|
125
|
-
const shown = names.slice(0, NAMED_WALKS).join(", ");
|
|
126
|
-
const more = names.length > NAMED_WALKS ? ` +${names.length - NAMED_WALKS}` : "";
|
|
127
|
-
return `${shown}${more} \xB7 ${formatBp(route.bp)}`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
WHOLE_FRACTION,
|
|
132
|
-
coversGraph,
|
|
133
|
-
SMALL_VARIANT_BP,
|
|
134
|
-
bubbleHalos
|
|
135
|
-
};
|
package/dist/loadBandage.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { LayoutNode } from '../layout/referenceSeeds.js'
|
|
2
|
-
import type { Graph, LayoutResult } from '../types.js'
|
|
3
|
-
|
|
4
|
-
export interface BandageModule {
|
|
5
|
-
computeLayout(
|
|
6
|
-
graph: { nodes: LayoutNode[]; edges: Graph['edges'] },
|
|
7
|
-
options: Record<string, unknown>,
|
|
8
|
-
): LayoutResult
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// The vendored Emscripten bundle's default export is a factory that
|
|
12
|
-
// instantiates the wasm module (layout inlined, -sSINGLE_FILE=1).
|
|
13
|
-
declare const createBandageLayoutModule: () => Promise<BandageModule>
|
|
14
|
-
export default createBandageLayoutModule
|