@jbrowse/plugin-dotplot-view 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/LICENSE +201 -0
  2. package/dist/ComparativeRenderer/index.d.ts +27 -0
  3. package/dist/ComparativeRenderer/index.js +59 -0
  4. package/dist/ComparativeRenderer/index.js.map +1 -0
  5. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
  6. package/dist/DotplotDisplay/components/DotplotDisplay.js +24 -0
  7. package/dist/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
  8. package/dist/DotplotDisplay/index.d.ts +12 -0
  9. package/dist/DotplotDisplay/index.js +48 -0
  10. package/dist/DotplotDisplay/index.js.map +1 -0
  11. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
  12. package/dist/DotplotDisplay/renderDotplotBlock.js +57 -0
  13. package/dist/DotplotDisplay/renderDotplotBlock.js.map +1 -0
  14. package/dist/DotplotDisplay/stateModelFactory.d.ts +138 -0
  15. package/dist/DotplotDisplay/stateModelFactory.js +165 -0
  16. package/dist/DotplotDisplay/stateModelFactory.js.map +1 -0
  17. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
  18. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +102 -0
  19. package/dist/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
  20. package/dist/DotplotReadVsRef/index.d.ts +2 -0
  21. package/dist/DotplotReadVsRef/index.js +42 -0
  22. package/dist/DotplotReadVsRef/index.js.map +1 -0
  23. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
  24. package/dist/DotplotRenderer/ComparativeRenderRpc.js +59 -0
  25. package/dist/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
  26. package/dist/DotplotRenderer/DotplotRenderer.d.ts +69 -0
  27. package/dist/DotplotRenderer/DotplotRenderer.js +274 -0
  28. package/dist/DotplotRenderer/DotplotRenderer.js.map +1 -0
  29. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
  30. package/dist/DotplotRenderer/components/DotplotRendering.js +13 -0
  31. package/dist/DotplotRenderer/components/DotplotRendering.js.map +1 -0
  32. package/dist/DotplotRenderer/configSchema.d.ts +61 -0
  33. package/dist/DotplotRenderer/configSchema.js +83 -0
  34. package/dist/DotplotRenderer/configSchema.js.map +1 -0
  35. package/dist/DotplotRenderer/index.d.ts +3 -0
  36. package/dist/DotplotRenderer/index.js +17 -0
  37. package/dist/DotplotRenderer/index.js.map +1 -0
  38. package/dist/DotplotView/1dview.d.ts +307 -0
  39. package/dist/DotplotView/1dview.js +95 -0
  40. package/dist/DotplotView/1dview.js.map +1 -0
  41. package/dist/DotplotView/blockTypes.d.ts +61 -0
  42. package/dist/DotplotView/blockTypes.js +117 -0
  43. package/dist/DotplotView/blockTypes.js.map +1 -0
  44. package/dist/DotplotView/components/Axes.d.ts +14 -0
  45. package/dist/DotplotView/components/Axes.js +127 -0
  46. package/dist/DotplotView/components/Axes.js.map +1 -0
  47. package/dist/DotplotView/components/CursorIcon.d.ts +4 -0
  48. package/dist/DotplotView/components/CursorIcon.js +19 -0
  49. package/dist/DotplotView/components/CursorIcon.js.map +1 -0
  50. package/dist/DotplotView/components/DotplotTooltip.d.ts +19 -0
  51. package/dist/DotplotView/components/DotplotTooltip.js +128 -0
  52. package/dist/DotplotView/components/DotplotTooltip.js.map +1 -0
  53. package/dist/DotplotView/components/DotplotView.d.ts +6 -0
  54. package/dist/DotplotView/components/DotplotView.js +272 -0
  55. package/dist/DotplotView/components/DotplotView.js.map +1 -0
  56. package/dist/DotplotView/components/DotplotWarnings.d.ts +6 -0
  57. package/dist/DotplotView/components/DotplotWarnings.js +40 -0
  58. package/dist/DotplotView/components/DotplotWarnings.js.map +1 -0
  59. package/dist/DotplotView/components/ExportSvgDialog.d.ts +8 -0
  60. package/dist/DotplotView/components/ExportSvgDialog.js +76 -0
  61. package/dist/DotplotView/components/ExportSvgDialog.js.map +1 -0
  62. package/dist/DotplotView/components/Grid.d.ts +10 -0
  63. package/dist/DotplotView/components/Grid.js +60 -0
  64. package/dist/DotplotView/components/Grid.js.map +1 -0
  65. package/dist/DotplotView/components/Header.d.ts +10 -0
  66. package/dist/DotplotView/components/Header.js +168 -0
  67. package/dist/DotplotView/components/Header.js.map +1 -0
  68. package/dist/DotplotView/components/ImportCustomTrack.d.ts +11 -0
  69. package/dist/DotplotView/components/ImportCustomTrack.js +180 -0
  70. package/dist/DotplotView/components/ImportCustomTrack.js.map +1 -0
  71. package/dist/DotplotView/components/ImportForm.d.ts +6 -0
  72. package/dist/DotplotView/components/ImportForm.js +121 -0
  73. package/dist/DotplotView/components/ImportForm.js.map +1 -0
  74. package/dist/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
  75. package/dist/DotplotView/components/ImportSyntenyTrackSelector.js +69 -0
  76. package/dist/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
  77. package/dist/DotplotView/components/PanButtons.d.ts +6 -0
  78. package/dist/DotplotView/components/PanButtons.js +60 -0
  79. package/dist/DotplotView/components/PanButtons.js.map +1 -0
  80. package/dist/DotplotView/components/WarningDialog.d.ts +16 -0
  81. package/dist/DotplotView/components/WarningDialog.js +41 -0
  82. package/dist/DotplotView/components/WarningDialog.js.map +1 -0
  83. package/dist/DotplotView/components/util.d.ts +19 -0
  84. package/dist/DotplotView/components/util.js +90 -0
  85. package/dist/DotplotView/components/util.js.map +1 -0
  86. package/dist/DotplotView/index.d.ts +2 -0
  87. package/dist/DotplotView/index.js +44 -0
  88. package/dist/DotplotView/index.js.map +1 -0
  89. package/dist/DotplotView/model.d.ts +616 -0
  90. package/dist/DotplotView/model.js +647 -0
  91. package/dist/DotplotView/model.js.map +1 -0
  92. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
  93. package/dist/DotplotView/svgcomponents/SVGBackground.js +13 -0
  94. package/dist/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
  95. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
  96. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +47 -0
  97. package/dist/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
  98. package/dist/LaunchDotplotView.d.ts +2 -0
  99. package/dist/LaunchDotplotView.js +45 -0
  100. package/dist/LaunchDotplotView.js.map +1 -0
  101. package/dist/ServerSideRenderedBlockContent.d.ts +12 -0
  102. package/dist/ServerSideRenderedBlockContent.js +87 -0
  103. package/dist/ServerSideRenderedBlockContent.js.map +1 -0
  104. package/dist/ServerSideSyntenyRendering.d.ts +23 -0
  105. package/dist/ServerSideSyntenyRendering.js +54 -0
  106. package/dist/ServerSideSyntenyRendering.js.map +1 -0
  107. package/dist/index.d.ts +7 -0
  108. package/dist/index.js +44 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/util.d.ts +9 -0
  111. package/dist/util.js +9 -0
  112. package/dist/util.js.map +1 -0
  113. package/esm/ComparativeRenderer/index.d.ts +27 -0
  114. package/esm/ComparativeRenderer/index.js +53 -0
  115. package/esm/ComparativeRenderer/index.js.map +1 -0
  116. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
  117. package/esm/DotplotDisplay/components/DotplotDisplay.js +19 -0
  118. package/esm/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
  119. package/esm/DotplotDisplay/index.d.ts +12 -0
  120. package/esm/DotplotDisplay/index.js +41 -0
  121. package/esm/DotplotDisplay/index.js.map +1 -0
  122. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
  123. package/esm/DotplotDisplay/renderDotplotBlock.js +49 -0
  124. package/esm/DotplotDisplay/renderDotplotBlock.js.map +1 -0
  125. package/esm/DotplotDisplay/stateModelFactory.d.ts +138 -0
  126. package/esm/DotplotDisplay/stateModelFactory.js +158 -0
  127. package/esm/DotplotDisplay/stateModelFactory.js.map +1 -0
  128. package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
  129. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +98 -0
  130. package/esm/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
  131. package/esm/DotplotReadVsRef/index.d.ts +2 -0
  132. package/esm/DotplotReadVsRef/index.js +36 -0
  133. package/esm/DotplotReadVsRef/index.js.map +1 -0
  134. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
  135. package/esm/DotplotRenderer/ComparativeRenderRpc.js +53 -0
  136. package/esm/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
  137. package/esm/DotplotRenderer/DotplotRenderer.d.ts +69 -0
  138. package/esm/DotplotRenderer/DotplotRenderer.js +268 -0
  139. package/esm/DotplotRenderer/DotplotRenderer.js.map +1 -0
  140. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
  141. package/esm/DotplotRenderer/components/DotplotRendering.js +8 -0
  142. package/esm/DotplotRenderer/components/DotplotRendering.js.map +1 -0
  143. package/esm/DotplotRenderer/configSchema.d.ts +61 -0
  144. package/esm/DotplotRenderer/configSchema.js +81 -0
  145. package/esm/DotplotRenderer/configSchema.js.map +1 -0
  146. package/esm/DotplotRenderer/index.d.ts +3 -0
  147. package/esm/DotplotRenderer/index.js +12 -0
  148. package/esm/DotplotRenderer/index.js.map +1 -0
  149. package/esm/DotplotView/1dview.d.ts +307 -0
  150. package/esm/DotplotView/1dview.js +87 -0
  151. package/esm/DotplotView/1dview.js.map +1 -0
  152. package/esm/DotplotView/blockTypes.d.ts +61 -0
  153. package/esm/DotplotView/blockTypes.js +109 -0
  154. package/esm/DotplotView/blockTypes.js.map +1 -0
  155. package/esm/DotplotView/components/Axes.d.ts +14 -0
  156. package/esm/DotplotView/components/Axes.js +121 -0
  157. package/esm/DotplotView/components/Axes.js.map +1 -0
  158. package/esm/DotplotView/components/CursorIcon.d.ts +4 -0
  159. package/esm/DotplotView/components/CursorIcon.js +11 -0
  160. package/esm/DotplotView/components/CursorIcon.js.map +1 -0
  161. package/esm/DotplotView/components/DotplotTooltip.d.ts +19 -0
  162. package/esm/DotplotView/components/DotplotTooltip.js +101 -0
  163. package/esm/DotplotView/components/DotplotTooltip.js.map +1 -0
  164. package/esm/DotplotView/components/DotplotView.d.ts +6 -0
  165. package/esm/DotplotView/components/DotplotView.js +244 -0
  166. package/esm/DotplotView/components/DotplotView.js.map +1 -0
  167. package/esm/DotplotView/components/DotplotWarnings.d.ts +6 -0
  168. package/esm/DotplotView/components/DotplotWarnings.js +15 -0
  169. package/esm/DotplotView/components/DotplotWarnings.js.map +1 -0
  170. package/esm/DotplotView/components/ExportSvgDialog.d.ts +8 -0
  171. package/esm/DotplotView/components/ExportSvgDialog.js +50 -0
  172. package/esm/DotplotView/components/ExportSvgDialog.js.map +1 -0
  173. package/esm/DotplotView/components/Grid.d.ts +10 -0
  174. package/esm/DotplotView/components/Grid.js +53 -0
  175. package/esm/DotplotView/components/Grid.js.map +1 -0
  176. package/esm/DotplotView/components/Header.d.ts +10 -0
  177. package/esm/DotplotView/components/Header.js +140 -0
  178. package/esm/DotplotView/components/Header.js.map +1 -0
  179. package/esm/DotplotView/components/ImportCustomTrack.d.ts +11 -0
  180. package/esm/DotplotView/components/ImportCustomTrack.js +152 -0
  181. package/esm/DotplotView/components/ImportCustomTrack.js.map +1 -0
  182. package/esm/DotplotView/components/ImportForm.d.ts +6 -0
  183. package/esm/DotplotView/components/ImportForm.js +93 -0
  184. package/esm/DotplotView/components/ImportForm.js.map +1 -0
  185. package/esm/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
  186. package/esm/DotplotView/components/ImportSyntenyTrackSelector.js +44 -0
  187. package/esm/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
  188. package/esm/DotplotView/components/PanButtons.d.ts +6 -0
  189. package/esm/DotplotView/components/PanButtons.js +55 -0
  190. package/esm/DotplotView/components/PanButtons.js.map +1 -0
  191. package/esm/DotplotView/components/WarningDialog.d.ts +16 -0
  192. package/esm/DotplotView/components/WarningDialog.js +36 -0
  193. package/esm/DotplotView/components/WarningDialog.js.map +1 -0
  194. package/esm/DotplotView/components/util.d.ts +19 -0
  195. package/esm/DotplotView/components/util.js +83 -0
  196. package/esm/DotplotView/components/util.js.map +1 -0
  197. package/esm/DotplotView/index.d.ts +2 -0
  198. package/esm/DotplotView/index.js +15 -0
  199. package/esm/DotplotView/index.js.map +1 -0
  200. package/esm/DotplotView/model.d.ts +616 -0
  201. package/esm/DotplotView/model.js +616 -0
  202. package/esm/DotplotView/model.js.map +1 -0
  203. package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
  204. package/esm/DotplotView/svgcomponents/SVGBackground.js +7 -0
  205. package/esm/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
  206. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
  207. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +40 -0
  208. package/esm/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
  209. package/esm/LaunchDotplotView.d.ts +2 -0
  210. package/esm/LaunchDotplotView.js +42 -0
  211. package/esm/LaunchDotplotView.js.map +1 -0
  212. package/esm/ServerSideRenderedBlockContent.d.ts +12 -0
  213. package/esm/ServerSideRenderedBlockContent.js +62 -0
  214. package/esm/ServerSideRenderedBlockContent.js.map +1 -0
  215. package/esm/ServerSideSyntenyRendering.d.ts +23 -0
  216. package/esm/ServerSideSyntenyRendering.js +29 -0
  217. package/esm/ServerSideSyntenyRendering.js.map +1 -0
  218. package/esm/index.d.ts +7 -0
  219. package/esm/index.js +38 -0
  220. package/esm/index.js.map +1 -0
  221. package/esm/util.d.ts +9 -0
  222. package/esm/util.js +5 -0
  223. package/esm/util.js.map +1 -0
  224. package/package.json +69 -0
  225. package/src/ComparativeRenderer/index.ts +87 -0
  226. package/src/DotplotDisplay/components/DotplotDisplay.tsx +34 -0
  227. package/src/DotplotDisplay/index.ts +48 -0
  228. package/src/DotplotDisplay/renderDotplotBlock.ts +60 -0
  229. package/src/DotplotDisplay/stateModelFactory.tsx +196 -0
  230. package/src/DotplotReadVsRef/DotplotReadVsRef.ts +115 -0
  231. package/src/DotplotReadVsRef/index.ts +50 -0
  232. package/src/DotplotRenderer/ComparativeRenderRpc.ts +87 -0
  233. package/src/DotplotRenderer/DotplotRenderer.ts +328 -0
  234. package/src/DotplotRenderer/__image_snapshots__/linear-synteny-renderer-test-ts-test-rendering-a-simple-synteny-from-fake-data-1-snap.png +0 -0
  235. package/src/DotplotRenderer/components/DotplotRendering.tsx +12 -0
  236. package/src/DotplotRenderer/configSchema.ts +92 -0
  237. package/src/DotplotRenderer/index.ts +16 -0
  238. package/src/DotplotView/1dview.ts +98 -0
  239. package/src/DotplotView/blockTypes.ts +140 -0
  240. package/src/DotplotView/components/Axes.tsx +246 -0
  241. package/src/DotplotView/components/CursorIcon.tsx +24 -0
  242. package/src/DotplotView/components/DotplotTooltip.tsx +163 -0
  243. package/src/DotplotView/components/DotplotView.tsx +348 -0
  244. package/src/DotplotView/components/DotplotWarnings.tsx +26 -0
  245. package/src/DotplotView/components/ExportSvgDialog.tsx +129 -0
  246. package/src/DotplotView/components/Grid.tsx +112 -0
  247. package/src/DotplotView/components/Header.tsx +182 -0
  248. package/src/DotplotView/components/ImportCustomTrack.tsx +262 -0
  249. package/src/DotplotView/components/ImportForm.tsx +209 -0
  250. package/src/DotplotView/components/ImportSyntenyTrackSelector.tsx +90 -0
  251. package/src/DotplotView/components/PanButtons.tsx +93 -0
  252. package/src/DotplotView/components/WarningDialog.tsx +74 -0
  253. package/src/DotplotView/components/util.ts +118 -0
  254. package/src/DotplotView/index.ts +16 -0
  255. package/src/DotplotView/model.test.ts +17 -0
  256. package/src/DotplotView/model.ts +719 -0
  257. package/src/DotplotView/svgcomponents/SVGBackground.tsx +21 -0
  258. package/src/DotplotView/svgcomponents/SVGDotplotView.tsx +68 -0
  259. package/src/LaunchDotplotView.ts +63 -0
  260. package/src/ServerSideRenderedBlockContent.tsx +86 -0
  261. package/src/ServerSideSyntenyRendering.tsx +54 -0
  262. package/src/index.ts +41 -0
  263. package/src/util.ts +14 -0
