@jbrowse/bandage-core 11.2.0 → 11.4.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.
Files changed (64) hide show
  1. package/README.md +4 -2
  2. package/dist/chunks/{chunk-5GRF7PJX.js → chunk-3HGYGISG.js} +4 -4
  3. package/dist/chunks/{chunk-A7VSP7MQ.js → chunk-3LZ334X4.js} +1 -1
  4. package/dist/chunks/{chunk-3UST3ZQE.js → chunk-6VVGFQ7S.js} +1 -1
  5. package/dist/chunks/{chunk-VWT3WZRQ.js → chunk-6YJESZND.js} +12 -12
  6. package/dist/chunks/{chunk-QTDBOJJO.js → chunk-7O7EGTYG.js} +1 -1
  7. package/dist/chunks/{chunk-3XSRT7RQ.js → chunk-B5ARSBOH.js} +36 -30
  8. package/dist/chunks/{chunk-RNYPCQZ3.js → chunk-BXLLMWC3.js} +1 -1
  9. package/dist/chunks/{chunk-AI5PTOSV.js → chunk-CE6ZIKJX.js} +1 -1
  10. package/dist/chunks/{chunk-W6EXQDV5.js → chunk-EFD753MS.js} +1 -1
  11. package/dist/chunks/{chunk-DR24UTRS.js → chunk-FRTYQQDI.js} +5 -2
  12. package/dist/chunks/{chunk-XVS52NMZ.js → chunk-G3I4TCEZ.js} +1 -1
  13. package/dist/chunks/{chunk-TABI4JEU.js → chunk-GM7M25NW.js} +1 -1
  14. package/dist/chunks/{chunk-ZU54STUX.js → chunk-I4BYUNJN.js} +2 -2
  15. package/dist/chunks/chunk-JDZ5GTZT.js +20 -0
  16. package/dist/chunks/{chunk-S2PUF4SX.js → chunk-JQ52XYD2.js} +5 -5
  17. package/dist/chunks/chunk-M75QPZNJ.js +502 -0
  18. package/dist/chunks/{chunk-TREAOGDV.js → chunk-N7G5ROIV.js} +7 -7
  19. package/dist/chunks/{chunk-WAST7UVB.js → chunk-QM7KEWWT.js} +1 -1
  20. package/dist/chunks/{chunk-KDU4EF66.js → chunk-REOWLPH4.js} +1 -1
  21. package/dist/chunks/{chunk-VQT3A57T.js → chunk-TEXAKEJX.js} +2 -2
  22. package/dist/chunks/{chunk-C2TAJTUO.js → chunk-TJOOHTJ6.js} +1 -1
  23. package/dist/chunks/{chunk-QR5XR5XL.js → chunk-TZLEHZVC.js} +8 -4
  24. package/dist/chunks/chunk-UFUSPK2A.js +227 -0
  25. package/dist/chunks/{chunk-XZ6PQBU6.js → chunk-VIQL7GZ4.js} +1 -1
  26. package/dist/chunks/{chunk-SWCULW6S.js → chunk-XSF4RQRP.js} +7 -6
  27. package/dist/cli/figure.js +20 -19
  28. package/dist/cli/fold.js +2 -2
  29. package/dist/figure.js +16 -15
  30. package/dist/figureData.js +15 -14
  31. package/dist/figureScene.js +10 -9
  32. package/dist/figureSettings.js +3 -3
  33. package/dist/gfa/graphTables.js +7 -3
  34. package/dist/index.js +52 -32
  35. package/dist/layout/forceCache.js +3 -3
  36. package/dist/layout/tubeMapLayout.js +4 -2
  37. package/dist/layout/walkRowDraw.js +2 -2
  38. package/dist/layout/walkRowLayout.js +6 -2
  39. package/dist/layout/walkRowLinks.js +12 -0
  40. package/dist/layout/walkRowRuns.js +20 -0
  41. package/dist/layout/walkRows.js +5 -2
  42. package/dist/layout/walkStrip.js +7 -5
  43. package/dist/layoutModes.js +6 -4
  44. package/dist/pipeline.js +2 -2
  45. package/dist/referenceStrip.js +2 -2
  46. package/dist/renderer/GeometryBuilder.js +1 -1
  47. package/dist/tubeMap/bundle.js +5 -3
  48. package/dist/tubeMap/coarsen.js +5 -3
  49. package/dist/tubeMap/deviations.js +5 -3
  50. package/dist/tubeMap/draw.js +5 -3
  51. package/dist/tubeMap/nodeColors.js +2 -2
  52. package/dist/types/gfa/graphTables.d.ts +10 -1
  53. package/dist/types/index.d.ts +5 -1
  54. package/dist/types/layout/walkRowLayout.d.ts +4 -0
  55. package/dist/types/layout/walkRowLinks.d.ts +32 -0
  56. package/dist/types/layout/walkRowRuns.d.ts +56 -0
  57. package/dist/types/layout/walkRows.d.ts +2 -1
  58. package/dist/types/version.d.ts +1 -1
  59. package/dist/version.js +1 -1
  60. package/dist/viewport.js +3 -3
  61. package/dist/walkEncoding.js +2 -2
  62. package/dist/walkHighlight.js +3 -3
  63. package/package.json +1 -1
  64. package/dist/chunks/chunk-5DHOFF4C.js +0 -322
