@jbrowse/bandage-core 12.7.1 → 13.1.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.
- package/README.md +42 -10
- package/dist/chunks/{chunk-F5CP5KSV.js → chunk-2HR33HEK.js} +43 -19
- package/dist/chunks/{chunk-XNLXC6GB.js → chunk-2TNFP3GC.js} +1 -1
- package/dist/chunks/{chunk-RQHIDUZR.js → chunk-4SM3YYY4.js} +6 -2
- package/dist/chunks/{chunk-3BLYOLTX.js → chunk-5PQQ4IXZ.js} +1 -1
- package/dist/chunks/{chunk-Q4B4O2M4.js → chunk-7ZS7UNYY.js} +1 -5
- package/dist/chunks/{chunk-H5NMBQZG.js → chunk-APOFTO4L.js} +1 -1
- package/dist/chunks/{chunk-6YVWF5TR.js → chunk-CDLHGGJH.js} +2 -2
- package/dist/chunks/{chunk-IDPBN2BP.js → chunk-DBLRFSET.js} +12 -13
- package/dist/chunks/{chunk-4J4IKYSL.js → chunk-FSOP446U.js} +6 -51
- package/dist/chunks/{chunk-QPKSULKV.js → chunk-IDYGRSNF.js} +1 -1
- package/dist/chunks/{chunk-WXUEAMJJ.js → chunk-IGQVO5L3.js} +1 -1
- package/dist/chunks/{chunk-KA6B7WCZ.js → chunk-JT2FJHD6.js} +1 -1
- package/dist/chunks/{chunk-EHEKIJ56.js → chunk-LJSZRCTZ.js} +2 -2
- package/dist/chunks/{chunk-7O7427XK.js → chunk-M2URPEV3.js} +1 -1
- package/dist/chunks/chunk-NPDW3JAD.js +118 -0
- package/dist/chunks/{chunk-FAWHP2CG.js → chunk-OB6OUWHG.js} +8 -8
- package/dist/chunks/{chunk-BPIELHWX.js → chunk-OROLXHDA.js} +2 -2
- package/dist/chunks/{chunk-ETYIYH7I.js → chunk-Q25JVERA.js} +5 -5
- package/dist/chunks/{chunk-LT66KA3W.js → chunk-QDP2NTAV.js} +3 -3
- package/dist/chunks/{chunk-TTFQTTBZ.js → chunk-RNROMUAS.js} +3 -3
- package/dist/chunks/{chunk-Q4X6O7BL.js → chunk-STHPR76Q.js} +22 -7
- package/dist/chunks/{chunk-QHCAFMHM.js → chunk-U7V64JZY.js} +1 -1
- package/dist/chunks/{chunk-O6SLIY74.js → chunk-WWQI7LPU.js} +195 -98
- package/dist/chunks/{chunk-3HNQW3HM.js → chunk-YI5HHKTR.js} +1 -1
- package/dist/chunks/{chunk-YAJT4IDN.js → chunk-Z2OUCH2J.js} +1 -1
- package/dist/chunks/{chunk-KCVW4VPK.js → chunk-Z2RG6IYI.js} +10 -10
- package/dist/cli/figure.js +22 -22
- package/dist/cli/fold.js +5 -5
- package/dist/figure.js +17 -17
- package/dist/figureData.js +20 -20
- package/dist/figureScene.js +13 -13
- package/dist/figureSettings.js +6 -6
- package/dist/gbzCut.js +4 -4
- package/dist/gbzWindow.js +3 -3
- package/dist/gfa/departures.js +26 -0
- package/dist/gfa/gfaConverter.js +1 -2
- package/dist/gfa/gfaTables.js +2 -2
- package/dist/gfa/graphTables.js +1 -2
- package/dist/index.js +39 -33
- package/dist/layout/forceCache.js +6 -6
- package/dist/layout/tubeMapLayout.js +5 -5
- package/dist/layout/walkRowDraw.js +4 -4
- package/dist/layout/walkRowLayout.js +6 -6
- package/dist/layout/walkRowRuns.js +3 -3
- package/dist/layout/walkRows.js +4 -4
- package/dist/layout/walkStrip.js +7 -7
- package/dist/layoutModes.js +8 -8
- package/dist/pipeline.js +5 -5
- package/dist/tubeMap/bundle.js +6 -6
- package/dist/tubeMap/coarsen.js +6 -6
- package/dist/tubeMap/deviations.js +6 -6
- package/dist/tubeMap/draw.js +5 -5
- package/dist/types/gfa/departures.d.ts +72 -0
- package/dist/types/gfa/graphTables.d.ts +35 -12
- package/dist/types/index.d.ts +4 -4
- package/dist/types/layout/deletionRoutes.d.ts +1 -1
- package/dist/types/layout/walkRowDraw.d.ts +4 -4
- package/dist/types/layout/walkRowRuns.d.ts +26 -6
- package/dist/types/layout/walkRows.d.ts +10 -4
- package/dist/types/types.d.ts +4 -25
- package/dist/types/version.d.ts +1 -1
- package/dist/types/walkHighlight.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/viewport.js +6 -6
- package/dist/walkHighlight.js +2 -2
- package/dist/walkKey.js +2 -2
- package/package.json +3 -1
- package/dist/chunks/chunk-D7ZTAGDM.js +0 -168
- package/dist/gfa/walkStops.js +0 -28
- package/dist/types/gfa/walkStops.d.ts +0 -59
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Graph, GraphPath, WalkSkips } from '../types.js';
|
|
1
|
+
import type { Graph, GraphPath } from '../types.js';
|
|
3
2
|
/**
|
|
4
3
|
* A graph as typed arrays, the shape a worker can hand across postMessage
|
|
5
4
|
* without copying: what a GFA of S lines tagged LN/SN/SO/SR, L lines and W
|
|
6
5
|
* lines states, with every link end and walk step an index into the node
|
|
7
|
-
* table
|
|
8
|
-
*
|
|
6
|
+
* table, and the departures from the reference over the cut, which no GFA
|
|
7
|
+
* line states. `graphFromTables` builds the Graph that converting that GFA
|
|
8
|
+
* builds, and `graphTablesGFA` writes the GFA.
|
|
9
|
+
*
|
|
10
|
+
* @jbrowse/graph-walks 6's `WalkGraph.tables` returns this shape, which
|
|
11
|
+
* typecheck/graphWalks.ts holds equal to its `GraphTables`. `departures` is
|
|
12
|
+
* required, so tables from a reader that states none fail to compile rather
|
|
13
|
+
* than draw no departure; a source with none passes `departureTable()`.
|
|
9
14
|
*/
|
|
10
15
|
export interface GraphTables {
|
|
11
16
|
nodes: {
|
|
@@ -15,6 +20,7 @@ export interface GraphTables {
|
|
|
15
20
|
starts: Float64Array;
|
|
16
21
|
ranks: Int32Array;
|
|
17
22
|
refNames: string[];
|
|
23
|
+
passes?: Int32Array;
|
|
18
24
|
};
|
|
19
25
|
links: {
|
|
20
26
|
from: Int32Array;
|
|
@@ -28,12 +34,28 @@ export interface GraphTables {
|
|
|
28
34
|
offsets: Int32Array;
|
|
29
35
|
steps: Int32Array;
|
|
30
36
|
reversed: Uint8Array;
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
trimmedBefore?: Float64Array;
|
|
38
|
+
trimmedAfter?: Float64Array;
|
|
33
39
|
abridgedSteps?: Float64Array;
|
|
34
40
|
abridgedBp?: Float64Array;
|
|
35
41
|
};
|
|
36
|
-
|
|
42
|
+
departures: DepartureTable;
|
|
43
|
+
}
|
|
44
|
+
export interface DepartureTable {
|
|
45
|
+
names: string[];
|
|
46
|
+
hapStarts: Float64Array;
|
|
47
|
+
ownBp: Float64Array;
|
|
48
|
+
missingBp: Float64Array;
|
|
49
|
+
leavePos: Float64Array;
|
|
50
|
+
leaveReversed: Uint8Array;
|
|
51
|
+
leavePasses: Int32Array;
|
|
52
|
+
rejoinPos: Float64Array;
|
|
53
|
+
rejoinReversed: Uint8Array;
|
|
54
|
+
rejoinPasses: Int32Array;
|
|
55
|
+
fromSteps: Uint8Array;
|
|
56
|
+
offsets: Int32Array;
|
|
57
|
+
steps: Int32Array;
|
|
58
|
+
reversed: Uint8Array;
|
|
37
59
|
}
|
|
38
60
|
/** The GraphPath `graphFromTables` builds of walk `p`, less its steps */
|
|
39
61
|
export declare function tablePath(w: GraphTables['walks'], p: number): Omit<GraphPath, 'nodeIds'> & {
|
|
@@ -44,17 +66,18 @@ export declare function tablePath(w: GraphTables['walks'], p: number): Omit<Grap
|
|
|
44
66
|
* claimed by a link and else by a walk. Counts each segment's walk steps into
|
|
45
67
|
* `traversals` when given one.
|
|
46
68
|
*/
|
|
47
|
-
export declare function tableNodeIds({ nodes: n, links: l, walks: w }: GraphTables, traversals?: Int32Array): string[];
|
|
69
|
+
export declare function tableNodeIds({ nodes: n, links: l, walks: w }: Omit<GraphTables, 'departures'>, traversals?: Int32Array): string[];
|
|
48
70
|
/**
|
|
49
71
|
* The Graph `convertGFAToGraph` builds from `graphTablesGFA(tables)`, deep
|
|
50
72
|
* equal, built by index: a step costs a few array reads and its visit, where
|
|
51
|
-
* the text costs a string and several map lookups. GFA has no line for a
|
|
52
|
-
*
|
|
73
|
+
* the text costs a string and several map lookups. GFA has no line for a
|
|
74
|
+
* departure or a trimmed walk's bp, so only this Graph keeps the tables'
|
|
75
|
+
* `departures` and each walk's trimmed bp.
|
|
53
76
|
*/
|
|
54
|
-
export declare function graphFromTables({ nodes: n, links: l, walks: w,
|
|
77
|
+
export declare function graphFromTables({ nodes: n, links: l, walks: w, departures }: GraphTables, name?: string): Graph;
|
|
55
78
|
/**
|
|
56
79
|
* The tables as GFA text: S lines in table order, then L lines, then a W
|
|
57
80
|
* line per walk, or a P line for a walk whose name has fewer than three PanSN
|
|
58
81
|
* parts
|
|
59
82
|
*/
|
|
60
|
-
export declare function graphTablesGFA({ nodes, links, walks }: GraphTables): string;
|
|
83
|
+
export declare function graphTablesGFA({ nodes, links, walks, }: Pick<GraphTables, 'nodes' | 'links' | 'walks'>): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -103,14 +103,14 @@ export type { GeneModel, GenePin } from './genes/genePins.js';
|
|
|
103
103
|
export { WELL_KNOWN_SAMPLES, assemblyWalk, backboneAssembly, featuresOnBackbone, graphBackbone, refNameBinding, referenceLabel, wellKnownSample, } from './reference.js';
|
|
104
104
|
export type { AssemblyNames, Backbone, BackboneContig } from './reference.js';
|
|
105
105
|
export { LABEL_CHAR_PX, LABEL_PAD, LABEL_PX } from './overlayLabels.js';
|
|
106
|
-
export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment,
|
|
106
|
+
export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment, } from './types.js';
|
|
107
107
|
export { compactTables, cutWindowGFA, cutWindowTables, haplotypeWanted, referencePathQuery, referenceSamplesOf, resolveReferenceSample, } from './gbzWindow.js';
|
|
108
108
|
export type { GbzWindowOptions } from './gbzWindow.js';
|
|
109
109
|
export { gfaTables } from './gfa/gfaTables.js';
|
|
110
110
|
export { graphFromTables, graphTablesGFA } from './gfa/graphTables.js';
|
|
111
|
-
export type { GraphTables } from './gfa/graphTables.js';
|
|
112
|
-
export {
|
|
113
|
-
export type { GapCause, GapPart,
|
|
111
|
+
export type { DepartureTable, GraphTables } from './gfa/graphTables.js';
|
|
112
|
+
export { GAP_CAUSE_TEXT, OUTSIDE_TEXT, PLACEMENT_CHOICE_TEXT, departureAt, departureKind, departureSpan, departureTable, departureText, gapParts, placementChoice, } from './gfa/departures.js';
|
|
113
|
+
export type { Departure, DepartureKind, GapCause, GapPart, } from './gfa/departures.js';
|
|
114
114
|
export { PathVisits, PathVisitsBuilder } from './pathVisits.js';
|
|
115
115
|
export { engineKey } from './pipeline.js';
|
|
116
116
|
export { axisScaleOf, contains, padded, screenToLayout, viewportOf, zoomAbout, } from './viewport.js';
|
|
@@ -18,7 +18,7 @@ export declare function withDeletionRoutes(graph: Graph, deletions: DeletionEdge
|
|
|
18
18
|
anchoredBy?: "tags" | "paths";
|
|
19
19
|
referencePath?: string;
|
|
20
20
|
reads?: import("../gaf/parseGaf.js").GafRecord[];
|
|
21
|
-
|
|
21
|
+
departures?: import("../index.js").DepartureTable;
|
|
22
22
|
};
|
|
23
23
|
routes: Map<number, string>;
|
|
24
24
|
ids: Set<string>;
|
|
@@ -1,12 +1,12 @@
|
|
|
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/
|
|
4
|
+
import type { GapCause } from '../gfa/departures.js';
|
|
5
5
|
export declare const ON_REFERENCE = "#2f8fd6";
|
|
6
6
|
export declare const OFF_REFERENCE = "#8e3fbf";
|
|
7
7
|
export declare const OUTSIDE_CUT = "#bdbdbd";
|
|
8
8
|
export declare const MISSING_INK = "#8a8a8a";
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const OWN_GAP = "#e2e2e2";
|
|
10
10
|
export declare const ABRIDGED_GAP = "#d9a441";
|
|
11
11
|
export declare const GENE_INK = "#1c1c22";
|
|
12
12
|
export declare const BAR_PX = 12;
|
|
@@ -18,9 +18,9 @@ export interface ReadoutCall {
|
|
|
18
18
|
spanningReads?: number;
|
|
19
19
|
agrees?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete' | 'stop' | 'abridgedSteps' | 'estimated' | '
|
|
21
|
+
export declare function walkRowReadout(row: Pick<WalkRow, 'bp' | 'gapBp' | 'complete' | 'stop' | 'abridgedSteps' | 'estimated' | 'departures' | 'placementChoice' | 'stepless'> & {
|
|
22
22
|
runs?: WalkRun[];
|
|
23
|
-
}, reference: Pick<WalkRow, 'bp'> | undefined, unit?: number, call?: ReadoutCall): string;
|
|
23
|
+
}, reference: (Pick<WalkRow, 'bp'> & Partial<WalkRow>) | undefined, unit?: number, call?: ReadoutCall): string;
|
|
24
24
|
export declare function readoutPlacement(text: string, endX: number, width: number): {
|
|
25
25
|
x: number;
|
|
26
26
|
anchor: "start";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WalkRow, WalkRows, WalkRun } from './walkRows.js';
|
|
2
2
|
import type { GraphTables } from '../gfa/graphTables.js';
|
|
3
|
-
import type { Graph
|
|
3
|
+
import type { Graph } from '../types.js';
|
|
4
4
|
export type WalkRowMeta = Omit<WalkRow, 'runs' | 'visits'>;
|
|
5
5
|
/**
|
|
6
6
|
* Each row's visits, row i's at `offsets[i]` up to `offsets[i + 1]`: the
|
|
@@ -28,8 +28,7 @@ export interface WalkRowRuns {
|
|
|
28
28
|
bp: Float64Array;
|
|
29
29
|
referenceStart: Float64Array;
|
|
30
30
|
flags: Uint8Array;
|
|
31
|
-
|
|
32
|
-
chunks: StopChunk[];
|
|
31
|
+
near: Float64Array;
|
|
33
32
|
visits?: WalkVisitColumns;
|
|
34
33
|
}
|
|
35
34
|
export declare function referenceWalkName(graph: Pick<Graph, 'nodes' | 'paths' | 'referencePath'>): string | undefined;
|
|
@@ -40,9 +39,30 @@ export declare function referenceWalkName(graph: Pick<Graph, 'nodes' | 'paths' |
|
|
|
40
39
|
*
|
|
41
40
|
* Each walk is cut at the nearest reference nodes IT visits on either side of
|
|
42
41
|
* the region, so a walk that skips one flanking node at a SNP is still
|
|
43
|
-
* measured between flanks rather than whole. A walk with one flank
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* measured between flanks rather than whole. A walk with one flank is the
|
|
43
|
+
* steps past that flank read in the reference's direction, a lower bound.
|
|
44
|
+
* Its contig ends at its last step there only where that step is on the
|
|
45
|
+
* reference, the walk has no departure leaving or rejoining at it, and the
|
|
46
|
+
* cut trimmed none of its bp past it; else it goes on (`WalkStop`). A walk
|
|
47
|
+
* file's fragment always ends on the reference, so its end alone says
|
|
48
|
+
* nothing.
|
|
49
|
+
*
|
|
50
|
+
* The window's side of a lone flank is the way the walk runs along the
|
|
51
|
+
* reference there, read from its nearest other step on it. Where the flank is
|
|
52
|
+
* the walk's only step, it is read from a departure at that step, whose strand
|
|
53
|
+
* there is the walk's; else from the bp the cut trimmed off one side alone,
|
|
54
|
+
* the side the walk came from; and with both sides trimmed or neither, both
|
|
55
|
+
* say the same. Nothing past the flank is in the window, so the row has no bp.
|
|
56
|
+
*
|
|
57
|
+
* A cut with no flanking reference stands the reference's outermost nodes in
|
|
58
|
+
* the cut in for the flanks, counted inside the window. A walk on both is
|
|
59
|
+
* whole; on one, it stops inside as a walk with one flank does, measured from
|
|
60
|
+
* that node; on neither, it is partial. The source decides whether a walk
|
|
61
|
+
* is read so: a walk file's tables state each walk's trimmed bp, 0 included,
|
|
62
|
+
* so there a side with none and no departure is where the contig ends. A
|
|
63
|
+
* source that states no trimmed bp, GFA text or a gbz-base extract, clips its
|
|
64
|
+
* paths at the subgraph's edge, so where they end says nothing and each walk
|
|
65
|
+
* is the slice whole.
|
|
46
66
|
*/
|
|
47
67
|
export declare function walkRowRuns(source: Graph | GraphTables, region?: {
|
|
48
68
|
start: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GapCause } from '../gfa/
|
|
2
|
-
import type { Graph
|
|
1
|
+
import type { Departure, GapCause } from '../gfa/departures.js';
|
|
2
|
+
import type { Graph } from '../types.js';
|
|
3
3
|
export { referenceWalkName } from './walkRowRuns.js';
|
|
4
4
|
export interface WalkRun {
|
|
5
5
|
start: number;
|
|
@@ -9,7 +9,7 @@ export interface WalkRun {
|
|
|
9
9
|
reversed?: true;
|
|
10
10
|
gap?: true;
|
|
11
11
|
cause?: GapCause;
|
|
12
|
-
|
|
12
|
+
near?: number;
|
|
13
13
|
}
|
|
14
14
|
export interface WalkAxis {
|
|
15
15
|
contig: string;
|
|
@@ -19,6 +19,10 @@ export interface WalkAxis {
|
|
|
19
19
|
export interface WalkStop {
|
|
20
20
|
contigEnds: boolean;
|
|
21
21
|
shortBp: number;
|
|
22
|
+
goesOn?: {
|
|
23
|
+
departure: Departure;
|
|
24
|
+
near: number;
|
|
25
|
+
};
|
|
22
26
|
}
|
|
23
27
|
export interface WalkVisit {
|
|
24
28
|
node: string;
|
|
@@ -38,7 +42,9 @@ export interface WalkRow {
|
|
|
38
42
|
stop?: WalkStop;
|
|
39
43
|
abridgedSteps?: number;
|
|
40
44
|
estimated?: boolean;
|
|
41
|
-
|
|
45
|
+
departures?: Departure[];
|
|
46
|
+
placementChoice?: true;
|
|
47
|
+
stepless?: true;
|
|
42
48
|
runs: WalkRun[];
|
|
43
49
|
visits?: WalkVisit[];
|
|
44
50
|
axis?: WalkAxis;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GafRecord } from './gaf/parseGaf.js';
|
|
2
|
+
import type { DepartureTable } from './gfa/graphTables.js';
|
|
2
3
|
import type { StableCoordinate } from './gfa-core/index.js';
|
|
3
4
|
import type { TubeMapDrawing } from './layout/tubeMapLayout.js';
|
|
4
5
|
import type { PathVisits } from './pathVisits.js';
|
|
@@ -32,30 +33,13 @@ export interface GraphPath {
|
|
|
32
33
|
haplotype?: number;
|
|
33
34
|
contig?: string;
|
|
34
35
|
members?: string[];
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
trimmedBefore?: number;
|
|
37
|
+
trimmedAfter?: number;
|
|
37
38
|
abridged?: {
|
|
38
39
|
steps: number;
|
|
39
40
|
bp: number;
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
export type PathStop = ({
|
|
43
|
-
kind: 'elsewhere';
|
|
44
|
-
chunk: StopChunk;
|
|
45
|
-
bp?: number;
|
|
46
|
-
} | {
|
|
47
|
-
kind: 'break';
|
|
48
|
-
bp: number;
|
|
49
|
-
chunk?: StopChunk;
|
|
50
|
-
} | {
|
|
51
|
-
kind: 'end';
|
|
52
|
-
}) & {
|
|
53
|
-
trimmed?: number;
|
|
54
|
-
};
|
|
55
|
-
export interface StopChunk {
|
|
56
|
-
refName: string;
|
|
57
|
-
start: number;
|
|
58
|
-
}
|
|
59
43
|
export interface PathOrigin {
|
|
60
44
|
name: string;
|
|
61
45
|
sample: string;
|
|
@@ -78,12 +62,7 @@ export interface Graph {
|
|
|
78
62
|
anchoredBy?: 'tags' | 'paths';
|
|
79
63
|
referencePath?: string;
|
|
80
64
|
reads?: GafRecord[];
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
export interface WalkSkips {
|
|
84
|
-
names: string[];
|
|
85
|
-
starts: Float64Array;
|
|
86
|
-
ends: Float64Array;
|
|
65
|
+
departures?: DepartureTable;
|
|
87
66
|
}
|
|
88
67
|
export interface NodeSegment {
|
|
89
68
|
x: number;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "13.1.0";
|
package/dist/version.js
CHANGED
package/dist/viewport.js
CHANGED
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
screenToLayout,
|
|
6
6
|
viewportOf,
|
|
7
7
|
zoomAbout
|
|
8
|
-
} from "./chunks/chunk-
|
|
9
|
-
import "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-2TNFP3GC.js";
|
|
9
|
+
import "./chunks/chunk-RNROMUAS.js";
|
|
10
10
|
import "./chunks/chunk-4FRX2SPT.js";
|
|
11
11
|
import "./chunks/chunk-OPPVSPEF.js";
|
|
12
12
|
import "./chunks/chunk-XABWOV3C.js";
|
|
13
13
|
import "./chunks/chunk-NAYS472K.js";
|
|
14
|
-
import "./chunks/chunk-
|
|
14
|
+
import "./chunks/chunk-7ZS7UNYY.js";
|
|
15
15
|
import "./chunks/chunk-QYBZZI5H.js";
|
|
16
16
|
import "./chunks/chunk-CFXXFHRK.js";
|
|
17
17
|
import "./chunks/chunk-FGH4D6WT.js";
|
|
18
|
-
import "./chunks/chunk-
|
|
18
|
+
import "./chunks/chunk-DBLRFSET.js";
|
|
19
19
|
import "./chunks/chunk-L4DBSRA2.js";
|
|
20
|
-
import "./chunks/chunk-
|
|
21
|
-
import "./chunks/chunk-
|
|
20
|
+
import "./chunks/chunk-FSOP446U.js";
|
|
21
|
+
import "./chunks/chunk-NPDW3JAD.js";
|
|
22
22
|
import "./chunks/chunk-HNNP5QUN.js";
|
|
23
23
|
import "./chunks/chunk-HKYXWZQS.js";
|
|
24
24
|
import "./chunks/chunk-34BOZKIE.js";
|
package/dist/walkHighlight.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
fadedKey,
|
|
4
4
|
walkHighlight,
|
|
5
5
|
walkLift
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-STHPR76Q.js";
|
|
7
7
|
import "./chunks/chunk-OC5HU7M3.js";
|
|
8
8
|
import "./chunks/chunk-UY7CLJNZ.js";
|
|
9
9
|
import "./chunks/chunk-YUIKEUKY.js";
|
|
@@ -13,7 +13,7 @@ import "./chunks/chunk-XWH4LB56.js";
|
|
|
13
13
|
import "./chunks/chunk-KKYPJITI.js";
|
|
14
14
|
import "./chunks/chunk-ZXOELYF3.js";
|
|
15
15
|
import "./chunks/chunk-L4DBSRA2.js";
|
|
16
|
-
import "./chunks/chunk-
|
|
16
|
+
import "./chunks/chunk-NPDW3JAD.js";
|
|
17
17
|
import "./chunks/chunk-74A3MFUM.js";
|
|
18
18
|
import "./chunks/chunk-HMXCN6PG.js";
|
|
19
19
|
import "./chunks/chunk-S43IBA5Y.js";
|
package/dist/walkKey.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
rangeText,
|
|
3
3
|
walkKey,
|
|
4
4
|
walkPosition
|
|
5
|
-
} from "./chunks/chunk-
|
|
6
|
-
import "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-QDP2NTAV.js";
|
|
6
|
+
import "./chunks/chunk-NPDW3JAD.js";
|
|
7
7
|
import "./chunks/chunk-74A3MFUM.js";
|
|
8
8
|
import "./chunks/chunk-HMXCN6PG.js";
|
|
9
9
|
import "./chunks/chunk-S43IBA5Y.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/bandage-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.1.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": {
|
|
@@ -43,10 +43,12 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@eslint/js": "^10.0.1",
|
|
46
|
+
"@jbrowse/graph-walks": "^6.0.0",
|
|
46
47
|
"@types/node": "^26.6.5",
|
|
47
48
|
"esbuild": "^0.28.2",
|
|
48
49
|
"eslint": "^10.11.0",
|
|
49
50
|
"eslint-plugin-import-x": "^4.17.1",
|
|
51
|
+
"generic-filehandle2": "^2.5.1",
|
|
50
52
|
"git-cliff": "^2.14.2",
|
|
51
53
|
"jsdom": "^30.1.2",
|
|
52
54
|
"prettier": "^3.9.10",
|
|
@@ -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
|
-
};
|
package/dist/gfa/walkStops.js
DELETED
|
@@ -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
|
-
}
|