@jbrowse/bandage-core 11.2.0 → 11.3.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 (52) 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-QTDBOJJO.js → chunk-7O7EGTYG.js} +1 -1
  5. package/dist/chunks/{chunk-3XSRT7RQ.js → chunk-B5ARSBOH.js} +36 -30
  6. package/dist/chunks/{chunk-RNYPCQZ3.js → chunk-BXLLMWC3.js} +1 -1
  7. package/dist/chunks/{chunk-AI5PTOSV.js → chunk-CE6ZIKJX.js} +1 -1
  8. package/dist/chunks/{chunk-W6EXQDV5.js → chunk-EFD753MS.js} +1 -1
  9. package/dist/chunks/chunk-JDZ5GTZT.js +20 -0
  10. package/dist/chunks/chunk-M75QPZNJ.js +502 -0
  11. package/dist/chunks/{chunk-ZU54STUX.js → chunk-PNM6Z3IE.js} +1 -1
  12. package/dist/chunks/{chunk-KDU4EF66.js → chunk-REOWLPH4.js} +1 -1
  13. package/dist/chunks/{chunk-VWT3WZRQ.js → chunk-RNNYRNDU.js} +10 -10
  14. package/dist/chunks/{chunk-TREAOGDV.js → chunk-SLDCKMIP.js} +6 -6
  15. package/dist/chunks/{chunk-S2PUF4SX.js → chunk-T35BSLW5.js} +3 -3
  16. package/dist/chunks/{chunk-VQT3A57T.js → chunk-TEXAKEJX.js} +2 -2
  17. package/dist/chunks/{chunk-C2TAJTUO.js → chunk-TJOOHTJ6.js} +1 -1
  18. package/dist/chunks/{chunk-QR5XR5XL.js → chunk-TZLEHZVC.js} +8 -4
  19. package/dist/chunks/chunk-UFUSPK2A.js +227 -0
  20. package/dist/chunks/{chunk-WAST7UVB.js → chunk-XEWPWCML.js} +1 -1
  21. package/dist/cli/figure.js +16 -15
  22. package/dist/cli/fold.js +2 -2
  23. package/dist/figure.js +13 -12
  24. package/dist/figureData.js +12 -11
  25. package/dist/figureScene.js +7 -6
  26. package/dist/figureSettings.js +3 -3
  27. package/dist/gfa/graphTables.js +7 -3
  28. package/dist/index.js +47 -27
  29. package/dist/layout/forceCache.js +3 -3
  30. package/dist/layout/tubeMapLayout.js +4 -2
  31. package/dist/layout/walkRowLayout.js +6 -2
  32. package/dist/layout/walkRowLinks.js +12 -0
  33. package/dist/layout/walkRowRuns.js +20 -0
  34. package/dist/layout/walkRows.js +5 -2
  35. package/dist/layout/walkStrip.js +5 -3
  36. package/dist/layoutModes.js +6 -4
  37. package/dist/pipeline.js +2 -2
  38. package/dist/tubeMap/bundle.js +5 -3
  39. package/dist/tubeMap/coarsen.js +5 -3
  40. package/dist/tubeMap/deviations.js +5 -3
  41. package/dist/tubeMap/draw.js +5 -3
  42. package/dist/types/gfa/graphTables.d.ts +10 -1
  43. package/dist/types/index.d.ts +5 -1
  44. package/dist/types/layout/walkRowLayout.d.ts +4 -0
  45. package/dist/types/layout/walkRowLinks.d.ts +32 -0
  46. package/dist/types/layout/walkRowRuns.d.ts +56 -0
  47. package/dist/types/layout/walkRows.d.ts +2 -1
  48. package/dist/types/version.d.ts +1 -1
  49. package/dist/version.js +1 -1
  50. package/dist/viewport.js +3 -3
  51. package/package.json +1 -1
  52. 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
@@ -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 = {
@@ -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
+ };