@jbrowse/bandage-core 4.0.24 → 4.0.26

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.
@@ -0,0 +1,33 @@
1
+ import { GBZBase } from '@gmod/gbz-base';
2
+ import type { ByteSource, RangeOptions } from '@gmod/gbz-base';
3
+ export interface GbzSource {
4
+ db: string;
5
+ index?: string;
6
+ region: string;
7
+ haplotypes?: string[];
8
+ referenceSample?: string;
9
+ context?: number;
10
+ snarls?: RangeOptions['snarls'];
11
+ }
12
+ export declare const HPRC_GBZ: {
13
+ db: string;
14
+ index: string;
15
+ };
16
+ export declare function parseRegion(text: string): {
17
+ refName: string;
18
+ start: number;
19
+ end: number;
20
+ };
21
+ export declare function openGbz(db: ByteSource, index?: ByteSource): Promise<{
22
+ base: GBZBase;
23
+ referenceSamples: string[];
24
+ }>;
25
+ export declare function cutGbzRegion({ base, referenceSamples }: Awaited<ReturnType<typeof openGbz>>, src: Omit<GbzSource, 'db' | 'index'>, signal?: AbortSignal): Promise<{
26
+ text: string;
27
+ region: {
28
+ refName: string;
29
+ start: number;
30
+ end: number;
31
+ };
32
+ sample: string;
33
+ }>;
@@ -0,0 +1,10 @@
1
+ import type { GeneModel } from './genePins.js';
2
+ type Interval = GeneModel['exons'][number];
3
+ export declare function mergedIntervals(intervals: Interval[]): {
4
+ start: number;
5
+ end: number;
6
+ }[];
7
+ export declare function genesFromGff3Lines(lines: Iterable<string>): GeneModel[];
8
+ export declare function genesFromBed(text: string): GeneModel[];
9
+ export declare function genesFromText(text: string): GeneModel[];
10
+ export {};
@@ -19,7 +19,8 @@ export { wheelZoomFactor } from './util/wheelZoom.js';
19
19
  export { REFERENCE_STRIP_ZONE_PX, drawReferenceStrip, referenceStripBlocks, stripBlockAt, } from './referenceStrip.js';
20
20
  export type { StripBlock } from './referenceStrip.js';
21
21
  export { drawTubeMap, tubeMapPicture } from './tubeMap/draw.js';
22
- export type { TubeMapFrame, TubeMapPicture } from './tubeMap/draw.js';
22
+ export type { TubeMapColors, TubeMapFrame, TubeMapPicture, } from './tubeMap/draw.js';
23
+ export { tubeMapNodeColors } from './tubeMap/nodeColors.js';
23
24
  export { referenceKnots, warpX } from './tubeMap/warp.js';
24
25
  export { tubeMapFrame, tubeMapNodeAt } from './tubeMap/frame.js';
25
26
  export type { TubeMapTransform, TubeMapView } from './tubeMap/frame.js';
@@ -33,8 +34,12 @@ export type { TubeMapColumn, TubeMapDrawing } from './layout/tubeMapLayout.js';
33
34
  export { deletionEdges } from './deletionEdges.js';
34
35
  export type { DeletionEdge } from './deletionEdges.js';
35
36
  export { facetLifts, walkHighlight, walkLift } from './walkHighlight.js';
36
- export { rangeText, walkKey } from './walkKey.js';
37
+ export { rangeText, walkKey, walkPosition } from './walkKey.js';
37
38
  export { figureSvg } from './figure.js';
39
+ export { genesFromBed, genesFromGff3Lines, genesFromText, } from './genes/geneFiles.js';
40
+ export { HPRC_GBZ, cutGbzRegion, openGbz, parseRegion } from './gbzCut.js';
41
+ export type { GbzSource } from './gbzCut.js';
42
+ export { version } from './version.js';
38
43
  export type { FigureOptions } from './figure.js';
39
44
  export { svgCanvas } from './renderer/svgCanvas.js';
40
45
  export { FACET_GAP_PX, FACET_PAD_PX, FACET_TITLE_PX, facetCells, facetGrid, } from './facetGrid.js';
@@ -46,4 +46,18 @@ export interface LabelLayout {
46
46
  sizes: GraphLabel[];
47
47
  }
48
48
  export declare function geneCoverageNote(pin: GenePin): string | undefined;
