@jbrowse/plugin-linear-comparative-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/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +36 -60
- package/dist/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/dist/LGVSyntenyDisplay/components/util.js +6 -13
- package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
- package/dist/LGVSyntenyDisplay/configSchemaF.js +12 -9
- package/dist/LGVSyntenyDisplay/index.d.ts +1 -1
- package/dist/LGVSyntenyDisplay/index.js +1 -1
- package/dist/LGVSyntenyDisplay/model.d.ts +122 -69
- package/dist/LGVSyntenyDisplay/model.js +20 -37
- package/dist/LaunchLinearSyntenyView.d.ts +1 -1
- package/dist/LaunchLinearSyntenyView.js +1 -3
- package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
- package/dist/LinearComparativeDisplay/configSchemaF.js +0 -6
- package/dist/LinearComparativeDisplay/index.d.ts +1 -1
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
- package/dist/LinearComparativeDisplay/stateModelFactory.js +13 -57
- package/dist/LinearComparativeView/components/Header.d.ts +2 -3
- package/dist/LinearComparativeView/components/Header.js +56 -86
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +5 -15
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -32
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
- package/dist/LinearComparativeView/components/LinearComparativeView.js +4 -9
- package/dist/LinearComparativeView/components/Rubberband.d.ts +2 -3
- package/dist/LinearComparativeView/components/Rubberband.js +36 -69
- package/dist/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
- package/dist/LinearComparativeView/components/VerticalGuide.js +5 -9
- package/dist/LinearComparativeView/index.d.ts +1 -1
- package/dist/LinearComparativeView/index.js +17 -7
- package/dist/LinearComparativeView/model.d.ts +38 -90
- package/dist/LinearComparativeView/model.js +40 -107
- package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
- package/dist/LinearReadVsRef/LinearReadVsRef.js +10 -55
- package/dist/LinearReadVsRef/index.d.ts +1 -1
- package/dist/LinearReadVsRef/index.js +17 -9
- package/dist/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
- package/dist/LinearSyntenyDisplay/afterAttach.js +8 -12
- package/dist/LinearSyntenyDisplay/components/Component.d.ts +2 -3
- package/dist/LinearSyntenyDisplay/components/Component.js +11 -36
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +95 -106
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -6
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
- package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -3
- package/dist/LinearSyntenyDisplay/components/util.js +0 -9
- package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
- package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -15
- package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.js +1 -23
- package/dist/LinearSyntenyDisplay/index.d.ts +1 -1
- package/dist/LinearSyntenyDisplay/index.js +18 -9
- package/dist/LinearSyntenyDisplay/model.d.ts +8 -102
- package/dist/LinearSyntenyDisplay/model.js +18 -99
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +35 -76
- package/dist/LinearSyntenyView/components/Icons.d.ts +3 -4
- package/dist/LinearSyntenyView/components/Icons.js +3 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +130 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +39 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +22 -0
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -150
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +43 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +68 -0
- package/dist/LinearSyntenyView/components/ImportForm/util.js +1 -3
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +20 -10
- package/dist/LinearSyntenyView/index.d.ts +1 -1
- package/dist/LinearSyntenyView/index.js +17 -7
- package/dist/LinearSyntenyView/model.d.ts +54 -58
- package/dist/LinearSyntenyView/model.js +61 -56
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -6
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -11
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +7 -24
- package/dist/LinearSyntenyView/types.d.ts +12 -0
- package/dist/LinearSyntenyView/types.js +2 -0
- package/dist/LinearSyntenyViewHelper/index.d.ts +1 -1
- package/dist/LinearSyntenyViewHelper/index.js +2 -2
- package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
- package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +87 -0
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +5 -90
- package/dist/SyntenyFeatureDetail/index.d.ts +1 -1
- package/dist/SyntenyFeatureDetail/index.js +18 -14
- package/dist/SyntenyFeatureDetail/types.d.ts +9 -0
- package/dist/SyntenyFeatureDetail/types.js +2 -0
- package/dist/SyntenyTrack/configSchema.d.ts +1 -1
- package/dist/SyntenyTrack/configSchema.js +1 -9
- package/dist/SyntenyTrack/index.d.ts +1 -1
- package/dist/SyntenyTrack/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/util.d.ts +2 -2
- package/dist/util.js +1 -11
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +35 -36
- package/esm/LGVSyntenyDisplay/components/util.d.ts +9 -6
- package/esm/LGVSyntenyDisplay/components/util.js +6 -13
- package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
- package/esm/LGVSyntenyDisplay/configSchemaF.js +12 -9
- package/esm/LGVSyntenyDisplay/index.d.ts +1 -1
- package/esm/LGVSyntenyDisplay/index.js +1 -1
- package/esm/LGVSyntenyDisplay/model.d.ts +122 -69
- package/esm/LGVSyntenyDisplay/model.js +4 -31
- package/esm/LaunchLinearSyntenyView.d.ts +1 -1
- package/esm/LaunchLinearSyntenyView.js +1 -3
- package/esm/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
- package/esm/LinearComparativeDisplay/configSchemaF.js +0 -6
- package/esm/LinearComparativeDisplay/index.d.ts +1 -1
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
- package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -58
- package/esm/LinearComparativeView/components/Header.d.ts +2 -3
- package/esm/LinearComparativeView/components/Header.js +56 -63
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +5 -12
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -29
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
- package/esm/LinearComparativeView/components/LinearComparativeView.js +4 -9
- package/esm/LinearComparativeView/components/Rubberband.d.ts +2 -3
- package/esm/LinearComparativeView/components/Rubberband.js +36 -46
- package/esm/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
- package/esm/LinearComparativeView/components/VerticalGuide.js +5 -6
- package/esm/LinearComparativeView/index.d.ts +1 -1
- package/esm/LinearComparativeView/model.d.ts +38 -90
- package/esm/LinearComparativeView/model.js +24 -101
- package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
- package/esm/LinearReadVsRef/LinearReadVsRef.js +10 -32
- package/esm/LinearReadVsRef/index.d.ts +1 -1
- package/esm/LinearReadVsRef/index.js +1 -3
- package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/afterAttach.js +8 -12
- package/esm/LinearSyntenyDisplay/components/Component.d.ts +2 -3
- package/esm/LinearSyntenyDisplay/components/Component.js +11 -13
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +79 -100
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -3
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
- package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -3
- package/esm/LinearSyntenyDisplay/components/util.js +2 -11
- package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
- package/esm/LinearSyntenyDisplay/configSchemaF.js +0 -15
- package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +1 -23
- package/esm/LinearSyntenyDisplay/index.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/index.js +1 -2
- package/esm/LinearSyntenyDisplay/model.d.ts +8 -102
- package/esm/LinearSyntenyDisplay/model.js +1 -92
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +35 -53
- package/esm/LinearSyntenyView/components/Icons.d.ts +3 -4
- package/esm/LinearSyntenyView/components/Icons.js +3 -5
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +125 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +37 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +16 -0
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -127
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +40 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/LinearSyntenyView/components/ImportForm/getAdapter.js +65 -0
- package/esm/LinearSyntenyView/components/ImportForm/util.js +1 -3
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -3
- package/esm/LinearSyntenyView/index.d.ts +1 -1
- package/esm/LinearSyntenyView/model.d.ts +54 -58
- package/esm/LinearSyntenyView/model.js +44 -49
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -3
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +4 -9
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +8 -25
- package/esm/LinearSyntenyView/types.d.ts +12 -0
- package/esm/LinearSyntenyView/types.js +1 -0
- package/esm/LinearSyntenyViewHelper/index.d.ts +1 -1
- package/esm/LinearSyntenyViewHelper/index.js +2 -2
- package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
- package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +52 -0
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +6 -68
- package/esm/SyntenyFeatureDetail/index.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/index.js +1 -7
- package/esm/SyntenyFeatureDetail/types.d.ts +9 -0
- package/esm/SyntenyFeatureDetail/types.js +1 -0
- package/esm/SyntenyTrack/configSchema.d.ts +1 -1
- package/esm/SyntenyTrack/configSchema.js +1 -9
- package/esm/SyntenyTrack/index.d.ts +1 -1
- package/esm/SyntenyTrack/index.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +4 -4
- package/esm/util.d.ts +2 -2
- package/esm/util.js +1 -11
- package/package.json +2 -4
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -194
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -59
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -52
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -169
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
- package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +0 -4
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -34
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
- package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -23
|
@@ -1,97 +1,61 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { addDisposer, cast, getPath, types, } from 'mobx-state-tree';
|
|
3
|
-
import { autorun } from 'mobx';
|
|
4
|
-
// jbrowse
|
|
5
2
|
import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
6
|
-
import { getSession, isSessionModelWithWidgets
|
|
3
|
+
import { avg, getSession, isSessionModelWithWidgets } from '@jbrowse/core/util';
|
|
7
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
8
|
-
// icons
|
|
9
5
|
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
|
10
|
-
|
|
6
|
+
import { autorun } from 'mobx';
|
|
7
|
+
import { addDisposer, cast, getPath, onAction, types } from 'mobx-state-tree';
|
|
11
8
|
const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
|
|
12
|
-
/**
|
|
13
|
-
* #stateModel LinearComparativeView
|
|
14
|
-
* extends
|
|
15
|
-
* - [BaseViewModel](../baseviewmodel)
|
|
16
|
-
*/
|
|
17
9
|
function stateModelFactory(pluginManager) {
|
|
18
10
|
var _a;
|
|
19
11
|
const LinearSyntenyViewHelper = (_a = pluginManager.getViewType('LinearSyntenyViewHelper')) === null || _a === void 0 ? void 0 : _a.stateModel;
|
|
20
12
|
return types
|
|
21
13
|
.compose('LinearComparativeView', BaseViewModel, types.model({
|
|
22
|
-
/**
|
|
23
|
-
* #property
|
|
24
|
-
*/
|
|
25
14
|
id: ElementId,
|
|
26
|
-
/**
|
|
27
|
-
* #property
|
|
28
|
-
*/
|
|
29
15
|
type: types.literal('LinearComparativeView'),
|
|
30
|
-
/**
|
|
31
|
-
* #property
|
|
32
|
-
*/
|
|
33
16
|
trackSelectorType: 'hierarchical',
|
|
34
|
-
/**
|
|
35
|
-
* #property
|
|
36
|
-
*/
|
|
37
17
|
showIntraviewLinks: true,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
interactToggled: false,
|
|
42
|
-
/**
|
|
43
|
-
* #property
|
|
44
|
-
*/
|
|
18
|
+
linkViews: false,
|
|
19
|
+
interactiveOverlay: false,
|
|
45
20
|
levels: types.array(LinearSyntenyViewHelper),
|
|
46
|
-
/**
|
|
47
|
-
* #property
|
|
48
|
-
* currently this is limited to an array of two
|
|
49
|
-
*/
|
|
50
21
|
views: types.array(pluginManager.getViewType('LinearGenomeView')
|
|
51
22
|
.stateModel),
|
|
52
|
-
/**
|
|
53
|
-
* #property
|
|
54
|
-
* this represents tracks specific to this view specifically used for
|
|
55
|
-
* read vs ref dotplots where this track would not really apply
|
|
56
|
-
* elsewhere
|
|
57
|
-
*/
|
|
58
23
|
viewTrackConfigs: types.array(pluginManager.pluggableConfigSchemaType('track')),
|
|
59
24
|
}))
|
|
60
25
|
.volatile(() => ({
|
|
61
|
-
/**
|
|
62
|
-
* #volatile
|
|
63
|
-
*/
|
|
64
26
|
width: undefined,
|
|
65
27
|
}))
|
|
66
28
|
.views(self => ({
|
|
67
|
-
/**
|
|
68
|
-
* #getter
|
|
69
|
-
*/
|
|
70
29
|
get initialized() {
|
|
71
|
-
return (
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
73
|
-
self.width !== undefined &&
|
|
30
|
+
return (self.width !== undefined &&
|
|
74
31
|
self.views.length > 0 &&
|
|
75
32
|
self.views.every(view => view.initialized));
|
|
76
33
|
},
|
|
77
|
-
/**
|
|
78
|
-
* #getter
|
|
79
|
-
*/
|
|
80
34
|
get refNames() {
|
|
81
35
|
return self.views.map(v => [
|
|
82
36
|
...new Set(v.staticBlocks.map(m => m.refName)),
|
|
83
37
|
]);
|
|
84
38
|
},
|
|
85
|
-
/**
|
|
86
|
-
* #getter
|
|
87
|
-
*/
|
|
88
39
|
get assemblyNames() {
|
|
89
40
|
return [...new Set(self.views.flatMap(v => v.assemblyNames))];
|
|
90
41
|
},
|
|
91
42
|
}))
|
|
92
43
|
.actions(self => ({
|
|
93
|
-
|
|
94
|
-
|
|
44
|
+
afterAttach() {
|
|
45
|
+
const actions = new Set([
|
|
46
|
+
'horizontalScroll',
|
|
47
|
+
'zoomTo',
|
|
48
|
+
'setScaleFactor',
|
|
49
|
+
]);
|
|
50
|
+
addDisposer(self, onAction(self, param => {
|
|
51
|
+
if (self.linkViews) {
|
|
52
|
+
const { name, path, args } = param;
|
|
53
|
+
if (actions.has(name) && path) {
|
|
54
|
+
this.onSubviewAction(name, path, args);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
},
|
|
95
59
|
beforeDestroy() {
|
|
96
60
|
var _a;
|
|
97
61
|
const session = getSession(self);
|
|
@@ -103,40 +67,27 @@ function stateModelFactory(pluginManager) {
|
|
|
103
67
|
self.views.forEach(view => {
|
|
104
68
|
const ret = getPath(view);
|
|
105
69
|
if (!ret.endsWith(path)) {
|
|
106
|
-
// @ts-expect-error
|
|
107
70
|
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
108
71
|
}
|
|
109
72
|
});
|
|
110
73
|
},
|
|
111
|
-
/**
|
|
112
|
-
* #action
|
|
113
|
-
*/
|
|
114
74
|
setWidth(newWidth) {
|
|
115
75
|
self.width = newWidth;
|
|
116
76
|
},
|
|
117
|
-
/**
|
|
118
|
-
* #action
|
|
119
|
-
*/
|
|
120
77
|
setViews(views) {
|
|
121
78
|
self.views = cast(views);
|
|
122
79
|
},
|
|
123
|
-
/**
|
|
124
|
-
* #action
|
|
125
|
-
*/
|
|
126
80
|
removeView(view) {
|
|
127
81
|
self.views.remove(view);
|
|
128
82
|
},
|
|
129
|
-
/**
|
|
130
|
-
* #action
|
|
131
|
-
*/
|
|
132
83
|
setLevelHeight(newHeight, level = 0) {
|
|
133
84
|
const l = self.levels[level];
|
|
134
85
|
l.setHeight(newHeight);
|
|
135
86
|
return l.height;
|
|
136
87
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
88
|
+
setLinkViews(arg) {
|
|
89
|
+
self.linkViews = arg;
|
|
90
|
+
},
|
|
140
91
|
activateTrackSelector(level) {
|
|
141
92
|
if (self.trackSelectorType === 'hierarchical') {
|
|
142
93
|
const session = getSession(self);
|
|
@@ -150,32 +101,20 @@ function stateModelFactory(pluginManager) {
|
|
|
150
101
|
}
|
|
151
102
|
throw new Error(`invalid track selector type ${self.trackSelectorType}`);
|
|
152
103
|
},
|
|
153
|
-
/**
|
|
154
|
-
* #action
|
|
155
|
-
*/
|
|
156
104
|
toggleTrack(trackId, level = 0) {
|
|
157
105
|
var _a;
|
|
158
106
|
(_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.toggleTrack(trackId);
|
|
159
107
|
},
|
|
160
|
-
/**
|
|
161
|
-
* #action
|
|
162
|
-
*/
|
|
163
108
|
showTrack(trackId, level = 0, initialSnapshot = {}) {
|
|
164
109
|
if (!self.levels[level]) {
|
|
165
110
|
self.levels[level] = cast({ level });
|
|
166
111
|
}
|
|
167
112
|
self.levels[level].showTrack(trackId, initialSnapshot);
|
|
168
113
|
},
|
|
169
|
-
/**
|
|
170
|
-
* #action
|
|
171
|
-
*/
|
|
172
114
|
hideTrack(trackId, level = 0) {
|
|
173
115
|
var _a;
|
|
174
116
|
(_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.hideTrack(trackId);
|
|
175
117
|
},
|
|
176
|
-
/**
|
|
177
|
-
* #action
|
|
178
|
-
*/
|
|
179
118
|
squareView() {
|
|
180
119
|
const average = avg(self.views.map(v => v.bpPerPx));
|
|
181
120
|
for (const view of self.views) {
|
|
@@ -186,28 +125,17 @@ function stateModelFactory(pluginManager) {
|
|
|
186
125
|
}
|
|
187
126
|
}
|
|
188
127
|
},
|
|
189
|
-
/**
|
|
190
|
-
* #action
|
|
191
|
-
*/
|
|
192
128
|
clearView() {
|
|
193
129
|
self.views = cast([]);
|
|
194
130
|
self.levels = cast([]);
|
|
195
131
|
},
|
|
196
132
|
}))
|
|
197
133
|
.views(() => ({
|
|
198
|
-
/**
|
|
199
|
-
* #method
|
|
200
|
-
* includes a subset of view menu options because the full list is a
|
|
201
|
-
* little overwhelming. overridden by subclasses
|
|
202
|
-
*/
|
|
203
134
|
headerMenuItems() {
|
|
204
135
|
return [];
|
|
205
136
|
},
|
|
206
137
|
}))
|
|
207
138
|
.views(self => ({
|
|
208
|
-
/**
|
|
209
|
-
* #method
|
|
210
|
-
*/
|
|
211
139
|
menuItems() {
|
|
212
140
|
return [
|
|
213
141
|
{
|
|
@@ -225,9 +153,6 @@ function stateModelFactory(pluginManager) {
|
|
|
225
153
|
},
|
|
226
154
|
];
|
|
227
155
|
},
|
|
228
|
-
/**
|
|
229
|
-
* #method
|
|
230
|
-
*/
|
|
231
156
|
rubberBandMenuItems() {
|
|
232
157
|
return [
|
|
233
158
|
{
|
|
@@ -256,8 +181,6 @@ function stateModelFactory(pluginManager) {
|
|
|
256
181
|
},
|
|
257
182
|
}))
|
|
258
183
|
.preProcessSnapshot(snap => {
|
|
259
|
-
// @ts-expect-error
|
|
260
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
261
184
|
const { tracks, levels = [{ tracks, level: 0 }], ...rest } = snap || {};
|
|
262
185
|
return {
|
|
263
186
|
...rest,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Feature } from '@jbrowse/core/util';
|
|
1
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
3
2
|
export default function ReadVsRefDialog({ track, feature: preFeature, handleClose, }: {
|
|
4
3
|
feature: Feature;
|
|
5
4
|
handleClose: () => void;
|
|
6
5
|
track: any;
|
|
7
|
-
}):
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
5
3
|
import { getConf } from '@jbrowse/core/configuration';
|
|
4
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
5
|
+
import { gatherOverlaps, getContainingView, getSession, } from '@jbrowse/core/util';
|
|
6
6
|
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
7
|
-
import { getSession, getContainingView, gatherOverlaps, } from '@jbrowse/core/util';
|
|
8
|
-
// locals
|
|
9
7
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
8
|
+
import { Button, CircularProgress, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
9
|
+
import { makeStyles } from 'tss-react/mui';
|
|
10
10
|
const { featurizeSA, getClip, getLength, getLengthSansClipping, getTag } = MismatchParser;
|
|
11
11
|
const useStyles = makeStyles()({
|
|
12
12
|
root: {
|
|
@@ -15,16 +15,11 @@ const useStyles = makeStyles()({
|
|
|
15
15
|
});
|
|
16
16
|
export default function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
17
17
|
const { classes } = useStyles();
|
|
18
|
-
// window size stored as string, because it corresponds to a textfield which
|
|
19
|
-
// is parsed as number on submit
|
|
20
18
|
const [windowSizeText, setWindowSize] = useState('0');
|
|
21
19
|
const [error, setError] = useState();
|
|
22
20
|
const [primaryFeature, setPrimaryFeature] = useState();
|
|
23
21
|
const windowSize = +windowSizeText;
|
|
24
|
-
// we need to fetch the primary alignment if the selected feature is 2048.
|
|
25
|
-
// this should be the first in the list of the SA tag
|
|
26
22
|
useEffect(() => {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
28
23
|
;
|
|
29
24
|
(async () => {
|
|
30
25
|
setError(undefined);
|
|
@@ -87,9 +82,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
87
82
|
const assemblyNames = [trackAssembly, readAssembly];
|
|
88
83
|
const trackId = `track-${Date.now()}`;
|
|
89
84
|
const trackName = `${readName}_vs_${trackAssembly}`;
|
|
90
|
-
// get the canonical refname for the read because if the
|
|
91
|
-
// read.get('refName') is chr1 and the actual fasta refName is 1 then no
|
|
92
|
-
// tracks can be opened on the top panel of the linear read vs ref
|
|
93
85
|
const { assemblyManager } = session;
|
|
94
86
|
const assembly = assemblyManager.get(trackAssembly);
|
|
95
87
|
if (!assembly) {
|
|
@@ -104,9 +96,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
104
96
|
start: clipPos,
|
|
105
97
|
end: clipPos + getLengthSansClipping(cigar),
|
|
106
98
|
};
|
|
107
|
-
// if secondary alignment or supplementary, calculate length from SA[0]'s
|
|
108
|
-
// CIGAR which is the primary alignments. otherwise it is the primary
|
|
109
|
-
// alignment just use seq.length if primary alignment
|
|
110
99
|
const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
|
|
111
100
|
const features = [feat, ...suppAlns];
|
|
112
101
|
features.forEach((f, idx) => {
|
|
@@ -117,8 +106,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
117
106
|
});
|
|
118
107
|
features.sort((a, b) => a.clipPos - b.clipPos);
|
|
119
108
|
const featSeq = feature.get('seq');
|
|
120
|
-
// the config feature store includes synthetic mate features
|
|
121
|
-
// mapped to the read assembly
|
|
122
109
|
const configFeatureStore = [...features, ...features.map(f => f.mate)];
|
|
123
110
|
const expand = 2 * windowSize;
|
|
124
111
|
const refLen = features.reduce((a, f) => a + f.end - f.start + expand, 0);
|
|
@@ -144,7 +131,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
144
131
|
{
|
|
145
132
|
start: 0,
|
|
146
133
|
end: totalLength,
|
|
147
|
-
seq: featSeq || '',
|
|
134
|
+
seq: featSeq || '',
|
|
148
135
|
refName: readName,
|
|
149
136
|
uniqueId: `${Math.random()}`,
|
|
150
137
|
},
|
|
@@ -245,16 +232,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
245
232
|
setError(e);
|
|
246
233
|
}
|
|
247
234
|
}
|
|
248
|
-
return (
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
React.createElement(CircularProgress, null))) : (React.createElement("div", { className: classes.root },
|
|
252
|
-
primaryFeature.get('flags') & 256 ? (React.createElement(Typography, { style: { color: 'orange' } }, "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment")) : null,
|
|
253
|
-
React.createElement(Typography, null, "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context."),
|
|
254
|
-
React.createElement(TextField, { value: windowSize, onChange: event => {
|
|
255
|
-
setWindowSize(event.target.value);
|
|
256
|
-
}, label: "Set window size" })))),
|
|
257
|
-
React.createElement(DialogActions, null,
|
|
258
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: handleClose }, "Cancel"),
|
|
259
|
-
React.createElement(Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit }, "Submit"))));
|
|
235
|
+
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Set window size", children: [_jsx(DialogContent, { children: error ? (_jsx(Typography, { color: "error", children: `${error}` })) : !primaryFeature ? (_jsxs("div", { children: [_jsx(Typography, { children: "To accurately perform comparison we are fetching the primary alignment. Loading primary feature..." }), _jsx(CircularProgress, {})] })) : (_jsxs("div", { className: classes.root, children: [primaryFeature.get('flags') & 256 ? (_jsx(Typography, { style: { color: 'orange' }, children: "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment" })) : null, _jsx(Typography, { children: "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context." }), _jsx(TextField, { value: windowSize, onChange: event => {
|
|
236
|
+
setWindowSize(event.target.value);
|
|
237
|
+
}, label: "Set window size" })] })) }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: handleClose, children: "Cancel" }), _jsx(Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit, children: "Submit" })] })] }));
|
|
260
238
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function LinearReadVsRefMenuItemF(pm: PluginManager): void;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
// icons
|
|
2
|
+
import { getContainingTrack, getSession } from '@jbrowse/core/util';
|
|
4
3
|
import AddIcon from '@mui/icons-material/Add';
|
|
5
|
-
// locals
|
|
6
4
|
const ReadVsRefDialog = lazy(() => import('./LinearReadVsRef'));
|
|
7
5
|
function isDisplay(elt) {
|
|
8
6
|
return elt.name === 'LinearPileupDisplay';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LinearSyntenyDisplayModel } from './model';
|
|
1
|
+
import type { LinearSyntenyDisplayModel } from './model';
|
|
2
2
|
export declare function doAfterAttach(self: LinearSyntenyDisplayModel): void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { reaction, autorun } from 'mobx';
|
|
2
|
-
import { addDisposer, getSnapshot } from 'mobx-state-tree';
|
|
3
1
|
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
4
2
|
import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
5
3
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
4
|
+
import { autorun, reaction } from 'mobx';
|
|
5
|
+
import { addDisposer, getSnapshot } from 'mobx-state-tree';
|
|
6
6
|
import { drawMouseoverSynteny, drawRef } from './drawSynteny';
|
|
7
7
|
export function doAfterAttach(self) {
|
|
8
8
|
addDisposer(self, autorun(() => {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
const view = getContainingView(self);
|
|
11
|
-
if (!view.initialized
|
|
11
|
+
if (!view.initialized ||
|
|
12
|
+
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const ctx1 = (_a = self.mainCanvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
|
|
@@ -24,25 +25,20 @@ export function doAfterAttach(self) {
|
|
|
24
25
|
}));
|
|
25
26
|
addDisposer(self, autorun(() => {
|
|
26
27
|
const view = getContainingView(self);
|
|
27
|
-
if (!view.initialized
|
|
28
|
+
if (!view.initialized ||
|
|
29
|
+
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
32
|
drawMouseoverSynteny(self);
|
|
31
33
|
}));
|
|
32
|
-
// this attempts to reduce recalculation of feature positions drawn by
|
|
33
|
-
// the synteny view
|
|
34
|
-
//
|
|
35
|
-
// uses a reaction to say "we know the positions don't change in any
|
|
36
|
-
// relevant way unless bpPerPx changes or displayedRegions changes"
|
|
37
34
|
addDisposer(self, reaction(() => {
|
|
38
35
|
const view = getContainingView(self);
|
|
39
36
|
return {
|
|
40
37
|
bpPerPx: view.views.map(v => v.bpPerPx),
|
|
41
|
-
// stringifying 'deeply' accesses the displayed regions, see
|
|
42
|
-
// issue #3456
|
|
43
38
|
displayedRegions: JSON.stringify(view.views.map(v => v.displayedRegions)),
|
|
44
39
|
features: self.features,
|
|
45
|
-
initialized: view.initialized
|
|
40
|
+
initialized: view.initialized &&
|
|
41
|
+
view.views.every(a => a.displayedRegions.length > 0 && a.initialized),
|
|
46
42
|
};
|
|
47
43
|
}, ({ initialized }) => {
|
|
48
44
|
if (!initialized) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LinearSyntenyDisplayModel } from '../model';
|
|
1
|
+
import type { LinearSyntenyDisplayModel } from '../model';
|
|
3
2
|
declare const ServerSideRenderedBlockContent: ({ model, }: {
|
|
4
3
|
model: LinearSyntenyDisplayModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default ServerSideRenderedBlockContent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
4
3
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
5
|
-
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
import LinearSyntenyRendering from './LinearSyntenyRendering';
|
|
7
7
|
const useStyles = makeStyles()(theme => {
|
|
8
8
|
const bg = theme.palette.action.disabledBackground;
|
|
@@ -25,7 +25,6 @@ const useStyles = makeStyles()(theme => {
|
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
function LoadingMessage() {
|
|
28
|
-
// only show the loading message after 300ms to prevent excessive flickering
|
|
29
28
|
const [shown, setShown] = useState(false);
|
|
30
29
|
const { classes } = useStyles();
|
|
31
30
|
useEffect(() => {
|
|
@@ -36,27 +35,26 @@ function LoadingMessage() {
|
|
|
36
35
|
clearTimeout(timeout);
|
|
37
36
|
};
|
|
38
37
|
});
|
|
39
|
-
return shown ? (
|
|
40
|
-
React.createElement(LoadingEllipses, null))) : null;
|
|
38
|
+
return shown ? (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, {}) })) : null;
|
|
41
39
|
}
|
|
42
40
|
function BlockMessage({ messageText }) {
|
|
43
41
|
const { classes } = useStyles();
|
|
44
|
-
return
|
|
42
|
+
return _jsx("div", { className: classes.blockMessage, children: messageText });
|
|
45
43
|
}
|
|
46
44
|
function BlockError({ error }) {
|
|
47
45
|
const { classes } = useStyles();
|
|
48
|
-
return
|
|
46
|
+
return _jsx("div", { className: classes.blockError, children: `${error}` });
|
|
49
47
|
}
|
|
50
48
|
const ServerSideRenderedBlockContent = observer(function ({ model, }) {
|
|
51
49
|
if (model.error) {
|
|
52
|
-
return
|
|
50
|
+
return _jsx(BlockError, { error: model.error });
|
|
53
51
|
}
|
|
54
52
|
if (model.message) {
|
|
55
|
-
return
|
|
53
|
+
return _jsx(BlockMessage, { messageText: model.message });
|
|
56
54
|
}
|
|
57
55
|
if (!model.features) {
|
|
58
|
-
return
|
|
56
|
+
return _jsx(LoadingMessage, {});
|
|
59
57
|
}
|
|
60
|
-
return
|
|
58
|
+
return _jsx(LinearSyntenyRendering, { model: model });
|
|
61
59
|
});
|
|
62
60
|
export default ServerSideRenderedBlockContent;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LinearSyntenyDisplayModel } from '../model';
|
|
1
|
+
import type { LinearSyntenyDisplayModel } from '../model';
|
|
3
2
|
declare const LinearSyntenyRendering: ({ model, }: {
|
|
4
3
|
model: LinearSyntenyDisplayModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default LinearSyntenyRendering;
|