@jbrowse/bandage-core 9.5.0 → 9.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.
@@ -3,7 +3,7 @@ import {
3
3
  WHOLE_FRACTION,
4
4
  bubbleHalos,
5
5
  coversGraph
6
- } from "../chunks/chunk-REM73HCU.js";
6
+ } from "../chunks/chunk-EHUBJDDB.js";
7
7
  import "../chunks/chunk-XKWD2RY3.js";
8
8
  import "../chunks/chunk-FX4RDMDN.js";
9
9
  import "../chunks/chunk-2CVHXFK7.js";
@@ -2,7 +2,7 @@ import {
2
2
  bubblesFromGraph,
3
3
  walkIndexOf,
4
4
  walkRoutes
5
- } from "../chunks/chunk-GOZYKNQ2.js";
5
+ } from "../chunks/chunk-CLOP7UVD.js";
6
6
  import "../chunks/chunk-FX4RDMDN.js";
7
7
  import "../chunks/chunk-HNQPEMYE.js";
8
8
  import "../chunks/chunk-CPMHA4W5.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  graphBubbles,
3
3
  superbubblesFromGraph
4
- } from "../chunks/chunk-TF7H5LQS.js";
4
+ } from "../chunks/chunk-C55SC5AJ.js";
5
5
  import "../chunks/chunk-VHW7FDHU.js";
6
- import "../chunks/chunk-REM73HCU.js";
6
+ import "../chunks/chunk-EHUBJDDB.js";
7
7
  import "../chunks/chunk-XKWD2RY3.js";
8
- import "../chunks/chunk-GOZYKNQ2.js";
8
+ import "../chunks/chunk-CLOP7UVD.js";
9
9
  import "../chunks/chunk-FX4RDMDN.js";
10
10
  import "../chunks/chunk-HNQPEMYE.js";
11
11
  import "../chunks/chunk-ST2IBUAN.js";
@@ -0,0 +1,81 @@
1
+ import {
2
+ pathSteps
3
+ } from "./chunk-6N7H22SS.js";
4
+ import {
5
+ pathOrigin
6
+ } from "./chunk-ST2IBUAN.js";
7
+
8
+ // src/tubeMap/bundle.ts
9
+ function bundleRoutes(graph, groupOf = () => "", merge = true) {
10
+ const paths = graph.paths ?? [];
11
+ const steps = pathSteps(graph);
12
+ const routes = /* @__PURE__ */ new Map();
13
+ paths.forEach((path, i) => {
14
+ const walk = pathOrigin(path.name).name;
15
+ const route = steps[i].map((s) => `${s.node.id}${s.strand}`).join(",");
16
+ const pieces = routes.get(walk);
17
+ if (pieces) {
18
+ pieces.push(route);
19
+ } else {
20
+ routes.set(walk, [route]);
21
+ }
22
+ });
23
+ const routeRank = /* @__PURE__ */ new Map();
24
+ const bundles = /* @__PURE__ */ new Map();
25
+ for (const [walk, pieces] of routes) {
26
+ const route = walk === graph.referencePath ? `\0${walk}` : pieces.join("|");
27
+ const group = groupOf(walk);
28
+ const rank = routeRank.get(route) ?? routeRank.size;
29
+ routeRank.set(route, rank);
30
+ const key = `${route} ${group}`;
31
+ const bundle = bundles.get(key);
32
+ if (bundle) {
33
+ bundle.walks.push(walk);
34
+ } else {
35
+ bundles.set(key, { rank, group, walks: [walk] });
36
+ }
37
+ }
38
+ if (merge && bundles.size === routes.size) {
39
+ return graph;
40
+ }
41
+ const ordered = [...bundles.values()].sort(
42
+ (a, b) => a.rank - b.rank || a.group.localeCompare(b.group)
43
+ );
44
+ const recordsOf = /* @__PURE__ */ new Map();
45
+ for (const path of paths) {
46
+ const walk = pathOrigin(path.name).name;
47
+ const records = recordsOf.get(walk);
48
+ if (records) {
49
+ records.push(path);
50
+ } else {
51
+ recordsOf.set(walk, [path]);
52
+ }
53
+ }
54
+ if (!merge) {
55
+ return {
56
+ ...graph,
57
+ paths: ordered.flatMap(
58
+ ({ walks }) => walks.flatMap((walk) => recordsOf.get(walk))
59
+ )
60
+ };
61
+ }
62
+ const kept = ordered.flatMap(
63
+ ({ walks }) => recordsOf.get(walks[0]).map((path) => walks.length > 1 ? { ...path, members: walks } : path)
64
+ );
65
+ const keptWalks = new Set(ordered.map((b) => b.walks[0]));
66
+ return {
67
+ ...graph,
68
+ paths: kept,
69
+ anchorPaths: graph.anchorPaths?.filter((p) => keptWalks.has(p.name)),
70
+ pathVisits: graph.pathVisits ? new Map(
71
+ [...graph.pathVisits].map(([segment, visits]) => [
72
+ segment,
73
+ visits.filter((v) => keptWalks.has(v.path))
74
+ ])
75
+ ) : void 0
76
+ };
77
+ }
78
+
79
+ export {
80
+ bundleRoutes
81
+ };
@@ -59,7 +59,8 @@ function tubeMapTracks(graph) {
59
59
  name: path.name,
60
60
  sequence,
61
61
  sourceTrackID: 0,
62
- type: "haplotype"
62
+ type: "haplotype",
63
+ ...path.members ? { freq: path.members.length } : {}
63
64
  }
