@jbrowse/bandage-core 10.3.1 → 11.0.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 (65) hide show
  1. package/README.md +5 -0
  2. package/dist/chunks/{chunk-DBLV7PGG.js → chunk-3XSRT7RQ.js} +16 -2
  3. package/dist/chunks/{chunk-EWLXU3UG.js → chunk-5LTZVKZQ.js} +9 -9
  4. package/dist/chunks/{chunk-AQCOIE5R.js → chunk-6OP4HPXG.js} +1 -1
  5. package/dist/chunks/{chunk-BKEZLETL.js → chunk-AI5PTOSV.js} +1 -1
  6. package/dist/chunks/{chunk-R2PJKD3Y.js → chunk-BIOKXS3M.js} +1 -1
  7. package/dist/chunks/{chunk-YZQI35UJ.js → chunk-C3NT37C3.js} +22 -1
  8. package/dist/chunks/{chunk-OOIOX36I.js → chunk-CIDSF47D.js} +28 -8
  9. package/dist/chunks/{chunk-CHNESV7L.js → chunk-CTZRIDMY.js} +7 -7
  10. package/dist/chunks/{chunk-QH2MIXBA.js → chunk-CZT33FZG.js} +6 -6
  11. package/dist/chunks/{chunk-CGFPFBT2.js → chunk-D4ZFRBB4.js} +11 -2
  12. package/dist/chunks/{chunk-Z6XZWPXK.js → chunk-DZR37KXT.js} +51 -2
  13. package/dist/chunks/{chunk-AZ4EEF6Q.js → chunk-EDWU7OM4.js} +5 -5
  14. package/dist/chunks/chunk-EIY2SKD3.js +164 -0
  15. package/dist/chunks/{chunk-MWOVW4AH.js → chunk-EY2ZGSCP.js} +1 -1
  16. package/dist/chunks/{chunk-NZTYV3JL.js → chunk-FFHJGWDK.js} +5 -1
  17. package/dist/chunks/{chunk-KMBE2Q42.js → chunk-KDU4EF66.js} +3 -3
  18. package/dist/chunks/{chunk-WYJQIC75.js → chunk-L5IETLWP.js} +4 -4
  19. package/dist/chunks/{chunk-GIHTHYXY.js → chunk-NMWQUFPF.js} +1 -1
  20. package/dist/chunks/{chunk-A2TJ5UX6.js → chunk-OLKXMZ6J.js} +1 -1
  21. package/dist/chunks/{chunk-FW2R7UDZ.js → chunk-PK5QQOMN.js} +1 -1
  22. package/dist/chunks/{chunk-OXRUPNSV.js → chunk-RNYPCQZ3.js} +1 -1
  23. package/dist/chunks/{chunk-SFP3E4RI.js → chunk-TEF3NBG3.js} +2 -2
  24. package/dist/chunks/{chunk-M5NPD55W.js → chunk-TUQKGAK3.js} +1 -1
  25. package/dist/chunks/{chunk-D7WIYPG3.js → chunk-W6EXQDV5.js} +1 -1
  26. package/dist/chunks/{chunk-ZJBOM73S.js → chunk-XZ6PQBU6.js} +58 -12
  27. package/dist/cli/figure.js +22 -21
  28. package/dist/cli/fold.js +5 -4
  29. package/dist/figure.js +16 -15
  30. package/dist/figureData.js +19 -18
  31. package/dist/figureScene.js +11 -10
  32. package/dist/figureSettings.js +6 -5
  33. package/dist/gbzCut.js +4 -3
  34. package/dist/gbzWindow.js +3 -2
  35. package/dist/gfa/gfaConverter.js +2 -1
  36. package/dist/gfa/gfaTables.js +2 -1
  37. package/dist/gfa/graphTables.js +2 -1
  38. package/dist/gfa/walkStops.js +28 -0
  39. package/dist/index.js +52 -34
  40. package/dist/layout/forceCache.js +6 -5
  41. package/dist/layout/tubeMapLayout.js +3 -2
  42. package/dist/layout/walkRowDraw.js +10 -1
  43. package/dist/layout/walkRowLayout.js +3 -2
  44. package/dist/layout/walkRows.js +2 -1
  45. package/dist/layout/walkStrip.js +5 -4
  46. package/dist/layoutModes.js +6 -5
  47. package/dist/pipeline.js +5 -4
  48. package/dist/tubeMap/bundle.js +4 -3
  49. package/dist/tubeMap/coarsen.js +4 -3
  50. package/dist/tubeMap/deviations.js +4 -3
  51. package/dist/tubeMap/draw.js +4 -3
  52. package/dist/types/gfa/graphTables.d.ts +3 -0
  53. package/dist/types/gfa/walkStops.d.ts +59 -0
  54. package/dist/types/index.d.ts +4 -2
  55. package/dist/types/layout/walkRowDraw.d.ts +14 -1
  56. package/dist/types/layout/walkRows.d.ts +4 -1
  57. package/dist/types/types.d.ts +19 -0
  58. package/dist/types/version.d.ts +1 -1
  59. package/dist/types/walkHighlight.d.ts +2 -0
  60. package/dist/types/walkKey.d.ts +1 -1
  61. package/dist/version.js +1 -1
  62. package/dist/viewport.js +6 -5
  63. package/dist/walkHighlight.js +2 -1
  64. package/dist/walkKey.js +2 -1
  65. package/package.json +1 -1
