@jbrowse/plugin-dotplot-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/ComparativeRenderer/index.d.ts +3 -8
- package/dist/ComparativeRenderer/index.js +3 -8
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
- package/dist/DotplotDisplay/index.d.ts +1 -7
- package/dist/DotplotDisplay/index.js +2 -12
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
- package/dist/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/dist/DotplotDisplay/stateModelFactory.js +57 -100
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
- package/dist/DotplotReadVsRef/index.d.ts +1 -1
- package/dist/DotplotReadVsRef/index.js +0 -2
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
- package/dist/DotplotRenderer/configSchema.d.ts +0 -21
- package/dist/DotplotRenderer/configSchema.js +2 -27
- package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/dist/DotplotRenderer/drawDotplot.js +3 -6
- package/dist/DotplotRenderer/index.d.ts +1 -1
- package/dist/DotplotRenderer/index.js +1 -1
- package/dist/DotplotView/1dview.d.ts +2 -77
- package/dist/DotplotView/1dview.js +4 -33
- package/dist/DotplotView/components/Axes.d.ts +5 -6
- package/dist/DotplotView/components/Axes.js +26 -40
- package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
- package/dist/DotplotView/components/CursorIcon.js +3 -5
- package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
- package/dist/DotplotView/components/DotplotControls.js +94 -97
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/dist/DotplotView/components/DotplotView.d.ts +2 -3
- package/dist/DotplotView/components/DotplotView.js +80 -92
- package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/dist/DotplotView/components/DotplotWarnings.js +26 -21
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
- package/dist/DotplotView/components/Grid.d.ts +3 -4
- package/dist/DotplotView/components/Grid.js +19 -32
- package/dist/DotplotView/components/Header.d.ts +2 -3
- package/dist/DotplotView/components/Header.js +4 -23
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
- package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
- package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/dist/DotplotView/components/ImportForm/index.js +47 -97
- package/dist/DotplotView/components/ImportForm/util.js +1 -3
- package/dist/DotplotView/components/PanButtons.d.ts +2 -3
- package/dist/DotplotView/components/PanButtons.js +17 -36
- package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
- package/dist/DotplotView/components/WarningDialog.js +12 -15
- package/dist/DotplotView/components/util.d.ts +2 -7
- package/dist/DotplotView/components/util.js +0 -5
- package/dist/DotplotView/index.d.ts +1 -1
- package/dist/DotplotView/index.js +17 -8
- package/dist/DotplotView/model.d.ts +11 -133
- package/dist/DotplotView/model.js +46 -222
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/dist/DotplotView/types.d.ts +12 -0
- package/dist/DotplotView/types.js +2 -0
- package/dist/LaunchDotplotView.d.ts +1 -1
- package/dist/LaunchDotplotView.js +1 -4
- package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
- package/dist/ServerSideRenderedBlockContent.js +11 -37
- package/dist/ServerSideSyntenyRendering.d.ts +1 -6
- package/dist/ServerSideSyntenyRendering.js +4 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -6
- package/dist/util.d.ts +1 -1
- package/esm/ComparativeRenderer/index.d.ts +3 -8
- package/esm/ComparativeRenderer/index.js +3 -8
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
- package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
- package/esm/DotplotDisplay/index.d.ts +1 -7
- package/esm/DotplotDisplay/index.js +2 -12
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
- package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
- package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
- package/esm/DotplotDisplay/stateModelFactory.js +58 -101
- package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
- package/esm/DotplotReadVsRef/index.d.ts +1 -1
- package/esm/DotplotReadVsRef/index.js +0 -2
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
- package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
- package/esm/DotplotRenderer/configSchema.d.ts +0 -21
- package/esm/DotplotRenderer/configSchema.js +2 -27
- package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
- package/esm/DotplotRenderer/drawDotplot.js +4 -7
- package/esm/DotplotRenderer/index.d.ts +1 -1
- package/esm/DotplotRenderer/index.js +1 -1
- package/esm/DotplotView/1dview.d.ts +2 -77
- package/esm/DotplotView/1dview.js +4 -33
- package/esm/DotplotView/components/Axes.d.ts +5 -6
- package/esm/DotplotView/components/Axes.js +26 -37
- package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
- package/esm/DotplotView/components/CursorIcon.js +3 -5
- package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
- package/esm/DotplotView/components/DotplotControls.js +94 -97
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
- package/esm/DotplotView/components/DotplotView.d.ts +2 -3
- package/esm/DotplotView/components/DotplotView.js +63 -85
- package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
- package/esm/DotplotView/components/DotplotWarnings.js +9 -14
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
- package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
- package/esm/DotplotView/components/Grid.d.ts +3 -4
- package/esm/DotplotView/components/Grid.js +19 -29
- package/esm/DotplotView/components/Header.d.ts +2 -3
- package/esm/DotplotView/components/Header.js +4 -23
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
- package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
- package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
- package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
- package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
- package/esm/DotplotView/components/ImportForm/index.js +48 -75
- package/esm/DotplotView/components/ImportForm/util.js +1 -3
- package/esm/DotplotView/components/PanButtons.d.ts +2 -3
- package/esm/DotplotView/components/PanButtons.js +17 -36
- package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
- package/esm/DotplotView/components/WarningDialog.js +12 -12
- package/esm/DotplotView/components/util.d.ts +2 -7
- package/esm/DotplotView/components/util.js +0 -5
- package/esm/DotplotView/index.d.ts +1 -1
- package/esm/DotplotView/index.js +0 -1
- package/esm/DotplotView/model.d.ts +11 -133
- package/esm/DotplotView/model.js +30 -216
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
- package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
- package/esm/DotplotView/types.d.ts +12 -0
- package/esm/DotplotView/types.js +1 -0
- package/esm/LaunchDotplotView.d.ts +1 -1
- package/esm/LaunchDotplotView.js +1 -4
- package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
- package/esm/ServerSideRenderedBlockContent.js +11 -14
- package/esm/ServerSideSyntenyRendering.d.ts +1 -6
- package/esm/ServerSideSyntenyRendering.js +4 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -6
- package/esm/util.d.ts +1 -1
- package/package.json +2 -4
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
- package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { Typography } from '@mui/material';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
4
3
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
4
|
+
import { Typography } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
7
|
const useStyles = makeStyles()(theme => {
|
|
7
8
|
const bg = theme.palette.action.disabledBackground;
|
|
8
9
|
return {
|
|
@@ -24,7 +25,6 @@ const useStyles = makeStyles()(theme => {
|
|
|
24
25
|
};
|
|
25
26
|
});
|
|
26
27
|
function LoadingMessage() {
|
|
27
|
-
// only show the loading message after 300ms to prevent excessive flickering
|
|
28
28
|
const [shown, setShown] = useState(false);
|
|
29
29
|
const { classes } = useStyles();
|
|
30
30
|
useEffect(() => {
|
|
@@ -35,31 +35,28 @@ function LoadingMessage() {
|
|
|
35
35
|
clearTimeout(timeout);
|
|
36
36
|
};
|
|
37
37
|
}, []);
|
|
38
|
-
return shown ? (
|
|
39
|
-
React.createElement(LoadingEllipses, null))) : null;
|
|
38
|
+
return shown ? (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, {}) })) : null;
|
|
40
39
|
}
|
|
41
40
|
function BlockMessage({ messageText }) {
|
|
42
41
|
const { classes } = useStyles();
|
|
43
|
-
return (
|
|
44
|
-
React.createElement(Typography, null, messageText)));
|
|
42
|
+
return (_jsx("div", { className: classes.blockMessage, children: _jsx(Typography, { children: messageText }) }));
|
|
45
43
|
}
|
|
46
44
|
function BlockError({ error }) {
|
|
47
45
|
const { classes } = useStyles();
|
|
48
|
-
return (
|
|
49
|
-
React.createElement(Typography, null, `${error}`)));
|
|
46
|
+
return (_jsx("div", { className: classes.blockError, children: _jsx(Typography, { children: `${error}` }) }));
|
|
50
47
|
}
|
|
51
48
|
const ServerSideRenderedDotplotContent = observer(function ({ model, style, }) {
|
|
52
49
|
if (model.error) {
|
|
53
|
-
return
|
|
50
|
+
return _jsx(BlockError, { error: model.error, "data-testid": "reload_button" });
|
|
54
51
|
}
|
|
55
52
|
else if (model.message) {
|
|
56
|
-
return
|
|
53
|
+
return _jsx(BlockMessage, { messageText: model.message });
|
|
57
54
|
}
|
|
58
55
|
else if (!model.filled) {
|
|
59
|
-
return
|
|
56
|
+
return _jsx(LoadingMessage, {});
|
|
60
57
|
}
|
|
61
58
|
else if (model.shouldDisplay) {
|
|
62
|
-
return
|
|
59
|
+
return _jsx("div", { style: style, children: model.reactElement });
|
|
63
60
|
}
|
|
64
61
|
return null;
|
|
65
62
|
});
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A block whose content is rendered outside of the main thread and hydrated by
|
|
4
|
-
* this component.
|
|
5
|
-
*/
|
|
6
1
|
interface ModelType {
|
|
7
2
|
imageData: string;
|
|
8
3
|
style: Record<string, string>;
|
|
@@ -14,5 +9,5 @@ interface ModelType {
|
|
|
14
9
|
}
|
|
15
10
|
declare const ServerSideSyntenyRendering: ({ model, }: {
|
|
16
11
|
model: ModelType;
|
|
17
|
-
}) =>
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
13
|
export default ServerSideSyntenyRendering;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { drawImageOntoCanvasContext } from '@jbrowse/core/util/offscreenCanvasPonyfill';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
4
5
|
const ServerSideSyntenyRendering = observer(function ({ model, }) {
|
|
5
6
|
const { imageData, style, renderProps } = model;
|
|
6
7
|
const { width, height, highResolutionScaling = 1 } = renderProps;
|
|
@@ -15,6 +16,6 @@ const ServerSideSyntenyRendering = observer(function ({ model, }) {
|
|
|
15
16
|
drawImageOntoCanvasContext(imageData, context);
|
|
16
17
|
setDone(true);
|
|
17
18
|
}, [imageData]);
|
|
18
|
-
return (
|
|
19
|
+
return (_jsx("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
|
|
19
20
|
});
|
|
20
21
|
export default ServerSideSyntenyRendering;
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class DotplotPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
2
|
import { isAbstractMenuManager } from '@jbrowse/core/util';
|
|
3
|
-
// icons
|
|
4
3
|
import TimelineIcon from '@mui/icons-material/Timeline';
|
|
5
|
-
|
|
6
|
-
import DotplotViewF from './DotplotView';
|
|
4
|
+
import ComparativeRenderer from './ComparativeRenderer';
|
|
7
5
|
import DotplotDisplayF from './DotplotDisplay';
|
|
6
|
+
import DotplotReadVsRefMenuItem from './DotplotReadVsRef';
|
|
8
7
|
import DotplotRendererF from './DotplotRenderer';
|
|
8
|
+
import DotplotViewF from './DotplotView';
|
|
9
9
|
import LaunchDotplotViewF from './LaunchDotplotView';
|
|
10
|
-
import ComparativeRenderer from './ComparativeRenderer';
|
|
11
|
-
import DotplotReadVsRefMenuItem from './DotplotReadVsRef';
|
|
12
10
|
export default class DotplotPlugin extends Plugin {
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
@@ -20,7 +18,6 @@ export default class DotplotPlugin extends Plugin {
|
|
|
20
18
|
DotplotRendererF(pluginManager);
|
|
21
19
|
LaunchDotplotViewF(pluginManager);
|
|
22
20
|
DotplotReadVsRefMenuItem(pluginManager);
|
|
23
|
-
// install our comparative rendering rpc callback
|
|
24
21
|
pluginManager.addRpcMethod(() => new ComparativeRenderer(pluginManager));
|
|
25
22
|
}
|
|
26
23
|
configure(pluginManager) {
|
package/esm/util.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-dotplot-view",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "JBrowse 2 dotplot view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,11 +36,9 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@floating-ui/react": "^0.26.3",
|
|
40
39
|
"@mui/icons-material": "^6.0.0",
|
|
41
40
|
"@mui/x-data-grid": "^7.0.0",
|
|
42
41
|
"@types/file-saver": "^2.0.1",
|
|
43
|
-
"clone": "^2.1.2",
|
|
44
42
|
"file-saver": "^2.0.0"
|
|
45
43
|
},
|
|
46
44
|
"peerDependencies": {
|
|
@@ -61,5 +59,5 @@
|
|
|
61
59
|
"publishConfig": {
|
|
62
60
|
"access": "public"
|
|
63
61
|
},
|
|
64
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
|
|
65
63
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SnapshotIn } from 'mobx-state-tree';
|
|
3
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
|
-
declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
|
|
6
|
-
sessionTrackData: Conf;
|
|
7
|
-
assembly1: string;
|
|
8
|
-
assembly2: string;
|
|
9
|
-
setSessionTrackData: (arg: Conf) => void;
|
|
10
|
-
}) => React.JSX.Element;
|
|
11
|
-
export default ImportCustomTrack;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const material_1 = require("@mui/material");
|
|
28
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
29
|
-
const mobx_react_1 = require("mobx-react");
|
|
30
|
-
const util_1 = require("./util");
|
|
31
|
-
function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
|
|
32
|
-
if (radioOption === '.paf') {
|
|
33
|
-
return {
|
|
34
|
-
type: 'PAFAdapter',
|
|
35
|
-
pafLocation: fileLocation,
|
|
36
|
-
queryAssembly: assembly1,
|
|
37
|
-
targetAssembly: assembly2,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
else if (radioOption === '.out') {
|
|
41
|
-
return {
|
|
42
|
-
type: 'MashMapAdapter',
|
|
43
|
-
outLocation: fileLocation,
|
|
44
|
-
queryAssembly: assembly1,
|
|
45
|
-
targetAssembly: assembly2,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else if (radioOption === '.delta') {
|
|
49
|
-
return {
|
|
50
|
-
type: 'DeltaAdapter',
|
|
51
|
-
deltaLocation: fileLocation,
|
|
52
|
-
queryAssembly: assembly1,
|
|
53
|
-
targetAssembly: assembly2,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
else if (radioOption === '.chain') {
|
|
57
|
-
return {
|
|
58
|
-
type: 'ChainAdapter',
|
|
59
|
-
chainLocation: fileLocation,
|
|
60
|
-
queryAssembly: assembly1,
|
|
61
|
-
targetAssembly: assembly2,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
else if (radioOption === '.anchors') {
|
|
65
|
-
return {
|
|
66
|
-
type: 'MCScanAnchorsAdapter',
|
|
67
|
-
mcscanAnchorsLocation: fileLocation,
|
|
68
|
-
bed1Location,
|
|
69
|
-
bed2Location,
|
|
70
|
-
assemblyNames: [assembly1, assembly2],
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
else if (radioOption === '.anchors.simple') {
|
|
74
|
-
return {
|
|
75
|
-
type: 'MCScanSimpleAnchorsAdapter',
|
|
76
|
-
mcscanSimpleAnchorsLocation: fileLocation,
|
|
77
|
-
bed1Location,
|
|
78
|
-
bed2Location,
|
|
79
|
-
assemblyNames: [assembly1, assembly2],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
else if (radioOption === '.pif.gz') {
|
|
83
|
-
return {
|
|
84
|
-
type: 'PairwiseIndexedPAFAdapter',
|
|
85
|
-
pifGzLocation: fileLocation,
|
|
86
|
-
index: { location: indexFileLocation },
|
|
87
|
-
assemblyNames: [assembly1, assembly2],
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const ImportCustomTrack = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, setSessionTrackData, }) {
|
|
95
|
-
const [bed2Location, setBed2Location] = (0, react_1.useState)();
|
|
96
|
-
const [bed1Location, setBed1Location] = (0, react_1.useState)();
|
|
97
|
-
const [fileLocation, setFileLocation] = (0, react_1.useState)();
|
|
98
|
-
const [indexFileLocation, setIndexFileLocation] = (0, react_1.useState)();
|
|
99
|
-
const [value, setValue] = (0, react_1.useState)('');
|
|
100
|
-
const [error, setError] = (0, react_1.useState)();
|
|
101
|
-
const fileName = (0, util_1.getName)(fileLocation);
|
|
102
|
-
const radioOption = value || (fileName ? (0, util_1.extName)((0, util_1.stripGz)(fileName)) : '');
|
|
103
|
-
(0, react_1.useEffect)(() => {
|
|
104
|
-
try {
|
|
105
|
-
if (fileLocation) {
|
|
106
|
-
const fn = fileName ? (0, util_1.basename)(fileName) : 'MyTrack';
|
|
107
|
-
const trackId = `${fn}-${Date.now()}`;
|
|
108
|
-
setError(undefined);
|
|
109
|
-
setSessionTrackData({
|
|
110
|
-
trackId,
|
|
111
|
-
name: fn,
|
|
112
|
-
assemblyNames: [assembly2, assembly1],
|
|
113
|
-
type: 'SyntenyTrack',
|
|
114
|
-
adapter: getAdapter({
|
|
115
|
-
radioOption,
|
|
116
|
-
assembly1,
|
|
117
|
-
assembly2,
|
|
118
|
-
fileLocation,
|
|
119
|
-
indexFileLocation,
|
|
120
|
-
bed1Location,
|
|
121
|
-
bed2Location,
|
|
122
|
-
}),
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
catch (e) {
|
|
127
|
-
console.error(e);
|
|
128
|
-
setError(e);
|
|
129
|
-
}
|
|
130
|
-
}, [
|
|
131
|
-
fileName,
|
|
132
|
-
assembly1,
|
|
133
|
-
assembly2,
|
|
134
|
-
bed1Location,
|
|
135
|
-
bed2Location,
|
|
136
|
-
fileLocation,
|
|
137
|
-
indexFileLocation,
|
|
138
|
-
radioOption,
|
|
139
|
-
setSessionTrackData,
|
|
140
|
-
]);
|
|
141
|
-
return (react_1.default.createElement(material_1.Paper, { style: { padding: 12 } },
|
|
142
|
-
error ? react_1.default.createElement(ui_1.ErrorMessage, { error: error }) : null,
|
|
143
|
-
react_1.default.createElement(material_1.Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
|
|
144
|
-
react_1.default.createElement(material_1.RadioGroup, { value: radioOption, onChange: event => {
|
|
145
|
-
setValue(event.target.value);
|
|
146
|
-
} },
|
|
147
|
-
react_1.default.createElement(material_1.Grid, { container: true, justifyContent: "center" },
|
|
148
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
149
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".paf", control: react_1.default.createElement(material_1.Radio, null), label: ".paf" })),
|
|
150
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
151
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".out", control: react_1.default.createElement(material_1.Radio, null), label: ".out" })),
|
|
152
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
153
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".delta", control: react_1.default.createElement(material_1.Radio, null), label: ".delta" })),
|
|
154
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
155
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".chain", control: react_1.default.createElement(material_1.Radio, null), label: ".chain" })),
|
|
156
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
157
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".anchors", control: react_1.default.createElement(material_1.Radio, null), label: ".anchors" })),
|
|
158
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
159
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".anchors.simple", control: react_1.default.createElement(material_1.Radio, null), label: ".anchors.simple" })),
|
|
160
|
-
react_1.default.createElement(material_1.Grid, { item: true },
|
|
161
|
-
react_1.default.createElement(material_1.FormControlLabel, { value: ".pif.gz", control: react_1.default.createElement(material_1.Radio, null), label: ".pif.gz" })))),
|
|
162
|
-
react_1.default.createElement(material_1.Grid, { container: true, justifyContent: "center" },
|
|
163
|
-
react_1.default.createElement(material_1.Grid, { item: true }, value === '.anchors' || value === '.anchors.simple' ? (react_1.default.createElement("div", null,
|
|
164
|
-
react_1.default.createElement("div", { style: { margin: 20 } },
|
|
165
|
-
"Open the ",
|
|
166
|
-
value,
|
|
167
|
-
" and .bed files for both genome assemblies from the MCScan (Python version) pipeline",
|
|
168
|
-
' ',
|
|
169
|
-
react_1.default.createElement("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)" }, "(more info)")),
|
|
170
|
-
react_1.default.createElement("div", { style: { display: 'flex' } },
|
|
171
|
-
react_1.default.createElement("div", null,
|
|
172
|
-
react_1.default.createElement(ui_1.FileSelector, { name: ".anchors file", description: "", location: fileLocation, setLocation: loc => {
|
|
173
|
-
setFileLocation(loc);
|
|
174
|
-
} })),
|
|
175
|
-
react_1.default.createElement("div", null,
|
|
176
|
-
react_1.default.createElement(ui_1.FileSelector, { name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
|
|
177
|
-
setBed1Location(loc);
|
|
178
|
-
} })),
|
|
179
|
-
react_1.default.createElement("div", null,
|
|
180
|
-
react_1.default.createElement(ui_1.FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
|
|
181
|
-
setBed2Location(loc);
|
|
182
|
-
} }))))) : value === '.pif.gz' ? (react_1.default.createElement("div", { style: { display: 'flex' } },
|
|
183
|
-
react_1.default.createElement("div", null,
|
|
184
|
-
react_1.default.createElement(ui_1.FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
|
|
185
|
-
setFileLocation(loc);
|
|
186
|
-
} })),
|
|
187
|
-
react_1.default.createElement("div", null,
|
|
188
|
-
react_1.default.createElement(ui_1.FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
|
|
189
|
-
setIndexFileLocation(loc);
|
|
190
|
-
} })))) : (react_1.default.createElement(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
|
|
191
|
-
setFileLocation(loc);
|
|
192
|
-
} }))))));
|
|
193
|
-
});
|
|
194
|
-
exports.default = ImportCustomTrack;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SnapshotIn } from 'mobx-state-tree';
|
|
3
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
|
-
declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
|
|
6
|
-
sessionTrackData: Conf;
|
|
7
|
-
assembly1: string;
|
|
8
|
-
assembly2: string;
|
|
9
|
-
setSessionTrackData: (arg: Conf) => void;
|
|
10
|
-
}) => React.JSX.Element;
|
|
11
|
-
export default ImportCustomTrack;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
|
|
3
|
-
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import { basename, extName, getName, stripGz } from './util';
|
|
6
|
-
function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
|
|
7
|
-
if (radioOption === '.paf') {
|
|
8
|
-
return {
|
|
9
|
-
type: 'PAFAdapter',
|
|
10
|
-
pafLocation: fileLocation,
|
|
11
|
-
queryAssembly: assembly1,
|
|
12
|
-
targetAssembly: assembly2,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
else if (radioOption === '.out') {
|
|
16
|
-
return {
|
|
17
|
-
type: 'MashMapAdapter',
|
|
18
|
-
outLocation: fileLocation,
|
|
19
|
-
queryAssembly: assembly1,
|
|
20
|
-
targetAssembly: assembly2,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
else if (radioOption === '.delta') {
|
|
24
|
-
return {
|
|
25
|
-
type: 'DeltaAdapter',
|
|
26
|
-
deltaLocation: fileLocation,
|
|
27
|
-
queryAssembly: assembly1,
|
|
28
|
-
targetAssembly: assembly2,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
else if (radioOption === '.chain') {
|
|
32
|
-
return {
|
|
33
|
-
type: 'ChainAdapter',
|
|
34
|
-
chainLocation: fileLocation,
|
|
35
|
-
queryAssembly: assembly1,
|
|
36
|
-
targetAssembly: assembly2,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
else if (radioOption === '.anchors') {
|
|
40
|
-
return {
|
|
41
|
-
type: 'MCScanAnchorsAdapter',
|
|
42
|
-
mcscanAnchorsLocation: fileLocation,
|
|
43
|
-
bed1Location,
|
|
44
|
-
bed2Location,
|
|
45
|
-
assemblyNames: [assembly1, assembly2],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
else if (radioOption === '.anchors.simple') {
|
|
49
|
-
return {
|
|
50
|
-
type: 'MCScanSimpleAnchorsAdapter',
|
|
51
|
-
mcscanSimpleAnchorsLocation: fileLocation,
|
|
52
|
-
bed1Location,
|
|
53
|
-
bed2Location,
|
|
54
|
-
assemblyNames: [assembly1, assembly2],
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
else if (radioOption === '.pif.gz') {
|
|
58
|
-
return {
|
|
59
|
-
type: 'PairwiseIndexedPAFAdapter',
|
|
60
|
-
pifGzLocation: fileLocation,
|
|
61
|
-
index: { location: indexFileLocation },
|
|
62
|
-
assemblyNames: [assembly1, assembly2],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const ImportCustomTrack = observer(function ({ assembly1, assembly2, setSessionTrackData, }) {
|
|
70
|
-
const [bed2Location, setBed2Location] = useState();
|
|
71
|
-
const [bed1Location, setBed1Location] = useState();
|
|
72
|
-
const [fileLocation, setFileLocation] = useState();
|
|
73
|
-
const [indexFileLocation, setIndexFileLocation] = useState();
|
|
74
|
-
const [value, setValue] = useState('');
|
|
75
|
-
const [error, setError] = useState();
|
|
76
|
-
const fileName = getName(fileLocation);
|
|
77
|
-
const radioOption = value || (fileName ? extName(stripGz(fileName)) : '');
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
try {
|
|
80
|
-
if (fileLocation) {
|
|
81
|
-
const fn = fileName ? basename(fileName) : 'MyTrack';
|
|
82
|
-
const trackId = `${fn}-${Date.now()}`;
|
|
83
|
-
setError(undefined);
|
|
84
|
-
setSessionTrackData({
|
|
85
|
-
trackId,
|
|
86
|
-
name: fn,
|
|
87
|
-
assemblyNames: [assembly2, assembly1],
|
|
88
|
-
type: 'SyntenyTrack',
|
|
89
|
-
adapter: getAdapter({
|
|
90
|
-
radioOption,
|
|
91
|
-
assembly1,
|
|
92
|
-
assembly2,
|
|
93
|
-
fileLocation,
|
|
94
|
-
indexFileLocation,
|
|
95
|
-
bed1Location,
|
|
96
|
-
bed2Location,
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
console.error(e);
|
|
103
|
-
setError(e);
|
|
104
|
-
}
|
|
105
|
-
}, [
|
|
106
|
-
fileName,
|
|
107
|
-
assembly1,
|
|
108
|
-
assembly2,
|
|
109
|
-
bed1Location,
|
|
110
|
-
bed2Location,
|
|
111
|
-
fileLocation,
|
|
112
|
-
indexFileLocation,
|
|
113
|
-
radioOption,
|
|
114
|
-
setSessionTrackData,
|
|
115
|
-
]);
|
|
116
|
-
return (React.createElement(Paper, { style: { padding: 12 } },
|
|
117
|
-
error ? React.createElement(ErrorMessage, { error: error }) : null,
|
|
118
|
-
React.createElement(Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
|
|
119
|
-
React.createElement(RadioGroup, { value: radioOption, onChange: event => {
|
|
120
|
-
setValue(event.target.value);
|
|
121
|
-
} },
|
|
122
|
-
React.createElement(Grid, { container: true, justifyContent: "center" },
|
|
123
|
-
React.createElement(Grid, { item: true },
|
|
124
|
-
React.createElement(FormControlLabel, { value: ".paf", control: React.createElement(Radio, null), label: ".paf" })),
|
|
125
|
-
React.createElement(Grid, { item: true },
|
|
126
|
-
React.createElement(FormControlLabel, { value: ".out", control: React.createElement(Radio, null), label: ".out" })),
|
|
127
|
-
React.createElement(Grid, { item: true },
|
|
128
|
-
React.createElement(FormControlLabel, { value: ".delta", control: React.createElement(Radio, null), label: ".delta" })),
|
|
129
|
-
React.createElement(Grid, { item: true },
|
|
130
|
-
React.createElement(FormControlLabel, { value: ".chain", control: React.createElement(Radio, null), label: ".chain" })),
|
|
131
|
-
React.createElement(Grid, { item: true },
|
|
132
|
-
React.createElement(FormControlLabel, { value: ".anchors", control: React.createElement(Radio, null), label: ".anchors" })),
|
|
133
|
-
React.createElement(Grid, { item: true },
|
|
134
|
-
React.createElement(FormControlLabel, { value: ".anchors.simple", control: React.createElement(Radio, null), label: ".anchors.simple" })),
|
|
135
|
-
React.createElement(Grid, { item: true },
|
|
136
|
-
React.createElement(FormControlLabel, { value: ".pif.gz", control: React.createElement(Radio, null), label: ".pif.gz" })))),
|
|
137
|
-
React.createElement(Grid, { container: true, justifyContent: "center" },
|
|
138
|
-
React.createElement(Grid, { item: true }, value === '.anchors' || value === '.anchors.simple' ? (React.createElement("div", null,
|
|
139
|
-
React.createElement("div", { style: { margin: 20 } },
|
|
140
|
-
"Open the ",
|
|
141
|
-
value,
|
|
142
|
-
" and .bed files for both genome assemblies from the MCScan (Python version) pipeline",
|
|
143
|
-
' ',
|
|
144
|
-
React.createElement("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)" }, "(more info)")),
|
|
145
|
-
React.createElement("div", { style: { display: 'flex' } },
|
|
146
|
-
React.createElement("div", null,
|
|
147
|
-
React.createElement(FileSelector, { name: ".anchors file", description: "", location: fileLocation, setLocation: loc => {
|
|
148
|
-
setFileLocation(loc);
|
|
149
|
-
} })),
|
|
150
|
-
React.createElement("div", null,
|
|
151
|
-
React.createElement(FileSelector, { name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
|
|
152
|
-
setBed1Location(loc);
|
|
153
|
-
} })),
|
|
154
|
-
React.createElement("div", null,
|
|
155
|
-
React.createElement(FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
|
|
156
|
-
setBed2Location(loc);
|
|
157
|
-
} }))))) : value === '.pif.gz' ? (React.createElement("div", { style: { display: 'flex' } },
|
|
158
|
-
React.createElement("div", null,
|
|
159
|
-
React.createElement(FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
|
|
160
|
-
setFileLocation(loc);
|
|
161
|
-
} })),
|
|
162
|
-
React.createElement("div", null,
|
|
163
|
-
React.createElement(FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
|
|
164
|
-
setIndexFileLocation(loc);
|
|
165
|
-
} })))) : (React.createElement(FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
|
|
166
|
-
setFileLocation(loc);
|
|
167
|
-
} }))))));
|
|
168
|
-
});
|
|
169
|
-
export default ImportCustomTrack;
|