@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.
Files changed (173) hide show
  1. package/dist/ComparativeRenderer/index.d.ts +3 -8
  2. package/dist/ComparativeRenderer/index.js +3 -8
  3. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
  4. package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
  5. package/dist/DotplotDisplay/index.d.ts +1 -7
  6. package/dist/DotplotDisplay/index.js +2 -12
  7. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  8. package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
  9. package/dist/DotplotDisplay/stateModelFactory.d.ts +8 -45
  10. package/dist/DotplotDisplay/stateModelFactory.js +57 -100
  11. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  12. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
  13. package/dist/DotplotReadVsRef/index.d.ts +1 -1
  14. package/dist/DotplotReadVsRef/index.js +0 -2
  15. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  16. package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  17. package/dist/DotplotRenderer/DotplotRenderer.d.ts +8 -7
  18. package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
  19. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  20. package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
  21. package/dist/DotplotRenderer/configSchema.d.ts +0 -21
  22. package/dist/DotplotRenderer/configSchema.js +2 -27
  23. package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
  24. package/dist/DotplotRenderer/drawDotplot.js +3 -6
  25. package/dist/DotplotRenderer/index.d.ts +1 -1
  26. package/dist/DotplotRenderer/index.js +1 -1
  27. package/dist/DotplotView/1dview.d.ts +2 -77
  28. package/dist/DotplotView/1dview.js +4 -33
  29. package/dist/DotplotView/components/Axes.d.ts +5 -6
  30. package/dist/DotplotView/components/Axes.js +26 -40
  31. package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
  32. package/dist/DotplotView/components/CursorIcon.js +3 -5
  33. package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
  34. package/dist/DotplotView/components/DotplotControls.js +94 -97
  35. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  36. package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
  37. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  38. package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  39. package/dist/DotplotView/components/DotplotView.d.ts +2 -3
  40. package/dist/DotplotView/components/DotplotView.js +80 -92
  41. package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
  42. package/dist/DotplotView/components/DotplotWarnings.js +26 -21
  43. package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  44. package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
  45. package/dist/DotplotView/components/Grid.d.ts +3 -4
  46. package/dist/DotplotView/components/Grid.js +19 -32
  47. package/dist/DotplotView/components/Header.d.ts +2 -3
  48. package/dist/DotplotView/components/Header.js +4 -23
  49. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  50. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
  51. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  52. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
  53. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  54. package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
  55. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  56. package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
  57. package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
  58. package/dist/DotplotView/components/ImportForm/index.js +47 -97
  59. package/dist/DotplotView/components/ImportForm/util.js +1 -3
  60. package/dist/DotplotView/components/PanButtons.d.ts +2 -3
  61. package/dist/DotplotView/components/PanButtons.js +17 -36
  62. package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
  63. package/dist/DotplotView/components/WarningDialog.js +12 -15
  64. package/dist/DotplotView/components/util.d.ts +2 -7
  65. package/dist/DotplotView/components/util.js +0 -5
  66. package/dist/DotplotView/index.d.ts +1 -1
  67. package/dist/DotplotView/index.js +17 -8
  68. package/dist/DotplotView/model.d.ts +11 -133
  69. package/dist/DotplotView/model.js +46 -222
  70. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  71. package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
  72. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  73. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  74. package/dist/DotplotView/types.d.ts +12 -0
  75. package/dist/DotplotView/types.js +2 -0
  76. package/dist/LaunchDotplotView.d.ts +1 -1
  77. package/dist/LaunchDotplotView.js +1 -4
  78. package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
  79. package/dist/ServerSideRenderedBlockContent.js +11 -37
  80. package/dist/ServerSideSyntenyRendering.d.ts +1 -6
  81. package/dist/ServerSideSyntenyRendering.js +4 -26
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +3 -6
  84. package/dist/util.d.ts +1 -1
  85. package/esm/ComparativeRenderer/index.d.ts +3 -8
  86. package/esm/ComparativeRenderer/index.js +3 -8
  87. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
  88. package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
  89. package/esm/DotplotDisplay/index.d.ts +1 -7
  90. package/esm/DotplotDisplay/index.js +2 -12
  91. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  92. package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
  93. package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
  94. package/esm/DotplotDisplay/stateModelFactory.js +58 -101
  95. package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  96. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
  97. package/esm/DotplotReadVsRef/index.d.ts +1 -1
  98. package/esm/DotplotReadVsRef/index.js +0 -2
  99. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  100. package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  101. package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
  102. package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
  103. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  104. package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
  105. package/esm/DotplotRenderer/configSchema.d.ts +0 -21
  106. package/esm/DotplotRenderer/configSchema.js +2 -27
  107. package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
  108. package/esm/DotplotRenderer/drawDotplot.js +4 -7
  109. package/esm/DotplotRenderer/index.d.ts +1 -1
  110. package/esm/DotplotRenderer/index.js +1 -1
  111. package/esm/DotplotView/1dview.d.ts +2 -77
  112. package/esm/DotplotView/1dview.js +4 -33
  113. package/esm/DotplotView/components/Axes.d.ts +5 -6
  114. package/esm/DotplotView/components/Axes.js +26 -37
  115. package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
  116. package/esm/DotplotView/components/CursorIcon.js +3 -5
  117. package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
  118. package/esm/DotplotView/components/DotplotControls.js +94 -97
  119. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  120. package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
  121. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  122. package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  123. package/esm/DotplotView/components/DotplotView.d.ts +2 -3
  124. package/esm/DotplotView/components/DotplotView.js +63 -85
  125. package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
  126. package/esm/DotplotView/components/DotplotWarnings.js +9 -14
  127. package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  128. package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
  129. package/esm/DotplotView/components/Grid.d.ts +3 -4
  130. package/esm/DotplotView/components/Grid.js +19 -29
  131. package/esm/DotplotView/components/Header.d.ts +2 -3
  132. package/esm/DotplotView/components/Header.js +4 -23
  133. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  134. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
  135. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  136. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
  137. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  138. package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
  139. package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  140. package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
  141. package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
  142. package/esm/DotplotView/components/ImportForm/index.js +48 -75
  143. package/esm/DotplotView/components/ImportForm/util.js +1 -3
  144. package/esm/DotplotView/components/PanButtons.d.ts +2 -3
  145. package/esm/DotplotView/components/PanButtons.js +17 -36
  146. package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
  147. package/esm/DotplotView/components/WarningDialog.js +12 -12
  148. package/esm/DotplotView/components/util.d.ts +2 -7
  149. package/esm/DotplotView/components/util.js +0 -5
  150. package/esm/DotplotView/index.d.ts +1 -1
  151. package/esm/DotplotView/index.js +0 -1
  152. package/esm/DotplotView/model.d.ts +11 -133
  153. package/esm/DotplotView/model.js +30 -216
  154. package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  155. package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
  156. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  157. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  158. package/esm/DotplotView/types.d.ts +12 -0
  159. package/esm/DotplotView/types.js +1 -0
  160. package/esm/LaunchDotplotView.d.ts +1 -1
  161. package/esm/LaunchDotplotView.js +1 -4
  162. package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
  163. package/esm/ServerSideRenderedBlockContent.js +11 -14
  164. package/esm/ServerSideSyntenyRendering.d.ts +1 -6
  165. package/esm/ServerSideSyntenyRendering.js +4 -3
  166. package/esm/index.d.ts +1 -1
  167. package/esm/index.js +3 -6
  168. package/esm/util.d.ts +1 -1
  169. package/package.json +2 -4
  170. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  171. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
  172. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  173. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