@@ -0,0 +1,59 @@
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';
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
+ }
@@ -73,7 +73,7 @@ export { bubbleSubgraph } from './bubbles/popBubble.js';
73
73
  export type { MinigraphBubble } from './bubbles/bubbleLine.js';
74
74
  export { filterSamples, walkRows } from './layout/walkRows.js';
75
75
  export type { WalkAxis, WalkRow, WalkRows, WalkRun, WalkStop, } from './layout/walkRows.js';
76
- export { BAR_PX as WALK_BAR_PX, CALL_TICK as WALK_CALL_TICK, DISAGREES as WALK_DISAGREES, GAP_PX as WALK_GAP_PX, GENE_INK as WALK_GENE_INK, OFF_REFERENCE as WALK_OFF_REFERENCE, ON_REFERENCE as WALK_ON_REFERENCE, OUTSIDE_CUT as WALK_OUTSIDE_CUT, UNBACKED_TICK as WALK_UNBACKED_TICK, alongRow, callTickInk, coalesceRuns, genesOnRow, placeRowGenes, readoutPlacement, rowGeneBoxes, rowPitch, rowSpan, runPaint, unitTicks, walkRowReadout, walkRowsKey, walkRowsKeyTree, walkRowsTree, } from './layout/walkRowDraw.js';
76
+ export { BAR_PX as WALK_BAR_PX, CALL_TICK as WALK_CALL_TICK, DISAGREES as WALK_DISAGREES, GAP_PX as WALK_GAP_PX, GENE_INK as WALK_GENE_INK, OFF_REFERENCE as WALK_OFF_REFERENCE, ON_REFERENCE as WALK_ON_REFERENCE, OUTSIDE_CUT as WALK_OUTSIDE_CUT, UNBACKED_TICK as WALK_UNBACKED_TICK, alongRow, callTickInk, coalesceRuns, gapStyle, genesOnRow, placeRowGenes, readoutPlacement, rowGeneBoxes, rowPitch, rowSpan, runPaint, unitTicks, walkRowReadout, walkRowsKey, walkRowsKeyTree, walkRowsTree, } from './layout/walkRowDraw.js';
77
77
  export type { GeneBox, GeneGaps, KeyEntry, KeySwatch, ReadoutCall, RowGene, RowPitch, WalkRowsFrame, WalkRowsWithCalls, } from './layout/walkRowDraw.js';
78
78
  export { LABELLED_ROW_PX, WALK_STRIP_CEILING_PX, segmentAt, stripGeneGaps, stripMarks, stripRowAt, walkMarksTree, walkStripFrame, walkStripLabelsTree, } from './layout/walkStrip.js';
79
79
  export type { StripFrame, StripMark } from './layout/walkStrip.js';
@@ -92,12 +92,14 @@ export type { GeneModel, GenePin } from './genes/genePins.js';
92
92
  export { WELL_KNOWN_SAMPLES, assemblyWalk, backboneAssembly, featuresOnBackbone, graphBackbone, refNameBinding, referenceLabel, wellKnownSample, } from './reference.js';
93
93
  export type { AssemblyNames, Backbone, BackboneContig } from './reference.js';
94
94
  export { LABEL_CHAR_PX, LABEL_PAD, LABEL_PX } from './overlayLabels.js';
95
- export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment, } from './types.js';
95
+ export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment, PathStop, StopChunk, } from './types.js';
96
96
  export { compactTables, cutWindowGFA, cutWindowTables, haplotypeWanted, referencePathQuery, referenceSamplesOf, resolveReferenceSample, } from './gbzWindow.js';
97
97
  export type { GbzWindowOptions } from './gbzWindow.js';
98
98
  export { gfaTables } from './gfa/gfaTables.js';
99
99
  export { graphFromTables, graphTablesGFA } from './gfa/graphTables.js';
100
100
  export type { GraphTables } from './gfa/graphTables.js';