49
+ export declare function geneLabelCandidates(pins: GenePin[], screen: (p: {
50
+ x: number;
51
+ y: number;
52
+ }) => {
53
+ x: number;
54
+ y: number;
55
+ }, contigThickness: number): {
56
+ item: GenePin;
57
+ x: number;
58
+ y: number;
59
+ text: string;
60
+ fallback: string | undefined;
61
+ stack: number;
62
+ }[];
49
63
  export declare function layoutLabels(m: LabelLayoutSource): LabelLayout;
@@ -1,4 +1,4 @@
1
- import type { Graph, PathOrigin, PathVisit } from './types.js';
1
+ import type { Graph, GraphPath, PathOrigin, PathVisit } from './types.js';
2
2
  export declare function pathOrigin(pathName: string): {
3
3
  name: string;
4
4
  start: number;
@@ -18,3 +18,7 @@ export declare function surveyPaths(paths: PathSteps[], lengthOf: (segmentId: st
18
18
  export declare function chooseReferencePath(anchorPaths: PathOrigin[], preferred: string | undefined): PathOrigin | undefined;
19
19
  export declare function anchorFromPaths(graph: Graph, preferred: string | undefined): Graph;
20
20
  export declare function anchorGraph(graph: Graph, preferred: string | undefined): Graph;
21
+ export declare function trimOrigins(origins: PathOrigin[], paths: GraphPath[], stretches: Map<string, {
22
+ dropped: number;
23
+ bp: number;
24
+ }>): PathOrigin[];
@@ -41,12 +41,13 @@ export interface StripLit {
41
41
  y: number;
42
42
  };
43
43
  }
44
- export declare function stripPixels(blocks: readonly StripBlock[], frame: BpFrame, width: number, dpr: number): {
44
+ export interface StripPixel {
45
45
  colors: string[];
46
46
  x0: number;
47
47
  x1: number;
48
- tier: number;
49
- }[];
48
+ tier?: number;
49
+ }
50
+ export declare function stripPixels(blocks: readonly StripBlock[], frame: BpFrame, width: number, dpr: number): StripPixel[];
50
51
  export declare function drawReferenceStrip(ctx: CanvasRenderingContext2D, blocks: readonly StripBlock[], frame: BpFrame, { width, lit, darkMode, dpr, }: {
51
52
  width: number;
52
53
  lit?: StripLit;
@@ -54,10 +54,15 @@ export interface TubeMapPicture {
54
54
  commands: Command[];
55
55
  x0: number;
56
56
  x1: number;
57
+ color?: string;
57
58
  }[];
58
59
  mismatches: TubeMapMismatch[];
59
60
  }
60
- export declare function tubeMapPicture(layout: TubeMapLayout): TubeMapPicture;
61
+ export interface TubeMapColors {
62
+ tubes?: readonly string[];
63
+ nodes?: ReadonlyMap<string, string>;
64
+ }
65
+ export declare function tubeMapPicture(layout: TubeMapLayout, colors?: TubeMapColors): TubeMapPicture;
61
66
  export interface TubeMapFrame extends TubeMapTransform {
62
67
  width: number;
63
68
  highlightNode?: string | null;
@@ -0,0 +1,4 @@
1
+ import type { ResolvedColorScheme } from '../colorSchemes.js';
2
+ import type { ReferenceRamp } from '../renderer/GeometryBuilder.js';
3
+ import type { Graph } from '../types.js';
4
+ export declare function tubeMapNodeColors(graph: Graph, colorScheme: ResolvedColorScheme, referenceRamp?: ReferenceRamp): Map<string, string> | undefined;
@@ -0,0 +1 @@
1
+ export declare const version = "4.0.26";
@@ -11,3 +11,4 @@ export declare function walkKey(walk: LiftedWalk, reference?: {
11
11
  scale: string | undefined;
12
12
  hover: string | undefined;
13
13
  };
14
+ export declare function walkPosition(walk: LiftedWalk, nodeId: string, length: number): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/bandage-core",
3
- "version": "4.0.24",
3
+ "version": "4.0.26",
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": {
@@ -31,7 +31,8 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@gmod/gbz-base": "^4.0.0",
34
+ "@gmod/gbz-base": "^4.1.0",
35
+ "@gmod/tabix": "^3.9.0",
35
36
  "@gmod/tubemap-core": "^0.1.0",
36
37
  "@jbrowse/core": "5.0.0-beta.9",
37
38
  "@jbrowse/render-core": "5.0.0-beta.9"