@jbrowse/plugin-breakpoint-split-view 2.17.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -11
- package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +18 -8
- package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/dist/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +93 -124
- package/dist/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Breakends.js +67 -92
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -39
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +35 -76
- package/dist/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Overlay.js +8 -9
- package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/dist/BreakpointSplitView/components/PairedFeatures.js +47 -72
- package/dist/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/dist/BreakpointSplitView/components/Translocations.js +57 -86
- package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/dist/BreakpointSplitView/components/util.d.ts +1 -1
- package/dist/BreakpointSplitView/components/util.js +12 -12
- package/dist/BreakpointSplitView/index.d.ts +1 -1
- package/dist/BreakpointSplitView/index.js +19 -10
- package/dist/BreakpointSplitView/model.d.ts +23 -108
- package/dist/BreakpointSplitView/model.js +50 -153
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -6
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/dist/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/dist/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/dist/BreakpointSplitView/types.d.ts +22 -0
- package/dist/BreakpointSplitView/types.js +2 -0
- package/dist/BreakpointSplitView/util.d.ts +12 -2
- package/dist/BreakpointSplitView/util.js +34 -8
- package/dist/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +6 -3
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +5 -8
- package/esm/BreakpointAlignmentsFeatureDetail/index.d.ts +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/index.js +1 -1
- package/esm/BreakpointSplitView/BreakpointSplitView.d.ts +22 -40
- package/esm/BreakpointSplitView/BreakpointSplitView.js +41 -90
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +3 -4
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +94 -102
- package/esm/BreakpointSplitView/components/Breakends.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Breakends.js +68 -70
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +13 -17
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +2 -3
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +10 -16
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +35 -53
- package/esm/BreakpointSplitView/components/Overlay.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Overlay.js +8 -9
- package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +3 -4
- package/esm/BreakpointSplitView/components/PairedFeatures.js +48 -50
- package/esm/BreakpointSplitView/components/Translocations.d.ts +3 -4
- package/esm/BreakpointSplitView/components/Translocations.js +58 -64
- package/esm/BreakpointSplitView/components/getOrientationColor.js +0 -8
- package/esm/BreakpointSplitView/components/util.d.ts +1 -1
- package/esm/BreakpointSplitView/components/util.js +12 -12
- package/esm/BreakpointSplitView/index.d.ts +1 -1
- package/esm/BreakpointSplitView/index.js +2 -3
- package/esm/BreakpointSplitView/model.d.ts +23 -108
- package/esm/BreakpointSplitView/model.js +30 -142
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +3 -3
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -1
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +6 -30
- package/esm/BreakpointSplitView/svgcomponents/util.d.ts +2 -2
- package/esm/BreakpointSplitView/svgcomponents/util.js +0 -1
- package/esm/BreakpointSplitView/types.d.ts +22 -0
- package/esm/BreakpointSplitView/types.js +1 -0
- package/esm/BreakpointSplitView/util.d.ts +12 -2
- package/esm/BreakpointSplitView/util.js +33 -10
- package/esm/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Feature } from '@jbrowse/core/util';
|
|
6
|
-
export declare function getClip(cigar: string, strand: number): number;
|
|
7
|
-
export interface ExportSvgOptions {
|
|
8
|
-
rasterizeLayers?: boolean;
|
|
9
|
-
filename?: string;
|
|
10
|
-
Wrapper?: React.FC<{
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}>;
|
|
13
|
-
fontSize?: number;
|
|
14
|
-
rulerHeight?: number;
|
|
15
|
-
textHeight?: number;
|
|
16
|
-
paddingHeight?: number;
|
|
17
|
-
headerHeight?: number;
|
|
18
|
-
cytobandHeight?: number;
|
|
19
|
-
trackLabels?: string;
|
|
20
|
-
themeName?: string;
|
|
21
|
-
}
|
|
22
|
-
type LGV = LinearGenomeViewModel;
|
|
23
|
-
export interface Breakend {
|
|
24
|
-
MateDirection: string;
|
|
25
|
-
Join: string;
|
|
26
|
-
Replacement: string;
|
|
27
|
-
MatePosition: string;
|
|
28
|
-
}
|
|
29
|
-
export type LayoutRecord = [number, number, number, number];
|
|
30
|
-
/**
|
|
31
|
-
* #stateModel BreakpointSplitView
|
|
32
|
-
* extends
|
|
33
|
-
* - [BaseViewModel](../baseviewmodel)
|
|
34
|
-
*/
|
|
1
|
+
import type { ExportSvgOptions } from './types';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
import type { Instance } from 'mobx-state-tree';
|
|
35
5
|
export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
36
6
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
37
7
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -42,7 +12,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
42
12
|
trackSelectorType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
43
13
|
showIntraviewLinks: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
44
14
|
linkViews: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
45
|
-
|
|
15
|
+
interactiveOverlay: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
46
16
|
views: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
47
17
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
48
18
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -62,7 +32,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
62
32
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
63
33
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
64
34
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
65
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
35
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType>>, [undefined]>;
|
|
66
36
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
67
37
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
68
38
|
}, {
|
|
@@ -83,8 +53,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
83
53
|
trackRefs: Record<string, HTMLDivElement>;
|
|
84
54
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
85
55
|
coarseTotalBp: number;
|
|
86
|
-
leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
|
|
87
|
-
rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
|
|
56
|
+
leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
57
|
+
rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
88
58
|
} & {
|
|
89
59
|
readonly trackLabelsSetting: any;
|
|
90
60
|
readonly width: number;
|
|
@@ -94,6 +64,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
94
64
|
scaleBarDisplayPrefix(): string | undefined;
|
|
95
65
|
MiniControlsComponent(): React.FC<any>;
|
|
96
66
|
HeaderComponent(): React.FC<any>;
|
|
67
|
+
readonly assembliesNotFound: string | undefined;
|
|
97
68
|
readonly assemblyErrors: string;
|
|
98
69
|
readonly assembliesInitialized: boolean;
|
|
99
70
|
readonly initialized: boolean;
|
|
@@ -130,12 +101,12 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
130
101
|
setHideHeaderOverview(b: boolean): void;
|
|
131
102
|
setHideNoTracksActive(b: boolean): void;
|
|
132
103
|
setShowGridlines(b: boolean): void;
|
|
133
|
-
addToHighlights(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
134
|
-
setHighlight(highlight?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType[]): void;
|
|
135
|
-
removeHighlight(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
104
|
+
addToHighlights(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType): void;
|
|
105
|
+
setHighlight(highlight?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType[]): void;
|
|
106
|
+
removeHighlight(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType): void;
|
|
136
107
|
scrollTo(offsetPx: number): number;
|
|
137
108
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
138
|
-
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
109
|
+
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
139
110
|
setSearchResults(searchResults: import("@jbrowse/core/TextSearch/BaseResults").default[], searchQuery: string, assemblyName?: string): void;
|
|
140
111
|
setNewView(bpPerPx: number, offsetPx: number): void;
|
|
141
112
|
horizontallyFlip(): void;
|
|
@@ -152,7 +123,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
152
123
|
setShowCenterLine(b: boolean): void;
|
|
153
124
|
setDisplayedRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
154
125
|
activateTrackSelector(): import("@jbrowse/core/util").Widget;
|
|
155
|
-
getSelectedRegions(leftOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, rightOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): {
|
|
126
|
+
getSelectedRegions(leftOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, rightOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): {
|
|
156
127
|
start: number;
|
|
157
128
|
end: number;
|
|
158
129
|
type: string;
|
|
@@ -174,7 +145,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
174
145
|
setDraggingTrackId(idx?: string): void;
|
|
175
146
|
setScaleFactor(factor: number): void;
|
|
176
147
|
clearView(): void;
|
|
177
|
-
exportSvg(opts?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").ExportSvgOptions): Promise<void>;
|
|
148
|
+
exportSvg(opts?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").ExportSvgOptions): Promise<void>;
|
|
178
149
|
} & {
|
|
179
150
|
slide: (viewWidths: number) => void;
|
|
180
151
|
} & {
|
|
@@ -196,15 +167,15 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
196
167
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
197
168
|
afterAttach(): void;
|
|
198
169
|
} & {
|
|
199
|
-
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
170
|
+
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
200
171
|
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
201
172
|
navToSearchString({ input, assembly, }: {
|
|
202
173
|
input: string;
|
|
203
174
|
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
204
175
|
}): Promise<void>;
|
|
205
176
|
navToLocations(parsedLocStrings: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string): Promise<void>;
|
|
206
|
-
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").NavLocation): void;
|
|
207
|
-
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").NavLocation[]): void;
|
|
177
|
+
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation): void;
|
|
178
|
+
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").NavLocation[]): void;
|
|
208
179
|
} & {
|
|
209
180
|
rubberBandMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
210
181
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
@@ -259,7 +230,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
259
230
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
260
231
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
261
232
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
262
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
233
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType>>, [undefined]>;
|
|
263
234
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
264
235
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
265
236
|
}>>, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -275,89 +246,34 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
275
246
|
width: number;
|
|
276
247
|
matchedTrackFeatures: Record<string, Feature[][]>;
|
|
277
248
|
} & {
|
|
278
|
-
/**
|
|
279
|
-
* #method
|
|
280
|
-
* creates an svg export and save using FileSaver
|
|
281
|
-
*/
|
|
282
249
|
exportSvg(opts?: ExportSvgOptions): Promise<void>;
|
|
283
250
|
} & {
|
|
284
|
-
/**
|
|
285
|
-
* #getter
|
|
286
|
-
* Find all track ids that match across multiple views, or return just
|
|
287
|
-
* the single view's track if only a single row is used
|
|
288
|
-
*/
|
|
289
251
|
readonly matchedTracks: (import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>>) | {
|
|
290
252
|
configuration: {
|
|
291
253
|
trackId: string;
|
|
292
254
|
};
|
|
293
255
|
}[];
|
|
294
|
-
/**
|
|
295
|
-
* #method
|
|
296
|
-
* Get tracks with a given trackId across multiple views
|
|
297
|
-
*/
|
|
298
256
|
getMatchedTracks(trackConfigId: string): any[];
|
|
299
|
-
/**
|
|
300
|
-
* #method
|
|
301
|
-
* Translocation features are handled differently since they do not have
|
|
302
|
-
* a mate e.g. they are one sided
|
|
303
|
-
*/
|
|
304
257
|
hasTranslocations(trackConfigId: string): Feature | undefined;
|
|
305
|
-
/**
|
|
306
|
-
* #method
|
|
307
|
-
* Paired features similar to breakends, but simpler, like BEDPE
|
|
308
|
-
*/
|
|
309
258
|
hasPairedFeatures(trackConfigId: string): Feature | undefined;
|
|
310
|
-
/**
|
|
311
|
-
* #method
|
|
312
|
-
* Get a composite map of featureId-\>feature map for a track across
|
|
313
|
-
* multiple views
|
|
314
|
-
*/
|
|
315
259
|
getTrackFeatures(trackConfigId: string): Map<string, Feature>;
|
|
316
|
-
/**
|
|
317
|
-
* #method
|
|
318
|
-
*/
|
|
319
260
|
getMatchedFeaturesInLayout(trackConfigId: string, features: Feature[][]): {
|
|
320
261
|
feature: Feature;
|
|
321
|
-
layout: LayoutRecord | undefined;
|
|
262
|
+
layout: import("./types").LayoutRecord | undefined;
|
|
322
263
|
level: number;
|
|
323
264
|
clipPos: number;
|
|
324
265
|
}[][];
|
|
325
266
|
} & {
|
|
326
267
|
afterAttach(): void;
|
|
327
268
|
onSubviewAction(actionName: string, path: string, args?: unknown[]): void;
|
|
328
|
-
/**
|
|
329
|
-
* #action
|
|
330
|
-
*/
|
|
331
269
|
setWidth(newWidth: number): void;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
removeView(view: LGV): void;
|
|
336
|
-
/**
|
|
337
|
-
* #action
|
|
338
|
-
*/
|
|
339
|
-
toggleInteract(): void;
|
|
340
|
-
/**
|
|
341
|
-
* #action
|
|
342
|
-
*/
|
|
343
|
-
toggleIntraviewLinks(): void;
|
|
344
|
-
/**
|
|
345
|
-
* #action
|
|
346
|
-
*/
|
|
347
|
-
toggleLinkViews(): void;
|
|
348
|
-
/**
|
|
349
|
-
* #action
|
|
350
|
-
*/
|
|
270
|
+
setInteractiveOverlay(arg: boolean): void;
|
|
271
|
+
setShowIntraviewLinks(arg: boolean): void;
|
|
272
|
+
setLinkViews(arg: boolean): void;
|
|
351
273
|
setMatchedTrackFeatures(obj: Record<string, Feature[][]>): void;
|
|
352
|
-
/**
|
|
353
|
-
* #action
|
|
354
|
-
*/
|
|
355
274
|
reverseViewOrder(): void;
|
|
356
275
|
} & {
|
|
357
276
|
afterAttach(): void;
|
|
358
|
-
/**
|
|
359
|
-
* #method
|
|
360
|
-
*/
|
|
361
277
|
menuItems(): ({
|
|
362
278
|
label: string;
|
|
363
279
|
subMenu: import("@jbrowse/core/ui").MenuItem[];
|
|
@@ -393,4 +309,3 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
393
309
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
394
310
|
export type BreakpointViewStateModel = ReturnType<typeof stateModelFactory>;
|
|
395
311
|
export type BreakpointViewModel = Instance<BreakpointViewStateModel>;
|
|
396
|
-
export {};
|
|
@@ -15,100 +15,49 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getClip = getClip;
|
|
30
39
|
exports.default = stateModelFactory;
|
|
31
40
|
const react_1 = require("react");
|
|
32
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
33
|
-
const mobx_1 = require("mobx");
|
|
34
|
-
const file_saver_1 = require("file-saver");
|
|
35
41
|
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
36
42
|
const util_1 = require("@jbrowse/core/util");
|
|
37
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
38
|
-
// icons
|
|
39
|
-
const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
|
|
40
43
|
const Link_1 = __importDefault(require("@mui/icons-material/Link"));
|
|
41
|
-
|
|
44
|
+
const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
|
|
45
|
+
const file_saver_1 = require("file-saver");
|
|
46
|
+
const mobx_1 = require("mobx");
|
|
47
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
48
|
const util_2 = require("./util");
|
|
43
|
-
// lazies
|
|
44
49
|
const ExportSvgDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ExportSvgDialog'))));
|
|
45
|
-
const startClip = new RegExp(/(\d+)[SH]$/);
|
|
46
|
-
const endClip = new RegExp(/^(\d+)([SH])/);
|
|
47
|
-
function getClip(cigar, strand) {
|
|
48
|
-
return strand === -1
|
|
49
|
-
? +(startClip.exec(cigar) || [])[1] || 0
|
|
50
|
-
: +(endClip.exec(cigar) || [])[1] || 0;
|
|
51
|
-
}
|
|
52
|
-
function calc(track, f) {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
return (_b = (_a = track.displays[0]).searchFeatureByID) === null || _b === void 0 ? void 0 : _b.call(_a, f.id());
|
|
55
|
-
}
|
|
56
|
-
async function getBlockFeatures(model, track) {
|
|
57
|
-
var _a;
|
|
58
|
-
const { views } = model;
|
|
59
|
-
const { rpcManager, assemblyManager } = (0, util_1.getSession)(model);
|
|
60
|
-
const assemblyName = (_a = model.views[0]) === null || _a === void 0 ? void 0 : _a.assemblyNames[0];
|
|
61
|
-
if (!assemblyName) {
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
const assembly = await assemblyManager.waitForAssembly(assemblyName);
|
|
65
|
-
if (!assembly) {
|
|
66
|
-
return undefined; // throw new Error(`assembly not found: "${assemblyName}"`)
|
|
67
|
-
}
|
|
68
|
-
const sessionId = track.configuration.trackId;
|
|
69
|
-
return Promise.all(views.map(async (view) => (await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
70
|
-
adapterConfig: (0, configuration_1.getConf)(track, ['adapter']),
|
|
71
|
-
sessionId,
|
|
72
|
-
regions: view.staticBlocks.contentBlocks,
|
|
73
|
-
})).flat()));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* #stateModel BreakpointSplitView
|
|
77
|
-
* extends
|
|
78
|
-
* - [BaseViewModel](../baseviewmodel)
|
|
79
|
-
*/
|
|
80
50
|
function stateModelFactory(pluginManager) {
|
|
81
51
|
const minHeight = 40;
|
|
82
52
|
const defaultHeight = 400;
|
|
83
53
|
return mobx_state_tree_1.types
|
|
84
54
|
.compose('BreakpointSplitView', models_1.BaseViewModel, mobx_state_tree_1.types.model({
|
|
85
|
-
/**
|
|
86
|
-
* #property
|
|
87
|
-
*/
|
|
88
55
|
type: mobx_state_tree_1.types.literal('BreakpointSplitView'),
|
|
89
|
-
/**
|
|
90
|
-
* #property
|
|
91
|
-
*/
|
|
92
56
|
height: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.refinement('viewHeight', mobx_state_tree_1.types.number, (n) => n >= minHeight), defaultHeight),
|
|
93
|
-
/**
|
|
94
|
-
* #property
|
|
95
|
-
*/
|
|
96
57
|
trackSelectorType: 'hierarchical',
|
|
97
|
-
/**
|
|
98
|
-
* #property
|
|
99
|
-
*/
|
|
100
58
|
showIntraviewLinks: true,
|
|
101
|
-
/**
|
|
102
|
-
* #property
|
|
103
|
-
*/
|
|
104
59
|
linkViews: false,
|
|
105
|
-
|
|
106
|
-
* #property
|
|
107
|
-
*/
|
|
108
|
-
interactToggled: false,
|
|
109
|
-
/**
|
|
110
|
-
* #property
|
|
111
|
-
*/
|
|
60
|
+
interactiveOverlay: true,
|
|
112
61
|
views: mobx_state_tree_1.types.array(pluginManager.getViewType('LinearGenomeView')
|
|
113
62
|
.stateModel),
|
|
114
63
|
}))
|
|
@@ -117,10 +66,6 @@ function stateModelFactory(pluginManager) {
|
|
|
117
66
|
matchedTrackFeatures: {},
|
|
118
67
|
}))
|
|
119
68
|
.views(self => ({
|
|
120
|
-
/**
|
|
121
|
-
* #method
|
|
122
|
-
* creates an svg export and save using FileSaver
|
|
123
|
-
*/
|
|
124
69
|
async exportSvg(opts = {}) {
|
|
125
70
|
const { renderToSvg } = await Promise.resolve().then(() => __importStar(require('./svgcomponents/SVGBreakpointSplitView')));
|
|
126
71
|
const html = await renderToSvg(self, opts);
|
|
@@ -129,64 +74,37 @@ function stateModelFactory(pluginManager) {
|
|
|
129
74
|
},
|
|
130
75
|
}))
|
|
131
76
|
.views(self => ({
|
|
132
|
-
/**
|
|
133
|
-
* #getter
|
|
134
|
-
* Find all track ids that match across multiple views, or return just
|
|
135
|
-
* the single view's track if only a single row is used
|
|
136
|
-
*/
|
|
137
77
|
get matchedTracks() {
|
|
138
78
|
return self.views.length === 1
|
|
139
79
|
? self.views[0].tracks
|
|
140
80
|
: (0, util_2.intersect)(elt => elt.configuration.trackId, ...self.views.map(view => view.tracks));
|
|
141
81
|
},
|
|
142
|
-
/**
|
|
143
|
-
* #method
|
|
144
|
-
* Get tracks with a given trackId across multiple views
|
|
145
|
-
*/
|
|
146
82
|
getMatchedTracks(trackConfigId) {
|
|
147
83
|
return self.views
|
|
148
84
|
.map(view => view.getTrack(trackConfigId))
|
|
149
85
|
.filter(f => !!f);
|
|
150
86
|
},
|
|
151
|
-
/**
|
|
152
|
-
* #method
|
|
153
|
-
* Translocation features are handled differently since they do not have
|
|
154
|
-
* a mate e.g. they are one sided
|
|
155
|
-
*/
|
|
156
87
|
hasTranslocations(trackConfigId) {
|
|
157
88
|
return [...this.getTrackFeatures(trackConfigId).values()].find(f => f.get('type') === 'translocation');
|
|
158
89
|
},
|
|
159
|
-
/**
|
|
160
|
-
* #method
|
|
161
|
-
* Paired features similar to breakends, but simpler, like BEDPE
|
|
162
|
-
*/
|
|
163
90
|
hasPairedFeatures(trackConfigId) {
|
|
164
91
|
return [...this.getTrackFeatures(trackConfigId).values()].find(f => f.get('type') === 'paired_feature');
|
|
165
92
|
},
|
|
166
|
-
/**
|
|
167
|
-
* #method
|
|
168
|
-
* Get a composite map of featureId-\>feature map for a track across
|
|
169
|
-
* multiple views
|
|
170
|
-
*/
|
|
171
93
|
getTrackFeatures(trackConfigId) {
|
|
172
94
|
var _a;
|
|
173
95
|
return new Map((_a = self.matchedTrackFeatures[trackConfigId]) === null || _a === void 0 ? void 0 : _a.flat().map(f => [f.id(), f]));
|
|
174
96
|
},
|
|
175
|
-
/**
|
|
176
|
-
* #method
|
|
177
|
-
*/
|
|
178
97
|
getMatchedFeaturesInLayout(trackConfigId, features) {
|
|
179
|
-
// use reverse to search the second track first
|
|
180
98
|
const tracks = this.getMatchedTracks(trackConfigId);
|
|
181
99
|
return features.map(c => c
|
|
182
100
|
.map(feature => {
|
|
183
|
-
const level = tracks.findIndex(track => calc(track, feature));
|
|
101
|
+
const level = tracks.findIndex(track => (0, util_2.calc)(track, feature));
|
|
184
102
|
return level !== -1
|
|
185
103
|
? {
|
|
186
104
|
feature,
|
|
187
|
-
layout: calc(tracks[level], feature),
|
|
105
|
+
layout: (0, util_2.calc)(tracks[level], feature),
|
|
188
106
|
level,
|
|
189
|
-
clipPos: getClip(feature.get('CIGAR'), feature.get('strand')),
|
|
107
|
+
clipPos: (0, util_2.getClip)(feature.get('CIGAR'), feature.get('strand')),
|
|
190
108
|
}
|
|
191
109
|
: undefined;
|
|
192
110
|
})
|
|
@@ -217,53 +135,28 @@ function stateModelFactory(pluginManager) {
|
|
|
217
135
|
self.views.forEach(view => {
|
|
218
136
|
const ret = (0, mobx_state_tree_1.getPath)(view);
|
|
219
137
|
if (!ret.endsWith(path)) {
|
|
220
|
-
// @ts-ignore
|
|
221
138
|
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
222
139
|
}
|
|
223
140
|
});
|
|
224
141
|
},
|
|
225
|
-
/**
|
|
226
|
-
* #action
|
|
227
|
-
*/
|
|
228
142
|
setWidth(newWidth) {
|
|
229
143
|
self.width = newWidth;
|
|
230
144
|
self.views.forEach(v => {
|
|
231
145
|
v.setWidth(newWidth);
|
|
232
146
|
});
|
|
233
147
|
},
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*/
|
|
237
|
-
removeView(view) {
|
|
238
|
-
self.views.remove(view);
|
|
239
|
-
},
|
|
240
|
-
/**
|
|
241
|
-
* #action
|
|
242
|
-
*/
|
|
243
|
-
toggleInteract() {
|
|
244
|
-
self.interactToggled = !self.interactToggled;
|
|
148
|
+
setInteractiveOverlay(arg) {
|
|
149
|
+
self.interactiveOverlay = arg;
|
|
245
150
|
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*/
|
|
249
|
-
toggleIntraviewLinks() {
|
|
250
|
-
self.showIntraviewLinks = !self.showIntraviewLinks;
|
|
151
|
+
setShowIntraviewLinks(arg) {
|
|
152
|
+
self.showIntraviewLinks = arg;
|
|
251
153
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
*/
|
|
255
|
-
toggleLinkViews() {
|
|
256
|
-
self.linkViews = !self.linkViews;
|
|
154
|
+
setLinkViews(arg) {
|
|
155
|
+
self.linkViews = arg;
|
|
257
156
|
},
|
|
258
|
-
/**
|
|
259
|
-
* #action
|
|
260
|
-
*/
|
|
261
157
|
setMatchedTrackFeatures(obj) {
|
|
262
158
|
self.matchedTrackFeatures = obj;
|
|
263
159
|
},
|
|
264
|
-
/**
|
|
265
|
-
* #action
|
|
266
|
-
*/
|
|
267
160
|
reverseViewOrder() {
|
|
268
161
|
self.views.reverse();
|
|
269
162
|
},
|
|
@@ -277,7 +170,7 @@ function stateModelFactory(pluginManager) {
|
|
|
277
170
|
}
|
|
278
171
|
self.setMatchedTrackFeatures(Object.fromEntries(await Promise.all(self.matchedTracks.map(async (track) => [
|
|
279
172
|
track.configuration.trackId,
|
|
280
|
-
await getBlockFeatures(self, track),
|
|
173
|
+
await (0, util_2.getBlockFeatures)(self, track),
|
|
281
174
|
]))));
|
|
282
175
|
}
|
|
283
176
|
catch (e) {
|
|
@@ -286,9 +179,6 @@ function stateModelFactory(pluginManager) {
|
|
|
286
179
|
}
|
|
287
180
|
}));
|
|
288
181
|
},
|
|
289
|
-
/**
|
|
290
|
-
* #method
|
|
291
|
-
*/
|
|
292
182
|
menuItems() {
|
|
293
183
|
return [
|
|
294
184
|
...self.views
|
|
@@ -297,26 +187,30 @@ function stateModelFactory(pluginManager) {
|
|
|
297
187
|
label: `Row ${f[0] + 1} view menu`,
|
|
298
188
|
subMenu: f[1],
|
|
299
189
|
})),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
190
|
+
...(self.views.length > 1
|
|
191
|
+
? [
|
|
192
|
+
{
|
|
193
|
+
label: 'Reverse view order',
|
|
194
|
+
onClick: () => {
|
|
195
|
+
self.reverseViewOrder();
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
]
|
|
199
|
+
: []),
|
|
306
200
|
{
|
|
307
201
|
label: 'Show intra-view links',
|
|
308
202
|
type: 'checkbox',
|
|
309
203
|
checked: self.showIntraviewLinks,
|
|
310
204
|
onClick: () => {
|
|
311
|
-
self.
|
|
205
|
+
self.setShowIntraviewLinks(!self.showIntraviewLinks);
|
|
312
206
|
},
|
|
313
207
|
},
|
|
314
208
|
{
|
|
315
209
|
label: 'Allow clicking alignment squiggles?',
|
|
316
210
|
type: 'checkbox',
|
|
317
|
-
checked: self.
|
|
211
|
+
checked: self.interactiveOverlay,
|
|
318
212
|
onClick: () => {
|
|
319
|
-
self.
|
|
213
|
+
self.setInteractiveOverlay(!self.interactiveOverlay);
|
|
320
214
|
},
|
|
321
215
|
},
|
|
322
216
|
{
|
|
@@ -325,7 +219,7 @@ function stateModelFactory(pluginManager) {
|
|
|
325
219
|
icon: Link_1.default,
|
|
326
220
|
checked: self.linkViews,
|
|
327
221
|
onClick: () => {
|
|
328
|
-
self.
|
|
222
|
+
self.setLinkViews(!self.linkViews);
|
|
329
223
|
},
|
|
330
224
|
},
|
|
331
225
|
{
|
|
@@ -334,7 +228,10 @@ function stateModelFactory(pluginManager) {
|
|
|
334
228
|
onClick: () => {
|
|
335
229
|
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
336
230
|
ExportSvgDialog,
|
|
337
|
-
{
|
|
231
|
+
{
|
|
232
|
+
model: self,
|
|
233
|
+
handleClose,
|
|
234
|
+
},
|
|
338
235
|
]);
|
|
339
236
|
},
|
|
340
237
|
},
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.default = SVGBackground;
|
|
7
|
-
const
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
5
|
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
10
7
|
function SVGBackground({ width, height, shift, }) {
|
|
11
8
|
const theme = (0, material_1.useTheme)();
|
|
12
|
-
return (
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("rect", { width: width + shift * 2, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
|
|
13
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BreakpointViewModel } from '../model';
|
|
2
|
+
import type { ExportSvgOptions } from '../types';
|
|
2
3
|
type BSV = BreakpointViewModel;
|
|
3
4
|
export declare function renderToSvg(model: BSV, opts: ExportSvgOptions): Promise<string>;
|
|
4
5
|
export {};
|