64
65
  ] : [];
65
66
  });
@@ -218,9 +219,12 @@ function runTubeMap(graph) {
218
219
  const reads = graph.reads ? tubeMapReads(graph, graph.reads, paths.length) : [];
219
220
  const tubeColor = reads.length > 0 ? pathGreyCssColor : pathCssColor;
220
221
  const pathColors = paths.map((_, i) => tubeColor(i, paths.length));
222
+ const bundled = paths.some((p) => p.members);
223
+ const walks = paths.reduce((n, p) => n + (p.members?.length ?? 1), 0);
221
224
  const layout = layoutTubeMap(tubeMapNodes(graph), tracks, reads, {
222
225
  nodeWidthOption: "compressed",
223
- trackWidth: tubeWidth(tracks.length)
226
+ trackWidth: tubeWidth(bundled ? walks : tracks.length),
227
+ ...bundled ? { freqWidth: "linear" } : {}
224
228
  });
225
229
  if (!layout) {
226
230
  return void 0;
@@ -45,7 +45,7 @@ import {
45
45
  } from "./chunk-BR25DGIJ.js";
46
46
  import {
47
47
  version
48
- } from "./chunk-DW4ZNIZH.js";
48
+ } from "./chunk-ESRCSSS2.js";
49
49
  import {
50
50
  walkRowLabels,
51
51
  walkRowsExtent
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VHW7FDHU.js";
4
4
  import {
5
5
  coversGraph
6
- } from "./chunk-REM73HCU.js";
6
+ } from "./chunk-EHUBJDDB.js";
7
7
  import {
8
8
  bubbleSegmentIds
9
9
  } from "./chunk-XKWD2RY3.js";
@@ -11,7 +11,7 @@ import {
11
11
  bubblesFromGraph,
12
12
  walkIndexOf,
13
13
  walkRoutes
14
- } from "./chunk-GOZYKNQ2.js";
14
+ } from "./chunk-CLOP7UVD.js";
15
15
  import {
16
16
  SATURATED_PATH_COUNT
17
17
  } from "./chunk-FX4RDMDN.js";
@@ -227,7 +227,10 @@ function superbubblesFromGraph(graph, span) {
227
227
  (f, i) => !covers[i] && placed(f) && !nested(f, i)
228
228
  );
229
229
  const byId = new Map(nodes.map((n) => [n.id, n]));