package/README.md CHANGED
@@ -61,8 +61,10 @@ against it. An API change lands with the consumer's side on a `core-next` branch
61
61
  in that repo, which CI tests in place of `main` until the release.
62
62
 
63
63
  Release with `pnpm version patch`: it lints, tests, stamps `src/version.ts`,
64
- writes the changelog with git-cliff and pushes the `v*` tag, and `publish.yml`
65
- publishes to npm with trusted publishing.
64
+ writes the changelog with git-cliff and pushes the `v*` tag. `publish.yml` then
65
+ runs CI, consumers included, and publishes to npm with trusted publishing only
66
+ if it passes. When a consumer fails, land its side on `core-next` and rerun the
67
+ failed jobs.
66
68
 
67
69
  ## See also
68
70
 
@@ -1,15 +1,15 @@
1
- import {
2
- MAX_GAP_PX
3
- } from "./chunk-MYDHU2UV.js";
4
1
  import {
5
2
  tubeMapMismatches
6
3
  } from "./chunk-BX4AUMZE.js";
4
+ import {
5
+ MAX_GAP_PX
6
+ } from "./chunk-MYDHU2UV.js";
7
7
  import {
8
8
  readColor
9
9
  } from "./chunk-A7H753BA.js";
10
10
  import {
11
11
  referenceWalkName
12
- } from "./chunk-5DHOFF4C.js";
12
+ } from "./chunk-M75QPZNJ.js";
13
13
  import {
14
14
  pathOrigin
15
15
  } from "./chunk-B5X2RLJG.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-A7H753BA.js";
6
6
  import {
7
7
  referenceWalkName
8
- } from "./chunk-5DHOFF4C.js";
8
+ } from "./chunk-M75QPZNJ.js";
9
9
  import {
10
10
  pathCssColor,
11
11
  pathGreyCssColor
@@ -2,7 +2,7 @@ import {
2
2
  LIFT_BACKDROP_CSS,
3
3
  computeColorSchemeRange,
4
4
  getNodeColor
5
- } from "./chunk-SWCULW6S.js";
5
+ } from "./chunk-XSF4RQRP.js";
6
6
  import {
7
7
  abgrToCssRgba
8
8
  } from "./chunk-G2FD7S3C.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ Canvas2DRenderer
3
+ } from "./chunk-EJRJAAN7.js";
1
4
  import {
2
5
  svgCanvas
3
6
  } from "./chunk-V4YML3GR.js";
