@weng-lab/genomebrowser 0.0.1 → 0.0.2
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/dist/components/browser/browser.d.ts +9 -0
- package/dist/components/browser/gqltracks.d.ts +13 -0
- package/dist/components/browser/index.d.ts +2 -0
- package/dist/components/browser/menuWrapper.d.ts +16 -0
- package/dist/components/browser/selectRegion.d.ts +12 -0
- package/dist/components/browser/stacked.d.ts +8 -0
- package/dist/components/browser/stackedtracks.d.ts +8 -0
- package/dist/components/browser/svgWrapper.d.ts +8 -0
- package/dist/components/browser/types.d.ts +55 -0
- package/dist/components/browser/utils.d.ts +1 -0
- package/dist/components/clipPath/clipPath.d.ts +14 -0
- package/dist/components/context/browserContext.d.ts +113 -0
- package/dist/components/context/domainContext.d.ts +9 -0
- package/dist/components/context/providers.d.ts +21 -0
- package/dist/components/controls/custombigwig.d.ts +4 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/inputregion.d.ts +4 -0
- package/dist/components/controls/shiftbutton.d.ts +4 -0
- package/dist/components/controls/types.d.ts +33 -0
- package/dist/components/controls/ucsc.d.ts +4 -0
- package/dist/components/controls/zoombutton.d.ts +4 -0
- package/dist/components/cytobands/centromere.d.ts +4 -0
- package/dist/components/cytobands/cytoband.d.ts +4 -0
- package/dist/components/cytobands/cytobands.d.ts +4 -0
- package/dist/components/cytobands/highlight.d.ts +4 -0
- package/dist/components/cytobands/index.d.ts +3 -0
- package/dist/components/cytobands/shorthighlight.d.ts +4 -0
- package/dist/components/cytobands/types.d.ts +61 -0
- package/dist/components/icons/error.d.ts +9 -0
- package/dist/components/icons/index.d.ts +3 -0
- package/dist/components/icons/settings.d.ts +3 -0
- package/dist/components/icons/spinner.d.ts +9 -0
- package/dist/components/icons/top.d.ts +2 -0
- package/dist/components/icons/types.d.ts +12 -0
- package/dist/components/magnification/index.d.ts +2 -0
- package/dist/components/magnification/magnification.d.ts +13 -0
- package/dist/components/menu/browserContextMenu.d.ts +10 -0
- package/dist/components/menu/contextMenu.d.ts +6 -0
- package/dist/components/menu/types.d.ts +22 -0
- package/dist/components/modal/forms/form.d.ts +3 -0
- package/dist/components/modal/forms/heightForm.d.ts +4 -0
- package/dist/components/modal/forms/rangeForm.d.ts +5 -0
- package/dist/components/modal/forms/transcriptForm.d.ts +4 -0
- package/dist/components/modal/forms/universalForm.d.ts +4 -0
- package/dist/components/modal/modal.d.ts +1 -0
- package/dist/components/modal/styles.d.ts +25 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/tooltipcontext.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +20 -0
- package/dist/components/tracks/bam/bam.d.ts +23 -0
- package/dist/components/tracks/bam/dense.d.ts +4 -0
- package/dist/components/tracks/bam/index.d.ts +4 -0
- package/dist/components/tracks/bam/squish.d.ts +9 -0
- package/dist/components/tracks/bam/types.d.ts +37 -0
- package/dist/components/tracks/bam/utils.d.ts +9 -0
- package/dist/components/tracks/bigbed/bigbed.d.ts +37 -0
- package/dist/components/tracks/bigbed/dense.d.ts +22 -0
- package/dist/components/tracks/bigbed/index.d.ts +4 -0
- package/dist/components/tracks/bigbed/squish.d.ts +27 -0
- package/dist/components/tracks/bigbed/tooltip.d.ts +4 -0
- package/dist/components/tracks/bigbed/types.d.ts +14 -0
- package/dist/components/tracks/bigbed/utils.d.ts +8 -0
- package/dist/components/tracks/bigwig/bigwig.d.ts +37 -0
- package/dist/components/tracks/bigwig/dense.d.ts +8 -0
- package/dist/components/tracks/bigwig/full.d.ts +8 -0
- package/dist/components/tracks/bigwig/index.d.ts +4 -0
- package/dist/components/tracks/bigwig/types.d.ts +34 -0
- package/dist/components/tracks/bigwig/utils.d.ts +50 -0
- package/dist/components/tracks/empty/empty.d.ts +4 -0
- package/dist/components/tracks/empty/index.d.ts +2 -0
- package/dist/components/tracks/empty/types.d.ts +11 -0
- package/dist/components/tracks/index.d.ts +9 -0
- package/dist/components/tracks/ld/graphqlldtrack.d.ts +4 -0
- package/dist/components/tracks/ld/index.d.ts +4 -0
- package/dist/components/tracks/ld/ldtrack.d.ts +4 -0
- package/dist/components/tracks/ld/queries.d.ts +3 -0
- package/dist/components/tracks/ld/types.d.ts +66 -0
- package/dist/components/tracks/ld/utils.d.ts +3 -0
- package/dist/components/tracks/link/index.d.ts +4 -0
- package/dist/components/tracks/link/linktrack.d.ts +9 -0
- package/dist/components/tracks/link/simplelinktrack.d.ts +9 -0
- package/dist/components/tracks/link/types.d.ts +38 -0
- package/dist/components/tracks/link/utils.d.ts +5 -0
- package/dist/components/tracks/manhattan/full.d.ts +25 -0
- package/dist/components/tracks/manhattan/index.d.ts +3 -0
- package/dist/components/tracks/manhattan/tooltip.d.ts +4 -0
- package/dist/components/tracks/manhattan/types.d.ts +14 -0
- package/dist/components/tracks/manhattan/utils.d.ts +8 -0
- package/dist/components/tracks/motif/dense.d.ts +4 -0
- package/dist/components/tracks/motif/index.d.ts +4 -0
- package/dist/components/tracks/motif/squish.d.ts +4 -0
- package/dist/components/tracks/motif/types.d.ts +32 -0
- package/dist/components/tracks/motif/utils.d.ts +9 -0
- package/dist/components/tracks/ruler/index.d.ts +5 -0
- package/dist/components/tracks/ruler/ruler.d.ts +9 -0
- package/dist/components/tracks/ruler/types.d.ts +7 -0
- package/dist/components/tracks/ruler/wrapped.d.ts +15 -0
- package/dist/components/tracks/trackset/bamtrack.d.ts +4 -0
- package/dist/components/tracks/trackset/customtrack.d.ts +1 -0
- package/dist/components/tracks/trackset/deducetype.d.ts +6 -0
- package/dist/components/tracks/trackset/graphqlset.d.ts +4 -0
- package/dist/components/tracks/trackset/index.d.ts +6 -0
- package/dist/components/tracks/trackset/motiftrack.d.ts +4 -0
- package/dist/components/tracks/trackset/queries.d.ts +2 -0
- package/dist/components/tracks/trackset/resttrackset.d.ts +4 -0
- package/dist/components/tracks/trackset/types.d.ts +107 -0
- package/dist/components/tracks/trackset/utils.d.ts +4 -0
- package/dist/components/tracks/transcripts/index.d.ts +4 -0
- package/dist/components/tracks/transcripts/pack.d.ts +8 -0
- package/dist/components/tracks/transcripts/queries.d.ts +3 -0
- package/dist/components/tracks/transcripts/squish.d.ts +9 -0
- package/dist/components/tracks/transcripts/transcript.d.ts +35 -0
- package/dist/components/tracks/transcripts/types.d.ts +74 -0
- package/dist/components/tracks/transcripts/utils.d.ts +38 -0
- package/dist/components/tracks/types.d.ts +71 -0
- package/dist/components/tracks/wrapped/dragTrack.d.ts +7 -0
- package/dist/components/tracks/wrapped/index.d.ts +3 -0
- package/dist/components/tracks/wrapped/ld/index.d.ts +3 -0
- package/dist/components/tracks/wrapped/ld/ldtrack.d.ts +4 -0
- package/dist/components/tracks/wrapped/ld/types.d.ts +3 -0
- package/dist/components/tracks/wrapped/margin.d.ts +5 -0
- package/dist/components/tracks/wrapped/motif/dense.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/index.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/squish.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/types.d.ts +4 -0
- package/dist/components/tracks/wrapped/swapTrack.d.ts +9 -0
- package/dist/components/tracks/wrapped/types.d.ts +42 -0
- package/dist/components/tracks/wrapped/wrapped.d.ts +10 -0
- package/dist/gbc.cjs.js +220 -0
- package/dist/gbc.es.js +13058 -0
- package/dist/gbc.umd.js +220 -0
- package/dist/hooks/useBrowserState.d.ts +2 -0
- package/dist/hooks/useInput.d.ts +5 -0
- package/dist/hooks/useModal.d.ts +10 -0
- package/dist/hooks/useTooltip.d.ts +6 -0
- package/dist/lib.d.ts +14 -0
- package/dist/pages/main.d.ts +1 -0
- package/dist/pages/trackExamples.d.ts +4 -0
- package/dist/utils/colors.d.ts +14 -0
- package/dist/utils/coordinates.d.ts +39 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/react.d.ts +2 -0
- package/dist/utils/svg.d.ts +2 -0
- package/dist/utils/types.d.ts +19 -0
- package/package.json +10 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ManhattanSNP, SummaryStatisticSNP } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders summary statistic data to Manhattan plot shapes.
|
|
4
|
+
* @param data input data vector.
|
|
5
|
+
* @param x a transform function for mapping data coordinates to SVG coordinates.
|
|
6
|
+
* @param y a transform function for mapping data scores to SVG coordinates.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderManhattanPlotData(data: SummaryStatisticSNP[], x: (value: number) => number, y: (value: number) => number): ManhattanSNP[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Domain } from '../../../utils/types';
|
|
2
|
+
export interface Rect {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
pwm?: number[][];
|
|
6
|
+
}
|
|
7
|
+
export type DenseMotifProps = {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
id?: string;
|
|
11
|
+
transform?: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
peakColor?: string;
|
|
14
|
+
domain: Domain;
|
|
15
|
+
data?: Rect[];
|
|
16
|
+
peaks?: Rect[];
|
|
17
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
18
|
+
onHeightChanged?: (height: number) => void;
|
|
19
|
+
};
|
|
20
|
+
export type SquishMotifProps = {
|
|
21
|
+
data?: Rect[];
|
|
22
|
+
peaks?: Rect[];
|
|
23
|
+
width: number;
|
|
24
|
+
rowHeight: number;
|
|
25
|
+
id?: string;
|
|
26
|
+
transform?: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
peakColor?: string;
|
|
29
|
+
domain: Domain;
|
|
30
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
31
|
+
onHeightChanged?: (height: number) => void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rect } from './types';
|
|
2
|
+
import { Domain } from './../../../utils/types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders dense Motif data to SVG rectangles; overlapping regions are merged into single rectangles.
|
|
5
|
+
* @param data input data vector.
|
|
6
|
+
* @param x a transform function for mapping data coordinates to SVG coordinates.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderDenseMotifData(data: Rect[], x: (value: number) => number, domain: Domain): Rect[];
|
|
9
|
+
export declare function renderSquishMotifData(data: Rect[], x: (value: number) => number, domain: Domain): Rect[][];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RulerTrackProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the ruler track at the top of the genome browser to provide a readout of coordinates and scale.
|
|
5
|
+
* This component is chromosome agnostic; chromosome information should be provided elsewhere, such as by
|
|
6
|
+
* wrapping this component in a WrappedTrack with an appropriate title and shortLabel.
|
|
7
|
+
*/
|
|
8
|
+
declare const RulerTrack: React.FC<RulerTrackProps>;
|
|
9
|
+
export default RulerTrack;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RulerTrackProps } from '.';
|
|
2
|
+
import { WrappedTrackProps } from '../wrapped/types';
|
|
3
|
+
/**
|
|
4
|
+
* Ruler track component. NOTE:
|
|
5
|
+
* The canDrag prop is being used to determine if the ruler should be re-rendered or not.
|
|
6
|
+
* When canDrag is false, the ruler is not re-rendered, when true it will be allowed to re-render.
|
|
7
|
+
* canDrag is set to true when the browser delta changes, meaning tracks are being dragged.
|
|
8
|
+
* When the tracks stop dragging, the domain changes, but the data has not been updated.
|
|
9
|
+
* Since canDrag is true, the ruler will not re-render, but the domain will be updated.
|
|
10
|
+
* When the data is updated, delta will return to 0, and canDrag will be set to false.
|
|
11
|
+
* The ruler will then re-render with the new domain while being centered.
|
|
12
|
+
* @param props - RulerTrackProps and WrappedTrackProps
|
|
13
|
+
* @returns Ruler track component
|
|
14
|
+
*/
|
|
15
|
+
export default function Ruler(props: RulerTrackProps & WrappedTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as GraphQLTrackSet } from './graphqlset';
|
|
2
|
+
import { default as RestTrackSet } from './resttrackset';
|
|
3
|
+
import { default as BamTrack } from './bamtrack';
|
|
4
|
+
import { default as MotifTrack } from './motiftrack';
|
|
5
|
+
import { BamTrackProps, GraphQLTrackSetProps, customTrackData, RestTracksetProps, MotifTrackProps } from './types';
|
|
6
|
+
export { GraphQLTrackSet, BamTrack, MotifTrack, type MotifTrackProps, type BamTrackProps, type GraphQLTrackSetProps, type customTrackData, type RestTracksetProps, RestTrackSet };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { BigWigData, BigBedData, BigZoomData } from 'bigwig-reader';
|
|
2
|
+
import { Domain, ValuedPoint } from '../../../utils/types';
|
|
3
|
+
import { BrowserState } from '../../context/browserContext';
|
|
4
|
+
export interface BigRequest {
|
|
5
|
+
url: string;
|
|
6
|
+
chr1: string;
|
|
7
|
+
start: number;
|
|
8
|
+
chr2?: string;
|
|
9
|
+
end: number;
|
|
10
|
+
zoomLevel?: number;
|
|
11
|
+
preRenderedWidth?: number;
|
|
12
|
+
googleProject?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
}
|
|
15
|
+
export type GraphQLTrackSetProps = {
|
|
16
|
+
tracks: BigRequest[];
|
|
17
|
+
browserState: BrowserState;
|
|
18
|
+
id: string;
|
|
19
|
+
transform: string;
|
|
20
|
+
endpoint: string;
|
|
21
|
+
width: number;
|
|
22
|
+
onHeightChanged?: (value: number) => void;
|
|
23
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
24
|
+
};
|
|
25
|
+
export type RestTracksetProps = {
|
|
26
|
+
tracks: BigRequest[];
|
|
27
|
+
id: string;
|
|
28
|
+
transform: string;
|
|
29
|
+
endpoint: string;
|
|
30
|
+
width: number;
|
|
31
|
+
onHeightChanged?: (value: number) => void;
|
|
32
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
33
|
+
};
|
|
34
|
+
export type BamTrackProps = {
|
|
35
|
+
track: {
|
|
36
|
+
bamUrl: string;
|
|
37
|
+
baiUrl: string;
|
|
38
|
+
chr: string;
|
|
39
|
+
start: number;
|
|
40
|
+
end: number;
|
|
41
|
+
color?: string;
|
|
42
|
+
};
|
|
43
|
+
id: string;
|
|
44
|
+
transform: string;
|
|
45
|
+
endpoint: string;
|
|
46
|
+
width: number;
|
|
47
|
+
onHeightChanged?: (value: number) => void;
|
|
48
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
49
|
+
};
|
|
50
|
+
export type MotifTrackProps = {
|
|
51
|
+
track: {
|
|
52
|
+
chromosome: string;
|
|
53
|
+
start: number;
|
|
54
|
+
end: number;
|
|
55
|
+
peaks_accession?: string;
|
|
56
|
+
consensus_regex?: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
offset?: number;
|
|
59
|
+
};
|
|
60
|
+
id: string;
|
|
61
|
+
assembly: string;
|
|
62
|
+
transform: string;
|
|
63
|
+
endpoint: string;
|
|
64
|
+
width: number;
|
|
65
|
+
onHeightChanged?: (value: number) => void;
|
|
66
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
67
|
+
};
|
|
68
|
+
export type BigResponseData = BigWigData[] | BigBedData[] | BigZoomData[] | ValuedPoint[];
|
|
69
|
+
export type BigResponse = {
|
|
70
|
+
data: BigResponseData;
|
|
71
|
+
error: RequestError;
|
|
72
|
+
};
|
|
73
|
+
export type RequestError = {
|
|
74
|
+
message: string;
|
|
75
|
+
errortype: string;
|
|
76
|
+
};
|
|
77
|
+
export type customTrackData = {
|
|
78
|
+
title: string;
|
|
79
|
+
color?: string;
|
|
80
|
+
displayMode?: string;
|
|
81
|
+
track: {
|
|
82
|
+
start: number;
|
|
83
|
+
end: number;
|
|
84
|
+
chr1: string;
|
|
85
|
+
url: string;
|
|
86
|
+
baiUrl?: string;
|
|
87
|
+
preRenderedWidth: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export type CustomTrackProps = {
|
|
91
|
+
data?: any;
|
|
92
|
+
loading?: boolean;
|
|
93
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
94
|
+
id: string;
|
|
95
|
+
height: number;
|
|
96
|
+
displayMode?: string;
|
|
97
|
+
width: number;
|
|
98
|
+
title: string;
|
|
99
|
+
color: string;
|
|
100
|
+
domain: Domain;
|
|
101
|
+
onHeightChanged?: (value: number) => void;
|
|
102
|
+
transform: string;
|
|
103
|
+
canDrag?: boolean;
|
|
104
|
+
};
|
|
105
|
+
export declare const DEFAULT_BIGBED_DISPLAYMODE = "dense";
|
|
106
|
+
export declare const DEFAULT_BIGWIG_DISPLAYMODE = "full";
|
|
107
|
+
export declare const DEFAULT_BAM_DISPLAYMODE = "squish";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ValuedPoint } from '../../../utils/types';
|
|
2
|
+
import { BigWigData } from 'bigwig-reader';
|
|
3
|
+
export declare function parseMultiplexedResponse(data: string): Array<any>;
|
|
4
|
+
export declare function condensedData(data: BigWigData[], preRenderedWidth: number, start: number, end: number): ValuedPoint[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PackTranscriptTrackProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a transcript track in pack mode. Transcripts are packed to occupy the minimum
|
|
5
|
+
* number of rows possible without overlap.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PackTranscriptTrack: React.FC<PackTranscriptTrackProps>;
|
|
8
|
+
export default PackTranscriptTrack;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SquishTranscriptTrackProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a transcript track in squish mode. Transcripts are packed to occupy the minimum
|
|
5
|
+
* number of rows possible without overlap. When a gene has multiple transcripts, they are
|
|
6
|
+
* merged into a single representative transcript.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SquishTranscriptTrack: React.FC<SquishTranscriptTrackProps>;
|
|
9
|
+
export default SquishTranscriptTrack;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TranscriptList, Transcript as Ts } from './types';
|
|
3
|
+
import { Domain } from '../../../utils/types';
|
|
4
|
+
import { DisplayMode, TrackType } from '../types';
|
|
5
|
+
import { LazyQueryExecFunction, OperationVariables } from '@apollo/client';
|
|
6
|
+
export type TranscriptProps = {
|
|
7
|
+
displayMode: string;
|
|
8
|
+
rowHeight: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
domain: Domain;
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
data: TranscriptList[];
|
|
15
|
+
version: number;
|
|
16
|
+
assembly: string;
|
|
17
|
+
};
|
|
18
|
+
export type TranscriptOptions = {
|
|
19
|
+
transform?: string;
|
|
20
|
+
color?: string;
|
|
21
|
+
onHeightChanged?: (height: number) => void;
|
|
22
|
+
onTranscriptClick?: (transcript: Ts) => void;
|
|
23
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
24
|
+
canDrag?: boolean;
|
|
25
|
+
refetch?: LazyQueryExecFunction<any, OperationVariables>;
|
|
26
|
+
};
|
|
27
|
+
export declare const DefaultTranscript: {
|
|
28
|
+
trackType: TrackType;
|
|
29
|
+
displayMode: DisplayMode;
|
|
30
|
+
rowHeight: number;
|
|
31
|
+
titleSize: number;
|
|
32
|
+
trackMargin: number;
|
|
33
|
+
canDrag: boolean;
|
|
34
|
+
};
|
|
35
|
+
export default function Transcript(props: TranscriptProps & TranscriptOptions): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Domain } from '../../../utils/types';
|
|
3
|
+
export declare const humanVersions: number[];
|
|
4
|
+
export declare const mouseVersions: number[];
|
|
5
|
+
export interface GenomicElement {
|
|
6
|
+
coordinates: Domain;
|
|
7
|
+
}
|
|
8
|
+
export interface Exon {
|
|
9
|
+
coordinates: Domain;
|
|
10
|
+
UTRs?: GenomicElement[];
|
|
11
|
+
}
|
|
12
|
+
export interface Transcript {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
coordinates: Domain;
|
|
16
|
+
strand: string;
|
|
17
|
+
exons?: Exon[];
|
|
18
|
+
color?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface TranscriptList {
|
|
21
|
+
transcripts: Transcript[];
|
|
22
|
+
strand: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
}
|
|
26
|
+
export type RenderedTranscript = {
|
|
27
|
+
transcript: Transcript;
|
|
28
|
+
paths: ExonPaths;
|
|
29
|
+
};
|
|
30
|
+
export type TranscriptRow = {
|
|
31
|
+
y: number;
|
|
32
|
+
transcripts: RenderedTranscript[];
|
|
33
|
+
};
|
|
34
|
+
export type PackTranscriptTrackProps = {
|
|
35
|
+
data?: TranscriptList[];
|
|
36
|
+
rowHeight: number;
|
|
37
|
+
width: number;
|
|
38
|
+
domain: Domain;
|
|
39
|
+
id: string;
|
|
40
|
+
transform?: string;
|
|
41
|
+
color?: string;
|
|
42
|
+
onHeightChanged?: (height: number) => void;
|
|
43
|
+
onTranscriptClick?: (transcript: Transcript) => void;
|
|
44
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
45
|
+
canDrag?: boolean;
|
|
46
|
+
};
|
|
47
|
+
export type SquishTranscriptTrackProps = {
|
|
48
|
+
data?: TranscriptList[];
|
|
49
|
+
rowHeight: number;
|
|
50
|
+
width: number;
|
|
51
|
+
domain: Domain;
|
|
52
|
+
id: string;
|
|
53
|
+
transform?: string;
|
|
54
|
+
color?: string;
|
|
55
|
+
onHeightChanged?: (height: number) => void;
|
|
56
|
+
onTranscriptClick?: (transcript: Transcript) => void;
|
|
57
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
58
|
+
canDrag?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type ExonPaths = {
|
|
61
|
+
introns: string;
|
|
62
|
+
exons: string;
|
|
63
|
+
};
|
|
64
|
+
export type GraphQLTranscriptTrackProps = {
|
|
65
|
+
assembly: string;
|
|
66
|
+
domain: Domain;
|
|
67
|
+
queryType?: 'genes' | 'refseqgenes' | 'refseqxenogenes';
|
|
68
|
+
endpoint: string;
|
|
69
|
+
transform: string;
|
|
70
|
+
id: string;
|
|
71
|
+
onHeightChanged?: (height: number) => void;
|
|
72
|
+
svgRef?: React.RefObject<SVGSVGElement>;
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Domain } from '../../../utils/types';
|
|
2
|
+
import { TranscriptList, Transcript, Exon, RenderedTranscript, GenomicElement } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Unpacks transcripts from a list of genes into a flat list of transcripts falling within the
|
|
5
|
+
* viewing window, then sorts them by starting coordinate.
|
|
6
|
+
* @param genes the list of genes, each with a list of transcripts and a strand.
|
|
7
|
+
* @param domain the current genomic range being viewed; transcripts outside this range are filtered.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sortedTranscripts(genes: TranscriptList[], domain: Domain): Transcript[];
|
|
10
|
+
export declare function mergeUTRs(utrs: GenomicElement[]): GenomicElement[];
|
|
11
|
+
export declare function mergeTranscripts(gene: TranscriptList): Transcript;
|
|
12
|
+
/**
|
|
13
|
+
* Converts transcript, exon, and UTR coordinates to SVG space, filtering exons which do not overlap the viewing window.
|
|
14
|
+
* @param transcript the transcript for which to convert coordinates.
|
|
15
|
+
* @param x linear transform function mapping genomic space to SVG space.
|
|
16
|
+
* @param domain the genomic region currently being displayed; exons outside this region will be filtered.
|
|
17
|
+
*/
|
|
18
|
+
export declare function convertTranscriptCoordinates(transcript: Transcript, x: (x: number) => number, domain: Domain): Transcript;
|
|
19
|
+
/**
|
|
20
|
+
* Renders introns for a single transcript as an SVG path. Arrows are drawn every 20 pixels with a center line connecting them.
|
|
21
|
+
* @prop start the start coordinate of the transcript, relative to the SVG.
|
|
22
|
+
* @prop end the end coordinate of the transcript, relative to the SVG.
|
|
23
|
+
* @prop strand the strand of the transcript; should be either '+' or '-'.
|
|
24
|
+
* @prop y the y coordinate of the center points of the arrows, relative to the SVG.
|
|
25
|
+
* @prop h half the height of the arrows, in units relative to the SVG.
|
|
26
|
+
* @prop w the width of the track; prevents arrows from being drawn off the screen.
|
|
27
|
+
*/
|
|
28
|
+
export declare function intronPath(start: number, end: number, strand: string, y: number, h: number, w: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Renders a single exon and its UTRs as an SVG path. All exon and UTR coordinates passed
|
|
31
|
+
* into this function must be relative to the SVG, not the reference sequence.
|
|
32
|
+
* @prop exon the exon to render, containing start and end fields and a list of UTRs.
|
|
33
|
+
* @prop y the y coordinate of the center of the exon, relative to the SVG.
|
|
34
|
+
* @prop h half the height of the row, relative to the SVG; exons are 0.6h high and UTRs are 0.4h high.
|
|
35
|
+
* @prop w the width of the track; if the exon is past the track width, this function returns an empty string.
|
|
36
|
+
*/
|
|
37
|
+
export declare function exonPath(exon: Exon, y: number, h: number, w: number): string;
|
|
38
|
+
export declare function renderTranscript(uTranscript: Transcript, x: (value: number) => number, domain: Domain, rowHeight: number, width: number): RenderedTranscript;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { OperationVariables, LazyQueryExecFunction } from '@apollo/client';
|
|
2
|
+
import { BigBedOptions, BigWigOptions } from '../../lib';
|
|
3
|
+
import { TranscriptOptions } from './transcripts';
|
|
4
|
+
/**
|
|
5
|
+
* Display modes for tracks
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DisplayMode {
|
|
8
|
+
FULL = "full",
|
|
9
|
+
DENSE = "dense",
|
|
10
|
+
SQUISH = "squish",
|
|
11
|
+
PACK = "pack",
|
|
12
|
+
HIDE = "hide",
|
|
13
|
+
DOWNLOAD = "download"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Types of tracks
|
|
17
|
+
*/
|
|
18
|
+
export declare enum TrackType {
|
|
19
|
+
UNDEFINED = "undefined",
|
|
20
|
+
RULER = "ruler",
|
|
21
|
+
BIGWIG = "bigwig",
|
|
22
|
+
BIGBED = "bigbed",
|
|
23
|
+
TRANSCRIPT = "transcript",
|
|
24
|
+
BAM = "bam",
|
|
25
|
+
MOTIF = "motif",
|
|
26
|
+
LDTRACK = "ldtrack"
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Base track props
|
|
30
|
+
*/
|
|
31
|
+
export type BaseTrack = {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
url?: string;
|
|
35
|
+
color?: string;
|
|
36
|
+
height: number;
|
|
37
|
+
actualHeight?: number;
|
|
38
|
+
trackMargin: number;
|
|
39
|
+
displayMode: DisplayMode;
|
|
40
|
+
trackType: TrackType;
|
|
41
|
+
data?: any[];
|
|
42
|
+
refetch?: LazyQueryExecFunction<any, OperationVariables>;
|
|
43
|
+
};
|
|
44
|
+
export declare function BigWigTrack(_: BigWigTrackProps): null;
|
|
45
|
+
export type BigWigTrackProps = {
|
|
46
|
+
props?: BigWigOptions;
|
|
47
|
+
} & BaseTrack;
|
|
48
|
+
export declare function BigBedTrack(_: BigBedTrackProps): null;
|
|
49
|
+
export type BigBedTrackProps = {
|
|
50
|
+
rowHeight: number;
|
|
51
|
+
props?: BigBedOptions;
|
|
52
|
+
} & BaseTrack;
|
|
53
|
+
export declare enum TranscriptHumanVersion {
|
|
54
|
+
V47 = 47,
|
|
55
|
+
V48 = 48,
|
|
56
|
+
V29 = 29
|
|
57
|
+
}
|
|
58
|
+
export declare enum TranscriptMouseVersion {
|
|
59
|
+
V36 = 36,
|
|
60
|
+
V25 = 25,
|
|
61
|
+
V21 = 21
|
|
62
|
+
}
|
|
63
|
+
export declare function TranscriptTrack(_: TranscriptTrackProps): null;
|
|
64
|
+
export type TranscriptTrackProps = {
|
|
65
|
+
rowHeight: number;
|
|
66
|
+
assembly: string;
|
|
67
|
+
queryType: string;
|
|
68
|
+
version: TranscriptHumanVersion | TranscriptMouseVersion;
|
|
69
|
+
props?: TranscriptOptions;
|
|
70
|
+
} & BaseTrack;
|
|
71
|
+
export type TrackProps = BigWigTrackProps | BigBedTrackProps | TranscriptTrackProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const dragContext: React.Context<boolean>;
|
|
3
|
+
declare function SwapTrack({ canDrag, id, height, children }: {
|
|
4
|
+
canDrag: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
height: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default SwapTrack;
|