@jbrowse/plugin-linear-comparative-view 3.7.0 → 4.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/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
package/esm/util.d.ts
CHANGED
package/esm/util.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { clamp } from '@jbrowse/core/util';
|
|
1
|
+
import { clamp, sum } from '@jbrowse/core/util';
|
|
2
2
|
const [, TOP, , BOTTOM] = [0, 1, 2, 3];
|
|
3
3
|
export function cheight(chunk) {
|
|
4
4
|
return chunk[BOTTOM] - chunk[TOP];
|
|
5
5
|
}
|
|
6
6
|
function heightFromSpecificLevel(views, trackConfigId, level) {
|
|
7
|
-
const heightUpUntilThisPoint = views
|
|
8
|
-
.slice(0, level)
|
|
9
|
-
.map(v => v.height + 7)
|
|
10
|
-
.reduce((a, b) => a + b, 0);
|
|
7
|
+
const heightUpUntilThisPoint = sum(views.slice(0, level).map(v => v.height + 7));
|
|
11
8
|
const v = views[level];
|
|
12
9
|
return (heightUpUntilThisPoint +
|
|
13
10
|
v.headerHeight +
|
|
14
|
-
v.
|
|
11
|
+
v.scalebarHeight +
|
|
15
12
|
getTrackPos(v, trackConfigId) +
|
|
16
13
|
1);
|
|
17
14
|
}
|
|
@@ -24,8 +21,7 @@ export function getTrackPos(view, trackConfigId) {
|
|
|
24
21
|
return accum;
|
|
25
22
|
}
|
|
26
23
|
export function getPxFromCoordinate(view, refName, coord) {
|
|
27
|
-
|
|
28
|
-
return (((_a = bpToPx(view, { refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
|
|
24
|
+
return (bpToPx(view, { refName, coord })?.offsetPx || 0) - view.offsetPx;
|
|
29
25
|
}
|
|
30
26
|
export function overlayYPos(trackConfigId, level, views, c, cond) {
|
|
31
27
|
const track = views[level].tracks.find(t => t.configuration === trackConfigId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -15,49 +15,43 @@
|
|
|
15
15
|
"directory": "plugins/linear-comparative-view"
|
|
16
16
|
},
|
|
17
17
|
"author": "JBrowse Team",
|
|
18
|
-
"
|
|
19
|
-
"srcMain": "src/index.ts",
|
|
20
|
-
"main": "dist/index.js",
|
|
18
|
+
"main": "esm/index.js",
|
|
21
19
|
"files": [
|
|
22
|
-
"dist",
|
|
23
20
|
"esm"
|
|
24
21
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "npm-run-all build:*",
|
|
27
|
-
"test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
|
|
28
|
-
"prepublishOnly": "yarn test",
|
|
29
|
-
"prepack": "yarn build && yarn useDist",
|
|
30
|
-
"postpack": "yarn useSrc",
|
|
31
|
-
"useDist": "node ../../scripts/useDist.js",
|
|
32
|
-
"useSrc": "node ../../scripts/useSrc.js",
|
|
33
|
-
"prebuild": "npm run clean",
|
|
34
|
-
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
35
|
-
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
36
|
-
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
|
-
},
|
|
38
22
|
"dependencies": {
|
|
39
|
-
"@jbrowse/
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"mobx": "^
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"tss-react": "^4.0.0"
|
|
23
|
+
"@jbrowse/mobx-state-tree": "^5.5.0",
|
|
24
|
+
"@mui/icons-material": "^7.3.6",
|
|
25
|
+
"@mui/material": "^7.3.6",
|
|
26
|
+
"copy-to-clipboard": "^3.3.3",
|
|
27
|
+
"@types/file-saver-es": "^2.0.3",
|
|
28
|
+
"file-saver-es": "^2.0.5",
|
|
29
|
+
"mobx": "^6.15.0",
|
|
30
|
+
"mobx-react": "^9.2.1",
|
|
31
|
+
"@jbrowse/core": "^4.0.0",
|
|
32
|
+
"@jbrowse/plugin-linear-genome-view": "^4.0.0",
|
|
33
|
+
"@jbrowse/plugin-alignments": "^4.0.0"
|
|
51
34
|
},
|
|
52
35
|
"peerDependencies": {
|
|
53
36
|
"react": ">=18.0.0",
|
|
54
37
|
"react-dom": ">=18.0.0"
|
|
55
38
|
},
|
|
56
|
-
"distModule": "esm/index.js",
|
|
57
|
-
"srcModule": "src/index.ts",
|
|
58
|
-
"module": "esm/index.js",
|
|
59
39
|
"publishConfig": {
|
|
60
40
|
"access": "public"
|
|
61
41
|
},
|
|
62
|
-
"
|
|
63
|
-
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "pnpm run /^build:/",
|
|
45
|
+
"test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
|
|
46
|
+
"prebuild": "pnpm clean",
|
|
47
|
+
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
48
|
+
"clean": "rimraf esm *.tsbuildinfo"
|
|
49
|
+
},
|
|
50
|
+
"types": "esm/index.d.ts",
|
|
51
|
+
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"types": "./esm/index.d.ts",
|
|
54
|
+
"import": "./esm/index.js"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
2
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
-
export default function LaunchSyntenyViewDialog({ session, view, feature, trackId, handleClose, }: {
|
|
4
|
-
session: AbstractSessionModel;
|
|
5
|
-
view?: LinearGenomeViewModel;
|
|
6
|
-
feature: Feature;
|
|
7
|
-
trackId: string;
|
|
8
|
-
handleClose: () => void;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = LaunchSyntenyViewDialog;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const mui_1 = require("tss-react/mui");
|
|
9
|
-
const util_1 = require("./util");
|
|
10
|
-
const useStyles = (0, mui_1.makeStyles)()({
|
|
11
|
-
padding: {
|
|
12
|
-
margin: 10,
|
|
13
|
-
border: '1px solid #ccc',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
function LaunchSyntenyViewDialog({ session, view, feature, trackId, handleClose, }) {
|
|
17
|
-
const { classes } = useStyles();
|
|
18
|
-
const inverted = feature.get('strand') === -1;
|
|
19
|
-
const hasCIGAR = !!feature.get('CIGAR');
|
|
20
|
-
const [horizontallyFlip, setHorizontallyFlip] = (0, react_1.useState)(inverted);
|
|
21
|
-
const [windowSize, setWindowSize] = (0, react_1.useState)('1000');
|
|
22
|
-
const [useRegionOfInterest, setUseRegionOfInterest] = (0, react_1.useState)(true);
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, title: "Launch synteny view", onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [view && hasCIGAR ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { className: classes.padding, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: useRegionOfInterest, onChange: event => {
|
|
24
|
-
setUseRegionOfInterest(event.target.checked);
|
|
25
|
-
} }), label: "Use CIGAR string to navigate the current visible to the target" })) : null, inverted ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { className: classes.padding, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: horizontallyFlip, onChange: event => {
|
|
26
|
-
setHorizontallyFlip(event.target.checked);
|
|
27
|
-
} }), label: "Note: The feature is inverted in orientation on the target\n sequence. This will result in the lower panel having genomic\n coordinates decreasing left to right. Horizontally flip?" })) : null, (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Add window size in bp", value: windowSize, onChange: event => {
|
|
28
|
-
setWindowSize(event.target.value);
|
|
29
|
-
} })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
30
|
-
;
|
|
31
|
-
(async () => {
|
|
32
|
-
try {
|
|
33
|
-
await (0, util_1.navToSynteny)({
|
|
34
|
-
feature,
|
|
35
|
-
windowSize: +windowSize,
|
|
36
|
-
horizontallyFlip,
|
|
37
|
-
trackId,
|
|
38
|
-
session,
|
|
39
|
-
region: useRegionOfInterest
|
|
40
|
-
? view === null || view === void 0 ? void 0 : view.dynamicBlocks.contentBlocks[0]
|
|
41
|
-
: undefined,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
console.error(e);
|
|
46
|
-
session.notifyError(`${e}`, e);
|
|
47
|
-
}
|
|
48
|
-
})();
|
|
49
|
-
handleClose();
|
|
50
|
-
}, children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
51
|
-
handleClose();
|
|
52
|
-
}, children: "Cancel" })] })] }));
|
|
53
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
2
|
-
export interface SimpleRegion {
|
|
3
|
-
refName: string;
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function navToSynteny({ feature, windowSize: ws, session, trackId, region, horizontallyFlip, }: {
|
|
8
|
-
windowSize: number;
|
|
9
|
-
trackId: string;
|
|
10
|
-
horizontallyFlip: boolean;
|
|
11
|
-
feature: Feature;
|
|
12
|
-
session: AbstractSessionModel;
|
|
13
|
-
region?: SimpleRegion;
|
|
14
|
-
}): Promise<void>;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.navToSynteny = navToSynteny;
|
|
4
|
-
const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
|
|
5
|
-
const { parseCigar } = plugin_alignments_1.MismatchParser;
|
|
6
|
-
function findPosInCigar(cigar, startX) {
|
|
7
|
-
let featX = 0;
|
|
8
|
-
let mateX = 0;
|
|
9
|
-
for (let i = 0; i < cigar.length; i++) {
|
|
10
|
-
const len = +cigar[i];
|
|
11
|
-
const op = cigar[i + 1];
|
|
12
|
-
const min = Math.min(len, startX - featX);
|
|
13
|
-
if (featX >= startX) {
|
|
14
|
-
break;
|
|
15
|
-
}
|
|
16
|
-
if (op === 'I') {
|
|
17
|
-
mateX += len;
|
|
18
|
-
}
|
|
19
|
-
else if (op === 'D') {
|
|
20
|
-
featX += min;
|
|
21
|
-
}
|
|
22
|
-
else if (op === 'M' || op === '=' || op === 'X') {
|
|
23
|
-
mateX += min;
|
|
24
|
-
featX += min;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return [featX, mateX];
|
|
28
|
-
}
|
|
29
|
-
async function navToSynteny({ feature, windowSize: ws, session, trackId, region, horizontallyFlip, }) {
|
|
30
|
-
const cigar = feature.get('CIGAR');
|
|
31
|
-
const strand = feature.get('strand');
|
|
32
|
-
const featRef = feature.get('refName');
|
|
33
|
-
const featAsm = feature.get('assemblyName');
|
|
34
|
-
const featStart = feature.get('start');
|
|
35
|
-
const featEnd = feature.get('end');
|
|
36
|
-
const mate = feature.get('mate');
|
|
37
|
-
const mateStart = mate.start;
|
|
38
|
-
const mateEnd = mate.end;
|
|
39
|
-
const mateAsm = mate.assemblyName;
|
|
40
|
-
const mateRef = mate.refName;
|
|
41
|
-
let rMateStart;
|
|
42
|
-
let rMateEnd;
|
|
43
|
-
let rFeatStart;
|
|
44
|
-
let rFeatEnd;
|
|
45
|
-
if (region && cigar) {
|
|
46
|
-
const regStart = region.start;
|
|
47
|
-
const regEnd = region.end;
|
|
48
|
-
const p = parseCigar(cigar);
|
|
49
|
-
const [fStartX, mStartX] = findPosInCigar(p, regStart - featStart);
|
|
50
|
-
const [fEndX, mEndX] = findPosInCigar(p, regEnd - featStart);
|
|
51
|
-
const flipper = strand === -1 ? -1 : 1;
|
|
52
|
-
rFeatStart = featStart + fStartX;
|
|
53
|
-
rFeatEnd = featStart + fEndX;
|
|
54
|
-
rMateStart = (strand === -1 ? mateEnd : mateStart) + mStartX * flipper;
|
|
55
|
-
rMateEnd = (strand === -1 ? mateEnd : mateStart) + mEndX * flipper;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
rFeatStart = featStart;
|
|
59
|
-
rFeatEnd = featEnd;
|
|
60
|
-
rMateStart = mateStart;
|
|
61
|
-
rMateEnd = mateEnd;
|
|
62
|
-
}
|
|
63
|
-
const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
|
|
64
|
-
const m1 = Math.min(rMateStart, rMateEnd);
|
|
65
|
-
const m2 = Math.max(rMateStart, rMateEnd);
|
|
66
|
-
const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
|
|
67
|
-
session.addView('LinearSyntenyView', {
|
|
68
|
-
type: 'LinearSyntenyView',
|
|
69
|
-
views: [
|
|
70
|
-
{
|
|
71
|
-
type: 'LinearGenomeView',
|
|
72
|
-
hideHeader: true,
|
|
73
|
-
init: {
|
|
74
|
-
assembly: featAsm,
|
|
75
|
-
loc: l1,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
type: 'LinearGenomeView',
|
|
80
|
-
hideHeader: true,
|
|
81
|
-
init: {
|
|
82
|
-
assembly: mateAsm,
|
|
83
|
-
loc: l2,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
tracks: [
|
|
88
|
-
{
|
|
89
|
-
configuration: trackId,
|
|
90
|
-
type: 'SyntenyTrack',
|
|
91
|
-
displays: [
|
|
92
|
-
{
|
|
93
|
-
type: 'LinearSyntenyDisplay',
|
|
94
|
-
configuration: `${trackId}-LinearSyntenyDisplay`,
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
});
|
|
100
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
|
-
mouseover: {
|
|
4
|
-
type: string;
|
|
5
|
-
defaultValue: string;
|
|
6
|
-
};
|
|
7
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
8
|
-
defaultRendering: {
|
|
9
|
-
type: string;
|
|
10
|
-
model: import("mobx-state-tree").ISimpleType<string>;
|
|
11
|
-
defaultValue: string;
|
|
12
|
-
};
|
|
13
|
-
renderers: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
14
|
-
PileupRenderer: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
15
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
16
|
-
maxFeatureScreenDensity: {
|
|
17
|
-
type: string;
|
|
18
|
-
description: string;
|
|
19
|
-
defaultValue: number;
|
|
20
|
-
};
|
|
21
|
-
colorBy: {
|
|
22
|
-
type: string;
|
|
23
|
-
description: string;
|
|
24
|
-
defaultValue: {
|
|
25
|
-
type: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
filterBy: {
|
|
29
|
-
type: string;
|
|
30
|
-
description: string;
|
|
31
|
-
defaultValue: {
|
|
32
|
-
flagInclude: number;
|
|
33
|
-
flagExclude: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
37
|
-
renderer: import("mobx-state-tree").IAnyModelType;
|
|
38
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
39
|
-
maxFeatureScreenDensity: {
|
|
40
|
-
type: string;
|
|
41
|
-
description: string;
|
|
42
|
-
defaultValue: number;
|
|
43
|
-
};
|
|
44
|
-
fetchSizeLimit: {
|
|
45
|
-
type: string;
|
|
46
|
-
defaultValue: number;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
|
-
height: {
|
|
50
|
-
type: string;
|
|
51
|
-
defaultValue: number;
|
|
52
|
-
description: string;
|
|
53
|
-
};
|
|
54
|
-
mouseover: {
|
|
55
|
-
type: string;
|
|
56
|
-
description: string;
|
|
57
|
-
defaultValue: string;
|
|
58
|
-
contextVariable: string[];
|
|
59
|
-
};
|
|
60
|
-
jexlFilters: {
|
|
61
|
-
type: string;
|
|
62
|
-
description: string;
|
|
63
|
-
defaultValue: never[];
|
|
64
|
-
};
|
|
65
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>, undefined>>;
|
|
66
|
-
export default configSchemaF;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
|
|
6
|
-
function configSchemaF(pluginManager) {
|
|
7
|
-
pluginManager.jexl.addFunction('lgvSyntenyTooltip', (f) => {
|
|
8
|
-
const mate = f.get('mate');
|
|
9
|
-
const l1name = f.get('name') || f.get('id');
|
|
10
|
-
const l2name = (mate === null || mate === void 0 ? void 0 : mate.name) || (mate === null || mate === void 0 ? void 0 : mate.id);
|
|
11
|
-
return [
|
|
12
|
-
l1name ? `Name1: ${l1name}` : '',
|
|
13
|
-
l2name ? `Name2: ${l2name}` : '',
|
|
14
|
-
`Loc1: ${(0, util_1.assembleLocString)({
|
|
15
|
-
refName: f.get('refName'),
|
|
16
|
-
start: f.get('start'),
|
|
17
|
-
end: f.get('end'),
|
|
18
|
-
})} (${(0, util_1.toLocale)(f.get('end') - f.get('start'))}bp)`,
|
|
19
|
-
`Loc2: ${(0, util_1.assembleLocString)({
|
|
20
|
-
refName: mate.refName,
|
|
21
|
-
start: mate.start,
|
|
22
|
-
end: mate.end,
|
|
23
|
-
})} (${(0, util_1.toLocale)(mate.end - mate.start)}bp)`,
|
|
24
|
-
]
|
|
25
|
-
.filter(f => !!f)
|
|
26
|
-
.join('<br/>');
|
|
27
|
-
});
|
|
28
|
-
return (0, configuration_1.ConfigurationSchema)('LGVSyntenyDisplay', {
|
|
29
|
-
mouseover: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
defaultValue: 'jexl:lgvSyntenyTooltip(feature)',
|
|
32
|
-
},
|
|
33
|
-
}, {
|
|
34
|
-
baseConfiguration: (0, plugin_alignments_1.linearPileupDisplayConfigSchemaFactory)(pluginManager),
|
|
35
|
-
explicitlyTyped: true,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
exports.default = configSchemaF;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = LGVSyntenyDisplayF;
|
|
7
|
-
const DisplayType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/DisplayType"));
|
|
8
|
-
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
9
|
-
const configSchemaF_1 = __importDefault(require("./configSchemaF"));
|
|
10
|
-
const model_1 = __importDefault(require("./model"));
|
|
11
|
-
function LGVSyntenyDisplayF(pluginManager) {
|
|
12
|
-
pluginManager.addDisplayType(() => {
|
|
13
|
-
const configSchema = (0, configSchemaF_1.default)(pluginManager);
|
|
14
|
-
const stateModel = (0, model_1.default)(configSchema);
|
|
15
|
-
return new DisplayType_1.default({
|
|
16
|
-
name: 'LGVSyntenyDisplay',
|
|
17
|
-
configSchema,
|
|
18
|
-
stateModel,
|
|
19
|
-
trackType: 'SyntenyTrack',
|
|
20
|
-
viewType: 'LinearGenomeView',
|
|
21
|
-
ReactComponent: plugin_linear_genome_view_1.BaseLinearDisplayComponent,
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|