230
- const walkIndex = walkIndexOf(graph);
230
+ const walkIndex = walkIndexOf(
231
+ graph,
232
+ outermost.flatMap((f) => [nodes[f.source >> 1].id, nodes[f.sink >> 1].id])
233
+ );
231
234
  return outermost.map((f) => {
232
235
  const source = nodes[f.source >> 1];
233
236
  const sink = nodes[f.sink >> 1];
@@ -38,7 +38,10 @@ function bubblesFromGraph(graph) {
38
38
  const backbone = graph.nodes.filter(isBackbone).sort((a, b) => a.stable.start - b.stable.start);
39
39
  const ends = /* @__PURE__ */ new Set([backbone[0].id, backbone.at(-1).id]);
40
40
  const boundaries = backbone.map((node) => [node, indexOf.get(node.id)]).filter(([node, i]) => ends.has(node.id) || reach[i] === 0).sort(([a, ia], [b, ib]) => ia - ib || a.stable.start - b.stable.start);
41
- const walkIndex = walkIndexOf(graph);
41
+ const walkIndex = walkIndexOf(
42
+ graph,
43
+ boundaries.map(([node]) => node.id)
44
+ );
42
45
  const bubbles = [];
43
46
  for (let i = 0; i + 1 < boundaries.length; i++) {
44
47
  const [start, i0] = boundaries[i];
@@ -104,47 +107,63 @@ function bubblesFromGraph(graph) {
104
107
  }
105
108
  return bubbles;
106
109
  }
107
- function walkIndexOf(graph) {
108
- return graph.paths?.map((p) => {
109
- const at = /* @__PURE__ */ new Map();
110
- p.nodeIds.forEach((id, i) => {
111
- if (!at.has(id)) {
112
- at.set(id, i);
110
+ function walkIndexOf(graph, ids) {
111
+ const paths = graph.paths;
112
+ if (!paths) {
113
+ return void 0;
114
+ }
115
+ const index = /* @__PURE__ */ new Map();
116
+ for (const id of ids) {
117
+ index.set(id, new Int32Array(paths.length).fill(-1));
118
+ }
119
+ paths.forEach((p, k) => {
120
+ const steps = p.nodeIds;
121
+ for (let i = 0; i < steps.length; i++) {
122
+ const at = index.get(steps[i]);
123
+ if (at?.[k] === -1) {
124
+ at[k] = i;
113
125
  }
114
- });
115
- return at;
126
+ }
116
127
  });
128
+ return index;
117
129
  }
118
130
  function walkRoutes(graph, byId, walkIndex, startId, endId) {
119
- const seen = /* @__PURE__ */ new Map();
131
+ const routes = [];
120
132
  let min = Infinity;
121
133
  let max = -Infinity;
122
134
  let left = 0;
135
+ const at0 = walkIndex.get(startId);
136
+ const at1 = walkIndex.get(endId);
123
137
  graph.paths.forEach((p, k) => {
124
- const i0 = walkIndex[k].get(startId);
125
- const i1 = walkIndex[k].get(endId);
126
- if (i0 === void 0 || i1 === void 0) {
127
- if (i0 !== void 0 || i1 !== void 0) {
138
+ const i0 = at0[k];
139
+ const i1 = at1[k];
140
+ if (i0 < 0 || i1 < 0) {
141
+ if (i0 >= 0 || i1 >= 0) {
128
142
  left++;
129
143
  }
130
144
  return;
131
145
  }
132
- const steps = p.nodeIds.slice(Math.min(i0, i1) + 1, Math.max(i0, i1));
133
- if (i1 < i0) {
134
- steps.reverse();
135
- }
136
- let bp = 0;
137
- for (const id of steps) {
138
- bp += byId.get(id)?.length ?? 0;
146
+ const ids = p.nodeIds;
147
+ const lo = Math.min(i0, i1) + 1;
148
+ const hi = Math.max(i0, i1);
149
+ const step = i1 < i0 ? (j) => ids[hi - 1 - j] : (j) => ids[lo + j];
150
+ let route = routes.find(
151
+ (r) => r.steps.length === hi - lo && r.steps.every((id, j) => id === step(j))
152
+ );
153
+ if (!route) {
154
+ const steps = Array.from({ length: hi - lo }, (_, j) => step(j));
155
+ let bp = 0;
156
+ for (const id of steps) {
157
+ bp += byId.get(id)?.length ?? 0;
158
+ }
159
+ route = { steps, bp, walks: [] };
160
+ routes.push(route);
139
161
  }
140
- const key = steps.join(",");
141
- const route = seen.get(key) ?? { steps, bp, walks: [] };
142
162
  route.walks.push(p.name);
143
- seen.set(key, route);
144
- min = Math.min(min, bp);
145
- max = Math.max(max, bp);
163
+ min = Math.min(min, route.bp);
164
+ max = Math.max(max, route.bp);
146
165
  });
147
- return seen.size || left ? { min, max, n: seen.size, left, routes: [...seen.values()] } : void 0;
166
+ return routes.length || left ? { min, max, n: routes.length, left, routes } : void 0;
148
167
  }
149
168
 
150
169
  export {
@@ -55,27 +55,11 @@ function bubbleHalos(graph, bubbles, positions, walkLabel = (name) => name, repe
55
55
  x: ends.reduce((s, p) => s + p.x, 0) / ends.length,
56
56
  y: ends.reduce((s, p) => s + p.y, 0) / ends.length
57
57
  } : labelAt;
58
- const sharing = /* @__PURE__ */ new Map();
59
- for (const route of bubble.routes ?? []) {
60
- for (const id of new Set(route.steps)) {
61
- sharing.set(id, (sharing.get(id) ?? 0) + 1);
62
- }
63
- }
64
58
  const routes = [];
65
- for (const route of bubble.routes ?? []) {
66
- if (bubble.longestAlleleLength < MIN_CHIPPED_BP) {
67
- break;
68
- }
69
- if (route.steps.length === 0) {
70
- continue;
71
- }
72
- const rarest = Math.min(...route.steps.map((id) => sharing.get(id)));
59
+ for (const [route, own] of ownStretches(bubble)) {
73
60
  let at;
74
61
  let far = -1;
75
- for (const id of route.steps) {
76
- if (sharing.get(id) !== rarest) {
77
- continue;
78
- }
62
+ for (const id of own) {
79
63
  for (const p of positions[id] ?? []) {
80
64
  const d = Math.hypot(p.x - anchor.x, p.y - anchor.y);
81
65
  if (d > far) {
@@ -105,6 +89,37 @@ function bubbleHalos(graph, bubbles, positions, walkLabel = (name) => name, repe
105
89
  }
106
90
  return halos;
107
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
+ }
108
123
  function routeText(route, walkLabel) {
109
124
  const names = [...new Set(route.walks.map(walkLabel))].sort();
110
125
  const shown = names.slice(0, NAMED_WALKS).join(", ");
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var version = "9.5.0";
2
+ var version = "9.7.0";
3
3
 
4
4
  export {
5
5
  version
@@ -6,7 +6,7 @@ import {
6
6
  hasTubeMapPaths,
7
7
  tubeMapLayout,
8
8
  tubeMapReferenceLayout
9
- } from "./chunk-INJ2UVOT.js";
9
+ } from "./chunk-6N7H22SS.js";
10
10
  import {
11
11
  anchoredLayout
12
12
  } from "./chunk-L3O7AWLI.js";
@@ -14,9 +14,9 @@ import "../chunks/chunk-LYJ4US66.js";
14
14
  import {
15
15
  LAYOUT_MODES,
16
16
  layoutModeByValue
17
- } from "../chunks/chunk-M7SRZJ32.js";
17
+ } from "../chunks/chunk-Z7UWHVOM.js";
18
18
  import "../chunks/chunk-LOEA5IHZ.js";
19
- import "../chunks/chunk-INJ2UVOT.js";
19
+ import "../chunks/chunk-6N7H22SS.js";
20
20
  import "../chunks/chunk-CWFNEKST.js";
21
21
  import "../chunks/chunk-L3O7AWLI.js";
22
22
  import "../chunks/chunk-TZFWUT2C.js";
@@ -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-T6EGLY2R.js";
38
+ } from "../chunks/chunk-7FARTP3U.js";
39
39
  import "../chunks/chunk-UD5FOCI2.js";
40
40
  import "../chunks/chunk-WBCOREDZ.js";
41
41
  import "../chunks/chunk-4BYTEJGW.js";
@@ -54,7 +54,7 @@ import "../chunks/chunk-2LQ5BWT7.js";
54
54
  import "../chunks/chunk-OXTR3BVF.js";
55
55
  import "../chunks/chunk-BR25DGIJ.js";
56
56
  import "../chunks/chunk-G2FD7S3C.js";
57
- import "../chunks/chunk-DW4ZNIZH.js";
57
+ import "../chunks/chunk-ESRCSSS2.js";
58
58
  import "../chunks/chunk-3C5UXR2U.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-T6EGLY2R.js";
3
+ } from "./chunks/chunk-7FARTP3U.js";
4
4
  import "./chunks/chunk-UD5FOCI2.js";
5
5
  import "./chunks/chunk-WBCOREDZ.js";
6
6
  import "./chunks/chunk-4BYTEJGW.js";
@@ -16,7 +16,7 @@ import "./chunks/chunk-2LQ5BWT7.js";
16
16
  import "./chunks/chunk-OXTR3BVF.js";
17
17
  import "./chunks/chunk-BR25DGIJ.js";
18
18
  import "./chunks/chunk-G2FD7S3C.js";
19
- import "./chunks/chunk-DW4ZNIZH.js";
19
+ import "./chunks/chunk-ESRCSSS2.js";
20
20
  import "./chunks/chunk-3C5UXR2U.js";
21
21
  import "./chunks/chunk-MAUEPAMG.js";
22
22
  import "./chunks/chunk-7GBL7SJY.js";
package/dist/index.js CHANGED
@@ -1,15 +1,28 @@
1
1
  import {
2
2
  wheelZoomFactor
3
3
  } from "./chunks/chunk-TDQLINVI.js";
4
+ import {
5
+ drawTubeMapGenes,
6
+ tubeMapGenes
7
+ } from "./chunks/chunk-WEDZ76AK.js";
4
8
  import {
5
9
  tubeMapNodeColors
6
10
  } from "./chunks/chunk-A4MYLGKG.js";
11
+ import {
12
+ bundleRoutes
13
+ } from "./chunks/chunk-5QOMIEHX.js";
7
14
  import {
8
15
  connectorAt,
9
16
  drawLitConnector,
10
17
  drawTubeMapConnectors,
11
18
  tubeMapConnectors
12
19
  } from "./chunks/chunk-2ZT7ZF7A.js";
20
+ import {
21
+ drawTubeMapRuler,
22
+ referenceBoxes,
23
+ rulerBoxes,
24
+ tubeX
25
+ } from "./chunks/chunk-BPRXQ2SS.js";
13
26
  import {
14
27
  drawTubeMap,
15
28
  drawTubeMapHighlight,
@@ -26,23 +39,13 @@ import {
26
39
  referenceKnots,
27
40
  warpX
28
41
  } from "./chunks/chunk-KQFOCDFY.js";
29
- import {
30
- drawTubeMapGenes,
31
- tubeMapGenes
32
- } from "./chunks/chunk-WEDZ76AK.js";
33
- import {
34
- drawTubeMapRuler,
35
- referenceBoxes,
36
- rulerBoxes,
37
- tubeX
38
- } from "./chunks/chunk-BPRXQ2SS.js";
39
42
  import {
40
43
  createForceLayoutCache
41
44
  } from "./chunks/chunk-BV64PQ2C.js";
42
45
  import {
43
46
  graphBubbles,
44
47
  superbubblesFromGraph
45
- } from "./chunks/chunk-TF7H5LQS.js";
48
+ } from "./chunks/chunk-C55SC5AJ.js";
46
49
  import {
47
50
  bubbleSubgraph
48
51
  } from "./chunks/chunk-VHW7FDHU.js";
@@ -54,7 +57,7 @@ import {
54
57
  } from "./chunks/chunk-BXEPA4KS.js";
55
58
  import {
56
59
  bubbleHalos
57
- } from "./chunks/chunk-REM73HCU.js";
60
+ } from "./chunks/chunk-EHUBJDDB.js";
58
61
  import {
59
62
  BUBBLE_KIND_COLORS,
60
63
  BUBBLE_KIND_NAMES,
@@ -63,7 +66,7 @@ import {
63
66
  } from "./chunks/chunk-XKWD2RY3.js";
64
67
  import {
65
68
  bubblesFromGraph
66
- } from "./chunks/chunk-GOZYKNQ2.js";
69
+ } from "./chunks/chunk-CLOP7UVD.js";
67
70
  import "./chunks/chunk-FX4RDMDN.js";
68
71
  import {
69
72
  REFERENCE_STRIP_ZONE_PX,
@@ -84,9 +87,9 @@ import {
84
87
  LAYOUT_MODES,
85
88
  layoutModeByValue,
86
89
  modeUsesLayoutEngine
87
- } from "./chunks/chunk-M7SRZJ32.js";
90
+ } from "./chunks/chunk-Z7UWHVOM.js";
88
91
  import "./chunks/chunk-LOEA5IHZ.js";
89
- import "./chunks/chunk-INJ2UVOT.js";
92
+ import "./chunks/chunk-6N7H22SS.js";
90
93
  import "./chunks/chunk-CWFNEKST.js";
91
94
  import "./chunks/chunk-L3O7AWLI.js";
92
95
  import "./chunks/chunk-TZFWUT2C.js";
@@ -119,7 +122,7 @@ import {
119
122
  } from "./chunks/chunk-AZFVORTC.js";
120
123
  import {
121
124
  figureSvg
122
- } from "./chunks/chunk-T6EGLY2R.js";
125
+ } from "./chunks/chunk-7FARTP3U.js";
123
126
  import {
124
127
  WALK_STRIP_CEILING_PX,
125
128
  cutsWholeWalks,
@@ -219,7 +222,7 @@ import {
219
222
  import "./chunks/chunk-G2FD7S3C.js";
220
223
  import {
221
224
  version
222
- } from "./chunks/chunk-DW4ZNIZH.js";
225
+ } from "./chunks/chunk-ESRCSSS2.js";
223
226
  import {
224
227
  walkRowLabels,
225
228
  walkRowsExtent
@@ -387,6 +390,7 @@ export {
387
390
  bubbleSubgraph,
388
391
  bubblesFromGraph,
389
392
  buildGeometry,
393
+ bundleRoutes,
390
394
  callTickInk,
391
395
  clampZoom,
392
396
  classifyBubble,
@@ -8,7 +8,7 @@ import {
8
8
  tubeMapReferenceLayout,
9
9
  tubeMapTracks,
10
10
  tubeWidth
11
- } from "../chunks/chunk-INJ2UVOT.js";
11
+ } from "../chunks/chunk-6N7H22SS.js";
12
12
  import "../chunks/chunk-CWFNEKST.js";
13
13
  import "../chunks/chunk-C44YRP5F.js";
14
14
  import "../chunks/chunk-7GBL7SJY.js";
@@ -4,9 +4,9 @@ import {
4
4
  LAYOUT_MODE_VALUES,
5
5
  layoutModeByValue,
6
6
  modeUsesLayoutEngine
7
- } from "./chunks/chunk-M7SRZJ32.js";
7
+ } from "./chunks/chunk-Z7UWHVOM.js";
8
8
  import "./chunks/chunk-LOEA5IHZ.js";
9
- import "./chunks/chunk-INJ2UVOT.js";
9
+ import "./chunks/chunk-6N7H22SS.js";
10
10
  import "./chunks/chunk-CWFNEKST.js";
11
11
  import "./chunks/chunk-L3O7AWLI.js";
12
12
  import "./chunks/chunk-TZFWUT2C.js";
@@ -0,0 +1,19 @@
1
+ import {
2
+ bundleRoutes
3
+ } from "../chunks/chunk-5QOMIEHX.js";
4
+ import "../chunks/chunk-6N7H22SS.js";
5
+ import "../chunks/chunk-CWFNEKST.js";
6
+ import "../chunks/chunk-C44YRP5F.js";
7
+ import "../chunks/chunk-7GBL7SJY.js";
8
+ import "../chunks/chunk-3ZZSX5HN.js";
9
+ import "../chunks/chunk-AB35TJST.js";
10
+ import "../chunks/chunk-ST2IBUAN.js";
11
+ import "../chunks/chunk-BPLIXMH7.js";
12
+ import "../chunks/chunk-TAMCZHLW.js";
13
+ import "../chunks/chunk-N6FECAXP.js";
14
+ import "../chunks/chunk-2CVHXFK7.js";
15
+ import "../chunks/chunk-CPMHA4W5.js";
16
+ import "../chunks/chunk-FYQWPEEY.js";
17
+ export {
18
+ bundleRoutes
19
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pathSteps
3
- } from "../chunks/chunk-INJ2UVOT.js";
3
+ } from "../chunks/chunk-6N7H22SS.js";
4
4
  import "../chunks/chunk-CWFNEKST.js";
5
5
  import "../chunks/chunk-C44YRP5F.js";
6
6
  import "../chunks/chunk-7GBL7SJY.js";
@@ -6,8 +6,9 @@ export interface Routes {
6
6
  n: number;
7
7
  }
8
8
  export declare function bubblesFromGraph(graph: Graph): MinigraphBubble[];
9
- export declare function walkIndexOf(graph: Graph): Map<string, number>[] | undefined;
10
- export declare function walkRoutes(graph: Graph, byId: Map<string, GraphNode>, walkIndex: Map<string, number>[], startId: string, endId: string): (Routes & {
9
+ export type WalkIndex = Map<string, Int32Array>;
10
+ export declare function walkIndexOf(graph: Graph, ids: Iterable<string>): WalkIndex | undefined;
11
+ export declare function walkRoutes(graph: Graph, byId: Map<string, GraphNode>, walkIndex: WalkIndex, startId: string, endId: string): (Routes & {
11
12
  left: number;
12
13
  routes: BubbleRoute[];
13
14
  }) | undefined;
@@ -43,6 +43,7 @@ export { drawTubeMapGenes, tubeMapGenes } from './tubeMap/genes.js';
43
43
  export type { TubeMapGene } from './tubeMap/genes.js';
44
44
  export { connectorAt, drawLitConnector, drawTubeMapConnectors, tubeMapConnectors, } from './tubeMap/connectors.js';
45
45
  export type { Connector } from './tubeMap/connectors.js';
46
+ export { bundleRoutes } from './tubeMap/bundle.js';
46
47
  export type { TubeMapColumn, TubeMapDrawing } from './layout/tubeMapLayout.js';
47
48
  export { deletionDrawing, deletionEdges } from './deletionEdges.js';
48
49
  export type { DeletionDrawing, DeletionEdge } from './deletionEdges.js';
@@ -0,0 +1,2 @@
1
+ import type { Graph } from '../types.js';
2
+ export declare function bundleRoutes(graph: Graph, groupOf?: (walk: string) => string, merge?: boolean): Graph;
@@ -23,6 +23,7 @@ export interface GraphPath {
23
23
  sample?: string;
24
24
  haplotype?: number;
25
25
  contig?: string;
26
+ members?: string[];
26
27
  }
27
28
  export interface PathOrigin {
28
29
  name: string;
@@ -1 +1 @@
1
- export declare const version = "9.5.0";
1
+ export declare const version = "9.7.0";
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "./chunks/chunk-DW4ZNIZH.js";
3
+ } from "./chunks/chunk-ESRCSSS2.js";
4
4
  export {
5
5
  version
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "9.5.0",
3
+ "version": "9.7.0",
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.1"
40
+ "@jbrowse/tubemap-core": "^0.2.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@eslint/js": "^10.0.1",