101
+ export { END_STOP_TAG, GAP_CAUSE_TEXT, OUTSIDE_TEXT, START_STOP_TAG, gapParts, parseStopTag, stopTag, } from './gfa/walkStops.js';
102
+ export type { GapCause, GapPart, WalkStopTable } from './gfa/walkStops.js';
101
103
  export { PathVisits, PathVisitsBuilder } from './pathVisits.js';
102
104
  export { engineKey } from './pipeline.js';
103
105
  export { axisScaleOf, contains, padded, screenToLayout, viewportOf, zoomAbout, } from './viewport.js';
@@ -1,19 +1,25 @@
1
1
  import type { WalkAxis, WalkRow, WalkRows, WalkRun } from './walkRows.js';
2
2
  import type { El } from '../el.js';
3
3
  import type { GeneModel } from '../genes/genePins.js';
4
+ import type { GapCause } from '../gfa/walkStops.js';
4
5
  export declare const ON_REFERENCE = "#2f8fd6";
5
6
  export declare const OFF_REFERENCE = "#8e3fbf";
6
7
  export declare const OUTSIDE_CUT = "#bdbdbd";
8
+ export declare const MISSING_INK = "#8a8a8a";
9
+ export declare const UNKNOWN_GAP = "#e2e2e2";
7
10
  export declare const GENE_INK = "#1c1c22";
8
11
  export declare const BAR_PX = 12;
9
12
  export declare const GAP_PX = 4;
13
+ export declare const MISSING_PX = 1;
10
14
  export declare const LABELLED_ROW_PX = 12;
11
15
  export interface ReadoutCall {
12
16
  bp: number;
13
17
  spanningReads?: number;
14
18
  agrees?: boolean;
15
19
  }
