@jbrowse/bandage-core 12.7.1 → 13.0.1

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 (71) hide show
  1. package/README.md +41 -9
  2. package/dist/chunks/{chunk-3HNQW3HM.js → chunk-252FIXUH.js} +1 -1
  3. package/dist/chunks/{chunk-F5CP5KSV.js → chunk-2HR33HEK.js} +43 -19
  4. package/dist/chunks/{chunk-QHCAFMHM.js → chunk-2T462OOE.js} +1 -1
  5. package/dist/chunks/{chunk-XNLXC6GB.js → chunk-2TNFP3GC.js} +1 -1
  6. package/dist/chunks/{chunk-FAWHP2CG.js → chunk-4D2OQVTR.js} +8 -8
  7. package/dist/chunks/{chunk-RQHIDUZR.js → chunk-4SM3YYY4.js} +6 -2
  8. package/dist/chunks/{chunk-3BLYOLTX.js → chunk-5PQQ4IXZ.js} +1 -1
  9. package/dist/chunks/{chunk-Q4B4O2M4.js → chunk-7ZS7UNYY.js} +1 -5
  10. package/dist/chunks/{chunk-O6SLIY74.js → chunk-BQ2GXFH6.js} +168 -80
  11. package/dist/chunks/{chunk-IDPBN2BP.js → chunk-DBLRFSET.js} +12 -13
  12. package/dist/chunks/{chunk-KA6B7WCZ.js → chunk-DZWYTA5R.js} +1 -1
  13. package/dist/chunks/{chunk-KCVW4VPK.js → chunk-EPCC5T5Y.js} +10 -10
  14. package/dist/chunks/{chunk-BPIELHWX.js → chunk-FLCRH3JY.js} +2 -2
  15. package/dist/chunks/{chunk-4J4IKYSL.js → chunk-FSOP446U.js} +6 -51
  16. package/dist/chunks/{chunk-EHEKIJ56.js → chunk-IDDGO6EW.js} +2 -2
  17. package/dist/chunks/{chunk-QPKSULKV.js → chunk-IDYGRSNF.js} +1 -1
  18. package/dist/chunks/{chunk-ETYIYH7I.js → chunk-K5QGQNPO.js} +5 -5
  19. package/dist/chunks/{chunk-H5NMBQZG.js → chunk-LHPUMKX4.js} +1 -1
  20. package/dist/chunks/chunk-NPDW3JAD.js +118 -0
  21. package/dist/chunks/{chunk-LT66KA3W.js → chunk-QDP2NTAV.js} +3 -3
  22. package/dist/chunks/{chunk-TTFQTTBZ.js → chunk-RNROMUAS.js} +3 -3
  23. package/dist/chunks/{chunk-WXUEAMJJ.js → chunk-RWCZLHXX.js} +1 -1
  24. package/dist/chunks/{chunk-7O7427XK.js → chunk-S3A345Q4.js} +1 -1
  25. package/dist/chunks/{chunk-Q4X6O7BL.js → chunk-STHPR76Q.js} +22 -7
  26. package/dist/chunks/{chunk-6YVWF5TR.js → chunk-VX57QTQD.js} +2 -2
  27. package/dist/chunks/{chunk-YAJT4IDN.js → chunk-Z2OUCH2J.js} +1 -1
  28. package/dist/cli/figure.js +22 -22
  29. package/dist/cli/fold.js +5 -5
  30. package/dist/figure.js +17 -17
  31. package/dist/figureData.js +20 -20
  32. package/dist/figureScene.js +13 -13
  33. package/dist/figureSettings.js +6 -6
  34. package/dist/gbzCut.js +4 -4
  35. package/dist/gbzWindow.js +3 -3
  36. package/dist/gfa/departures.js +26 -0
  37. package/dist/gfa/gfaConverter.js +1 -2
  38. package/dist/gfa/gfaTables.js +2 -2
  39. package/dist/gfa/graphTables.js +1 -2
  40. package/dist/index.js +39 -33
  41. package/dist/layout/forceCache.js +6 -6
  42. package/dist/layout/tubeMapLayout.js +5 -5
  43. package/dist/layout/walkRowDraw.js +4 -4
  44. package/dist/layout/walkRowLayout.js +6 -6
  45. package/dist/layout/walkRowRuns.js +3 -3
  46. package/dist/layout/walkRows.js +4 -4
  47. package/dist/layout/walkStrip.js +7 -7
  48. package/dist/layoutModes.js +8 -8
  49. package/dist/pipeline.js +5 -5
  50. package/dist/tubeMap/bundle.js +6 -6
  51. package/dist/tubeMap/coarsen.js +6 -6
  52. package/dist/tubeMap/deviations.js +6 -6
  53. package/dist/tubeMap/draw.js +5 -5
  54. package/dist/types/gfa/departures.d.ts +72 -0
  55. package/dist/types/gfa/graphTables.d.ts +35 -12
  56. package/dist/types/index.d.ts +4 -4
  57. package/dist/types/layout/deletionRoutes.d.ts +1 -1
  58. package/dist/types/layout/walkRowDraw.d.ts +4 -4
  59. package/dist/types/layout/walkRowRuns.d.ts +26 -6
  60. package/dist/types/layout/walkRows.d.ts +10 -4
  61. package/dist/types/types.d.ts +4 -25
  62. package/dist/types/version.d.ts +1 -1
  63. package/dist/types/walkHighlight.d.ts +1 -1
  64. package/dist/version.js +1 -1
  65. package/dist/viewport.js +6 -6
  66. package/dist/walkHighlight.js +2 -2
  67. package/dist/walkKey.js +2 -2
  68. package/package.json +2 -1
  69. package/dist/chunks/chunk-D7ZTAGDM.js +0 -168
  70. package/dist/gfa/walkStops.js +0 -28
  71. package/dist/types/gfa/walkStops.d.ts +0 -59