@@ -1,8 +1,9 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { makeStyles } from 'tss-react/mui';
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 ? (React.createElement("div", { className: classes.loading },
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 (React.createElement("div", { className: classes.blockMessage },
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 (React.createElement("div", { className: classes.blockError },
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 React.createElement(BlockError, { error: model.error, "data-testid": "reload_button" });
50
+ return _jsx(BlockError, { error: model.error, "data-testid": "reload_button" });
54
51
  }
55
52
  else if (model.message) {
56
- return React.createElement(BlockMessage, { messageText: model.message });
53
+ return _jsx(BlockMessage, { messageText: model.message });
57
54
  }
58
55
  else if (!model.filled) {
59
- return React.createElement(LoadingMessage, null);
56
+ return _jsx(LoadingMessage, {});
60
57
  }
61
58
  else if (model.shouldDisplay) {
62
- return React.createElement("div", { style: style }, model.reactElement);
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
- }) => React.JSX.Element;
12
+ }) => import("react/jsx-runtime").JSX.Element;
18
13
  export default ServerSideSyntenyRendering;
@@ -1,6 +1,7 @@
1
- import React, { useRef, useState, useEffect } from 'react';
2
- import { observer } from 'mobx-react';
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 (React.createElement("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
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
- // locals
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
@@ -1,4 +1,4 @@
1
- import { Feature } from '@jbrowse/core/util';
1
+ import type { Feature } from '@jbrowse/core/util';
2
2
  export interface ReducedFeature {
3
3
  refName: string;
4
4
  start: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-dotplot-view",
3
- "version": "2.17.0",
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": "eed30b5e671f8f7823652d7cecc51aa89226de46"
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;