16
- export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete' | 'stop'>, reference: Pick<WalkRow, 'bp'> | undefined, unit?: number, call?: ReadoutCall): string;
20
+ export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete' | 'stop'> & {
21
+ runs?: WalkRun[];
22
+ }, reference: Pick<WalkRow, 'bp'> | undefined, unit?: number, call?: ReadoutCall): string;
17
23
  export declare function readoutPlacement(text: string, endX: number, width: number): {
18
24
  x: number;
19
25
  anchor: "start";
@@ -24,6 +30,11 @@ export declare function readoutPlacement(text: string, endX: number, width: numb
24
30
  halo: boolean;
25
31
  };
26
32
  export declare function unitTicks(bp: number, unit: number, pxPerBp: number): number[];
33
+ export declare function gapStyle(cause: GapCause | undefined): {
34
+ fill: string;
35
+ px: number;
36
+ label: string;
37
+ };
27
38
  export declare function runPaint(run: WalkRun, ramp: {
28
39
  start: number;
29
40
  end: number;
@@ -79,6 +90,7 @@ export type KeySwatch = {
79
90
  } | {
80
91
  kind: 'gap';
81
92
  fill: string;
93
+ px: number;
82
94
  } | {
83
95
  kind: 'gene';
84
96
  };
@@ -134,6 +146,7 @@ export interface WalkRowsFrame {
134
146
  rowPx?: number;
135
147
  barPx?: number;
136
148
  readouts?: boolean;
149
+ bars?: boolean;
137
150
  }
138
151
  export declare function coalesceRuns(runs: WalkRun[], pxPerBp: number): WalkRun[];
139
152
  export declare function walkRowsTree(bars: WalkRowsWithCalls, frame: WalkRowsFrame, o?: {
@@ -1,4 +1,5 @@
1
- import type { Graph } from '../types.js';
1
+ import type { GapCause } from '../gfa/walkStops.js';
2
+ import type { Graph, StopChunk } from '../types.js';
2
3
  export interface WalkRun {
3
4
  start: number;
4
5
  bp: number;
@@ -6,6 +7,8 @@ export interface WalkRun {
6
7
  referenceStart?: number;
7
8
  reversed?: true;
8
9
  gap?: true;
10
+ cause?: GapCause;
11
+ chunk?: StopChunk;
9
12
  }
10
13
  export interface WalkAxis {
11
14
  contig: string;
@@ -25,6 +25,25 @@ export interface GraphPath {
25
25
  haplotype?: number;
26
26
  contig?: string;
27
27
  members?: string[];
28
+ before?: PathStop;
29
+ after?: PathStop;
30
+ }
31
+ export type PathStop = ({
32
+ kind: 'elsewhere';
33
+ chunk: StopChunk;
34
+ bp?: number;
35
+ } | {
36
+ kind: 'break';
37
+ bp: number;
38
+ chunk?: StopChunk;
39
+ } | {
40
+ kind: 'end';
41
+ }) & {
42
+ trimmed?: number;
43
+ };
44
+ export interface StopChunk {
45
+ refName: string;
46
+ start: number;
28
47
  }
29
48
  export interface PathOrigin {
30
49
  name: string;
@@ -1 +1 @@
1
- export declare const version = "10.3.1";
1
+ export declare const version = "11.0.0";
@@ -15,6 +15,8 @@ export interface WalkHighlight {
15
15
  start: number;
16
16
  end: number;
17
17
  };
18
+ missingBp: number;
19
+ unknownBp: number;
18
20
  }
19
21
  export interface LiftedWalk extends WalkHighlight {
20
22
  encoding: WalkEncoding;
@@ -6,7 +6,7 @@ export declare function walkKey(walk: LiftedWalk, reference?: {
6
6
  end: number;
7
7
  }): {
8
8
  delta: string;
9
- outside: string;
9
+ gaps: string;
10
10
  reversed: string;
11
11
  shades: boolean;
12
12
  scale: string | undefined;
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "./chunks/chunk-AQCOIE5R.js";
3
+ } from "./chunks/chunk-6OP4HPXG.js";
4
4
  export {
5
5
  version
6
6
  };
package/dist/viewport.js CHANGED
@@ -5,19 +5,20 @@ import {
5
5
  screenToLayout,
6
6
  viewportOf,
7
7
  zoomAbout
8
- } from "./chunks/chunk-BKEZLETL.js";
9
- import "./chunks/chunk-KMBE2Q42.js";
8
+ } from "./chunks/chunk-AI5PTOSV.js";
9
+ import "./chunks/chunk-KDU4EF66.js";
10
10
  import "./chunks/chunk-3PZSBNLI.js";
11
11
  import "./chunks/chunk-CKUVEHSS.js";
12
12
  import "./chunks/chunk-OPPVSPEF.js";
13
13
  import "./chunks/chunk-VPE4AYP7.js";
14
- import "./chunks/chunk-NZTYV3JL.js";
14
+ import "./chunks/chunk-FFHJGWDK.js";
15
15
  import "./chunks/chunk-QYBZZI5H.js";
16
16
  import "./chunks/chunk-5I3K4R2G.js";
17
- import "./chunks/chunk-DBLV7PGG.js";
17
+ import "./chunks/chunk-3XSRT7RQ.js";
18
18
  import "./chunks/chunk-B5X2RLJG.js";
19
19
  import "./chunks/chunk-VX656OAZ.js";
20
- import "./chunks/chunk-Z6XZWPXK.js";
20
+ import "./chunks/chunk-DZR37KXT.js";
21
+ import "./chunks/chunk-EIY2SKD3.js";
21
22
  import "./chunks/chunk-ZPZ7GNBT.js";
22
23
  import "./chunks/chunk-BZFOFC4D.js";
23
24
  import "./chunks/chunk-HKYXWZQS.js";
@@ -2,7 +2,7 @@ import {
2
2
  facetLifts,
3
3
  walkHighlight,
4
4
  walkLift
5
- } from "./chunks/chunk-YZQI35UJ.js";
5
+ } from "./chunks/chunk-C3NT37C3.js";
6
6
  import "./chunks/chunk-DO62DG26.js";
7
7
  import "./chunks/chunk-SWCULW6S.js";
8
8
  import "./chunks/chunk-G2FD7S3C.js";
@@ -12,6 +12,7 @@ import "./chunks/chunk-3GP3KT5L.js";
12
12
  import "./chunks/chunk-CRCD3ODN.js";
13
13
  import "./chunks/chunk-B5X2RLJG.js";
14
14
  import "./chunks/chunk-VX656OAZ.js";
15
+ import "./chunks/chunk-EIY2SKD3.js";
15
16
  import "./chunks/chunk-ZPZ7GNBT.js";
16
17
  import "./chunks/chunk-PFRQBCGC.js";
17
18
  import "./chunks/chunk-HMXCN6PG.js";
package/dist/walkKey.js CHANGED
@@ -2,7 +2,8 @@ import {
2
2
  rangeText,
3
3
  walkKey,
4
4
  walkPosition
5
- } from "./chunks/chunk-CGFPFBT2.js";
5
+ } from "./chunks/chunk-D4ZFRBB4.js";
6
+ import "./chunks/chunk-EIY2SKD3.js";
6
7
  import "./chunks/chunk-PFRQBCGC.js";
7
8
  import "./chunks/chunk-HMXCN6PG.js";
8
9
  import "./chunks/chunk-AB35TJST.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "10.3.1",
3
+ "version": "11.0.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": {