@@ -5,15 +8,12 @@ import {
5
8
  stripGeneGaps,
6
9
  walkStripFrame,
7
10
  walkStripLabelsTree
8
- } from "./chunk-ZU54STUX.js";
11
+ } from "./chunk-I4BYUNJN.js";
9
12
  import {
10
13
  walkRowsKey,
11
14
  walkRowsKeyTree,
12
15
  walkRowsTree
13
- } from "./chunk-XZ6PQBU6.js";
14
- import {
15
- Canvas2DRenderer
16
- } from "./chunk-EJRJAAN7.js";
16
+ } from "./chunk-VIQL7GZ4.js";
17
17
  import {
18
18
  EXON_COLOR,
19
19
  exonOutlineTree,
@@ -34,32 +34,32 @@ import {
34
34
  } from "./chunk-77EGQQJU.js";
35
35
  import {
36
36
  version
37
- } from "./chunk-WAST7UVB.js";
37
+ } from "./chunk-QM7KEWWT.js";
38
38
  import {
39
39
  axisScaleOf
40
- } from "./chunk-AI5PTOSV.js";
40
+ } from "./chunk-CE6ZIKJX.js";
41
41
  import {
42
42
  figureScene
43
- } from "./chunk-S2PUF4SX.js";
43
+ } from "./chunk-JQ52XYD2.js";
44
44
  import {
45
45
  encodingStops
46
- } from "./chunk-TABI4JEU.js";
46
+ } from "./chunk-GM7M25NW.js";
47
47
  import {
48
48
  rangeText
49
49
  } from "./chunk-D4ZFRBB4.js";
50
50
  import {
51
51
  walkRowLabels
52
- } from "./chunk-QR5XR5XL.js";
52
+ } from "./chunk-TZLEHZVC.js";
53
53
  import {
54
54
  nodeInk
55
55
  } from "./chunk-CRCD3ODN.js";
56
56
  import {
57
57
  FIGURE_DEFAULTS
58
- } from "./chunk-W6EXQDV5.js";
58
+ } from "./chunk-EFD753MS.js";
59
59
  import {
60
60
  FIT_PADDING,
61
61
  fitTransform
62
- } from "./chunk-KDU4EF66.js";
62
+ } from "./chunk-REOWLPH4.js";
63
63
  import {
64
64
  LABEL_CHAR_PX,
65
65
  LABEL_PAD,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pathSteps
3
- } from "./chunk-A7VSP7MQ.js";
3
+ } from "./chunk-3LZ334X4.js";
4
4
  import {
5
5
  pathOrigin
6
6
  } from "./chunk-B5X2RLJG.js";
