@jbrowse/plugin-linear-comparative-view 3.7.0 → 4.0.1
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/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +3 -3
- package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +9 -9
- package/esm/LGVSyntenyDisplay/configSchemaF.js +1 -1
- package/esm/LGVSyntenyDisplay/index.js +2 -2
- package/esm/LGVSyntenyDisplay/model.d.ts +1179 -133
- package/esm/LGVSyntenyDisplay/model.js +2 -2
- package/esm/LaunchLinearSyntenyView.js +13 -86
- package/esm/LinearComparativeDisplay/configSchemaF.d.ts +1 -1
- package/esm/LinearComparativeDisplay/index.js +2 -2
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +95 -135
- package/esm/LinearComparativeDisplay/stateModelFactory.js +18 -17
- package/esm/LinearComparativeView/components/ColorBySelector.d.ts +1 -1
- package/esm/LinearComparativeView/components/ColorBySelector.js +3 -4
- package/esm/LinearComparativeView/components/Header.d.ts +1 -1
- package/esm/LinearComparativeView/components/Header.js +8 -9
- package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -2
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
- package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +9 -8
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
- package/esm/LinearComparativeView/components/LinearComparativeView.js +5 -5
- package/esm/LinearComparativeView/components/MinLengthSlider.d.ts +1 -1
- package/esm/LinearComparativeView/components/MinLengthSlider.js +7 -7
- package/esm/LinearComparativeView/components/OpacitySlider.d.ts +1 -1
- package/esm/LinearComparativeView/components/OpacitySlider.js +5 -6
- package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearComparativeView/components/Rubberband.js +5 -5
- package/esm/LinearComparativeView/components/RubberbandSpan.js +3 -5
- package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearComparativeView/components/VerticalGuide.js +2 -2
- package/esm/LinearComparativeView/components/useRangeSelect.d.ts +1 -1
- package/esm/LinearComparativeView/components/useRangeSelect.js +1 -1
- package/esm/LinearComparativeView/components/util.js +1 -1
- package/esm/LinearComparativeView/index.js +2 -2
- package/esm/LinearComparativeView/model.d.ts +474 -222
- package/esm/LinearComparativeView/model.js +50 -29
- package/esm/LinearReadVsRef/LinearReadVsRef.js +8 -9
- package/esm/LinearReadVsRef/index.js +1 -1
- package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/afterAttach.js +10 -11
- package/esm/LinearSyntenyDisplay/components/BlockError.js +1 -1
- package/esm/LinearSyntenyDisplay/components/BlockMessage.js +6 -15
- package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/Component.js +5 -5
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +10 -14
- package/esm/LinearSyntenyDisplay/components/LoadingMessage.js +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +8 -33
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/esm/LinearSyntenyDisplay/components/util.d.ts +2 -2
- package/esm/LinearSyntenyDisplay/components/util.js +3 -3
- package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +2 -2
- package/esm/LinearSyntenyDisplay/configSchemaF.js +1 -1
- package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.d.ts +2 -0
- package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.js +53 -0
- package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +3 -5
- package/esm/LinearSyntenyDisplay/index.js +3 -3
- package/esm/LinearSyntenyDisplay/model.d.ts +97 -137
- package/esm/LinearSyntenyDisplay/model.js +3 -3
- package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +1 -1
- package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.js +2 -2
- package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +6 -2
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +4 -4
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +4 -5
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +11 -1
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +8 -4
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.js +26 -9
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +5 -5
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +1 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +2 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +2 -2
- package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +3 -3
- package/esm/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
- package/esm/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +4 -4
- package/esm/LinearSyntenyView/components/ImportForm/selectors/index.js +4 -4
- package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
- package/esm/LinearSyntenyView/components/LinearSyntenyView.js +14 -4
- package/esm/LinearSyntenyView/index.js +2 -2
- package/esm/LinearSyntenyView/model.d.ts +522 -254
- package/esm/LinearSyntenyView/model.js +99 -15
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +3 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -3
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -2
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +34 -31
- package/esm/LinearSyntenyView/types.d.ts +10 -1
- package/esm/LinearSyntenyViewHelper/index.js +1 -1
- package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +11 -11
- package/esm/LinearSyntenyViewHelper/stateModelFactory.js +5 -43
- package/esm/SyntenyFeatureDetail/Formatter.js +2 -2
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +6 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -3
- package/esm/SyntenyFeatureDetail/index.js +2 -2
- package/esm/SyntenyTrack/configSchema.d.ts +16 -11
- package/esm/SyntenyTrack/index.js +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +11 -14
- package/esm/util.d.ts +1 -1
- package/esm/util.js +4 -8
- package/package.json +29 -35
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +0 -9
- package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -53
- package/dist/LGVSyntenyDisplay/components/util.d.ts +0 -14
- package/dist/LGVSyntenyDisplay/components/util.js +0 -100
- package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +0 -66
- package/dist/LGVSyntenyDisplay/configSchemaF.js +0 -38
- package/dist/LGVSyntenyDisplay/index.d.ts +0 -2
- package/dist/LGVSyntenyDisplay/index.js +0 -24
- package/dist/LGVSyntenyDisplay/model.d.ts +0 -418
- package/dist/LGVSyntenyDisplay/model.js +0 -118
- package/dist/LaunchLinearSyntenyView.d.ts +0 -2
- package/dist/LaunchLinearSyntenyView.js +0 -93
- package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -2
- package/dist/LinearComparativeDisplay/configSchemaF.js +0 -10
- package/dist/LinearComparativeDisplay/index.d.ts +0 -2
- package/dist/LinearComparativeDisplay/index.js +0 -24
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +0 -243
- package/dist/LinearComparativeDisplay/stateModelFactory.js +0 -146
- package/dist/LinearComparativeView/components/ColorBySelector.d.ts +0 -5
- package/dist/LinearComparativeView/components/ColorBySelector.js +0 -54
- package/dist/LinearComparativeView/components/Header.d.ts +0 -5
- package/dist/LinearComparativeView/components/Header.js +0 -87
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +0 -5
- package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +0 -24
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +0 -5
- package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +0 -46
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +0 -5
- package/dist/LinearComparativeView/components/LinearComparativeView.js +0 -30
- package/dist/LinearComparativeView/components/MinLengthSlider.d.ts +0 -5
- package/dist/LinearComparativeView/components/MinLengthSlider.js +0 -47
- package/dist/LinearComparativeView/components/OpacitySlider.d.ts +0 -5
- package/dist/LinearComparativeView/components/OpacitySlider.js +0 -46
- package/dist/LinearComparativeView/components/Rubberband.d.ts +0 -7
- package/dist/LinearComparativeView/components/Rubberband.js +0 -32
- package/dist/LinearComparativeView/components/RubberbandSpan.d.ts +0 -15
- package/dist/LinearComparativeView/components/RubberbandSpan.js +0 -38
- package/dist/LinearComparativeView/components/RubberbandTooltip.d.ts +0 -5
- package/dist/LinearComparativeView/components/RubberbandTooltip.js +0 -20
- package/dist/LinearComparativeView/components/SliderTooltip.d.ts +0 -2
- package/dist/LinearComparativeView/components/SliderTooltip.js +0 -9
- package/dist/LinearComparativeView/components/VerticalGuide.d.ts +0 -7
- package/dist/LinearComparativeView/components/VerticalGuide.js +0 -26
- package/dist/LinearComparativeView/components/useRangeSelect.d.ts +0 -59
- package/dist/LinearComparativeView/components/useRangeSelect.js +0 -124
- package/dist/LinearComparativeView/components/util.d.ts +0 -4
- package/dist/LinearComparativeView/components/util.js +0 -6
- package/dist/LinearComparativeView/index.d.ts +0 -2
- package/dist/LinearComparativeView/index.js +0 -55
- package/dist/LinearComparativeView/model.d.ts +0 -606
- package/dist/LinearComparativeView/model.js +0 -238
- package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +0 -6
- package/dist/LinearReadVsRef/LinearReadVsRef.js +0 -241
- package/dist/LinearReadVsRef/index.d.ts +0 -2
- package/dist/LinearReadVsRef/index.js +0 -86
- package/dist/LinearSyntenyDisplay/afterAttach.d.ts +0 -2
- package/dist/LinearSyntenyDisplay/afterAttach.js +0 -104
- package/dist/LinearSyntenyDisplay/components/BlockError.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/BlockError.js +0 -16
- package/dist/LinearSyntenyDisplay/components/BlockMessage.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/BlockMessage.js +0 -24
- package/dist/LinearSyntenyDisplay/components/Component.d.ts +0 -5
- package/dist/LinearSyntenyDisplay/components/Component.js +0 -26
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +0 -5
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +0 -223
- package/dist/LinearSyntenyDisplay/components/LoadingMessage.d.ts +0 -3
- package/dist/LinearSyntenyDisplay/components/LoadingMessage.js +0 -21
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +0 -15
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +0 -56
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +0 -4
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +0 -13
- package/dist/LinearSyntenyDisplay/components/util.d.ts +0 -45
- package/dist/LinearSyntenyDisplay/components/util.js +0 -199
- package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +0 -12
- package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -23
- package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +0 -6
- package/dist/LinearSyntenyDisplay/drawSynteny.js +0 -470
- package/dist/LinearSyntenyDisplay/index.d.ts +0 -2
- package/dist/LinearSyntenyDisplay/index.js +0 -56
- package/dist/LinearSyntenyDisplay/model.d.ts +0 -291
- package/dist/LinearSyntenyDisplay/model.js +0 -133
- package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +0 -6
- package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.js +0 -87
- package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +0 -58
- package/dist/LinearSyntenyView/components/Icons.d.ts +0 -3
- package/dist/LinearSyntenyView/components/Icons.js +0 -12
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -81
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +0 -8
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +0 -39
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +0 -7
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +0 -22
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +0 -11
- package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.js +0 -58
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +0 -5
- package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +0 -60
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +0 -5
- package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +0 -43
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +0 -117
- package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +0 -68
- package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -19
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.js +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +0 -3
- package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +0 -20
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
- package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
- package/dist/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +0 -4
- package/dist/LinearSyntenyView/components/ImportForm/selectors/index.js +0 -27
- package/dist/LinearSyntenyView/components/ImportForm/util.d.ts +0 -10
- package/dist/LinearSyntenyView/components/ImportForm/util.js +0 -24
- package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +0 -5
- package/dist/LinearSyntenyView/components/LinearSyntenyView.js +0 -47
- package/dist/LinearSyntenyView/components/TextField2.d.ts +0 -2
- package/dist/LinearSyntenyView/components/TextField2.js +0 -8
- package/dist/LinearSyntenyView/index.d.ts +0 -2
- package/dist/LinearSyntenyView/index.js +0 -52
- package/dist/LinearSyntenyView/model.d.ts +0 -702
- package/dist/LinearSyntenyView/model.js +0 -240
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +0 -5
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +0 -10
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +0 -11
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +0 -11
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +0 -3
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +0 -80
- package/dist/LinearSyntenyView/types.d.ts +0 -29
- package/dist/LinearSyntenyView/types.js +0 -2
- package/dist/LinearSyntenyView/util/diagonalize.d.ts +0 -27
- package/dist/LinearSyntenyView/util/diagonalize.js +0 -91
- package/dist/LinearSyntenyViewHelper/index.d.ts +0 -2
- package/dist/LinearSyntenyViewHelper/index.js +0 -25
- package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +0 -18
- package/dist/LinearSyntenyViewHelper/stateModelFactory.js +0 -78
- package/dist/SyntenyFeatureDetail/Formatter.d.ts +0 -3
- package/dist/SyntenyFeatureDetail/Formatter.js +0 -23
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +0 -7
- package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +0 -87
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +0 -5
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +0 -19
- package/dist/SyntenyFeatureDetail/index.d.ts +0 -2
- package/dist/SyntenyFeatureDetail/index.js +0 -60
- package/dist/SyntenyFeatureDetail/types.d.ts +0 -9
- package/dist/SyntenyFeatureDetail/types.js +0 -2
- package/dist/SyntenyTrack/configSchema.d.ts +0 -80
- package/dist/SyntenyTrack/configSchema.js +0 -9
- package/dist/SyntenyTrack/index.d.ts +0 -2
- package/dist/SyntenyTrack/index.js +0 -19
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -48
- package/dist/util.d.ts +0 -25
- package/dist/util.js +0 -67
|
@@ -2,13 +2,12 @@ import { lazy } from 'react';
|
|
|
2
2
|
import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
3
3
|
import { avg, getSession, isSessionModelWithWidgets } from '@jbrowse/core/util';
|
|
4
4
|
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
5
|
+
import { addDisposer, addMiddleware, cast, getPath, types, } from '@jbrowse/mobx-state-tree';
|
|
5
6
|
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
|
6
7
|
import { autorun } from 'mobx';
|
|
7
|
-
import { addDisposer, cast, getPath, onAction, types } from 'mobx-state-tree';
|
|
8
8
|
const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
|
|
9
9
|
function stateModelFactory(pluginManager) {
|
|
10
|
-
|
|
11
|
-
const LinearSyntenyViewHelper = (_a = pluginManager.getViewType('LinearSyntenyViewHelper')) === null || _a === void 0 ? void 0 : _a.stateModel;
|
|
10
|
+
const LinearSyntenyViewHelper = pluginManager.getViewType('LinearSyntenyViewHelper')?.stateModel;
|
|
12
11
|
return types
|
|
13
12
|
.compose('LinearComparativeView', BaseViewModel, types.model({
|
|
14
13
|
id: ElementId,
|
|
@@ -25,6 +24,7 @@ function stateModelFactory(pluginManager) {
|
|
|
25
24
|
}))
|
|
26
25
|
.volatile(() => ({
|
|
27
26
|
width: undefined,
|
|
27
|
+
isLoading: false,
|
|
28
28
|
}))
|
|
29
29
|
.views(self => ({
|
|
30
30
|
get initialized() {
|
|
@@ -40,41 +40,49 @@ function stateModelFactory(pluginManager) {
|
|
|
40
40
|
get assemblyNames() {
|
|
41
41
|
return [...new Set(self.views.flatMap(v => v.assemblyNames))];
|
|
42
42
|
},
|
|
43
|
+
get loadingMessage() {
|
|
44
|
+
return this.showLoading ? 'Loading' : undefined;
|
|
45
|
+
},
|
|
46
|
+
get showLoading() {
|
|
47
|
+
return self.isLoading || (!this.initialized && self.views.length > 0);
|
|
48
|
+
},
|
|
43
49
|
}))
|
|
44
50
|
.actions(self => ({
|
|
45
51
|
afterAttach() {
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
addDisposer(self, addMiddleware(self, (rawCall, next) => {
|
|
53
|
+
if (rawCall.type === 'action' && rawCall.id === rawCall.rootId) {
|
|
54
|
+
const syncActions = [
|
|
55
|
+
'horizontalScroll',
|
|
56
|
+
'zoomTo',
|
|
57
|
+
'setScaleFactor',
|
|
58
|
+
];
|
|
59
|
+
if (self.linkViews && syncActions.includes(rawCall.name)) {
|
|
60
|
+
const sourcePath = getPath(rawCall.context);
|
|
61
|
+
next(rawCall);
|
|
62
|
+
for (const view of self.views) {
|
|
63
|
+
const viewPath = getPath(view);
|
|
64
|
+
if (viewPath !== sourcePath) {
|
|
65
|
+
view[rawCall.name](rawCall.args[0]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
56
69
|
}
|
|
57
70
|
}
|
|
71
|
+
next(rawCall);
|
|
58
72
|
}));
|
|
59
73
|
},
|
|
60
74
|
beforeDestroy() {
|
|
61
|
-
var _a;
|
|
62
75
|
const session = getSession(self);
|
|
63
76
|
for (const name of self.assemblyNames) {
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
onSubviewAction(actionName, path, args) {
|
|
68
|
-
for (const view of self.views) {
|
|
69
|
-
const ret = getPath(view);
|
|
70
|
-
if (!ret.endsWith(path)) {
|
|
71
|
-
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
72
|
-
}
|
|
77
|
+
session.removeTemporaryAssembly?.(name);
|
|
73
78
|
}
|
|
74
79
|
},
|
|
75
80
|
setWidth(newWidth) {
|
|
76
81
|
self.width = newWidth;
|
|
77
82
|
},
|
|
83
|
+
setIsLoading(arg) {
|
|
84
|
+
self.isLoading = arg;
|
|
85
|
+
},
|
|
78
86
|
setViews(views) {
|
|
79
87
|
self.views = cast(views);
|
|
80
88
|
const levels = [];
|
|
@@ -111,8 +119,7 @@ function stateModelFactory(pluginManager) {
|
|
|
111
119
|
throw new Error(`invalid track selector type ${self.trackSelectorType}`);
|
|
112
120
|
},
|
|
113
121
|
toggleTrack(trackId, level = 0) {
|
|
114
|
-
|
|
115
|
-
(_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.toggleTrack(trackId);
|
|
122
|
+
self.levels[level]?.toggleTrack(trackId);
|
|
116
123
|
},
|
|
117
124
|
showTrack(trackId, level = 0, initialSnapshot = {}) {
|
|
118
125
|
if (!self.levels[level]) {
|
|
@@ -121,8 +128,7 @@ function stateModelFactory(pluginManager) {
|
|
|
121
128
|
self.levels[level].showTrack(trackId, initialSnapshot);
|
|
122
129
|
},
|
|
123
130
|
hideTrack(trackId, level = 0) {
|
|
124
|
-
|
|
125
|
-
(_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.hideTrack(trackId);
|
|
131
|
+
self.levels[level]?.hideTrack(trackId);
|
|
126
132
|
},
|
|
127
133
|
squareView() {
|
|
128
134
|
const average = avg(self.views.map(v => v.bpPerPx));
|
|
@@ -180,13 +186,13 @@ function stateModelFactory(pluginManager) {
|
|
|
180
186
|
}))
|
|
181
187
|
.actions(self => ({
|
|
182
188
|
afterAttach() {
|
|
183
|
-
addDisposer(self, autorun(()
|
|
189
|
+
addDisposer(self, autorun(function comparativeViewWidthAutorun() {
|
|
184
190
|
if (self.width) {
|
|
185
191
|
for (const view of self.views) {
|
|
186
192
|
view.setWidth(self.width);
|
|
187
193
|
}
|
|
188
194
|
}
|
|
189
|
-
}));
|
|
195
|
+
}, { name: 'ComparativeViewWidth' }));
|
|
190
196
|
},
|
|
191
197
|
}))
|
|
192
198
|
.preProcessSnapshot(snap => {
|
|
@@ -195,6 +201,21 @@ function stateModelFactory(pluginManager) {
|
|
|
195
201
|
...rest,
|
|
196
202
|
levels,
|
|
197
203
|
};
|
|
204
|
+
})
|
|
205
|
+
.postProcessSnapshot(snap => {
|
|
206
|
+
if (!snap) {
|
|
207
|
+
return snap;
|
|
208
|
+
}
|
|
209
|
+
const { trackSelectorType, showIntraviewLinks, linkViews, interactiveOverlay, showDynamicControls, viewTrackConfigs, ...rest } = snap;
|
|
210
|
+
return {
|
|
211
|
+
...rest,
|
|
212
|
+
...(trackSelectorType !== 'hierarchical' ? { trackSelectorType } : {}),
|
|
213
|
+
...(!showIntraviewLinks ? { showIntraviewLinks } : {}),
|
|
214
|
+
...(linkViews ? { linkViews } : {}),
|
|
215
|
+
...(interactiveOverlay ? { interactiveOverlay } : {}),
|
|
216
|
+
...(!showDynamicControls ? { showDynamicControls } : {}),
|
|
217
|
+
...(viewTrackConfigs.length ? { viewTrackConfigs } : {}),
|
|
218
|
+
};
|
|
198
219
|
});
|
|
199
220
|
}
|
|
200
221
|
export default stateModelFactory;
|
|
@@ -4,9 +4,9 @@ import { getConf } from '@jbrowse/core/configuration';
|
|
|
4
4
|
import { Dialog } from '@jbrowse/core/ui';
|
|
5
5
|
import { gatherOverlaps, getContainingView, getSession, } from '@jbrowse/core/util';
|
|
6
6
|
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
7
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
7
8
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
8
9
|
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: {
|
|
@@ -63,7 +63,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
63
63
|
})();
|
|
64
64
|
}, [preFeature, track]);
|
|
65
65
|
function onSubmit() {
|
|
66
|
-
var _a;
|
|
67
66
|
try {
|
|
68
67
|
if (!primaryFeature) {
|
|
69
68
|
return;
|
|
@@ -76,7 +75,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
76
75
|
const origStrand = feature.get('strand');
|
|
77
76
|
const SA = getTag(feature, 'SA') || '';
|
|
78
77
|
const readName = feature.get('name');
|
|
79
|
-
const
|
|
78
|
+
const clipLengthAtStartOfRead = getClip(cigar, 1);
|
|
80
79
|
const readAssembly = `${readName}_assembly_${Date.now()}`;
|
|
81
80
|
const [trackAssembly] = getConf(track, 'assemblyNames');
|
|
82
81
|
const assemblyNames = [trackAssembly, readAssembly];
|
|
@@ -89,12 +88,12 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
89
88
|
}
|
|
90
89
|
const suppAlns = featurizeSA(SA, feature.id(), origStrand, readName, true);
|
|
91
90
|
const feat = feature.toJSON();
|
|
92
|
-
feat.
|
|
91
|
+
feat.clipLengthAtStartOfRead = clipLengthAtStartOfRead;
|
|
93
92
|
feat.strand = 1;
|
|
94
93
|
feat.mate = {
|
|
95
94
|
refName: readName,
|
|
96
|
-
start:
|
|
97
|
-
end:
|
|
95
|
+
start: clipLengthAtStartOfRead,
|
|
96
|
+
end: clipLengthAtStartOfRead + getLengthSansClipping(cigar),
|
|
98
97
|
};
|
|
99
98
|
const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
|
|
100
99
|
const features = [feat, ...suppAlns];
|
|
@@ -104,7 +103,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
104
103
|
f.mate.syntenyId = idx;
|
|
105
104
|
f.mate.uniqueId = `${f.uniqueId}_mate`;
|
|
106
105
|
}
|
|
107
|
-
features.sort((a, b) => a.
|
|
106
|
+
features.sort((a, b) => a.clipLengthAtStartOfRead - b.clipLengthAtStartOfRead);
|
|
108
107
|
const featSeq = feature.get('seq');
|
|
109
108
|
const configFeatureStore = [...features, ...features.map(f => f.mate)];
|
|
110
109
|
const expand = 2 * windowSize;
|
|
@@ -117,7 +116,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
117
116
|
end: f.end + windowSize,
|
|
118
117
|
assemblyName: trackAssembly,
|
|
119
118
|
})));
|
|
120
|
-
|
|
119
|
+
session.addTemporaryAssembly?.({
|
|
121
120
|
name: readAssembly,
|
|
122
121
|
sequence: {
|
|
123
122
|
type: 'ReferenceSequenceTrack',
|
|
@@ -161,7 +160,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
161
160
|
showReverse: true,
|
|
162
161
|
showTranslation: false,
|
|
163
162
|
height: 35,
|
|
164
|
-
configuration: `${
|
|
163
|
+
configuration: `${sequenceTrackConf.trackId}-LinearReferenceSequenceDisplay`,
|
|
165
164
|
},
|
|
166
165
|
],
|
|
167
166
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { getContainingTrack, getSession } from '@jbrowse/core/util';
|
|
3
3
|
import AddIcon from '@mui/icons-material/Add';
|
|
4
|
-
const ReadVsRefDialog = lazy(() => import(
|
|
4
|
+
const ReadVsRefDialog = lazy(() => import("./LinearReadVsRef.js"));
|
|
5
5
|
function isDisplay(elt) {
|
|
6
6
|
return elt.name === 'LinearPileupDisplay';
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { LinearSyntenyDisplayModel } from './model';
|
|
1
|
+
import type { LinearSyntenyDisplayModel } from './model.ts';
|
|
2
2
|
export declare function doAfterAttach(self: LinearSyntenyDisplayModel): void;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
2
2
|
import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
3
|
+
import { addDisposer, getSnapshot } from '@jbrowse/mobx-state-tree';
|
|
3
4
|
import { MismatchParser } from '@jbrowse/plugin-alignments';
|
|
4
5
|
import { autorun, reaction } from 'mobx';
|
|
5
|
-
import {
|
|
6
|
-
import { drawCigarClickMap, drawMouseoverClickMap, drawRef, } from './drawSynteny';
|
|
6
|
+
import { drawCigarClickMap, drawMouseoverClickMap, drawRef, } from "./drawSynteny.js";
|
|
7
7
|
export function doAfterAttach(self) {
|
|
8
|
-
addDisposer(self, autorun(()
|
|
9
|
-
var _a, _b;
|
|
8
|
+
addDisposer(self, autorun(function syntenyDrawAutorun() {
|
|
10
9
|
const view = getContainingView(self);
|
|
11
10
|
if (!view.initialized ||
|
|
12
11
|
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
const ctx1 =
|
|
16
|
-
const ctx3 =
|
|
14
|
+
const ctx1 = self.mainCanvas?.getContext('2d');
|
|
15
|
+
const ctx3 = self.cigarClickMapCanvas?.getContext('2d');
|
|
17
16
|
if (!ctx1 || !ctx3) {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
@@ -23,8 +22,8 @@ export function doAfterAttach(self) {
|
|
|
23
22
|
ctx1.clearRect(0, 0, width, height);
|
|
24
23
|
drawRef(self, ctx1);
|
|
25
24
|
drawCigarClickMap(self, ctx3);
|
|
26
|
-
}));
|
|
27
|
-
addDisposer(self, autorun(()
|
|
25
|
+
}, { name: 'SyntenyDraw' }));
|
|
26
|
+
addDisposer(self, autorun(function syntenyMouseoverAutorun() {
|
|
28
27
|
const view = getContainingView(self);
|
|
29
28
|
if (!view.initialized ||
|
|
30
29
|
!view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
|
|
@@ -32,7 +31,7 @@ export function doAfterAttach(self) {
|
|
|
32
31
|
}
|
|
33
32
|
const { clickId, mouseoverId } = self;
|
|
34
33
|
drawMouseoverClickMap(self);
|
|
35
|
-
}));
|
|
34
|
+
}, { name: 'SyntenyMouseover' }));
|
|
36
35
|
addDisposer(self, reaction(() => {
|
|
37
36
|
const view = getContainingView(self);
|
|
38
37
|
return {
|
|
@@ -72,8 +71,8 @@ export function doAfterAttach(self) {
|
|
|
72
71
|
const a2 = assemblyManager.get(mate.assemblyName);
|
|
73
72
|
const r1 = f.get('refName');
|
|
74
73
|
const r2 = mate.refName;
|
|
75
|
-
const ref1 =
|
|
76
|
-
const ref2 =
|
|
74
|
+
const ref1 = a1?.getCanonicalRefName(r1) || r1;
|
|
75
|
+
const ref2 = a2?.getCanonicalRefName(r2) || r2;
|
|
77
76
|
const v1 = viewSnaps[level];
|
|
78
77
|
const v2 = viewSnaps[level + 1];
|
|
79
78
|
const p11 = bpToPx({ self: v1, refName: ref1, coord: f1s });
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles } from 'tss-react
|
|
3
|
-
const useStyles = makeStyles()(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
backgroundColor: theme.palette.background.default,
|
|
9
|
-
backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
|
|
10
|
-
textAlign: 'center',
|
|
11
|
-
},
|
|
12
|
-
blockMessage: {
|
|
13
|
-
background: '#f1f1f1',
|
|
14
|
-
padding: 10,
|
|
15
|
-
},
|
|
16
|
-
};
|
|
2
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
3
|
+
const useStyles = makeStyles()({
|
|
4
|
+
blockMessage: {
|
|
5
|
+
background: '#f1f1f1',
|
|
6
|
+
padding: 10,
|
|
7
|
+
},
|
|
17
8
|
});
|
|
18
9
|
export default function BlockMessage({ messageText }) {
|
|
19
10
|
const { classes } = useStyles();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
|
-
import BlockError from
|
|
4
|
-
import BlockMessage from
|
|
5
|
-
import LinearSyntenyRendering from
|
|
6
|
-
import LoadingMessage from
|
|
7
|
-
const ServerSideRenderedBlockContent = observer(function ({ model, }) {
|
|
3
|
+
import BlockError from "./BlockError.js";
|
|
4
|
+
import BlockMessage from "./BlockMessage.js";
|
|
5
|
+
import LinearSyntenyRendering from "./LinearSyntenyRendering.js";
|
|
6
|
+
import LoadingMessage from "./LoadingMessage.js";
|
|
7
|
+
const ServerSideRenderedBlockContent = observer(function ServerSideRenderedBlockContent({ model, }) {
|
|
8
8
|
if (model.error) {
|
|
9
9
|
return _jsx(BlockError, { error: model.error });
|
|
10
10
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { lazy, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
4
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
5
|
import { transaction } from 'mobx';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const SyntenyTooltip = lazy(() => import('./SyntenyTooltip'));
|
|
7
|
+
import { MAX_COLOR_RANGE, getId } from "../drawSynteny.js";
|
|
8
|
+
import SyntenyContextMenu from "./SyntenyContextMenu.js";
|
|
9
|
+
import { getTooltip, onSynClick, onSynContextClick } from "./util.js";
|
|
10
|
+
const SyntenyTooltip = lazy(() => import("./SyntenyTooltip.js"));
|
|
11
11
|
const useStyles = makeStyles()({
|
|
12
12
|
pix: {
|
|
13
13
|
imageRendering: 'pixelated',
|
|
@@ -26,7 +26,7 @@ const useStyles = makeStyles()({
|
|
|
26
26
|
position: 'absolute',
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
|
-
const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
29
|
+
const LinearSyntenyRendering = observer(function LinearSyntenyRendering({ model, }) {
|
|
30
30
|
const { classes } = useStyles();
|
|
31
31
|
const { mouseoverId, height } = model;
|
|
32
32
|
const xOffset = useRef(0);
|
|
@@ -50,7 +50,6 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
50
50
|
mainSyntenyCanvasRefp.current = ref;
|
|
51
51
|
}, [model, height, width]);
|
|
52
52
|
useEffect(() => {
|
|
53
|
-
var _a;
|
|
54
53
|
function onWheel(event) {
|
|
55
54
|
event.preventDefault();
|
|
56
55
|
if (event.ctrlKey) {
|
|
@@ -62,13 +61,12 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
62
61
|
clearTimeout(timeout.current);
|
|
63
62
|
}
|
|
64
63
|
timeout.current = setTimeout(() => {
|
|
65
|
-
var _a;
|
|
66
64
|
for (const v of view.views) {
|
|
67
65
|
v.setScaleFactor(1);
|
|
68
66
|
v.zoomTo(delta.current > 0
|
|
69
67
|
? v.bpPerPx * (1 + delta.current)
|
|
70
68
|
: v.bpPerPx / (1 - delta.current), event.clientX -
|
|
71
|
-
(
|
|
69
|
+
(mainSyntenyCanvasRefp.current?.getBoundingClientRect().left ||
|
|
72
70
|
0));
|
|
73
71
|
}
|
|
74
72
|
delta.current = 0;
|
|
@@ -92,10 +90,9 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
|
-
|
|
93
|
+
mainSyntenyCanvasRefp.current?.addEventListener('wheel', onWheel);
|
|
96
94
|
return () => {
|
|
97
|
-
|
|
98
|
-
(_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', onWheel);
|
|
95
|
+
mainSyntenyCanvasRefp.current?.removeEventListener('wheel', onWheel);
|
|
99
96
|
};
|
|
100
97
|
}, [model, height, width]);
|
|
101
98
|
const clickMapCanvasRef = useCallback((ref) => {
|
|
@@ -105,7 +102,6 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
105
102
|
model.setCigarClickMapCanvasRef(ref);
|
|
106
103
|
}, [model, height, width]);
|
|
107
104
|
return (_jsxs("div", { className: classes.rel, children: [_jsx("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }), _jsx("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
|
|
108
|
-
var _a;
|
|
109
105
|
if (mouseCurrDownX !== undefined) {
|
|
110
106
|
xOffset.current += mouseCurrDownX - event.clientX;
|
|
111
107
|
setMouseCurrDownX(event.clientX);
|
|
@@ -143,7 +139,7 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
143
139
|
const [r2, g2, b2] = ctx2.getImageData(x, y, 1, 1).data;
|
|
144
140
|
const unitMultiplier = Math.floor(MAX_COLOR_RANGE / model.numFeats);
|
|
145
141
|
const id = getId(r1, g1, b1, unitMultiplier);
|
|
146
|
-
model.setMouseoverId(
|
|
142
|
+
model.setMouseoverId(model.featPositions[id]?.f.id());
|
|
147
143
|
if (id === -1) {
|
|
148
144
|
setTooltip('');
|
|
149
145
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
|
-
import { makeStyles } from 'tss-react
|
|
3
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
4
|
const useStyles = makeStyles()(theme => {
|
|
5
5
|
const bg = theme.palette.action.disabledBackground;
|
|
6
6
|
return {
|
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Menu } from '@jbrowse/core/ui';
|
|
3
|
-
import { getContainingView
|
|
3
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
4
4
|
export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
|
|
5
5
|
const view = getContainingView(model);
|
|
6
6
|
const { clientX, clientY, feature } = anchorEl;
|
|
7
|
-
return (_jsx(Menu, { onMenuItemClick: (
|
|
8
|
-
callback(
|
|
7
|
+
return (_jsx(Menu, { onMenuItemClick: (_, callback) => {
|
|
8
|
+
callback();
|
|
9
9
|
onClose();
|
|
10
|
-
}, anchorEl:
|
|
11
|
-
nodeType: 1,
|
|
12
|
-
getBoundingClientRect: () => {
|
|
13
|
-
const x = clientX;
|
|
14
|
-
const y = clientY;
|
|
15
|
-
return {
|
|
16
|
-
top: y,
|
|
17
|
-
left: x,
|
|
18
|
-
bottom: y,
|
|
19
|
-
right: x,
|
|
20
|
-
width: 0,
|
|
21
|
-
height: 0,
|
|
22
|
-
x,
|
|
23
|
-
y,
|
|
24
|
-
toJSON() { },
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
}, onClose: onClose, open: Boolean(anchorEl), menuItems: [
|
|
10
|
+
}, anchorReference: "anchorPosition", anchorPosition: { top: clientY, left: clientX }, onClose: onClose, open: Boolean(anchorEl), menuItems: [
|
|
28
11
|
{
|
|
29
12
|
label: 'Center on feature',
|
|
30
13
|
onClick: () => {
|
|
@@ -35,18 +18,10 @@ export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
|
|
|
35
18
|
const mate = f.get('mate');
|
|
36
19
|
const l1 = view.views[model.level];
|
|
37
20
|
const l2 = view.views[model.level + 1];
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
l1.
|
|
41
|
-
|
|
42
|
-
console.error(l1asm, err);
|
|
43
|
-
getSession(model).notifyError(err, e);
|
|
44
|
-
});
|
|
45
|
-
l2.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`).catch((e) => {
|
|
46
|
-
const err = `${l2asm}:${e}`;
|
|
47
|
-
console.error(l2asm, err);
|
|
48
|
-
getSession(model).notifyError(err, e);
|
|
49
|
-
});
|
|
21
|
+
const center1 = (start + end) / 2;
|
|
22
|
+
const center2 = (mate.start + mate.end) / 2;
|
|
23
|
+
l1.centerAt(center1, refName);
|
|
24
|
+
l2.centerAt(center2, mate.refName);
|
|
50
25
|
},
|
|
51
26
|
},
|
|
52
27
|
] }));
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
3
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
const SyntenyTooltip = observer(function ({ title }) {
|
|
5
|
+
const SyntenyTooltip = observer(function SyntenyTooltip({ title, }) {
|
|
6
6
|
return title ? (_jsx(BaseTooltip, { children: _jsx(SanitizedHTML, { html: title }) })) : null;
|
|
7
7
|
});
|
|
8
8
|
export default SyntenyTooltip;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { LinearSyntenyDisplayModel } from '../model';
|
|
2
|
+
import type { LinearSyntenyDisplayModel } from '../model.ts';
|
|
3
3
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
4
|
interface Pos {
|
|
5
5
|
offsetPx: number;
|
|
@@ -35,7 +35,7 @@ export declare function draw(ctx: CanvasRenderingContext2D, x1: number, x2: numb
|
|
|
35
35
|
export declare function drawLocationMarkers(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number, bpPerPx1: number, bpPerPx2: number, drawCurves?: boolean): void;
|
|
36
36
|
export declare function drawBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number): void;
|
|
37
37
|
export declare function drawBezierBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number): void;
|
|
38
|
-
export declare function onSynClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel): import("../model").FeatPos | undefined;
|
|
38
|
+
export declare function onSynClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel): import("../model.ts").FeatPos | undefined;
|
|
39
39
|
export declare function onSynContextClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel, setAnchorEl: (arg: ClickCoord) => void): void;
|
|
40
40
|
export declare function getTooltip({ feature, cigarOp, cigarOpLen, }: {
|
|
41
41
|
feature: Feature;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assembleLocString, doesIntersect2, getContainingTrack, getContainingView, getSession, isSessionModelWithWidgets, toLocale, } from '@jbrowse/core/util';
|
|
2
|
-
import { MAX_COLOR_RANGE, getId } from
|
|
2
|
+
import { MAX_COLOR_RANGE, getId } from "../drawSynteny.js";
|
|
3
3
|
export function drawMatchSimple({ feature, ctx, offsets, level, cb, height, drawCurves, oobLimit, viewWidth, hideTiny, }) {
|
|
4
4
|
const { p11, p12, p21, p22 } = feature;
|
|
5
5
|
const x11 = p11.offsetPx - offsets[level];
|
|
@@ -177,8 +177,8 @@ export function getTooltip({ feature, cigarOp, cigarOpLen, }) {
|
|
|
177
177
|
`Loc1: ${assembleLocString(f1)}`,
|
|
178
178
|
`Loc2: ${assembleLocString(f2)}`,
|
|
179
179
|
`Inverted: ${f1.strand === -1}`,
|
|
180
|
-
`Query len: ${l1
|
|
181
|
-
`Target len: ${l2
|
|
180
|
+
`Query len: ${toLocale(l1)}`,
|
|
181
|
+
`Target len: ${toLocale(l2)}`,
|
|
182
182
|
identity ? `Identity: ${identity.toPrecision(2)}` : '',
|
|
183
183
|
cigarOp ? `CIGAR operator: ${toLocale(+cigarOpLen)}${cigarOp}` : '',
|
|
184
184
|
n1 ? `Name 1: ${n1}` : '',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
declare function configSchemaFactory(pluginManager: PluginManager): import("
|
|
2
|
+
declare function configSchemaFactory(pluginManager: PluginManager): import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{
|
|
3
3
|
trackIds: {
|
|
4
4
|
type: string;
|
|
5
5
|
defaultValue: never[];
|
|
@@ -8,5 +8,5 @@ declare function configSchemaFactory(pluginManager: PluginManager): import("@jbr
|
|
|
8
8
|
type: string;
|
|
9
9
|
defaultValue: boolean;
|
|
10
10
|
};
|
|
11
|
-
}, import("
|
|
11
|
+
}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
12
12
|
export default configSchemaFactory;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
import baseConfigFactory from
|
|
2
|
+
import baseConfigFactory from "../LinearComparativeDisplay/configSchemaF.js";
|
|
3
3
|
function configSchemaFactory(pluginManager) {
|
|
4
4
|
return ConfigurationSchema('LinearSyntenyDisplay', {
|
|
5
5
|
trackIds: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
2
|
+
import { drawMatchSimple } from "./components/util.js";
|
|
3
|
+
const oobLimit = 1600;
|
|
4
|
+
const fillCallback = (ctx) => {
|
|
5
|
+
ctx.fill();
|
|
6
|
+
};
|
|
7
|
+
const strokeCallback = (ctx) => {
|
|
8
|
+
ctx.stroke();
|
|
9
|
+
};
|
|
10
|
+
export function drawMouseoverClickMap(model) {
|
|
11
|
+
const { level, clickId, mouseoverId } = model;
|
|
12
|
+
const view = getContainingView(model);
|
|
13
|
+
const drawCurves = view.drawCurves;
|
|
14
|
+
const height = model.height;
|
|
15
|
+
const width = view.width;
|
|
16
|
+
const ctx = model.mouseoverCanvas?.getContext('2d');
|
|
17
|
+
const offsets = view.views.map(v => v.offsetPx);
|
|
18
|
+
if (!ctx) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
ctx.resetTransform();
|
|
22
|
+
ctx.clearRect(0, 0, width, height);
|
|
23
|
+
ctx.strokeStyle = 'rgba(0, 0, 0, 0.9)';
|
|
24
|
+
ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';
|
|
25
|
+
const feature1 = model.featMap[mouseoverId || ''];
|
|
26
|
+
if (feature1) {
|
|
27
|
+
drawMatchSimple({
|
|
28
|
+
cb: fillCallback,
|
|
29
|
+
feature: feature1,
|
|
30
|
+
level,
|
|
31
|
+
ctx,
|
|
32
|
+
oobLimit,
|
|
33
|
+
viewWidth: width,
|
|
34
|
+
drawCurves,
|
|
35
|
+
offsets,
|
|
36
|
+
height,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const feature2 = model.featMap[clickId || ''];
|
|
40
|
+
if (feature2) {
|
|
41
|
+
drawMatchSimple({
|
|
42
|
+
cb: strokeCallback,
|
|
43
|
+
feature: feature2,
|
|
44
|
+
ctx,
|
|
45
|
+
level,
|
|
46
|
+
oobLimit,
|
|
47
|
+
viewWidth: width,
|
|
48
|
+
drawCurves,
|
|
49
|
+
offsets,
|
|
50
|
+
height,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|