@jbrowse/plugin-linear-comparative-view 3.0.5 → 3.2.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/LinearComparativeView/components/Rubberband.js +5 -5
- package/dist/LinearComparativeView/components/VerticalGuide.js +3 -6
- package/dist/LinearComparativeView/model.d.ts +60 -4
- package/dist/LinearComparativeView/model.js +7 -2
- package/dist/LinearReadVsRef/LinearReadVsRef.js +2 -2
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +11 -0
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.js +58 -0
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +18 -52
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +1 -1
- package/dist/LinearSyntenyView/model.d.ts +61 -5
- package/dist/LinearSyntenyView/model.js +3 -3
- package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -2
- package/esm/LinearComparativeView/components/Rubberband.js +5 -5
- package/esm/LinearComparativeView/components/VerticalGuide.js +4 -7
- package/esm/LinearComparativeView/model.d.ts +60 -4
- package/esm/LinearComparativeView/model.js +7 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.js +2 -2
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +11 -0
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.js +53 -0
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +21 -55
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +1 -1
- package/esm/LinearSyntenyView/model.d.ts +61 -5
- package/esm/LinearSyntenyView/model.js +3 -3
- package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -2
- package/package.json +5 -5
|
@@ -112,12 +112,12 @@ function stateModelFactory(pluginManager) {
|
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
label: 'Draw CIGAR',
|
|
115
|
-
onClick: () => {
|
|
116
|
-
self.setDrawCIGAR(!self.drawCIGAR);
|
|
117
|
-
},
|
|
118
115
|
checked: self.drawCIGAR,
|
|
119
116
|
type: 'checkbox',
|
|
120
117
|
description: 'Draws per-base CIGAR level alignments',
|
|
118
|
+
onClick: () => {
|
|
119
|
+
self.setDrawCIGAR(!self.drawCIGAR);
|
|
120
|
+
},
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
label: 'Link views',
|
|
@@ -51,9 +51,9 @@ function linearSyntenyViewHelperModelFactory(pluginManager) {
|
|
|
51
51
|
const config = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
|
|
52
52
|
const shownTracks = self.tracks.filter(t => t.configuration === config);
|
|
53
53
|
(0, mobx_1.transaction)(() => {
|
|
54
|
-
|
|
54
|
+
for (const t of shownTracks) {
|
|
55
55
|
self.tracks.remove(t);
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
});
|
|
58
58
|
return shownTracks.length;
|
|
59
59
|
},
|
|
@@ -13,7 +13,7 @@ const useStyles = makeStyles()(theme => {
|
|
|
13
13
|
height: '100%',
|
|
14
14
|
background: alpha(theme.palette.tertiary.main, 0.7),
|
|
15
15
|
position: 'absolute',
|
|
16
|
-
zIndex:
|
|
16
|
+
zIndex: 900,
|
|
17
17
|
textAlign: 'center',
|
|
18
18
|
overflow: 'hidden',
|
|
19
19
|
},
|
|
@@ -76,13 +76,13 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
|
|
|
76
76
|
clientY,
|
|
77
77
|
});
|
|
78
78
|
transaction(() => {
|
|
79
|
-
model.views
|
|
79
|
+
for (const view of model.views) {
|
|
80
80
|
const args = computeOffsets(offsetX, view);
|
|
81
81
|
if (args) {
|
|
82
82
|
const { leftOffset, rightOffset } = args;
|
|
83
83
|
view.setOffsets(leftOffset, rightOffset);
|
|
84
84
|
}
|
|
85
|
-
}
|
|
85
|
+
}
|
|
86
86
|
});
|
|
87
87
|
setGuideX(undefined);
|
|
88
88
|
}
|
|
@@ -120,9 +120,9 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
|
|
|
120
120
|
function mouseOut() {
|
|
121
121
|
setGuideX(undefined);
|
|
122
122
|
transaction(() => {
|
|
123
|
-
model.views
|
|
123
|
+
for (const view of model.views) {
|
|
124
124
|
view.setOffsets(undefined, undefined);
|
|
125
|
-
}
|
|
125
|
+
}
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
function handleClose() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { stringify } from '@jbrowse/core/util';
|
|
3
|
-
import { Tooltip
|
|
3
|
+
import { Tooltip } from '@mui/material';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
5
|
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
const useStyles = makeStyles()({
|
|
@@ -9,19 +9,16 @@ const useStyles = makeStyles()({
|
|
|
9
9
|
height: '100%',
|
|
10
10
|
width: 1,
|
|
11
11
|
position: 'absolute',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
sm: {
|
|
15
|
-
fontSize: 10,
|
|
12
|
+
background: 'red',
|
|
13
|
+
zIndex: 1001,
|
|
16
14
|
},
|
|
17
15
|
});
|
|
18
16
|
const VerticalGuide = observer(function ({ model, coordX, }) {
|
|
19
17
|
const { classes } = useStyles();
|
|
20
18
|
return (_jsx(Tooltip, { open: true, placement: "top", title: model.views
|
|
21
19
|
.map(view => view.pxToBp(coordX))
|
|
22
|
-
.map((elt, idx) => (_jsx(
|
|
20
|
+
.map((elt, idx) => (_jsx("div", { children: stringify(elt, true) }, [JSON.stringify(elt), idx].join('-')))), arrow: true, children: _jsx("div", { className: classes.guide, style: {
|
|
23
21
|
left: coordX,
|
|
24
|
-
background: 'red',
|
|
25
22
|
} }) }));
|
|
26
23
|
});
|
|
27
24
|
export default VerticalGuide;
|
|
@@ -49,6 +49,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
49
49
|
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]>;
|
|
50
50
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
51
51
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
52
|
+
init: import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined>;
|
|
52
53
|
}, {
|
|
53
54
|
width: number;
|
|
54
55
|
} & {
|
|
@@ -70,10 +71,15 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
70
71
|
leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
71
72
|
rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
72
73
|
} & {
|
|
74
|
+
readonly pinnedTracks: any[];
|
|
75
|
+
readonly unpinnedTracks: any[];
|
|
73
76
|
readonly trackLabelsSetting: any;
|
|
74
77
|
readonly width: number;
|
|
75
78
|
readonly interRegionPaddingWidth: number;
|
|
76
79
|
readonly assemblyNames: string[];
|
|
80
|
+
readonly stickyViewHeaders: boolean;
|
|
81
|
+
readonly rubberbandTop: number;
|
|
82
|
+
readonly pinnedTracksTop: number;
|
|
77
83
|
} & {
|
|
78
84
|
scaleBarDisplayPrefix(): string | undefined;
|
|
79
85
|
MiniControlsComponent(): React.FC<any>;
|
|
@@ -159,6 +165,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
159
165
|
setDraggingTrackId(idx?: string): void;
|
|
160
166
|
setScaleFactor(factor: number): void;
|
|
161
167
|
clearView(): void;
|
|
168
|
+
setInit(arg?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState): void;
|
|
162
169
|
exportSvg(opts?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").ExportSvgOptions): Promise<void>;
|
|
163
170
|
} & {
|
|
164
171
|
slide: (viewWidths: number) => void;
|
|
@@ -179,7 +186,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
179
186
|
readonly coarseVisibleLocStrings: string;
|
|
180
187
|
} & {
|
|
181
188
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
182
|
-
afterAttach(): void;
|
|
183
189
|
} & {
|
|
184
190
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
185
191
|
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
@@ -225,6 +231,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
225
231
|
} | undefined;
|
|
226
232
|
} & {
|
|
227
233
|
afterCreate(): void;
|
|
234
|
+
afterAttach(): void;
|
|
228
235
|
}, import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
229
236
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
230
237
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -247,7 +254,28 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
247
254
|
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]>;
|
|
248
255
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
249
256
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
250
|
-
|
|
257
|
+
init: import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined>;
|
|
258
|
+
}>>, {
|
|
259
|
+
id: string;
|
|
260
|
+
type: string;
|
|
261
|
+
displayName: string | undefined;
|
|
262
|
+
tracks: any[];
|
|
263
|
+
minimized: boolean;
|
|
264
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
265
|
+
offsetPx: number;
|
|
266
|
+
bpPerPx: number;
|
|
267
|
+
hideHeader: boolean;
|
|
268
|
+
hideHeaderOverview: boolean;
|
|
269
|
+
hideNoTracksActive: boolean;
|
|
270
|
+
trackSelectorType: string;
|
|
271
|
+
showCenterLine: boolean;
|
|
272
|
+
showCytobandsSetting: boolean;
|
|
273
|
+
trackLabels: string;
|
|
274
|
+
showGridlines: boolean;
|
|
275
|
+
highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType[];
|
|
276
|
+
colorByCDS: boolean;
|
|
277
|
+
showTrackOutlines: boolean;
|
|
278
|
+
}>>;
|
|
251
279
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
252
280
|
}, {
|
|
253
281
|
width: number;
|
|
@@ -335,6 +363,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
335
363
|
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]>;
|
|
336
364
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
337
365
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
366
|
+
init: import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined>;
|
|
338
367
|
}, {
|
|
339
368
|
width: number;
|
|
340
369
|
} & {
|
|
@@ -356,10 +385,15 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
356
385
|
leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
357
386
|
rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset;
|
|
358
387
|
} & {
|
|
388
|
+
readonly pinnedTracks: any[];
|
|
389
|
+
readonly unpinnedTracks: any[];
|
|
359
390
|
readonly trackLabelsSetting: any;
|
|
360
391
|
readonly width: number;
|
|
361
392
|
readonly interRegionPaddingWidth: number;
|
|
362
393
|
readonly assemblyNames: string[];
|
|
394
|
+
readonly stickyViewHeaders: boolean;
|
|
395
|
+
readonly rubberbandTop: number;
|
|
396
|
+
readonly pinnedTracksTop: number;
|
|
363
397
|
} & {
|
|
364
398
|
scaleBarDisplayPrefix(): string | undefined;
|
|
365
399
|
MiniControlsComponent(): React.FC<any>;
|
|
@@ -445,6 +479,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
445
479
|
setDraggingTrackId(idx?: string): void;
|
|
446
480
|
setScaleFactor(factor: number): void;
|
|
447
481
|
clearView(): void;
|
|
482
|
+
setInit(arg?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState): void;
|
|
448
483
|
exportSvg(opts?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").ExportSvgOptions): Promise<void>;
|
|
449
484
|
} & {
|
|
450
485
|
slide: (viewWidths: number) => void;
|
|
@@ -465,7 +500,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
465
500
|
readonly coarseVisibleLocStrings: string;
|
|
466
501
|
} & {
|
|
467
502
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
468
|
-
afterAttach(): void;
|
|
469
503
|
} & {
|
|
470
504
|
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").BpOffset): void;
|
|
471
505
|
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
@@ -511,6 +545,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
511
545
|
} | undefined;
|
|
512
546
|
} & {
|
|
513
547
|
afterCreate(): void;
|
|
548
|
+
afterAttach(): void;
|
|
514
549
|
}, import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
515
550
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
516
551
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -533,7 +568,28 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
533
568
|
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]>;
|
|
534
569
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
535
570
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
536
|
-
|
|
571
|
+
init: import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").InitState | undefined>;
|
|
572
|
+
}>>, {
|
|
573
|
+
id: string;
|
|
574
|
+
type: string;
|
|
575
|
+
displayName: string | undefined;
|
|
576
|
+
tracks: any[];
|
|
577
|
+
minimized: boolean;
|
|
578
|
+
displayedRegions: import("@jbrowse/core/util").Region[];
|
|
579
|
+
offsetPx: number;
|
|
580
|
+
bpPerPx: number;
|
|
581
|
+
hideHeader: boolean;
|
|
582
|
+
hideHeaderOverview: boolean;
|
|
583
|
+
hideNoTracksActive: boolean;
|
|
584
|
+
trackSelectorType: string;
|
|
585
|
+
showCenterLine: boolean;
|
|
586
|
+
showCytobandsSetting: boolean;
|
|
587
|
+
trackLabels: string;
|
|
588
|
+
showGridlines: boolean;
|
|
589
|
+
highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView/types").HighlightType[];
|
|
590
|
+
colorByCDS: boolean;
|
|
591
|
+
showTrackOutlines: boolean;
|
|
592
|
+
}>>;
|
|
537
593
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
538
594
|
}>>, import("mobx-state-tree")._NotCustomized>;
|
|
539
595
|
export type LinearComparativeViewStateModel = ReturnType<typeof stateModelFactory>;
|
|
@@ -64,18 +64,23 @@ function stateModelFactory(pluginManager) {
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
onSubviewAction(actionName, path, args) {
|
|
67
|
-
self.views
|
|
67
|
+
for (const view of self.views) {
|
|
68
68
|
const ret = getPath(view);
|
|
69
69
|
if (!ret.endsWith(path)) {
|
|
70
70
|
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
71
71
|
}
|
|
72
|
-
}
|
|
72
|
+
}
|
|
73
73
|
},
|
|
74
74
|
setWidth(newWidth) {
|
|
75
75
|
self.width = newWidth;
|
|
76
76
|
},
|
|
77
77
|
setViews(views) {
|
|
78
78
|
self.views = cast(views);
|
|
79
|
+
const levels = [];
|
|
80
|
+
for (let i = 0; i < views.length - 1; i++) {
|
|
81
|
+
levels.push({ level: i });
|
|
82
|
+
}
|
|
83
|
+
self.levels = cast(levels);
|
|
79
84
|
},
|
|
80
85
|
removeView(view) {
|
|
81
86
|
self.views.remove(view);
|
|
@@ -98,12 +98,12 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
98
98
|
};
|
|
99
99
|
const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
|
|
100
100
|
const features = [feat, ...suppAlns];
|
|
101
|
-
features.
|
|
101
|
+
for (const [idx, f] of features.entries()) {
|
|
102
102
|
f.refName = assembly.getCanonicalRefName(f.refName) || f.refName;
|
|
103
103
|
f.syntenyId = idx;
|
|
104
104
|
f.mate.syntenyId = idx;
|
|
105
105
|
f.mate.uniqueId = `${f.uniqueId}_mate`;
|
|
106
|
-
}
|
|
106
|
+
}
|
|
107
107
|
features.sort((a, b) => a.clipPos - b.clipPos);
|
|
108
108
|
const featSeq = feature.get('seq');
|
|
109
109
|
const configFeatureStore = [...features, ...features.map(f => f.mate)];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LinearSyntenyViewModel } from '../../model';
|
|
2
|
+
declare const LeftPanel: ({ model, selectedAssemblyNames, setSelectedAssemblyNames, selectedRow, setSelectedRow, defaultAssemblyName, onLaunch, }: {
|
|
3
|
+
model: LinearSyntenyViewModel;
|
|
4
|
+
selectedAssemblyNames: string[];
|
|
5
|
+
setSelectedAssemblyNames: (names: string[]) => void;
|
|
6
|
+
selectedRow: number;
|
|
7
|
+
setSelectedRow: (row: number) => void;
|
|
8
|
+
defaultAssemblyName: string;
|
|
9
|
+
onLaunch: () => void;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default LeftPanel;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { AssemblySelector } from '@jbrowse/core/ui';
|
|
3
|
+
import { getSession, notEmpty } from '@jbrowse/core/util';
|
|
4
|
+
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
|
5
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
6
|
+
import { Button, IconButton } from '@mui/material';
|
|
7
|
+
import { observer } from 'mobx-react';
|
|
8
|
+
import { makeStyles } from 'tss-react/mui';
|
|
9
|
+
const useStyles = makeStyles()(theme => ({
|
|
10
|
+
mb: {
|
|
11
|
+
marginBottom: 10,
|
|
12
|
+
},
|
|
13
|
+
button: {
|
|
14
|
+
margin: theme.spacing(2),
|
|
15
|
+
},
|
|
16
|
+
rel: {
|
|
17
|
+
position: 'relative',
|
|
18
|
+
},
|
|
19
|
+
synbutton: {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: 30,
|
|
22
|
+
},
|
|
23
|
+
bg: {
|
|
24
|
+
background: theme.palette.divider,
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
27
|
+
const AssemblyRows = observer(function ({ selectedRow, selectedAssemblyNames, setSelectedRow, setSelectedAssemblyNames, model, }) {
|
|
28
|
+
const { classes, cx } = useStyles();
|
|
29
|
+
const session = getSession(model);
|
|
30
|
+
return selectedAssemblyNames.map((assemblyName, idx) => (_jsxs("div", { className: classes.rel, children: [_jsxs("span", { children: ["Row ", idx + 1, ": "] }), _jsx(IconButton, { disabled: selectedAssemblyNames.length <= 2, onClick: () => {
|
|
31
|
+
model.importFormRemoveRow(idx);
|
|
32
|
+
setSelectedAssemblyNames(selectedAssemblyNames
|
|
33
|
+
.map((asm, idx2) => (idx2 === idx ? undefined : asm))
|
|
34
|
+
.filter(notEmpty));
|
|
35
|
+
if (selectedRow >= selectedAssemblyNames.length - 2) {
|
|
36
|
+
setSelectedRow(0);
|
|
37
|
+
}
|
|
38
|
+
}, children: _jsx(CloseIcon, {}) }), _jsx(AssemblySelector, { helperText: "", selected: assemblyName, onChange: newAssembly => {
|
|
39
|
+
setSelectedAssemblyNames(selectedAssemblyNames.map((asm, idx2) => idx2 === idx ? newAssembly : asm));
|
|
40
|
+
}, session: session }), idx !== selectedAssemblyNames.length - 1 ? (_jsx(IconButton, { "data-testid": "synbutton", className: cx(classes.synbutton, idx === selectedRow ? classes.bg : undefined), onClick: () => {
|
|
41
|
+
setSelectedRow(idx);
|
|
42
|
+
}, children: _jsx(ArrowForwardIosIcon, {}) })) : null] }, `${assemblyName}-${idx}`)));
|
|
43
|
+
});
|
|
44
|
+
const LeftPanel = observer(function ({ model, selectedAssemblyNames, setSelectedAssemblyNames, selectedRow, setSelectedRow, defaultAssemblyName, onLaunch, }) {
|
|
45
|
+
const { classes } = useStyles();
|
|
46
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: classes.mb, children: "Select assemblies for linear synteny view" }), _jsx(AssemblyRows, { model: model, selectedAssemblyNames: selectedAssemblyNames, setSelectedAssemblyNames: setSelectedAssemblyNames, selectedRow: selectedRow, setSelectedRow: setSelectedRow }), _jsxs("div", { children: [_jsx(Button, { className: classes.button, variant: "contained", color: "secondary", onClick: () => {
|
|
47
|
+
setSelectedAssemblyNames([
|
|
48
|
+
...selectedAssemblyNames,
|
|
49
|
+
defaultAssemblyName,
|
|
50
|
+
]);
|
|
51
|
+
}, children: "Add row" }), _jsx(Button, { className: classes.button, onClick: onLaunch, variant: "contained", color: "primary", children: "Launch" })] })] }));
|
|
52
|
+
});
|
|
53
|
+
export default LeftPanel;
|
|
@@ -1,38 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { getSession
|
|
5
|
-
import
|
|
6
|
-
import CloseIcon from '@mui/icons-material/Close';
|
|
7
|
-
import { Button, Container, IconButton } from '@mui/material';
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
|
+
import { getSession } from '@jbrowse/core/util';
|
|
5
|
+
import { Container } from '@mui/material';
|
|
8
6
|
import { observer } from 'mobx-react';
|
|
9
7
|
import { makeStyles } from 'tss-react/mui';
|
|
10
8
|
import ImportSyntenyTrackSelector from './ImportSyntenyTrackSelectorArea';
|
|
9
|
+
import LeftPanel from './LeftPanel';
|
|
11
10
|
import { doSubmit } from './doSubmit';
|
|
12
11
|
const useStyles = makeStyles()(theme => ({
|
|
13
12
|
importFormContainer: {
|
|
14
13
|
padding: theme.spacing(4),
|
|
15
14
|
},
|
|
16
|
-
button: {
|
|
17
|
-
margin: theme.spacing(2),
|
|
18
|
-
},
|
|
19
|
-
rel: {
|
|
20
|
-
position: 'relative',
|
|
21
|
-
},
|
|
22
|
-
synbutton: {
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
top: 30,
|
|
25
|
-
},
|
|
26
15
|
flex: {
|
|
27
16
|
display: 'flex',
|
|
28
17
|
gap: 90,
|
|
29
18
|
},
|
|
30
|
-
mb: {
|
|
31
|
-
marginBottom: 10,
|
|
32
|
-
},
|
|
33
|
-
bg: {
|
|
34
|
-
background: theme.palette.divider,
|
|
35
|
-
},
|
|
36
19
|
rightPanel: {
|
|
37
20
|
flexGrow: 11,
|
|
38
21
|
},
|
|
@@ -42,7 +25,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
42
25
|
},
|
|
43
26
|
}));
|
|
44
27
|
const LinearSyntenyViewImportForm = observer(function ({ model, }) {
|
|
45
|
-
const { classes
|
|
28
|
+
const { classes } = useStyles();
|
|
46
29
|
const session = getSession(model);
|
|
47
30
|
const { assemblyNames } = session;
|
|
48
31
|
const defaultAssemblyName = assemblyNames[0] || '';
|
|
@@ -52,38 +35,21 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
|
|
|
52
35
|
defaultAssemblyName,
|
|
53
36
|
]);
|
|
54
37
|
const [error, setError] = useState();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]);
|
|
72
|
-
}, children: "Add row" }), _jsx(Button, { className: classes.button, onClick: () => {
|
|
73
|
-
;
|
|
74
|
-
(async () => {
|
|
75
|
-
try {
|
|
76
|
-
setError(undefined);
|
|
77
|
-
await doSubmit({
|
|
78
|
-
selectedAssemblyNames,
|
|
79
|
-
model,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
console.error(e);
|
|
84
|
-
setError(e);
|
|
85
|
-
}
|
|
86
|
-
})();
|
|
87
|
-
}, variant: "contained", color: "primary", children: "Launch" })] })] }), _jsxs("div", { className: classes.rightPanel, children: [_jsxs("div", { children: ["Synteny dataset to display between row ", selectedRow + 1, " and", ' ', selectedRow + 2] }), _jsx(ImportSyntenyTrackSelector, { model: model, selectedRow: selectedRow, assembly1: selectedAssemblyNames[selectedRow], assembly2: selectedAssemblyNames[selectedRow + 1] })] })] })] }));
|
|
38
|
+
const handleLaunch = async () => {
|
|
39
|
+
try {
|
|
40
|
+
setError(undefined);
|
|
41
|
+
await doSubmit({
|
|
42
|
+
selectedAssemblyNames,
|
|
43
|
+
model,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.error(e);
|
|
48
|
+
setError(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return (_jsxs(Container, { className: classes.importFormContainer, children: [error ? _jsx(ErrorMessage, { error: error }) : null, _jsxs("div", { className: classes.flex, children: [_jsx("div", { className: classes.leftPanel, children: _jsx(LeftPanel, { model: model, selectedAssemblyNames: selectedAssemblyNames, setSelectedAssemblyNames: setSelectedAssemblyNames, selectedRow: selectedRow, setSelectedRow: setSelectedRow, defaultAssemblyName: defaultAssemblyName, onLaunch: () => {
|
|
52
|
+
handleLaunch();
|
|
53
|
+
} }) }), _jsxs("div", { className: classes.rightPanel, children: [_jsxs("div", { children: ["Synteny dataset to display between row ", selectedRow + 1, " and", ' ', selectedRow + 2] }), _jsx(ImportSyntenyTrackSelector, { model: model, selectedRow: selectedRow, assembly1: selectedAssemblyNames[selectedRow], assembly2: selectedAssemblyNames[selectedRow + 1] })] })] })] }));
|
|
88
54
|
});
|
|
89
55
|
export default LinearSyntenyViewImportForm;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { LinearSyntenyViewModel } from '../model';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
model: LSV;
|
|
2
|
+
declare const LinearSyntenyView: ({ model, }: {
|
|
3
|
+
model: LinearSyntenyViewModel;
|
|
5
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default LinearSyntenyView;
|
|
@@ -3,7 +3,7 @@ import { lazy } from 'react';
|
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import LinearComparativeViewComponent from '../../LinearComparativeView/components/LinearComparativeView';
|
|
5
5
|
const LinearSyntenyImportForm = lazy(() => import('./ImportForm/LinearSyntenyImportForm'));
|
|
6
|
-
const LinearSyntenyView = observer(function ({ model }) {
|
|
6
|
+
const LinearSyntenyView = observer(function ({ model, }) {
|
|
7
7
|
return !model.initialized ? (_jsx(LinearSyntenyImportForm, { model: model })) : (_jsx(LinearComparativeViewComponent, { model: model }));
|
|
8
8
|
});
|
|
9
9
|
export default LinearSyntenyView;
|