@@ -15,6 +15,20 @@ import {
15
15
  function pLineName(name, start, end) {
16
16
  return start === 0 ? name : `${name}:${start}-${end}`;
17
17
  }
18
+ function tablePath(w, p) {
19
+ const walkName = w.names[p];
20
+ const fields = panSNFields(walkName);
21
+ const start = w.starts[p];
22
+ return fields ? {
23
+ name: `${fields.sample}#${fields.haplotype}#${fields.contig}`,
24
+ start,
25
+ ...fields,
26
+ ...stopFields(
27
+ w.before && stopAt(w.before, p),
28
+ w.after && stopAt(w.after, p)
29
+ )
30
+ } : { name: pLineName(walkName, start, w.ends[p]), start };
31
+ }
18
32
  function namesByList(lists, names, listCount, pathNames) {
19
33
  const starts = new Int32Array(listCount + 1);
20
34
  for (const list of lists) {
@@ -41,10 +55,8 @@ function namesByList(lists, names, listCount, pathNames) {
41
55
  return out;
42
56
  });
43
57
  }
44
- function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA") {
45
- const count = n.names.length;
46
- const declared = n.lengths.length;
47
- const canonical = new Uint8Array(count);
58
+ function tableNodeIds({ nodes: n, links: l, walks: w }) {
59
+ const canonical = new Uint8Array(n.names.length);
48
60
  const claim = (node, reversed) => {
49
61
  if (canonical[node] === 0) {
50
62
  canonical[node] = reversed ? 2 : 1;
@@ -54,6 +66,17 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
54
66
  claim(l.from[i], l.strands[i] & 1);
55
67
  claim(l.to[i], l.strands[i] & 2);
56
68
  }
69
+ const stepCount = w.offsets[w.names.length] ?? 0;
70
+ for (let s = 0; s < stepCount; s++) {
71
+ claim(w.steps[s], w.reversed[s]);
72
+ }
73
+ return n.names.map(
74
+ (segment, i) => `${segment}${canonical[i] === 2 ? "-" : "+"}`
75
+ );
76
+ }
77
+ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA") {
78
+ const count = n.names.length;
79
+ const declared = n.lengths.length;
57
80
  const drawnWalks = [];
58
81
  for (let p = 0; p < w.names.length; p++) {
59
82
  if (w.offsets[p + 1] > w.offsets[p]) {
@@ -61,18 +84,10 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
61
84
  }
62
85
  }
63
86
  const traversals = new Int32Array(count);
64
- for (const p of drawnWalks) {
65
- for (let s = w.offsets[p]; s < w.offsets[p + 1]; s++) {
66
- const node = w.steps[s];
67
- if (traversals[node] === 0) {
68
- claim(node, w.reversed[s]);
69
- }
70
- traversals[node]++;
71
- }
87
+ for (const node of w.steps.subarray(0, w.offsets[w.names.length])) {
88
+ traversals[node]++;
72
89
  }
73
- const ids = n.names.map(
74
- (segment, i) => `${segment}${canonical[i] === 2 ? "-" : "+"}`
75
- );
90
+ const ids = tableNodeIds({ nodes: n, links: l, walks: w });
76
91
  const nodes = [];
77
92
  for (let i = 0; i < declared; i++) {
78
93
  const ref = n.refs[i];
@@ -168,11 +183,9 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
168
183
  const edgeNameIndex = /* @__PURE__ */ new Map();
169
184
  const edgeNames = [];
170
185
  for (const p of drawnWalks) {
171
- const walkName = w.names[p];
172
- const fields = panSNFields(walkName);
173
- const start = w.starts[p];
174
- const visitName = fields ? `${fields.sample}#${fields.haplotype}#${fields.contig}` : walkName;
175
- const pathName = fields ? visitName : pLineName(walkName, start, w.ends[p]);
186
+ const head = tablePath(w, p);
187
+ const { start, name: pathName } = head;
188
+ const visitName = head.sample === void 0 ? w.names[p] : pathName;
176
189
  let named = nameIndex.get(visitName);
177
190
  if (named === void 0) {
178
191
  named = pathNames.length;
@@ -214,16 +227,7 @@ function graphFromTables({ nodes: n, links: l, walks: w }, name = "Imported GFA"
214
227
  }
215
228
  prev = node;
216
229
  }
217
- paths.push({
218
- name: pathName,
219
- nodeIds,
220
- start,
221
- ...fields,
222
- ...fields ? stopFields(
223
- w.before && stopAt(w.before, p),
224
- w.after && stopAt(w.after, p)
225
- ) : {}
226
- });
230
+ paths.push({ ...head, nodeIds });
227
231
  anchorPaths.push({
228
232
  name: visitName,
229
233
  sample: visitSample,
@@ -293,6 +297,8 @@ function graphTablesGFA({ nodes, links, walks }) {
293
297
  }
294
298
 
295
299
  export {
300
+ tablePath,
301
+ tableNodeIds,
296
302
  graphFromTables,
297
303
  graphTablesGFA
298
304
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  engineKey,
3
3
  forceLayout
4
- } from "./chunk-KDU4EF66.js";
4
+ } from "./chunk-REOWLPH4.js";
5
5
 
6
6
  // src/layout/forceCache.ts
7
7
  var DEFAULT_SIZE = 4;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clampZoom
3
- } from "./chunk-KDU4EF66.js";
3
+ } from "./chunk-REOWLPH4.js";
4
4
 
5
5
  // src/viewport.ts
6
6
  function axisScaleOf(scale, pixelRows) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ENGINE_DEFAULTS
3
- } from "./chunk-KDU4EF66.js";
3
+ } from "./chunk-REOWLPH4.js";
4
4
 
5
5
  // src/figureSettings.ts
6
6
  var FIGURE_DEFAULTS = {
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  encodedColor,
3
3
  resolveEncoding
4
- } from "./chunk-TABI4JEU.js";
4
+ } from "./chunk-GM7M25NW.js";
5
5
  import {
6
6
  pathOrigin
7
7
  } from "./chunk-B5X2RLJG.js";
8
8
  import {
9
9
  gapParts
10
10
  } from "./chunk-EIY2SKD3.js";
11
+ import {
12
+ isBackbone
13
+ } from "./chunk-RJWPJCIB.js";
11
14
  import {
12
15
  panSNContig
13
16
  } from "./chunk-4XWZNPQ2.js";
@@ -115,7 +118,7 @@ function laneColors(byId, walk, encoding, ramp) {
115
118
  for (const [id, progress] of walk.progress) {
116
119
  const node = byId.get(id);
117
120
  const mid = ramp?.midpoints.get(id);
118
- const t = encoding.field === "progress" ? progress : ramp && mid !== void 0 && !(node?.stable && node.stable.rank > 0) ? (mid - ramp.start) / ramp.span : void 0;
121
+ const t = encoding.field === "progress" ? progress : ramp && mid !== void 0 && node && isBackbone(node) ? (mid - ramp.start) / ramp.span : void 0;
119
122
  colors.set(id, encodedColor(encoding, t));
120
123
  }
121
124
  return colors;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computeColorSchemeRange,
3
3
  getNodeColor
4
- } from "./chunk-SWCULW6S.js";
4
+ } from "./chunk-XSF4RQRP.js";
5
5
  import {
6
6
  abgrToCssRgba
7
7
  } from "./chunk-G2FD7S3C.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REFERENCE_RAMP_ALT_COLOR,