@@ -0,0 +1,165 @@
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.stateModelFactory = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const react_1 = __importDefault(require("react"));
9
+ const mobx_state_tree_1 = require("mobx-state-tree");
10
+ const configuration_1 = require("@jbrowse/core/configuration");
11
+ const tracks_1 = require("@jbrowse/core/util/tracks");
12
+ const util_1 = require("@jbrowse/core/util");
13
+ const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
14
+ // locals
15
+ const ServerSideRenderedBlockContent_1 = __importDefault(require("../ServerSideRenderedBlockContent"));
16
+ const renderDotplotBlock_1 = require("./renderDotplotBlock");
17
+ /**
18
+ * #stateModel DotplotDisplay
19
+ * #category display
20
+ */
21
+ function stateModelFactory(configSchema) {
22
+ return mobx_state_tree_1.types
23
+ .compose('DotplotDisplay', models_1.BaseDisplay, mobx_state_tree_1.types
24
+ .model({
25
+ /**
26
+ * #property
27
+ */
28
+ type: mobx_state_tree_1.types.literal('DotplotDisplay'),
29
+ /**
30
+ * #property
31
+ */
32
+ configuration: (0, configuration_1.ConfigurationReference)(configSchema),
33
+ })
34
+ .volatile(() => ({
35
+ warnings: [],
36
+ renderInProgress: undefined,
37
+ filled: false,
38
+ data: undefined,
39
+ reactElement: undefined,
40
+ message: undefined,
41
+ renderingComponent: undefined,
42
+ ReactComponent2: ServerSideRenderedBlockContent_1.default,
43
+ })))
44
+ .views(self => ({
45
+ get shouldDisplay() {
46
+ const view = (0, util_1.getContainingView)(self);
47
+ return (view.vview.bpPerPx === self.data.bpPerPxY &&
48
+ view.hview.bpPerPx === self.data.bpPerPxX);
49
+ },
50
+ /**
51
+ * #getter
52
+ */
53
+ get rendererTypeName() {
54
+ return (0, configuration_1.getConf)(self, ['renderer', 'type']);
55
+ },
56
+ /**
57
+ * #method
58
+ */
59
+ renderProps() {
60
+ return {
61
+ ...(0, tracks_1.getParentRenderProps)(self),
62
+ rpcDriverName: self.rpcDriverName,
63
+ displayModel: self,
64
+ config: self.configuration.renderer,
65
+ };
66
+ },
67
+ }))
68
+ .views(self => ({
69
+ /**
70
+ * #method
71
+ */
72
+ async renderSvg(opts) {
73
+ const props = (0, renderDotplotBlock_1.renderBlockData)(self);
74
+ if (!props) {
75
+ return null;
76
+ }
77
+ const { rendererType, rpcManager, renderProps } = props;
78
+ const rendering = await rendererType.renderInClient(rpcManager, {
79
+ ...renderProps,
80
+ exportSVG: opts,
81
+ theme: opts.theme || renderProps.theme,
82
+ });
83
+ const { hview, vview } = (0, util_1.getContainingView)(self);
84
+ const offX = -hview.offsetPx + rendering.offsetX;
85
+ const offY = -vview.offsetPx + rendering.offsetY;
86
+ return (react_1.default.createElement("g", { transform: `translate(${offX} ${-offY})` },
87
+ react_1.default.createElement(util_1.ReactRendering, { rendering: rendering })));
88
+ },
89
+ }))
90
+ .actions(self => {
91
+ let renderInProgress;
92
+ return {
93
+ afterAttach() {
94
+ (0, util_1.makeAbortableReaction)(self, () => (0, renderDotplotBlock_1.renderBlockData)(self), blockData => (0, renderDotplotBlock_1.renderBlockEffect)(blockData), {
95
+ name: `${self.type} ${self.id} rendering`,
96
+ delay: 500,
97
+ fireImmediately: true,
98
+ }, this.setLoading, this.setRendered, this.setError);
99
+ },
100
+ /**
101
+ * #action
102
+ */
103
+ setLoading(abortController) {
104
+ self.filled = false;
105
+ self.message = undefined;
106
+ self.reactElement = undefined;
107
+ self.data = undefined;
108
+ self.error = undefined;
109
+ self.renderingComponent = undefined;
110
+ renderInProgress = abortController;
111
+ },
112
+ /**
113
+ * #action
114
+ */
115
+ setMessage(messageText) {
116
+ if (renderInProgress && !renderInProgress.signal.aborted) {
117
+ renderInProgress.abort();
118
+ }
119
+ self.filled = false;
120
+ self.message = messageText;
121
+ self.reactElement = undefined;
122
+ self.data = undefined;
123
+ self.error = undefined;
124
+ self.renderingComponent = undefined;
125
+ renderInProgress = undefined;
126
+ },
127
+ /**
128
+ * #action
129
+ */
130
+ setRendered(args) {
131
+ if (args === undefined) {
132
+ return;
133
+ }
134
+ const { data, reactElement, renderingComponent } = args;
135
+ self.warnings = data.warnings;
136
+ self.filled = true;
137
+ self.message = undefined;
138
+ self.reactElement = reactElement;
139
+ self.data = data;
140
+ self.error = undefined;
141
+ self.renderingComponent = renderingComponent;
142
+ renderInProgress = undefined;
143
+ },
144
+ /**
145
+ * #action
146
+ */
147
+ setError(error) {
148
+ console.error(error);
149
+ if (renderInProgress && !renderInProgress.signal.aborted) {
150
+ renderInProgress.abort();
151
+ }
152
+ // the rendering failed for some reason
153
+ self.filled = false;
154
+ self.message = undefined;
155
+ self.reactElement = undefined;
156
+ self.data = undefined;
157
+ self.error = error;
158
+ self.renderingComponent = undefined;
159
+ renderInProgress = undefined;
160
+ },
161
+ };
162
+ });
163
+ }
164
+ exports.stateModelFactory = stateModelFactory;
165
+ //# sourceMappingURL=stateModelFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateModelFactory.js","sourceRoot":"","sources":["../../src/DotplotDisplay/stateModelFactory.tsx"],"names":[],"mappings":";;;;;;AAAA,uDAAuD;AACvD,kDAAyB;AAEzB,qDAAiD;AACjD,+DAIoC;AACpC,sDAAgE;AAChE,6CAI2B;AAC3B,uEAAwE;AAExE,SAAS;AACT,uGAA8E;AAC9E,6DAAyE;AAGzE;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,YAAwC;IACxE,OAAO,uBAAK;SACT,OAAO,CACN,gBAAgB,EAChB,oBAAW,EACX,uBAAK;SACF,KAAK,CAAC;QACL;;WAEG;QACH,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACrC;;WAEG;QACH,aAAa,EAAE,IAAA,sCAAsB,EAAC,YAAY,CAAC;KACpD,CAAC;SACD,QAAQ,CAAC,GAAG,EAAE,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AAA;gBACpB,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE;oBACxD,gBAAgB,CAAC,KAAK,EAAE,CAAA;iBACzB;gBACD,uCAAuC;gBACvC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;gBACnB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;gBACxB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAA;gBAC7B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;gBACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;gBAClB,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAA;gBACnC,gBAAgB,GAAG,SAAS,CAAA;YAC9B,CAAC;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC;AAtKD,8CAsKC"}
@@ -0,0 +1,3 @@
1
+ import { Feature } from '@jbrowse/core/util';
2
+ import { LinearPileupDisplayModel } from '@jbrowse/plugin-alignments';
3
+ export declare function onClick(feature: Feature, self: LinearPileupDisplayModel): void;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onClick = void 0;
4
+ const configuration_1 = require("@jbrowse/core/configuration");
5
+ const util_1 = require("@jbrowse/core/util");
6
+ const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
7
+ const { featurizeSA, getClip, getTag, getLength, getLengthSansClipping } = plugin_alignments_1.MismatchParser;
8
+ function onClick(feature, self) {
9
+ const session = (0, util_1.getSession)(self);
10
+ try {
11
+ const cigar = feature.get('CIGAR');
12
+ const clipPos = getClip(cigar, 1);
13
+ const flags = feature.get('flags');
14
+ const strand = feature.get('strand');
15
+ const readName = feature.get('name');
16
+ const readAssembly = `${readName}_assembly_${Date.now()}`;
17
+ const { parentTrack } = self;
18
+ const [trackAssembly] = (0, configuration_1.getConf)(parentTrack, 'assemblyNames');
19
+ const assemblyNames = [trackAssembly, readAssembly];
20
+ const trackId = `track-${Date.now()}`;
21
+ const trackName = `${readName}_vs_${trackAssembly}`;
22
+ const SA = getTag(feature, 'SA') || '';
23
+ const SA2 = featurizeSA(SA, feature.id(), strand, readName, true);
24
+ const feat = feature.toJSON();
25
+ feat.strand = 1;
26
+ feat.mate = {
27
+ refName: readName,
28
+ start: clipPos,
29
+ end: clipPos + getLengthSansClipping(cigar),
30
+ };
31
+ // if secondary alignment or supplementary, calculate length from SA[0]'s
32
+ // CIGAR which is the primary alignments. otherwise it is the primary
33
+ // alignment just use seq.length if primary alignment
34
+ const totalLength = getLength(flags & 2048 ? SA2[0].CIGAR : cigar);
35
+ const features = [feat, ...SA2];
36
+ features.sort((a, b) => a.clipPos - b.clipPos);
37
+ const refLength = features.reduce((a, f) => a + f.end - f.start, 0);
38
+ session.addView('DotplotView', {
39
+ type: 'DotplotView',
40
+ hview: {
41
+ offsetPx: 0,
42
+ bpPerPx: refLength / 800,
43
+ displayedRegions: (0, util_1.gatherOverlaps)(features.map((f, index) => {
44
+ const { start, end, refName } = f;
45
+ return {
46
+ start,
47
+ end,
48
+ refName,
49
+ index,
50
+ assemblyName: trackAssembly,
51
+ };
52
+ })),
53
+ },
54
+ vview: {
55
+ offsetPx: 0,
56
+ bpPerPx: totalLength / 400,
57
+ minimumBlockWidth: 0,
58
+ interRegionPaddingWidth: 0,
59
+ displayedRegions: [
60
+ {
61
+ assemblyName: readAssembly,
62
+ start: 0,
63
+ end: totalLength,
64
+ refName: readName,
65
+ },
66
+ ],
67
+ },
68
+ viewTrackConfigs: [
69
+ {
70
+ type: 'SyntenyTrack',
71
+ assemblyNames,
72
+ adapter: {
73
+ type: 'FromConfigAdapter',
74
+ features,
75
+ },
76
+ trackId,
77
+ name: trackName,
78
+ },
79
+ ],
80
+ assemblyNames,
81
+ tracks: [
82
+ {
83
+ configuration: trackId,
84
+ type: 'SyntenyTrack',
85
+ displays: [
86
+ {
87
+ type: 'DotplotDisplay',
88
+ configuration: `${trackId}-DotplotDisplay`,
89
+ },
90
+ ],
91
+ },
92
+ ],
93
+ displayName: `${readName} vs ${trackAssembly}`,
94
+ });
95
+ }
96
+ catch (e) {
97
+ console.error(e);
98
+ session.notify(`${e}`, 'error');
99
+ }
100
+ }
101
+ exports.onClick = onClick;
102
+ //# sourceMappingURL=DotplotReadVsRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DotplotReadVsRef.js","sourceRoot":"","sources":["../../src/DotplotReadVsRef/DotplotReadVsRef.ts"],"names":[],"mappings":";;;AAAA,+DAAqD;AACrD,6CAAwE;AACxE,kEAGmC;AAKnC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GACtE,kCAAc,CAAA;AAEhB,SAAgB,OAAO,CAAC,OAAgB,EAAE,IAA8B;IACtE,MAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAA;IAChC,IAAI;QACF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAClC,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,MAAM,YAAY,GAAG,GAAG,QAAQ,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;QACzD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;QAC5B,MAAM,CAAC,aAAa,CAAC,GAAG,IAAA,uBAAO,EAAC,WAAW,EAAE,eAAe,CAAC,CAAA;QAC7D,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,GAAG,EAAE,EAAE,CAA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owse/core/PluginManager';
2
+ export default function DotplotReadVsRefMenuItem(pluginManager: PluginManager): void;
@@ -0,0 +1,42 @@
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
+ // icons
7
+ const Add_1 = __importDefault(require("@mui/icons-material/Add"));
8
+ // local
9
+ const DotplotReadVsRef_1 = require("./DotplotReadVsRef");
10
+ function DotplotReadVsRefMenuItem(pluginManager) {
11
+ pluginManager.addToExtensionPoint('Core-extendPluggableElement', (pluggableElement) => {
12
+ if (pluggableElement.name === 'LinearPileupDisplay') {
13
+ const { stateModel } = pluggableElement;
14
+ const newStateModel = stateModel.extend((self) => {
15
+ const superContextMenuItems = self.contextMenuItems;
16
+ return {
17
+ views: {
18
+ contextMenuItems() {
19
+ const feature = self.contextMenuFeature;
20
+ return [
21
+ ...superContextMenuItems(),
22
+ ...(feature
23
+ ? [
24
+ {
25
+ label: 'Dotplot of read vs ref',
26
+ icon: Add_1.default,
27
+ onClick: () => (0, DotplotReadVsRef_1.onClick)(feature, self),
28
+ },
29
+ ]
30
+ : []),
31
+ ];
32
+ },
33
+ },
34
+ };
35
+ });
36
+ pluggableElement.stateModel = newStateModel;
37
+ }
38
+ return pluggableElement;
39
+ });
40
+ }
41
+ exports.default = DotplotReadVsRefMenuItem;
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DotplotReadVsRef/index.ts"],"names":[],"mappings":";;;;;AAOA,QAAQ;AACR,kEAA6C;AAE7C,QAAQ;AACR,yDAA4C;AAE5C,SAAwB,wBAAwB,CAAC,aAA4B;IAC3E,aAAa,CAAC,mBAAmB,CAC/B,6BAA6B,EAC7B,CAAC,gBAAsC,EAAE,EAAE;QACzC,IAAI,gBAAgB,CAAC,IAAI,KAAK,qBAAqB,EAAE;YACnD,MAAM,EAAE,UAAU,EAAE,GAAG,gBAA4B,CAAA;YACnD,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CACrC,CAAC,IAA8B,EAAE,EAAE;gBACjC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAA;gBACnD,OAAO;oBACL,KAAK,EAAE;wBACL,gBAAgB;4BACd,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAA;4BACvC,OAAO;gCACL,GAAG,qBAAqB,EAAE;gCAC1B,GAAG,CAAC,OAAO;oCACT,CAAC,CAAC;wCACE;4CACE,KAAK,EAAE,wBAAwB;4CAC/B,IAAI,EAAE,aAAO;4CACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,0BAAO,EAAC,OAAO,EAAE,IAAI,CAAC;yCACtC;qCACF;oCACH,CAAC,CAAC,EAAE,CAAC;6BACR,CAAA;wBACH,CAAC;qBACF;iBACF,CAAA;YACH,CAAC,CACF,CAEA;YAAC,gBAA6B,CAAC,UAAU,GAAG,aAAa,CAAA;SAC3D;QACD,OAAO,gBAAgB,CAAA;IACzB,CAAC,CACF,CAAA;AACH,CAAC;AApCD,2CAoCC"}
@@ -0,0 +1,27 @@
1
+ import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType';
2
+ import ComparativeRenderer, { RenderArgs as ComparativeRenderArgs, RenderArgsSerialized as ComparativeRenderArgsSerialized, RenderResults, ResultsSerialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
3
+ import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals';
4
+ interface RenderArgs extends ComparativeRenderArgs {
5
+ adapterConfig: {};
6
+ rendererType: string;
7
+ }
8
+ interface RenderArgsSerialized extends ComparativeRenderArgsSerialized {
9
+ adapterConfig: {};
10
+ rendererType: string;
11
+ }
12
+ /**
13
+ * call a synteny renderer with the given args
14
+ * param views: a set of views that each contain a set of regions
15
+ * used instead of passing regions directly as in render()
16
+ */
17
+ export default class ComparativeRender extends RpcMethodType {
18
+ name: string;
19
+ renameRegionsIfNeeded(args: RenderArgs, rend: ComparativeRenderer): Promise<ComparativeRenderArgs>;
20
+ getRenderer(rendererType: string): ComparativeRenderer;
21
+ serializeArguments(args: RenderArgs, rpcDriver: string): Promise<ComparativeRenderArgs | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").RenderArgsSerialized>;
22
+ execute(args: RenderArgsSerialized & {
23
+ signal?: RemoteAbortSignal;
24
+ }, rpcDriver: string): Promise<RenderResults | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").ResultsSerialized>;
25
+ deserializeReturn(val: RenderResults | ResultsSerialized, args: RenderArgs, rpcDriver: string): Promise<unknown>;
26
+ }
27
+ export {};
@@ -0,0 +1,59 @@
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
+ const util_1 = require("@jbrowse/core/util");
7
+ const RpcMethodType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/RpcMethodType"));
8
+ /**
9
+ * call a synteny renderer with the given args
10
+ * param views: a set of views that each contain a set of regions
11
+ * used instead of passing regions directly as in render()
12
+ */
13
+ class ComparativeRender extends RpcMethodType_1.default {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.name = 'ComparativeRender';
17
+ }
18
+ async renameRegionsIfNeeded(args, rend) {
19
+ return rend.renameRegionsIfNeeded(args);
20
+ }
21
+ getRenderer(rendererType) {
22
+ const pm = this.pluginManager;
23
+ return pm.getRendererType(rendererType);
24
+ }
25
+ async serializeArguments(args, rpcDriver) {
26
+ const { rendererType } = args;
27
+ const renderer = this.getRenderer(rendererType);
28
+ const n = (await super.serializeArguments(args, rpcDriver));
29
+ const result = await this.renameRegionsIfNeeded(n, renderer);
30
+ return rpcDriver === 'MainThreadRpcDriver'
31
+ ? result
32
+ : renderer.serializeArgsInClient(result);
33
+ }
34
+ async execute(args, rpcDriver) {
35
+ let deserializedArgs = args;
36
+ if (rpcDriver !== 'MainThreadRpcDriver') {
37
+ deserializedArgs = await this.deserializeArguments(args, rpcDriver);
38
+ }
39
+ const { sessionId, rendererType, signal } = deserializedArgs;
40
+ if (!sessionId) {
41
+ throw new Error('must pass a unique session id');
42
+ }
43
+ (0, util_1.checkAbortSignal)(signal);
44
+ const renderer = this.getRenderer(rendererType);
45
+ return rpcDriver === 'MainThreadRpcDriver'
46
+ ? renderer.render(deserializedArgs)
47
+ : renderer.renderInWorker(deserializedArgs);
48
+ }
49
+ async deserializeReturn(val, args, rpcDriver) {
50
+ const ret = (await super.deserializeReturn(val, args, rpcDriver));
51
+ if (rpcDriver === 'MainThreadRpcDriver') {
52
+ return ret;
53
+ }
54
+ const renderer = this.getRenderer(args.rendererType);
55
+ return renderer.deserializeResultsInClient(ret, args);
56
+ }
57
+ }
58
+ exports.default = ComparativeRender;
59
+ //# sourceMappingURL=ComparativeRenderRpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComparativeRenderRpc.js","sourceRoot":"","sources":["../../src/DotplotRenderer/ComparativeRenderRpc.ts"],"names":[],"mappings":";;;;;AAAA,6CAAqD;AACrD,sGAA6E;AAmB7E;;;;GAIG;AACH,MAAqB,iBAAkB,SAAQ,uBAAa;IAA5D;;QACE,SAAI,GAAG,mBAAmB,CAAA;IA4D5B,CAAC;IA1DC,KAAK,CAAC,qBAAqB,CAAC,IAAgB,EAAE,IAAyB;QACrE,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAED,WAAW,CAAC,YAAoB;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QAC7B,OAAO,EAAE,CAAC,eAAe,CAAC,YAAY,CAAwB,CAAA;IAChE,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,IAAgB,EAAE,SAAiB;QAC1D,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI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vB,IAAI,SAAS,KAAK,qBAAqB,EAAE;YACvC,OAAO,GAAG,CAAA;SACX;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACpD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACvD,CAAC;CACF;AA7DD,oCA6DC"}
@@ -0,0 +1,69 @@
1
+ /// <reference types="react" />
2
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import { Region } from '@jbrowse/core/util';
4
+ import ComparativeRenderer, { RenderArgsDeserialized, RenderArgs } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
5
+ import { Dotplot1DViewModel } from '../DotplotView/model';
6
+ export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
7
+ height: number;
8
+ width: number;
9
+ highResolutionScaling: number;
10
+ view: {
11
+ hview: Dotplot1DViewModel;
12
+ vview: Dotplot1DViewModel;
13
+ };
14
+ }
15
+ interface DotplotRenderArgs extends RenderArgs {
16
+ adapterConfig: AnyConfigurationModel;
17
+ sessionId: string;
18
+ view: {
19
+ hview: {
20
+ displayedRegions: Region[];
21
+ };
22
+ vview: {
23
+ displayedRegions: Region[];
24
+ };
25
+ };
26
+ }
27
+ export default class DotplotRenderer extends ComparativeRenderer {
28
+ supportsSVG: boolean;
29
+ renameRegionsIfNeeded(args: DotplotRenderArgs): Promise<DotplotRenderArgs>;
30
+ drawDotplot(ctx: CanvasRenderingContext2D, props: DotplotRenderArgsDeserialized & {
31
+ views: Dotplot1DViewModel[];
32
+ }): Promise<{
33
+ warnings: {
34
+ message: string;
35
+ effect: string;
36
+ }[];
37
+ }>;
38
+ render(renderProps: DotplotRenderArgsDeserialized): Promise<{
39
+ height: number;
40
+ width: number;
41
+ offsetX: number;
42
+ offsetY: number;
43
+ bpPerPxX: number;
44
+ bpPerPxY: number;
45
+ canvasRecordedData: any;
46
+ reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
47
+ html?: string | undefined;
48
+ } | {
49
+ height: number;
50
+ width: number;
51
+ offsetX: number;
52
+ offsetY: number;
53
+ bpPerPxX: number;
54
+ bpPerPxY: number;
55
+ reactElement: import("react").JSX.Element;
56
+ html?: string | undefined;
57
+ } | {
58
+ height: number;
59
+ width: number;
60
+ offsetX: number;
61
+ offsetY: number;
62
+ bpPerPxX: number;
63
+ bpPerPxY: number;
64
+ imageData: any;
65
+ reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
66
+ html?: string | undefined;
67
+ }>;
68
+ }
69
+ export {};