@@ -1,168 +0,0 @@
1
- // src/gfa/walkStops.ts
2
- var START_STOP_TAG = "ws";
3
- var END_STOP_TAG = "we";
4
- var STOP_KINDS = ["elsewhere", "break", "end"];
5
- var GAP_CAUSE_TEXT = {
6
- missing: "not in the graph",
7
- elsewhere: "on nodes filed elsewhere",
8
- unknown: "gap, cause unknown",
9
- abridged: "abridged: steps not loaded",
10
- // a walk file's skip row: the haplotype has no step on the reference
11
- // across the window, which says nothing of what it carries instead
12
- deleted: "no step on the reference"
13
- };
14
- var OUTSIDE_TEXT = "outside the extracted subgraph";
15
- function gapParts(bp, after, before) {
16
- if (!after && !before) {
17
- return [{ bp }];
18
- }
19
- const left = Math.min(after?.trimmed ?? 0, bp);
20
- const right = Math.min(before?.trimmed ?? 0, bp - left);
21
- let rest = bp - left - right;
22
- const lead = after?.kind === "break" ? Math.min(after.bp, rest) : 0;
23
- rest -= lead;
24
- const trail = before?.kind === "break" ? Math.min(before.bp, rest) : 0;
25
- rest -= trail;
26
- const elsewhere = [after, before].find((s) => s?.kind === "elsewhere");
27
- const parts = [
28
- { bp: left },
29
- { bp: lead, cause: "missing" },
30
- elsewhere?.kind === "elsewhere" ? { bp: rest, cause: "elsewhere", chunk: elsewhere.chunk } : { bp: rest, cause: "unknown" },
31
- { bp: trail, cause: "missing" },
32
- { bp: right }
33
- ];
34
- return parts.filter((part) => part.bp > 0);
35
- }
36
- function stopAt(table, i) {
37
- const bp = table.bp[i];
38
- const ref = table.chunkRefs[i];
39
- return stopOf(
40
- table.kindNames[table.kinds[i]],
41
- Number.isNaN(bp) ? void 0 : bp,
42
- table.trimmed[i],
43
- ref < 0 ? void 0 : { refName: table.chunkRefNames[ref], start: table.chunkStarts[i] }
44
- );
45
- }
46
- function stopOf(kind, bp, trimmed, chunk) {
47
- const cut = trimmed > 0 ? { trimmed } : {};
48
- if (kind === "elsewhere" && chunk) {
49
- return { kind, chunk, ...bp === void 0 ? {} : { bp }, ...cut };
50
- }
51
- if (kind === "break" && bp !== void 0) {
52
- return { kind, bp, ...chunk ? { chunk } : {}, ...cut };
53
- }
54
- return kind === "end" ? { kind, ...cut } : void 0;
55
- }
56
- function stopTag(stop) {
57
- const parts = [stop.kind];
58
- if ("bp" in stop && stop.bp !== void 0) {
59
- parts.push(`bp=${stop.bp}`);
60
- }
61
- if (stop.trimmed) {
62
- parts.push(`trimmed=${stop.trimmed}`);
63
- }
64
- if ("chunk" in stop && stop.chunk) {
65
- parts.push(`chunk=${stop.chunk.refName}:${stop.chunk.start}`);
66
- }
67
- return parts.join(",");
68
- }
69
- function parseStopTag(value) {
70
- const [kind, ...fields] = value.split(",");
71
- let bp;
72
- let trimmed = 0;
73
- let chunk;
74
- for (const field of fields) {
75
- if (field.startsWith("bp=")) {
76
- bp = +field.slice(3);
77
- } else if (field.startsWith("trimmed=")) {
78
- trimmed = +field.slice(8);
79
- } else if (field.startsWith("chunk=")) {
80
- const at = field.lastIndexOf(":");
81
- chunk = { refName: field.slice(6, at), start: +field.slice(at + 1) };
82
- }
83
- }
84
- return stopOf(kind, bp, trimmed, chunk);
85
- }
86
- function stopFields(before, after) {
87
- return {
88
- ...before ? { before } : {},
89
- ...after ? { after } : {}
90
- };
91
- }
92
- function walkStopFields(tags) {
93
- const before = tags[START_STOP_TAG];
94
- const after = tags[END_STOP_TAG];
95
- return stopFields(
96
- typeof before === "string" ? parseStopTag(before) : void 0,
97
- typeof after === "string" ? parseStopTag(after) : void 0
98
- );
99
- }
100
- function walkStopTags(walks, p) {
101
- const tags = [];
102
- for (const [tag, table] of [
103
- [START_STOP_TAG, walks.before],
104
- [END_STOP_TAG, walks.after]
105
- ]) {
106
- const stop = table && stopAt(table, p);
107
- if (stop) {
108
- tags.push(` ${tag}:Z:${stopTag(stop)}`);
109
- }
110
- }
111
- return tags.join("");
112
- }
113
- var StopColumns = class {
114
- constructor() {
115
- this.kinds = [];
116
- this.bp = [];
117
- this.trimmed = [];
118
- this.chunkRefs = [];
119
- this.chunkStarts = [];
120
- this.chunkRefNames = [];
121
- this.refIndex = /* @__PURE__ */ new Map();
122
- }
123
- push(stop) {
124
- this.kinds.push(STOP_KINDS.indexOf(stop.kind));
125
- this.bp.push("bp" in stop && stop.bp !== void 0 ? stop.bp : NaN);
126
- this.trimmed.push(stop.trimmed ?? 0);
127
- const chunk = "chunk" in stop ? stop.chunk : void 0;
128
- if (chunk) {
129
- let ref = this.refIndex.get(chunk.refName);
130
- if (ref === void 0) {
131
- ref = this.chunkRefNames.length;
132
- this.refIndex.set(chunk.refName, ref);
133
- this.chunkRefNames.push(chunk.refName);
134
- }
135
- this.chunkRefs.push(ref);
136
- this.chunkStarts.push(chunk.start);
137
- } else {
138
- this.chunkRefs.push(-1);
139
- this.chunkStarts.push(NaN);
140
- }
141
- }
142
- table() {
143
- return {
144
- kinds: Uint8Array.from(this.kinds),
145
- kindNames: [...STOP_KINDS],
146
- bp: Float64Array.from(this.bp),
147
- trimmed: Float64Array.from(this.trimmed),
148
- chunkRefs: Int32Array.from(this.chunkRefs),
149
- chunkStarts: Float64Array.from(this.chunkStarts),
150
- chunkRefNames: this.chunkRefNames
151
- };
152
- }
153
- };
154
-
155
- export {
156
- START_STOP_TAG,
157
- END_STOP_TAG,
158
- GAP_CAUSE_TEXT,
159
- OUTSIDE_TEXT,
160
- gapParts,
161
- stopAt,
162
- stopTag,
163
- parseStopTag,
164
- stopFields,
165
- walkStopFields,
166
- walkStopTags,
167
- StopColumns
168
- };
@@ -1,28 +0,0 @@
1
- import {
2
- END_STOP_TAG,
3
- GAP_CAUSE_TEXT,
4
- OUTSIDE_TEXT,
5
- START_STOP_TAG,
6
- StopColumns,
7
- gapParts,
8
- parseStopTag,
9
- stopAt,
10
- stopFields,
11
- stopTag,
12
- walkStopFields,
13
- walkStopTags
14
- } from "../chunks/chunk-D7ZTAGDM.js";
15
- export {
16
- END_STOP_TAG,
17
- GAP_CAUSE_TEXT,
18
- OUTSIDE_TEXT,
19
- START_STOP_TAG,
20
- StopColumns,
21
- gapParts,
22
- parseStopTag,
23
- stopAt,
24
- stopFields,
25
- stopTag,
26
- walkStopFields,
27
- walkStopTags
28
- };
@@ -1,59 +0,0 @@
1
- import type { PathStop, StopChunk } from '../types.js';
2
- export declare const START_STOP_TAG = "ws";
3
- export declare const END_STOP_TAG = "we";
4
- export type GapCause = 'missing' | 'elsewhere' | 'unknown' | 'abridged' | 'deleted';
5
- export declare const GAP_CAUSE_TEXT: Record<GapCause, string>;
6
- export declare const OUTSIDE_TEXT = "outside the extracted subgraph";
7
- export interface GapPart {
8
- bp: number;
9
- cause?: GapCause;
10
- chunk?: StopChunk;
11
- }
12
- /**
13
- * A gap of `bp` in contig order, split by the stops either side: the bp each
14
- * side's cut trimmed, outside the extracted subgraph, then the bp a record
15
- * break beside either side says the graph lacks, and the rest between, on
16
- * nodes filed elsewhere when either side goes on in a chunk the cut did not
17
- * read. A gap neither side states a stop for stays whole, with no cause.
18
- */
19
- export declare function gapParts(bp: number, after: PathStop | undefined, before: PathStop | undefined): GapPart[];
20
- export interface WalkStopTable {
21
- kinds: Uint8Array;
22
- kindNames: string[];
23
- bp: Float64Array;
24
- trimmed: Float64Array;
25
- chunkRefs: Int32Array;
26
- chunkStarts: Float64Array;
27
- chunkRefNames: string[];
28
- }
29
- export declare function stopAt(table: WalkStopTable, i: number): PathStop | undefined;
30
- /**
31
- * A stop as a Z tag's value: its kind, then `bp=`, `trimmed=` and
32
- * `chunk=refName:start` where it states them, comma-joined:
33
- * `break,bp=19021`, `elsewhere,bp=34110,chunk=GRCh38#0#chr22:20316160`
34
- */
35
- export declare function stopTag(stop: PathStop): string;
36
- export declare function parseStopTag(value: string): PathStop | undefined;
37
- export declare function stopFields(before: PathStop | undefined, after: PathStop | undefined): {
38
- after?: PathStop | undefined;
39
- before?: PathStop | undefined;
40
- };
41
- export declare function walkStopFields(tags: Record<string, string | number>): {
42
- after?: PathStop | undefined;
43
- before?: PathStop | undefined;
44
- };
45
- export declare function walkStopTags(walks: {
46
- before?: WalkStopTable;
47
- after?: WalkStopTable;
48
- }, p: number): string;
49
- export declare class StopColumns {
50
- kinds: number[];
51
- bp: number[];
52
- trimmed: number[];
53
- chunkRefs: number[];
54
- chunkStarts: number[];
55
- chunkRefNames: string[];
56
- private refIndex;
57
- push(stop: PathStop): void;
58
- table(): WalkStopTable;
59
- }