3
3
  hslToRgb
4
- } from "./chunk-SWCULW6S.js";
4
+ } from "./chunk-XSF4RQRP.js";
5
5
  import {
6
6
  packAbgr
7
7
  } from "./chunk-G2FD7S3C.js";
@@ -3,14 +3,14 @@ import {
3
3
  boxesGenes,
4
4
  rowPitch,
5
5
  rowSpan
6
- } from "./chunk-XZ6PQBU6.js";
6
+ } from "./chunk-VIQL7GZ4.js";
7
7
  import {
8
8
  el
9
9
  } from "./chunk-H2H4Y3TV.js";
10
10
  import {
11
11
  READOUT_ROOM,
12
12
  longestBar
13
- } from "./chunk-QR5XR5XL.js";
13
+ } from "./chunk-TZLEHZVC.js";
14
14
  import {
15
15
  pathOrigin
16
16
  } from "./chunk-B5X2RLJG.js";
@@ -0,0 +1,20 @@
1
+ import {
2
+ walkRowRuns,
3
+ walkRowsOf
4
+ } from "./chunk-M75QPZNJ.js";
5
+
6
+ // src/layout/walkRows.ts
7
+ function filterSamples(rows, samples) {
8
+ return samples ? rows.filter((r) => samples.includes(r.sample)).sort(
9
+ (a, b) => samples.indexOf(a.sample) - samples.indexOf(b.sample) || a.label.localeCompare(b.label)
10
+ ) : rows;
11
+ }
12
+ function walkRows(graph, region, unit, o = {}) {
13
+ const runs = walkRowRuns(graph, region, o);
14
+ return runs && walkRowsOf(runs, unit);
15
+ }
16
+
17
+ export {
18
+ filterSamples,
19
+ walkRows
20
+ };
@@ -4,27 +4,27 @@ import {
4
4
  import {
5
5
  facetLifts,
6
6
  walkLift
7
- } from "./chunk-DR24UTRS.js";
7
+ } from "./chunk-FRTYQQDI.js";
8
8
  import {
9
9
  walkKey
10
10
  } from "./chunk-D4ZFRBB4.js";
11
11
  import {
12
12
  buildGeometry,
13
13
  computeReferenceRamp
14
- } from "./chunk-SWCULW6S.js";
14
+ } from "./chunk-XSF4RQRP.js";
15
15
  import {
16
16
  walkRowsExtent
17
- } from "./chunk-QR5XR5XL.js";
17
+ } from "./chunk-TZLEHZVC.js";
18
18
  import {
19
19
  pathLegend,
20
20
  walkLabelsOf
21
21
  } from "./chunk-3GP3KT5L.js";
22
22
  import {
23
23
  FIGURE_DEFAULTS
24
- } from "./chunk-W6EXQDV5.js";
24
+ } from "./chunk-EFD753MS.js";
25
25
  import {
26
26
  drawingBounds
27
- } from "./chunk-KDU4EF66.js";
27
+ } from "./chunk-REOWLPH4.js";
28
28
  import {
29
29
  referenceLabel
30
30
  } from "./chunk-234NFZS4.js";