@jbrowse/bandage-core 0.1.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.
- package/LICENSE +674 -0
- package/README.md +29 -0
- package/dist/chunks/bandage-layout-3AR6BCUD.js +4694 -0
- package/dist/index.js +5409 -0
- package/dist/types/alleleProjection/projectAlleles.d.ts +13 -0
- package/dist/types/anchoredNodes.d.ts +17 -0
- package/dist/types/bandage/bandage-layout.d.ts +14 -0
- package/dist/types/bubbleSpreads.d.ts +32 -0
- package/dist/types/bubbles/bubbleHalos.d.ts +20 -0
- package/dist/types/bubbles/bubbleLine.d.ts +24 -0
- package/dist/types/bubbles/bubblesFromGraph.d.ts +3 -0
- package/dist/types/bubbles/classifyBubble.d.ts +16 -0
- package/dist/types/bubbles/popBubble.d.ts +2 -0
- package/dist/types/colorSchemes.d.ts +33 -0
- package/dist/types/deletionEdges.d.ts +24 -0
- package/dist/types/gaf/parseGaf.d.ts +37 -0
- package/dist/types/gbzWindow.d.ts +27 -0
- package/dist/types/genes/genePins.d.ts +19 -0
- package/dist/types/gfa/gfaConverter.d.ts +11 -0
- package/dist/types/gfa-core/gfaParser.d.ts +48 -0
- package/dist/types/gfa-core/index.d.ts +2 -0
- package/dist/types/graphLabels.d.ts +46 -0
- package/dist/types/index.d.ts +50 -0
- package/dist/types/labelLayout.d.ts +59 -0
- package/dist/types/layout/anchoredLayout.d.ts +5 -0
- package/dist/types/layout/drawnScale.d.ts +28 -0
- package/dist/types/layout/mergeRuns.d.ts +9 -0
- package/dist/types/layout/orderedLayout.d.ts +9 -0
- package/dist/types/layout/orientToReference.d.ts +4 -0
- package/dist/types/layout/placeOffReference.d.ts +9 -0
- package/dist/types/layout/referenceSeeds.d.ts +12 -0
- package/dist/types/layout/rowSpacing.d.ts +1 -0
- package/dist/types/layout/sampleRowLayout.d.ts +5 -0
- package/dist/types/layout/tubeMapLayout.d.ts +19 -0
- package/dist/types/layout/variantMapLayout.d.ts +2 -0
- package/dist/types/layout/walkRowLayout.d.ts +10 -0
- package/dist/types/layout/walkRows.d.ts +25 -0
- package/dist/types/layoutModes.d.ts +153 -0
- package/dist/types/loadBandage.d.ts +3 -0
- package/dist/types/nodeWidths.d.ts +18 -0
- package/dist/types/overlayLabels.d.ts +29 -0
- package/dist/types/pansn.d.ts +8 -0
- package/dist/types/pathAnchoring.d.ts +20 -0
- package/dist/types/pathColors.d.ts +14 -0
- package/dist/types/pipeline.d.ts +79 -0
- package/dist/types/referenceSpan.d.ts +12 -0
- package/dist/types/renderer/Canvas2DRenderer.d.ts +32 -0
- package/dist/types/renderer/GeometryBuilder.d.ts +63 -0
- package/dist/types/renderer/colorBits.d.ts +2 -0
- package/dist/types/renderer/types.d.ts +50 -0
- package/dist/types/tubeMap/draw.d.ts +66 -0
- package/dist/types/tubeMap/frame.d.ts +15 -0
- package/dist/types/tubeMap/mismatches.d.ts +24 -0
- package/dist/types/tubeMap/reads.d.ts +10 -0
- package/dist/types/tubeMap/warp.d.ts +7 -0
- package/dist/types/types.d.ts +75 -0
- package/dist/types/util/SpatialIndex.d.ts +25 -0
- package/dist/types/util/edgeCurves.d.ts +4 -0
- package/dist/types/util/geometry.d.ts +46 -0
- package/dist/types/util/hitDetection.d.ts +10 -0
- package/dist/types/util/wheelZoom.d.ts +5 -0
- package/dist/types/viewport.d.ts +22 -0
- package/dist/types/walkHighlight.d.ts +10 -0
- package/package.json +43 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Graph } from '../types';
|
|
2
|
+
export interface ProjectedAllele {
|
|
3
|
+
start: number;
|
|
4
|
+
refSpan: number;
|
|
5
|
+
nodeIds: string[];
|
|
6
|
+
nodeOffsets: number[];
|
|
7
|
+
pathLength: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function parsePanSN(refName: string): {
|
|
10
|
+
sample: string;
|
|
11
|
+
haplotype: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare function projectAlleles(graph: Graph): ProjectedAllele[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StableCoordinate } from './gfa-core/index';
|
|
2
|
+
import type { Graph, GraphNode, NodeSegment } from './types';
|
|
3
|
+
export type AnchoredNode = GraphNode & {
|
|
4
|
+
stable: StableCoordinate;
|
|
5
|
+
};
|
|
6
|
+
export declare const REFERENCE_RANK = 0;
|
|
7
|
+
export declare function isAnchored(node: GraphNode): node is AnchoredNode;
|
|
8
|
+
export declare function isBackbone(node: GraphNode): node is AnchoredNode;
|
|
9
|
+
export declare function isOffReference(node: GraphNode): node is AnchoredNode;
|
|
10
|
+
export declare function backboneNodes(graph: Graph): AnchoredNode[];
|
|
11
|
+
export declare function backbonePositions(backbone: AnchoredNode[]): Record<string, NodeSegment[]>;
|
|
12
|
+
export declare function firstNodeAtOrAfter(nodes: AnchoredNode[], bp: number): number;
|
|
13
|
+
export declare function backboneSpan(backbone: AnchoredNode[]): number;
|
|
14
|
+
export declare function referenceSpan(backbone: AnchoredNode[], region?: {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
}): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LayoutNode } from '../layout/referenceSeeds'
|
|
2
|
+
import type { Graph, LayoutResult } from '../types'
|
|
3
|
+
|
|
4
|
+
export interface BandageModule {
|
|
5
|
+
computeLayout(
|
|
6
|
+
graph: { nodes: LayoutNode[]; edges: Graph['edges'] },
|
|
7
|
+
options: Record<string, unknown>,
|
|
8
|
+
): LayoutResult
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// The vendored Emscripten bundle's default export is a factory that
|
|
12
|
+
// instantiates the wasm module (layout inlined, -sSINGLE_FILE=1).
|
|
13
|
+
declare const createBandageLayoutModule: () => Promise<BandageModule>
|
|
14
|
+
export default createBandageLayoutModule
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { NodeLengthSpread } from './layout/drawnScale';
|
|
2
|
+
export declare const BUBBLE_SPREADS: readonly [{
|
|
3
|
+
readonly value: "auto";
|
|
4
|
+
readonly label: "Proportional";
|
|
5
|
+
readonly description: "Bandage's own scale: a node draws proportional to its length, so a 1 bp allele is a speck.";
|
|
6
|
+
readonly law: import("./layout/drawnScale").DrawnLengthLaw;
|
|
7
|
+
readonly minNodeFactor: 0;
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "open";
|
|
10
|
+
readonly label: "Open bubbles";
|
|
11
|
+
readonly description: "Give every allele a drawn length, so a bubble reads as two arms rather than a knot.";
|
|
12
|
+
readonly law: import("./layout/drawnScale").DrawnLengthLaw;
|
|
13
|
+
readonly minNodeFactor: 2.5;
|
|
14
|
+
}, {
|
|
15
|
+
readonly value: "wide";
|
|
16
|
+
readonly label: "Wide bubbles";
|
|
17
|
+
readonly description: "As open, spread further. Best on a window of a dozen bubbles.";
|
|
18
|
+
readonly law: import("./layout/drawnScale").DrawnLengthLaw;
|
|
19
|
+
readonly minNodeFactor: 10;
|
|
20
|
+
}, {
|
|
21
|
+
readonly value: "compress";
|
|
22
|
+
readonly label: "Compress lengths";
|
|
23
|
+
readonly description: "Pull the longest and shortest nodes towards the graph’s mean, so a cut spanning kb and bp fits one pane.";
|
|
24
|
+
readonly law: {
|
|
25
|
+
readonly power: 0.5;
|
|
26
|
+
readonly effect: 0.5;
|
|
27
|
+
};
|
|
28
|
+
readonly minNodeFactor: 0;
|
|
29
|
+
}];
|
|
30
|
+
export type BubbleSpread = (typeof BUBBLE_SPREADS)[number]['value'];
|
|
31
|
+
export declare const BUBBLE_SPREAD_VALUES: ("auto" | "open" | "wide" | "compress")[];
|
|
32
|
+
export declare function spreadFor(spread: string): NodeLengthSpread;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BubbleRoute, MinigraphBubble } from './bubbleLine';
|
|
2
|
+
import type { BubbleKind, RepeatSpan } from './classifyBubble';
|
|
3
|
+
import type { Graph, NodeSegment } from '../types';
|
|
4
|
+
export interface BubbleHalo {
|
|
5
|
+
bubble: MinigraphBubble;
|
|
6
|
+
kind: BubbleKind;
|
|
7
|
+
label: string;
|
|
8
|
+
path: string;
|
|
9
|
+
labelAt: NodeSegment;
|
|
10
|
+
members: number;
|
|
11
|
+
nodeIds: string[];
|
|
12
|
+
whole: boolean;
|
|
13
|
+
routes: RouteLabel[];
|
|
14
|
+
}
|
|
15
|
+
export interface RouteLabel {
|
|
16
|
+
route: BubbleRoute;
|
|
17
|
+
at: NodeSegment;
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function bubbleHalos(graph: Graph, bubbles: MinigraphBubble[], positions: Record<string, NodeSegment[]>, walkLabel?: (name: string) => string, repeats?: readonly RepeatSpan[]): BubbleHalo[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface MinigraphBubble {
|
|
2
|
+
refName: string;
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
segmentCount: number;
|
|
6
|
+
pathCount: number;
|
|
7
|
+
inversion: boolean;
|
|
8
|
+
shortestAlleleLength: number;
|
|
9
|
+
longestAlleleLength: number;
|
|
10
|
+
segments: string;
|
|
11
|
+
shortestAllele: string | undefined;
|
|
12
|
+
longestAllele: string | undefined;
|
|
13
|
+
partial?: boolean;
|
|
14
|
+
routes?: BubbleRoute[];
|
|
15
|
+
}
|
|
16
|
+
export interface BubbleRoute {
|
|
17
|
+
steps: string[];
|
|
18
|
+
bp: number;
|
|
19
|
+
walks: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function parseBubbleLine(line: string): MinigraphBubble;
|
|
22
|
+
export declare function bubbleLabel(bubble: MinigraphBubble): string;
|
|
23
|
+
export declare const SATURATED_PATH_COUNT = 2147483647;
|
|
24
|
+
export declare function bubbleDescription(bubble: MinigraphBubble): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MinigraphBubble } from './bubbleLine';
|
|
2
|
+
export type BubbleKind = 'snp' | 'substitution' | 'insertion' | 'deletion' | 'inversion' | 'repeat' | 'superbubble' | 'complex';
|
|
3
|
+
export interface BubbleClass {
|
|
4
|
+
kind: BubbleKind;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RepeatSpan {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function formatBp(bp: number): string;
|
|
13
|
+
export declare function classifyBubble(b: MinigraphBubble, repeats?: readonly RepeatSpan[]): BubbleClass;
|
|
14
|
+
export declare const BUBBLE_KIND_COLORS: Record<BubbleKind, string>;
|
|
15
|
+
export declare const BUBBLE_KIND_NAMES: Record<BubbleKind, string>;
|
|
16
|
+
export declare function bubbleSegmentIds(b: MinigraphBubble): string[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Graph } from './types';
|
|
2
|
+
export declare const COLOR_SCHEMES: readonly [{
|
|
3
|
+
readonly value: "auto";
|
|
4
|
+
readonly label: "Auto";
|
|
5
|
+
}, {
|
|
6
|
+
readonly value: "uniform";
|
|
7
|
+
readonly label: "Uniform";
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "random";
|
|
10
|
+
readonly label: "Random";
|
|
11
|
+
}, {
|
|
12
|
+
readonly value: "rainbow";
|
|
13
|
+
readonly label: "Rainbow";
|
|
14
|
+
}, {
|
|
15
|
+
readonly value: "depth";
|
|
16
|
+
readonly label: "Depth";
|
|
17
|
+
}, {
|
|
18
|
+
readonly value: "node-length";
|
|
19
|
+
readonly label: "Node Length";
|
|
20
|
+
}, {
|
|
21
|
+
readonly value: "stable-rank";
|
|
22
|
+
readonly label: "Stable rank";
|
|
23
|
+
}, {
|
|
24
|
+
readonly value: "reference-position";
|
|
25
|
+
readonly label: "Reference position";
|
|
26
|
+
}, {
|
|
27
|
+
readonly value: "grey";
|
|
28
|
+
readonly label: "Grey";
|
|
29
|
+
}];
|
|
30
|
+
export type ColorScheme = (typeof COLOR_SCHEMES)[number]['value'];
|
|
31
|
+
export type ResolvedColorScheme = Exclude<ColorScheme, 'auto'>;
|
|
32
|
+
export declare const COLOR_SCHEME_VALUES: ("auto" | "uniform" | "random" | "rainbow" | "depth" | "node-length" | "stable-rank" | "reference-position" | "grey")[];
|
|
33
|
+
export declare function resolveColorScheme(scheme: ColorScheme, graph: Graph | undefined): ResolvedColorScheme;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Graph } from './types';
|
|
2
|
+
import type { AxisScale } from './util/geometry';
|
|
3
|
+
export interface DeletionEdge {
|
|
4
|
+
edgeIndex: number;
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
refName: string;
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
bp: number;
|
|
11
|
+
bypassed: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function bypassedPoints(nodePositions: Record<string, {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}[]>, bypassed: string[]): {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}[];
|
|
20
|
+
export declare function deletionArcCurves(nodePositions: Record<string, {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}[]>, deletion: DeletionEdge, axis: AxisScale): import("./util/geometry").BezierCurve[] | undefined;
|
|
24
|
+
export declare function deletionEdges(graph: Graph): DeletionEdge[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface GafStep {
|
|
2
|
+
name: string;
|
|
3
|
+
strand: '+' | '-';
|
|
4
|
+
}
|
|
5
|
+
export interface GafRecord {
|
|
6
|
+
name: string;
|
|
7
|
+
queryLength: number;
|
|
8
|
+
queryStart: number;
|
|
9
|
+
queryEnd: number;
|
|
10
|
+
strand: '+' | '-';
|
|
11
|
+
path: GafStep[];
|
|
12
|
+
pathLength: number;
|
|
13
|
+
pathStart: number;
|
|
14
|
+
pathEnd: number;
|
|
15
|
+
matches: number;
|
|
16
|
+
blockLength: number;
|
|
17
|
+
mappingQuality: number;
|
|
18
|
+
secondary: boolean;
|
|
19
|
+
cs?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function parseGafPath(column: string): GafStep[] | undefined;
|
|
22
|
+
export declare function parseGafLine(line: string): GafRecord | undefined;
|
|
23
|
+
export declare function parseGaf(text: string): GafRecord[];
|
|
24
|
+
export type CsOp = {
|
|
25
|
+
op: 'match';
|
|
26
|
+
length: number;
|
|
27
|
+
} | {
|
|
28
|
+
op: 'substitution';
|
|
29
|
+
seq: string;
|
|
30
|
+
} | {
|
|
31
|
+
op: 'insertion';
|
|
32
|
+
seq: string;
|
|
33
|
+
} | {
|
|
34
|
+
op: 'deletion';
|
|
35
|
+
length: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function parseCs(cs: string): CsOp[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GBZBase, PathName, PathQuery, RangeOptions } from '@gmod/gbz-base';
|
|
2
|
+
export declare class NoReferenceSampleError extends Error {
|
|
3
|
+
name: string;
|
|
4
|
+
constructor(anchor: string, referenceSamples: string[]);
|
|
5
|
+
}
|
|
6
|
+
export declare class NodeLimitError extends Error {
|
|
7
|
+
name: string;
|
|
8
|
+
constructor(limit: number, windowBp: number, fitsBp: number);
|
|
9
|
+
}
|
|
10
|
+
export declare function haplotypePrefix(name: Pick<PathName, 'sample' | 'haplotype'>): string;
|
|
11
|
+
export declare function haplotypeWanted(name: PathName, wanted: string[] | undefined): boolean;
|
|
12
|
+
export declare function referenceSamplesOf(db: GBZBase): Promise<string[]>;
|
|
13
|
+
export declare function resolveReferenceSample({ configured, anchorPrefix, referenceSamples, }: {
|
|
14
|
+
configured: string;
|
|
15
|
+
anchorPrefix: string;
|
|
16
|
+
referenceSamples: string[];
|
|
17
|
+
}): string;
|
|
18
|
+
export declare function referencePathQuery(db: GBZBase, referenceSample: string, refName: string): Promise<PathQuery | undefined>;
|
|
19
|
+
export declare function nodeLimitError(error: unknown, limit: number, windowBp: number): NodeLimitError | undefined;
|
|
20
|
+
export interface GbzWindowOptions {
|
|
21
|
+
context: number;
|
|
22
|
+
snarls: RangeOptions['snarls'];
|
|
23
|
+
limit: number;
|
|
24
|
+
keep?: (name: PathName) => boolean;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}
|
|
27
|
+
export declare function cutWindowGFA(db: GBZBase, query: PathQuery | undefined, start: number, end: number, { keep, ...opts }: GbzWindowOptions): Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Graph, NodeSegment } from '../types';
|
|
2
|
+
export interface GeneModel {
|
|
3
|
+
name: string;
|
|
4
|
+
refName: string;
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
strand: number;
|
|
8
|
+
exons: {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export interface GenePin {
|
|
14
|
+
gene: GeneModel;
|
|
15
|
+
exons: string;
|
|
16
|
+
at: NodeSegment;
|
|
17
|
+
covered: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function genePins(graph: Graph, genes: GeneModel[], positions: Record<string, NodeSegment[]>): GenePin[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GFAGraph } from '../gfa-core/index';
|
|
2
|
+
import type { GraphEdge, GraphNode, GraphPath } from '../types';
|
|
3
|
+
export declare function convertGFAToGraph(gfaGraph: GFAGraph, name?: string): {
|
|
4
|
+
name: string;
|
|
5
|
+
nodes: GraphNode[];
|
|
6
|
+
edges: GraphEdge[];
|
|
7
|
+
paths: GraphPath[] | undefined;
|
|
8
|
+
anchorPaths: import("../types").PathOrigin[] | undefined;
|
|
9
|
+
pathVisits: Map<string, import("../types").PathVisit[]> | undefined;
|
|
10
|
+
anchoredBy: "tags" | undefined;
|
|
11
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface GFANode {
|
|
2
|
+
id: string;
|
|
3
|
+
length: number;
|
|
4
|
+
sequence: string;
|
|
5
|
+
tags: Record<string, string | number>;
|
|
6
|
+
}
|
|
7
|
+
export interface StableCoordinate {
|
|
8
|
+
refName: string;
|
|
9
|
+
start: number;
|
|
10
|
+
rank: number;
|
|
11
|
+
strand?: '+' | '-';
|
|
12
|
+
}
|
|
13
|
+
export declare function stableCoordinate(node: GFANode): StableCoordinate | undefined;
|
|
14
|
+
export interface GFALink {
|
|
15
|
+
source: string;
|
|
16
|
+
target: string;
|
|
17
|
+
strand1?: string;
|
|
18
|
+
strand2?: string;
|
|
19
|
+
cigar: string;
|
|
20
|
+
tags: Record<string, string | number>;
|
|
21
|
+
}
|
|
22
|
+
export interface GFAPath {
|
|
23
|
+
name: string;
|
|
24
|
+
path: string;
|
|
25
|
+
rest: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface GFAWalkSegment {
|
|
28
|
+
id: string;
|
|
29
|
+
strand: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GFAWalk {
|
|
32
|
+
sample: string;
|
|
33
|
+
haplotype: number;
|
|
34
|
+
contig: string;
|
|
35
|
+
start: number;
|
|
36
|
+
end: number;
|
|
37
|
+
segments: GFAWalkSegment[];
|
|
38
|
+
tags: Record<string, string | number>;
|
|
39
|
+
}
|
|
40
|
+
export interface GFAGraph {
|
|
41
|
+
nodes: GFANode[];
|
|
42
|
+
links: GFALink[];
|
|
43
|
+
paths: GFAPath[];
|
|
44
|
+
walks: GFAWalk[];
|
|
45
|
+
header: Record<string, string | number>[];
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function parseGFA(file: string): GFAGraph;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DeletionEdge } from './deletionEdges';
|
|
2
|
+
import type { Box, TakeBox } from './overlayLabels';
|
|
3
|
+
import type { AlleleDeletion, NodeSegment } from './types';
|
|
4
|
+
import type { AxisScale } from './util/geometry';
|
|
5
|
+
export declare function rowLabelBox(text: string, screenY: number): Box;
|
|
6
|
+
export interface Leader {
|
|
7
|
+
arcX: number;
|
|
8
|
+
arcY: number;
|
|
9
|
+
labelX: number;
|
|
10
|
+
labelY: number;
|
|
11
|
+
}
|
|
12
|
+
export interface GraphLabel {
|
|
13
|
+
key: string;
|
|
14
|
+
text: string;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
kind: 'node' | 'deletion';
|
|
18
|
+
leader?: Leader;
|
|
19
|
+
}
|
|
20
|
+
export declare function formatBp(bp: number): string;
|
|
21
|
+
interface SizeLabelArgs {
|
|
22
|
+
nodePositions: Record<string, NodeSegment[]>;
|
|
23
|
+
nodeLengths: Map<string, number>;
|
|
24
|
+
deletions: DeletionEdge[];
|
|
25
|
+
alleleDeletions?: AlleleDeletion[];
|
|
26
|
+
axis: AxisScale;
|
|
27
|
+
translateX: number;
|
|
28
|
+
translateY: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
version?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface SizeLabelCandidate {
|
|
34
|
+
label: GraphLabel;
|
|
35
|
+
box: Box;
|
|
36
|
+
}
|
|
37
|
+
export declare function sizeLabelCandidates({ nodePositions, nodeLengths, deletions, alleleDeletions, axis, translateX, translateY, width, height, version, }: SizeLabelArgs): {
|
|
38
|
+
deletions: SizeLabelCandidate[];
|
|
39
|
+
nodes: SizeLabelCandidate[];
|
|
40
|
+
};
|
|
41
|
+
export declare function nodeLabelBudget(width: number, height: number): number;
|
|
42
|
+
export declare function placeSizeLabels(candidates: SizeLabelCandidate[], take: TakeBox, budget?: number): GraphLabel[];
|
|
43
|
+
export declare function graphLabels({ reserved, ...args }: SizeLabelArgs & {
|
|
44
|
+
reserved?: Box[];
|
|
45
|
+
}): GraphLabel[];
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { FIT_PADDING, clampZoom, drawingBounds, engineRequest, fitTransform, forceLayout, layoutExtent, loadGraph, } from './pipeline';
|
|
2
|
+
export type { Bounds, EngineRequest, EngineSettings, LayoutEngine, } from './pipeline';
|
|
3
|
+
export { FORCE_LAYOUT_LABEL, LAYOUT_MODES, layoutModeByValue, modeUsesLayoutEngine, } from './layoutModes';
|
|
4
|
+
export type { LayoutModeValue } from './layoutModes';
|
|
5
|
+
export { COLOR_SCHEMES, resolveColorScheme } from './colorSchemes';
|
|
6
|
+
export type { ColorScheme, ResolvedColorScheme } from './colorSchemes';
|
|
7
|
+
export { NODE_WIDTHS, maxNodeWidthPx, meanDepth, nodeInk, nodeWidthPx, } from './nodeWidths';
|
|
8
|
+
export type { NodeWidth } from './nodeWidths';
|
|
9
|
+
export { BUBBLE_SPREADS } from './bubbleSpreads';
|
|
10
|
+
export type { BubbleSpread } from './bubbleSpreads';
|
|
11
|
+
export { REFERENCE_RAMP_MAX_HUE, buildGeometry, computeReferenceRamp, } from './renderer/GeometryBuilder';
|
|
12
|
+
export { Canvas2DRenderer } from './renderer/Canvas2DRenderer';
|
|
13
|
+
export { getDpr } from '@jbrowse/render-core/canvas2dUtils';
|
|
14
|
+
export type { Renderer } from './renderer/types';
|
|
15
|
+
export { findHoveredEdge, findHoveredNode } from './util/hitDetection';
|
|
16
|
+
export type { NodeInk } from './util/hitDetection';
|
|
17
|
+
export type { AxisScale } from './util/geometry';
|
|
18
|
+
export { wheelZoomFactor } from './util/wheelZoom';
|
|
19
|
+
export { drawTubeMap, tubeMapPicture } from './tubeMap/draw';
|
|
20
|
+
export type { TubeMapFrame, TubeMapPicture } from './tubeMap/draw';
|
|
21
|
+
export { referenceKnots, warpX } from './tubeMap/warp';
|
|
22
|
+
export { tubeMapFrame, tubeMapNodeAt } from './tubeMap/frame';
|
|
23
|
+
export type { TubeMapTransform, TubeMapView } from './tubeMap/frame';
|
|
24
|
+
export type { TubeMapColumn, TubeMapDrawing } from './layout/tubeMapLayout';
|
|
25
|
+
export { deletionEdges } from './deletionEdges';
|
|
26
|
+
export type { DeletionEdge } from './deletionEdges';
|
|
27
|
+
export { walkHighlight } from './walkHighlight';
|
|
28
|
+
export { pathColorsLegible, pathLegend } from './pathColors';
|
|
29
|
+
export { bubblesFromGraph } from './bubbles/bubblesFromGraph';
|
|
30
|
+
export { bubbleHalos } from './bubbles/bubbleHalos';
|
|
31
|
+
export type { BubbleHalo } from './bubbles/bubbleHalos';
|
|
32
|
+
export { BUBBLE_KIND_COLORS, BUBBLE_KIND_NAMES, bubbleSegmentIds, classifyBubble, } from './bubbles/classifyBubble';
|
|
33
|
+
export { bubbleSubgraph } from './bubbles/popBubble';
|
|
34
|
+
export type { MinigraphBubble } from './bubbles/bubbleLine';
|
|
35
|
+
export { walkRows } from './layout/walkRows';
|
|
36
|
+
export type { WalkRows } from './layout/walkRows';
|
|
37
|
+
export { walkRowsExtent } from './layout/walkRowLayout';
|
|
38
|
+
export { ROW_HEIGHT_PX } from './layout/rowSpacing';
|
|
39
|
+
export { HALO_FACTOR, LEGEND_INSET_PX, layoutLabels } from './labelLayout';
|
|
40
|
+
export type { BubbleGlyph, LabelLayout, LabelLayoutSource } from './labelLayout';
|
|
41
|
+
export { formatBp } from './graphLabels';
|
|
42
|
+
export { LABEL_CHAR_PX, LABEL_PAD, LABEL_PX } from './overlayLabels';
|
|
43
|
+
export type { Graph, GraphEdge, GraphNode, LayoutResult, NodeSegment, } from './types';
|
|
44
|
+
export { cutWindowGFA, haplotypeWanted, referencePathQuery, referenceSamplesOf, resolveReferenceSample, } from './gbzWindow';
|
|
45
|
+
export type { GbzWindowOptions } from './gbzWindow';
|
|
46
|
+
export { engineKey } from './pipeline';
|
|
47
|
+
export { axisScaleOf, contains, padded, screenToLayout, viewportOf, zoomAbout, } from './viewport';
|
|
48
|
+
export type { PaneTransform } from './viewport';
|
|
49
|
+
export { default as loadBandage } from './loadBandage';
|
|
50
|
+
export { panSNContig, panSNHaplotype, panSNSample } from './pansn';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BubbleHalo, RouteLabel } from './bubbles/bubbleHalos';
|
|
2
|
+
import type { MinigraphBubble } from './bubbles/bubbleLine';
|
|
3
|
+
import type { BubbleKind } from './bubbles/classifyBubble';
|
|
4
|
+
import type { DeletionEdge } from './deletionEdges';
|
|
5
|
+
import type { GenePin } from './genes/genePins';
|
|
6
|
+
import type { GraphLabel } from './graphLabels';
|
|
7
|
+
import type { PlacedLabel } from './overlayLabels';
|
|
8
|
+
import type { AlleleDeletion, NodeSegment } from './types';
|
|
9
|
+
import type { AxisScale } from './util/geometry';
|
|
10
|
+
export declare const HALO_FACTOR = 3.4;
|
|
11
|
+
export declare const LEGEND_INSET_PX = 6;
|
|
12
|
+
export interface BubbleGlyph {
|
|
13
|
+
bubble: MinigraphBubble;
|
|
14
|
+
kind: BubbleKind;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LabelLayoutSource {
|
|
18
|
+
paneWidth: number;
|
|
19
|
+
canvasHeight: number;
|
|
20
|
+
axisScale: AxisScale;
|
|
21
|
+
translateX: number;
|
|
22
|
+
translateY: number;
|
|
23
|
+
contigThickness: number;
|
|
24
|
+
legendSize: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
drawnRowLabels: {
|
|
29
|
+
label: string;
|
|
30
|
+
y: number;
|
|
31
|
+
}[];
|
|
32
|
+
bubbleHalos: BubbleHalo[];
|
|
33
|
+
bubbleGlyphs: BubbleGlyph[];
|
|
34
|
+
genePins: GenePin[];
|
|
35
|
+
poppedFrom?: {
|
|
36
|
+
label: string;
|
|
37
|
+
};
|
|
38
|
+
nodePositions?: Record<string, NodeSegment[]>;
|
|
39
|
+
labelsNodeSizes: boolean;
|
|
40
|
+
nodeLengths: Map<string, number>;
|
|
41
|
+
showDeletionEdges: boolean;
|
|
42
|
+
deletions: DeletionEdge[];
|
|
43
|
+
alleleDeletions: AlleleDeletion[];
|
|
44
|
+
positionsVersion: number;
|
|
45
|
+
}
|
|
46
|
+
export interface LabelLayout {
|
|
47
|
+
bubbles: PlacedLabel<BubbleHalo>[];
|
|
48
|
+
glyphs: PlacedLabel<{
|
|
49
|
+
glyph: BubbleGlyph;
|
|
50
|
+
glyphX: number;
|
|
51
|
+
}>[];
|
|
52
|
+
genes: PlacedLabel<GenePin>[];
|
|
53
|
+
routes: PlacedLabel<{
|
|
54
|
+
halo: BubbleHalo;
|
|
55
|
+
route: RouteLabel;
|
|
56
|
+
}>[];
|
|
57
|
+
sizes: GraphLabel[];
|
|
58
|
+
}
|
|
59
|
+
export declare function layoutLabels(m: LabelLayoutSource): LabelLayout;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Graph, GraphNode } from '../types';
|
|
2
|
+
export interface BandageScaleOpts {
|
|
3
|
+
nodeLengthPerMegabase: number;
|
|
4
|
+
minimumNodeLength: number;
|
|
5
|
+
nodeSegmentLength: number;
|
|
6
|
+
edgeLength: number;
|
|
7
|
+
}
|
|
8
|
+
declare const MEAN_NODE_LENGTH = 40;
|
|
9
|
+
export declare function drawnNodeLength(opts: BandageScaleOpts, length: number): number;
|
|
10
|
+
export declare function bandageAutoScale(graph: Graph, minNodeLength?: number): BandageScaleOpts;
|
|
11
|
+
export interface DrawnLengthLaw {
|
|
12
|
+
power: number;
|
|
13
|
+
effect: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const PROPORTIONAL_LENGTH: DrawnLengthLaw;
|
|
16
|
+
export declare function isProportional(law: DrawnLengthLaw): boolean;
|
|
17
|
+
export declare function drawnLengthFor(graph: Graph, law: DrawnLengthLaw): (bp: number) => number;
|
|
18
|
+
export interface NodeLengthSpread {
|
|
19
|
+
law: DrawnLengthLaw;
|
|
20
|
+
minNodeLength: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const PROPORTIONAL_SPREAD: NodeLengthSpread;
|
|
23
|
+
export interface LayoutScaling {
|
|
24
|
+
nodes: GraphNode[];
|
|
25
|
+
opts: BandageScaleOpts;
|
|
26
|
+
}
|
|
27
|
+
export declare function layoutScaling(graph: Graph, spread?: NodeLengthSpread): LayoutScaling;
|
|
28
|
+
export { MEAN_NODE_LENGTH };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Graph, NodeSegment } from '../types';
|
|
2
|
+
export interface MergedRuns {
|
|
3
|
+
graph: Graph;
|
|
4
|
+
runs: Map<string, string[]>;
|
|
5
|
+
}
|
|
6
|
+
export declare function mergeRuns(graph: Graph): MergedRuns;
|
|
7
|
+
export declare function splitRuns(positions: Record<string, NodeSegment[]>, runs: Map<string, string[]>, weightOf: (id: string) => number): Record<string, NodeSegment[]>;
|
|
8
|
+
export declare function polylineSlice(line: NodeSegment[], from: number, to: number): NodeSegment[];
|
|
9
|
+
export declare function polylineMidpoint(line: NodeSegment[]): NodeSegment;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Graph, LayoutResult } from '../types';
|
|
2
|
+
export declare function referenceOrder(graph: Graph): string[];
|
|
3
|
+
export interface LayeredGraph {
|
|
4
|
+
layers: string[][];
|
|
5
|
+
layerOf: Map<string, number>;
|
|
6
|
+
preds: Map<string, string[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare function layerGraph(graph: Graph): LayeredGraph;
|
|
9
|
+
export declare function orderedLayout(graph: Graph): LayoutResult | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AlleleDeletion, Graph, NodeSegment } from '../types';
|
|
2
|
+
interface PlaceArgs {
|
|
3
|
+
graph: Graph;
|
|
4
|
+
span: number;
|
|
5
|
+
rowY: (node: Graph['nodes'][number]) => number;
|
|
6
|
+
positions: Record<string, NodeSegment[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare function placeOffReference({ graph, span, rowY, positions, }: PlaceArgs): AlleleDeletion[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LayoutScaling } from './drawnScale';
|
|
2
|
+
import type { Graph, GraphNode } from '../types';
|
|
3
|
+
export type LayoutNode = GraphNode & {
|
|
4
|
+
x?: number;
|
|
5
|
+
y?: number;
|
|
6
|
+
};
|
|
7
|
+
export interface Seed {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function referenceSeeds(graph: Graph, scaling: LayoutScaling): Map<string, Seed>;
|
|
12
|
+
export declare function seededNodes(graph: Graph, scaling: LayoutScaling): LayoutNode[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ROW_HEIGHT_PX = 20;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Graph, LayoutResult } from '../types';
|
|
2
|
+
import type { InputTrack, TubeMapLayout } from '@gmod/tubemap-core';
|
|
3
|
+
export interface TubeMapColumn {
|
|
4
|
+
order: number;
|
|
5
|
+
x0: number;
|
|
6
|
+
x1: number;
|
|
7
|
+
bp0: number;
|
|
8
|
+
bp1: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TubeMapDrawing {
|
|
11
|
+
layout: TubeMapLayout;
|
|
12
|
+
yOffset: number;
|
|
13
|
+
columns?: TubeMapColumn[];
|
|
14
|
+
}
|
|
15
|
+
export declare function tubeMapTracks(graph: Graph): InputTrack[];
|
|
16
|
+
export declare function hasTubeMapPaths(graph: Graph): boolean;
|
|
17
|
+
export declare function tubeWidth(trackCount: number): number;
|
|
18
|
+
export declare function tubeMapLayout(graph: Graph): LayoutResult | undefined;
|
|
19
|
+
export declare function tubeMapReferenceLayout(graph: Graph): LayoutResult | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WalkRows } from './walkRows';
|
|
2
|
+
import type { Graph, LayoutResult } from '../types';
|
|
3
|
+
export declare function walkRowsExtent(walks: WalkRows): {
|
|
4
|
+
maxX: number;
|
|
5
|
+
maxY: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function walkRowLayout(graph: Graph, region?: {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
}): LayoutResult | undefined;
|