@jbrowse/plugin-linear-comparative-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 (276) hide show
  1. package/LICENSE +201 -0
  2. package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +52 -0
  3. package/dist/LGVSyntenyDisplay/configSchemaF.js +18 -0
  4. package/dist/LGVSyntenyDisplay/configSchemaF.js.map +1 -0
  5. package/dist/LGVSyntenyDisplay/index.d.ts +3 -0
  6. package/dist/LGVSyntenyDisplay/index.js +24 -0
  7. package/dist/LGVSyntenyDisplay/index.js.map +1 -0
  8. package/dist/LGVSyntenyDisplay/model.d.ts +380 -0
  9. package/dist/LGVSyntenyDisplay/model.js +154 -0
  10. package/dist/LGVSyntenyDisplay/model.js.map +1 -0
  11. package/dist/LaunchLinearSyntenyView.d.ts +2 -0
  12. package/dist/LaunchLinearSyntenyView.js +58 -0
  13. package/dist/LaunchLinearSyntenyView.js.map +1 -0
  14. package/dist/LinearComparativeDisplay/configSchemaF.d.ts +5 -0
  15. package/dist/LinearComparativeDisplay/configSchemaF.js +18 -0
  16. package/dist/LinearComparativeDisplay/configSchemaF.js.map +1 -0
  17. package/dist/LinearComparativeDisplay/index.d.ts +3 -0
  18. package/dist/LinearComparativeDisplay/index.js +24 -0
  19. package/dist/LinearComparativeDisplay/index.js.map +1 -0
  20. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +275 -0
  21. package/dist/LinearComparativeDisplay/stateModelFactory.js +172 -0
  22. package/dist/LinearComparativeDisplay/stateModelFactory.js.map +1 -0
  23. package/dist/LinearComparativeView/components/Header.d.ts +7 -0
  24. package/dist/LinearComparativeView/components/Header.js +89 -0
  25. package/dist/LinearComparativeView/components/Header.js.map +1 -0
  26. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +8 -0
  27. package/dist/LinearComparativeView/components/LinearComparativeView.js +99 -0
  28. package/dist/LinearComparativeView/components/LinearComparativeView.js.map +1 -0
  29. package/dist/LinearComparativeView/components/Rubberband.d.ts +9 -0
  30. package/dist/LinearComparativeView/components/Rubberband.js +225 -0
  31. package/dist/LinearComparativeView/components/Rubberband.js.map +1 -0
  32. package/dist/LinearComparativeView/index.d.ts +3 -0
  33. package/dist/LinearComparativeView/index.js +42 -0
  34. package/dist/LinearComparativeView/index.js.map +1 -0
  35. package/dist/LinearComparativeView/model.d.ts +326 -0
  36. package/dist/LinearComparativeView/model.js +346 -0
  37. package/dist/LinearComparativeView/model.js.map +1 -0
  38. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +7 -0
  39. package/dist/LinearReadVsRef/LinearReadVsRef.js +284 -0
  40. package/dist/LinearReadVsRef/LinearReadVsRef.js.map +1 -0
  41. package/dist/LinearReadVsRef/index.d.ts +2 -0
  42. package/dist/LinearReadVsRef/index.js +55 -0
  43. package/dist/LinearReadVsRef/index.js.map +1 -0
  44. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +2 -0
  45. package/dist/LinearSyntenyDisplay/afterAttach.js +108 -0
  46. package/dist/LinearSyntenyDisplay/afterAttach.js.map +1 -0
  47. package/dist/LinearSyntenyDisplay/components/Component.d.ts +6 -0
  48. package/dist/LinearSyntenyDisplay/components/Component.js +87 -0
  49. package/dist/LinearSyntenyDisplay/components/Component.js.map +1 -0
  50. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +6 -0
  51. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +160 -0
  52. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js.map +1 -0
  53. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +7 -0
  54. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +83 -0
  55. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js.map +1 -0
  56. package/dist/LinearSyntenyDisplay/components/util.d.ts +27 -0
  57. package/dist/LinearSyntenyDisplay/components/util.js +84 -0
  58. package/dist/LinearSyntenyDisplay/components/util.js.map +1 -0
  59. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +23 -0
  60. package/dist/LinearSyntenyDisplay/configSchemaF.js +36 -0
  61. package/dist/LinearSyntenyDisplay/configSchemaF.js.map +1 -0
  62. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +5 -0
  63. package/dist/LinearSyntenyDisplay/drawSynteny.js +235 -0
  64. package/dist/LinearSyntenyDisplay/drawSynteny.js.map +1 -0
  65. package/dist/LinearSyntenyDisplay/index.d.ts +3 -0
  66. package/dist/LinearSyntenyDisplay/index.js +47 -0
  67. package/dist/LinearSyntenyDisplay/index.js.map +1 -0
  68. package/dist/LinearSyntenyDisplay/model.d.ts +333 -0
  69. package/dist/LinearSyntenyDisplay/model.js +179 -0
  70. package/dist/LinearSyntenyDisplay/model.js.map +1 -0
  71. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +8 -0
  72. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +86 -0
  73. package/dist/LinearSyntenyView/components/ExportSvgDialog.js.map +1 -0
  74. package/dist/LinearSyntenyView/components/Icons.d.ts +4 -0
  75. package/dist/LinearSyntenyView/components/Icons.js +19 -0
  76. package/dist/LinearSyntenyView/components/Icons.js.map +1 -0
  77. package/dist/LinearSyntenyView/components/ImportCustomTrack.d.ts +11 -0
  78. package/dist/LinearSyntenyView/components/ImportCustomTrack.js +180 -0
  79. package/dist/LinearSyntenyView/components/ImportCustomTrack.js.map +1 -0
  80. package/dist/LinearSyntenyView/components/ImportForm.d.ts +6 -0
  81. package/dist/LinearSyntenyView/components/ImportForm.js +127 -0
  82. package/dist/LinearSyntenyView/components/ImportForm.js.map +1 -0
  83. package/dist/LinearSyntenyView/components/ImportSyntenyTrackSelector.d.ts +9 -0
  84. package/dist/LinearSyntenyView/components/ImportSyntenyTrackSelector.js +63 -0
  85. package/dist/LinearSyntenyView/components/ImportSyntenyTrackSelector.js.map +1 -0
  86. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +7 -0
  87. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +38 -0
  88. package/dist/LinearSyntenyView/components/LinearSyntenyView.js.map +1 -0
  89. package/dist/LinearSyntenyView/index.d.ts +3 -0
  90. package/dist/LinearSyntenyView/index.js +42 -0
  91. package/dist/LinearSyntenyView/index.js.map +1 -0
  92. package/dist/LinearSyntenyView/model.d.ts +754 -0
  93. package/dist/LinearSyntenyView/model.js +170 -0
  94. package/dist/LinearSyntenyView/model.js.map +1 -0
  95. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +6 -0
  96. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +13 -0
  97. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js.map +1 -0
  98. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +4 -0
  99. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +85 -0
  100. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js.map +1 -0
  101. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +5 -0
  102. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +66 -0
  103. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js.map +1 -0
  104. package/dist/SyntenyFeatureDetail/index.d.ts +3 -0
  105. package/dist/SyntenyFeatureDetail/index.js +58 -0
  106. package/dist/SyntenyFeatureDetail/index.js.map +1 -0
  107. package/dist/SyntenyTrack/configSchema.d.ts +75 -0
  108. package/dist/SyntenyTrack/configSchema.js +16 -0
  109. package/dist/SyntenyTrack/configSchema.js.map +1 -0
  110. package/dist/SyntenyTrack/index.d.ts +3 -0
  111. package/dist/SyntenyTrack/index.js +19 -0
  112. package/dist/SyntenyTrack/index.js.map +1 -0
  113. package/dist/index.d.ts +7 -0
  114. package/dist/index.js +47 -0
  115. package/dist/index.js.map +1 -0
  116. package/dist/util.d.ts +25 -0
  117. package/dist/util.js +77 -0
  118. package/dist/util.js.map +1 -0
  119. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +52 -0
  120. package/esm/LGVSyntenyDisplay/configSchemaF.js +16 -0
  121. package/esm/LGVSyntenyDisplay/configSchemaF.js.map +1 -0
  122. package/esm/LGVSyntenyDisplay/index.d.ts +3 -0
  123. package/esm/LGVSyntenyDisplay/index.js +19 -0
  124. package/esm/LGVSyntenyDisplay/index.js.map +1 -0
  125. package/esm/LGVSyntenyDisplay/model.d.ts +380 -0
  126. package/esm/LGVSyntenyDisplay/model.js +152 -0
  127. package/esm/LGVSyntenyDisplay/model.js.map +1 -0
  128. package/esm/LaunchLinearSyntenyView.d.ts +2 -0
  129. package/esm/LaunchLinearSyntenyView.js +55 -0
  130. package/esm/LaunchLinearSyntenyView.js.map +1 -0
  131. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +5 -0
  132. package/esm/LinearComparativeDisplay/configSchemaF.js +16 -0
  133. package/esm/LinearComparativeDisplay/configSchemaF.js.map +1 -0
  134. package/esm/LinearComparativeDisplay/index.d.ts +3 -0
  135. package/esm/LinearComparativeDisplay/index.js +19 -0
  136. package/esm/LinearComparativeDisplay/index.js.map +1 -0
  137. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +275 -0
  138. package/esm/LinearComparativeDisplay/stateModelFactory.js +170 -0
  139. package/esm/LinearComparativeDisplay/stateModelFactory.js.map +1 -0
  140. package/esm/LinearComparativeView/components/Header.d.ts +7 -0
  141. package/esm/LinearComparativeView/components/Header.js +61 -0
  142. package/esm/LinearComparativeView/components/Header.js.map +1 -0
  143. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +8 -0
  144. package/esm/LinearComparativeView/components/LinearComparativeView.js +94 -0
  145. package/esm/LinearComparativeView/components/LinearComparativeView.js.map +1 -0
  146. package/esm/LinearComparativeView/components/Rubberband.d.ts +9 -0
  147. package/esm/LinearComparativeView/components/Rubberband.js +200 -0
  148. package/esm/LinearComparativeView/components/Rubberband.js.map +1 -0
  149. package/esm/LinearComparativeView/index.d.ts +3 -0
  150. package/esm/LinearComparativeView/index.js +14 -0
  151. package/esm/LinearComparativeView/index.js.map +1 -0
  152. package/esm/LinearComparativeView/model.d.ts +326 -0
  153. package/esm/LinearComparativeView/model.js +318 -0
  154. package/esm/LinearComparativeView/model.js.map +1 -0
  155. package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +7 -0
  156. package/esm/LinearReadVsRef/LinearReadVsRef.js +258 -0
  157. package/esm/LinearReadVsRef/LinearReadVsRef.js.map +1 -0
  158. package/esm/LinearReadVsRef/index.d.ts +2 -0
  159. package/esm/LinearReadVsRef/index.js +49 -0
  160. package/esm/LinearReadVsRef/index.js.map +1 -0
  161. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +2 -0
  162. package/esm/LinearSyntenyDisplay/afterAttach.js +104 -0
  163. package/esm/LinearSyntenyDisplay/afterAttach.js.map +1 -0
  164. package/esm/LinearSyntenyDisplay/components/Component.d.ts +6 -0
  165. package/esm/LinearSyntenyDisplay/components/Component.js +59 -0
  166. package/esm/LinearSyntenyDisplay/components/Component.js.map +1 -0
  167. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +6 -0
  168. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +132 -0
  169. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js.map +1 -0
  170. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +7 -0
  171. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +58 -0
  172. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js.map +1 -0
  173. package/esm/LinearSyntenyDisplay/components/util.d.ts +27 -0
  174. package/esm/LinearSyntenyDisplay/components/util.js +77 -0
  175. package/esm/LinearSyntenyDisplay/components/util.js.map +1 -0
  176. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +23 -0
  177. package/esm/LinearSyntenyDisplay/configSchemaF.js +31 -0
  178. package/esm/LinearSyntenyDisplay/configSchemaF.js.map +1 -0
  179. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +5 -0
  180. package/esm/LinearSyntenyDisplay/drawSynteny.js +229 -0
  181. package/esm/LinearSyntenyDisplay/drawSynteny.js.map +1 -0
  182. package/esm/LinearSyntenyDisplay/index.d.ts +3 -0
  183. package/esm/LinearSyntenyDisplay/index.js +19 -0
  184. package/esm/LinearSyntenyDisplay/index.js.map +1 -0
  185. package/esm/LinearSyntenyDisplay/model.d.ts +333 -0
  186. package/esm/LinearSyntenyDisplay/model.js +151 -0
  187. package/esm/LinearSyntenyDisplay/model.js.map +1 -0
  188. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +8 -0
  189. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +60 -0
  190. package/esm/LinearSyntenyView/components/ExportSvgDialog.js.map +1 -0
  191. package/esm/LinearSyntenyView/components/Icons.d.ts +4 -0
  192. package/esm/LinearSyntenyView/components/Icons.js +11 -0
  193. package/esm/LinearSyntenyView/components/Icons.js.map +1 -0
  194. package/esm/LinearSyntenyView/components/ImportCustomTrack.d.ts +11 -0
  195. package/esm/LinearSyntenyView/components/ImportCustomTrack.js +152 -0
  196. package/esm/LinearSyntenyView/components/ImportCustomTrack.js.map +1 -0
  197. package/esm/LinearSyntenyView/components/ImportForm.d.ts +6 -0
  198. package/esm/LinearSyntenyView/components/ImportForm.js +99 -0
  199. package/esm/LinearSyntenyView/components/ImportForm.js.map +1 -0
  200. package/esm/LinearSyntenyView/components/ImportSyntenyTrackSelector.d.ts +9 -0
  201. package/esm/LinearSyntenyView/components/ImportSyntenyTrackSelector.js +38 -0
  202. package/esm/LinearSyntenyView/components/ImportSyntenyTrackSelector.js.map +1 -0
  203. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +7 -0
  204. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +10 -0
  205. package/esm/LinearSyntenyView/components/LinearSyntenyView.js.map +1 -0
  206. package/esm/LinearSyntenyView/index.d.ts +3 -0
  207. package/esm/LinearSyntenyView/index.js +14 -0
  208. package/esm/LinearSyntenyView/index.js.map +1 -0
  209. package/esm/LinearSyntenyView/model.d.ts +754 -0
  210. package/esm/LinearSyntenyView/model.js +141 -0
  211. package/esm/LinearSyntenyView/model.js.map +1 -0
  212. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +6 -0
  213. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +7 -0
  214. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js.map +1 -0
  215. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +4 -0
  216. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +78 -0
  217. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js.map +1 -0
  218. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +5 -0
  219. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +38 -0
  220. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js.map +1 -0
  221. package/esm/SyntenyFeatureDetail/index.d.ts +3 -0
  222. package/esm/SyntenyFeatureDetail/index.js +30 -0
  223. package/esm/SyntenyFeatureDetail/index.js.map +1 -0
  224. package/esm/SyntenyTrack/configSchema.d.ts +75 -0
  225. package/esm/SyntenyTrack/configSchema.js +14 -0
  226. package/esm/SyntenyTrack/configSchema.js.map +1 -0
  227. package/esm/SyntenyTrack/index.d.ts +3 -0
  228. package/esm/SyntenyTrack/index.js +14 -0
  229. package/esm/SyntenyTrack/index.js.map +1 -0
  230. package/esm/index.d.ts +7 -0
  231. package/esm/index.js +41 -0
  232. package/esm/index.js.map +1 -0
  233. package/esm/util.d.ts +25 -0
  234. package/esm/util.js +69 -0
  235. package/esm/util.js.map +1 -0
  236. package/package.json +67 -0
  237. package/src/LGVSyntenyDisplay/configSchemaF.ts +22 -0
  238. package/src/LGVSyntenyDisplay/index.ts +20 -0
  239. package/src/LGVSyntenyDisplay/model.ts +177 -0
  240. package/src/LaunchLinearSyntenyView.ts +86 -0
  241. package/src/LinearComparativeDisplay/configSchemaF.ts +22 -0
  242. package/src/LinearComparativeDisplay/index.ts +21 -0
  243. package/src/LinearComparativeDisplay/stateModelFactory.ts +212 -0
  244. package/src/LinearComparativeView/components/Header.tsx +103 -0
  245. package/src/LinearComparativeView/components/LinearComparativeView.tsx +152 -0
  246. package/src/LinearComparativeView/components/Rubberband.tsx +329 -0
  247. package/src/LinearComparativeView/index.ts +15 -0
  248. package/src/LinearComparativeView/model.ts +395 -0
  249. package/src/LinearReadVsRef/LinearReadVsRef.tsx +360 -0
  250. package/src/LinearReadVsRef/index.ts +58 -0
  251. package/src/LinearSyntenyDisplay/afterAttach.ts +149 -0
  252. package/src/LinearSyntenyDisplay/components/Component.tsx +75 -0
  253. package/src/LinearSyntenyDisplay/components/LinearSyntenyRendering.tsx +200 -0
  254. package/src/LinearSyntenyDisplay/components/SyntenyTooltip.tsx +82 -0
  255. package/src/LinearSyntenyDisplay/components/util.ts +142 -0
  256. package/src/LinearSyntenyDisplay/configSchemaF.ts +38 -0
  257. package/src/LinearSyntenyDisplay/drawSynteny.ts +266 -0
  258. package/src/LinearSyntenyDisplay/index.ts +21 -0
  259. package/src/LinearSyntenyDisplay/model.ts +187 -0
  260. package/src/LinearSyntenyView/components/ExportSvgDialog.tsx +148 -0
  261. package/src/LinearSyntenyView/components/Icons.tsx +24 -0
  262. package/src/LinearSyntenyView/components/ImportCustomTrack.tsx +262 -0
  263. package/src/LinearSyntenyView/components/ImportForm.tsx +221 -0
  264. package/src/LinearSyntenyView/components/ImportSyntenyTrackSelector.tsx +82 -0
  265. package/src/LinearSyntenyView/components/LinearSyntenyView.tsx +20 -0
  266. package/src/LinearSyntenyView/index.ts +15 -0
  267. package/src/LinearSyntenyView/model.test.ts +1605 -0
  268. package/src/LinearSyntenyView/model.ts +169 -0
  269. package/src/LinearSyntenyView/svgcomponents/SVGBackground.tsx +21 -0
  270. package/src/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.tsx +176 -0
  271. package/src/SyntenyFeatureDetail/SyntenyFeatureDetail.tsx +64 -0
  272. package/src/SyntenyFeatureDetail/index.ts +36 -0
  273. package/src/SyntenyTrack/configSchema.ts +23 -0
  274. package/src/SyntenyTrack/index.tsx +15 -0
  275. package/src/index.tsx +42 -0
  276. package/src/util.ts +124 -0
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@jbrowse/plugin-linear-comparative-view",
3
+ "version": "2.6.1",
4
+ "description": "JBrowse 2 linear comparative view",
5
+ "keywords": [
6
+ "jbrowse",
7
+ "jbrowse2"
8
+ ],
9
+ "license": "Apache-2.0",
10
+ "homepage": "https://jbrowse.org",
11
+ "bugs": "https://github.com/GMOD/jbrowse-components/issues",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/GMOD/jbrowse-components.git",
15
+ "directory": "plugins/linear-comparative-view"
16
+ },
17
+ "author": "JBrowse Team",
18
+ "distMain": "dist/index.js",
19
+ "srcMain": "src/index.tsx",
20
+ "main": "dist/index.js",
21
+ "files": [
22
+ "dist",
23
+ "src",
24
+ "esm"
25
+ ],
26
+ "scripts": {
27
+ "build": "npm-run-all build:*",
28
+ "test": "cd ../..; jest plugins/linear-comparative-view",
29
+ "prepublishOnly": "yarn test",
30
+ "prepack": "yarn build && yarn useDist",
31
+ "postpack": "yarn useSrc",
32
+ "useDist": "node ../../scripts/useDist.js",
33
+ "useSrc": "node ../../scripts/useSrc.js",
34
+ "prebuild": "npm run clean",
35
+ "build:esm": "tsc --build tsconfig.build.esm.json",
36
+ "build:es5": "tsc --build tsconfig.build.es5.json",
37
+ "clean": "rimraf dist esm *.tsbuildinfo"
38
+ },
39
+ "dependencies": {
40
+ "@mui/icons-material": "^5.0.1",
41
+ "@popperjs/core": "^2.0.0",
42
+ "clone": "^2.1.2",
43
+ "copy-to-clipboard": "^3.3.1",
44
+ "file-saver": "^2.0.0",
45
+ "react-popper": "^2.0.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@jbrowse/core": "^2.0.0",
49
+ "@jbrowse/plugin-alignments": "^2.0.0",
50
+ "@jbrowse/plugin-linear-genome-view": "^2.0.0",
51
+ "@mui/material": "^5.0.0",
52
+ "mobx": "^6.0.0",
53
+ "mobx-react": "^7.0.0",
54
+ "mobx-state-tree": "^5.0.0",
55
+ "react": ">=16.8.0",
56
+ "react-dom": ">=16.8.0",
57
+ "rxjs": "^7.0.0",
58
+ "tss-react": "^4.0.0"
59
+ },
60
+ "distModule": "esm/index.js",
61
+ "srcModule": "src/index.ts",
62
+ "module": "esm/index.js",
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
67
+ }
@@ -0,0 +1,22 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
+ import PluginManager from '@jbrowse/core/PluginManager'
3
+ import { linearPileupDisplayConfigSchemaFactory } from '@jbrowse/plugin-alignments'
4
+
5
+ /**
6
+ * #config LGVSyntenyDisplay
7
+ */
8
+ function configSchemaF(pluginManager: PluginManager) {
9
+ return ConfigurationSchema(
10
+ 'LGVSyntenyDisplay',
11
+ {},
12
+ {
13
+ /**
14
+ * #baseConfiguration
15
+ */
16
+ baseConfiguration: linearPileupDisplayConfigSchemaFactory(pluginManager),
17
+ explicitlyTyped: true,
18
+ },
19
+ )
20
+ }
21
+
22
+ export default configSchemaF
@@ -0,0 +1,20 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
3
+ import configSchemaF from './configSchemaF'
4
+ import stateModelF from './model'
5
+ import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view'
6
+
7
+ export default (pluginManager: PluginManager) => {
8
+ pluginManager.addDisplayType(() => {
9
+ const configSchema = configSchemaF(pluginManager)
10
+ const stateModel = stateModelF(configSchema)
11
+ return new DisplayType({
12
+ name: 'LGVSyntenyDisplay',
13
+ configSchema,
14
+ stateModel,
15
+ trackType: 'SyntenyTrack',
16
+ viewType: 'LinearGenomeView',
17
+ ReactComponent: BaseLinearDisplayComponent,
18
+ })
19
+ })
20
+ }
@@ -0,0 +1,177 @@
1
+ import {
2
+ ConfigurationReference,
3
+ AnyConfigurationSchemaType,
4
+ } from '@jbrowse/core/configuration'
5
+ import {
6
+ getSession,
7
+ getContainingTrack,
8
+ getContainingView,
9
+ Feature,
10
+ } from '@jbrowse/core/util'
11
+ import {
12
+ MismatchParser,
13
+ linearPileupDisplayStateModelFactory,
14
+ } from '@jbrowse/plugin-alignments'
15
+ import { IAnyStateTreeNode, types } from 'mobx-state-tree'
16
+ import { when } from 'mobx'
17
+
18
+ // locals
19
+ import { LinearSyntenyViewModel } from '../LinearSyntenyView/model'
20
+
21
+ type LSV = LinearSyntenyViewModel
22
+
23
+ const { parseCigar } = MismatchParser
24
+
25
+ function findPosInCigar(cigar: string[], startX: number) {
26
+ let featX = 0
27
+ let mateX = 0
28
+ for (let i = 0; i < cigar.length; i++) {
29
+ const len = +cigar[i]
30
+ const op = cigar[i + 1]
31
+ const min = Math.min(len, startX - featX)
32
+
33
+ if (featX >= startX) {
34
+ break
35
+ } else if (op === 'I') {
36
+ mateX += len
37
+ } else if (op === 'D') {
38
+ featX += min
39
+ } else if (op === 'M') {
40
+ mateX += min
41
+ featX += min
42
+ }
43
+ }
44
+ return [featX, mateX]
45
+ }
46
+
47
+ async function navToSynteny(feature: Feature, self: IAnyStateTreeNode) {
48
+ const session = getSession(self)
49
+ const track = getContainingTrack(self)
50
+ const view = getContainingView(self)
51
+ const reg = view.dynamicBlocks.contentBlocks[0]
52
+ const cigar = feature.get('CIGAR')
53
+ const strand = feature.get('strand')
54
+ const regStart = reg.start
55
+ const regEnd = reg.end
56
+ const featStart = feature.get('start')
57
+ const featEnd = feature.get('end')
58
+ const mate = feature.get('mate')
59
+ const mateStart = mate.start
60
+ const mateEnd = mate.end
61
+ const mateAsm = mate.assemblyName
62
+ const mateRef = mate.refName
63
+ const featAsm = reg.assemblyName
64
+ const featRef = reg.refName
65
+
66
+ let rMateStart: number
67
+ let rMateEnd: number
68
+ let rFeatStart: number
69
+ let rFeatEnd: number
70
+
71
+ if (cigar) {
72
+ const p = parseCigar(cigar)
73
+ const [fStartX, mStartX] = findPosInCigar(p, regStart - featStart)
74
+ const [fEndX, mEndX] = findPosInCigar(p, regEnd - featStart)
75
+
76
+ // avoid multiply by 0 with strand undefined
77
+ const flipper = strand === -1 ? -1 : 1
78
+ rFeatStart = featStart + fStartX
79
+ rFeatEnd = featStart + fEndX
80
+ rMateStart = (strand === -1 ? mateEnd : mateStart) + mStartX * flipper
81
+ rMateEnd = (strand === -1 ? mateEnd : mateStart) + mEndX * flipper
82
+ } else {
83
+ rFeatStart = featStart
84
+ rFeatEnd = featEnd
85
+ rMateStart = mateStart
86
+ rMateEnd = mateEnd
87
+ }
88
+ const trackId = track.configuration.trackId
89
+
90
+ const view2 = session.addView('LinearSyntenyView', {
91
+ type: 'LinearSyntenyView',
92
+ views: [
93
+ {
94
+ id: `${Math.random()}`,
95
+ type: 'LinearGenomeView',
96
+ hideHeader: true,
97
+ },
98
+ {
99
+ id: `${Math.random()}`,
100
+ type: 'LinearGenomeView',
101
+ hideHeader: true,
102
+ },
103
+ ],
104
+ tracks: [
105
+ {
106
+ configuration: trackId,
107
+ type: 'SyntenyTrack',
108
+ displays: [
109
+ {
110
+ type: 'LinearSyntenyDisplay',
111
+ configuration: `${trackId}-LinearSyntenyDisplay`,
112
+ },
113
+ ],
114
+ },
115
+ ],
116
+ }) as LSV
117
+ const f = (n: number) => Math.floor(n)
118
+ const l1 = `${featRef}:${f(rFeatStart)}-${f(rFeatEnd)}`
119
+ const m1 = Math.min(rMateStart, rMateEnd)
120
+ const m2 = Math.max(rMateStart, rMateEnd)
121
+ const l2 = `${mateRef}:${f(m1)}-${f(m2)}${strand === -1 ? '[rev]' : ''}`
122
+ await when(() => view2.width !== undefined)
123
+ await Promise.all([
124
+ view2.views[0].navToLocString(l1, featAsm),
125
+ view2.views[1].navToLocString(l2, mateAsm),
126
+ ])
127
+ }
128
+
129
+ /**
130
+ * #stateModel LGVSyntenyDisplay
131
+ * extends `LinearPileupDisplay`, displays location of "synteny" feature in a
132
+ * plain LGV, allowing linking out to external synteny views
133
+ */
134
+ function stateModelFactory(schema: AnyConfigurationSchemaType) {
135
+ return types
136
+ .compose(
137
+ 'LGVSyntenyDisplay',
138
+ linearPileupDisplayStateModelFactory(schema),
139
+ types.model({
140
+ /**
141
+ * #property
142
+ */
143
+ type: types.literal('LGVSyntenyDisplay'),
144
+ /**
145
+ * #property
146
+ */
147
+ configuration: ConfigurationReference(schema),
148
+ }),
149
+ )
150
+ .views(self => {
151
+ const superContextMenuItems = self.contextMenuItems
152
+ return {
153
+ contextMenuItems() {
154
+ const feature = self.contextMenuFeature
155
+ return [
156
+ ...superContextMenuItems(),
157
+ ...(feature
158
+ ? [
159
+ {
160
+ label: 'Open synteny view for this position',
161
+ onClick: () => navToSynteny(feature, self),
162
+ },
163
+ ]
164
+ : []),
165
+ ]
166
+ },
167
+ }
168
+ })
169
+ .actions(self => ({
170
+ afterCreate() {
171
+ // use color by strand to help indicate inversions better
172
+ self.setColorScheme({ type: 'strand' })
173
+ },
174
+ }))
175
+ }
176
+
177
+ export default stateModelFactory
@@ -0,0 +1,86 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { AbstractSessionModel } from '@jbrowse/core/util'
3
+ import { LinearSyntenyViewModel } from './LinearSyntenyView/model'
4
+ import { when } from 'mobx'
5
+
6
+ type LSV = LinearSyntenyViewModel
7
+
8
+ export default function LaunchLinearSyntenyView(pluginManager: PluginManager) {
9
+ pluginManager.addToExtensionPoint(
10
+ 'LaunchView-LinearSyntenyView',
11
+ // @ts-expect-error
12
+ async ({
13
+ session,
14
+ views,
15
+ tracks = [],
16
+ }: {
17
+ session: AbstractSessionModel
18
+ views: { loc: string; assembly: string; tracks?: string[] }[]
19
+ tracks?: string[]
20
+ }) => {
21
+ try {
22
+ const { assemblyManager } = session
23
+ const model = session.addView('LinearSyntenyView', {}) as LSV
24
+
25
+ await when(() => !!model.width)
26
+
27
+ model.setViews(
28
+ await Promise.all(
29
+ views.map(async view => {
30
+ const asm = await assemblyManager.waitForAssembly(view.assembly)
31
+ if (!asm) {
32
+ throw new Error(`Assembly ${view.assembly} failed to load`)
33
+ }
34
+ return {
35
+ type: 'LinearGenomeView' as const,
36
+ bpPerPx: 1,
37
+ offsetPx: 0,
38
+ hideHeader: true,
39
+ displayedRegions: asm.regions,
40
+ }
41
+ }),
42
+ ),
43
+ )
44
+
45
+ await Promise.all(model.views.map(view => when(() => view.initialized)))
46
+
47
+ const idsNotFound = [] as string[]
48
+ await Promise.all(
49
+ views.map(async (data, idx) => {
50
+ const view = model.views[idx]
51
+ const { loc, tracks = [] } = data
52
+ await view.navToLocString(loc)
53
+ tracks.forEach(track => tryTrack(view, track, idsNotFound))
54
+ }),
55
+ )
56
+
57
+ tracks.forEach(track => tryTrack(model, track, idsNotFound))
58
+
59
+ if (idsNotFound.length) {
60
+ throw new Error(
61
+ `Could not resolve identifiers: ${idsNotFound.join(',')}`,
62
+ )
63
+ }
64
+ } catch (e) {
65
+ session.notify(`${e}`, 'error')
66
+ throw e
67
+ }
68
+ },
69
+ )
70
+ }
71
+
72
+ function tryTrack(
73
+ model: { showTrack: (arg: string) => void },
74
+ trackId: string,
75
+ idsNotFound: string[],
76
+ ) {
77
+ try {
78
+ model.showTrack(trackId)
79
+ } catch (e) {
80
+ if (`${e}`.match('Could not resolve identifier')) {
81
+ idsNotFound.push(trackId)
82
+ } else {
83
+ throw e
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,22 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
3
+
4
+ /**
5
+ * #config LinearComparativeDisplay
6
+ */
7
+ function configSchemaFactory(pluginManager: any) {
8
+ return ConfigurationSchema(
9
+ 'LinearComparativeDisplay',
10
+ {},
11
+ {
12
+ explicitlyTyped: true,
13
+
14
+ /**
15
+ * #identifier
16
+ */
17
+ explicitIdentifier: 'displayId',
18
+ },
19
+ )
20
+ }
21
+
22
+ export default configSchemaFactory
@@ -0,0 +1,21 @@
1
+ import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
2
+ import PluginManager from '@jbrowse/core/PluginManager'
3
+
4
+ import configSchemaFactory from './configSchemaF'
5
+ import stateModelFactory from './stateModelFactory'
6
+
7
+ export default (pluginManager: PluginManager) => {
8
+ pluginManager.addDisplayType(() => {
9
+ const configSchema = configSchemaFactory(pluginManager)
10
+ return new DisplayType({
11
+ name: 'LinearComparativeDisplay',
12
+ configSchema,
13
+ stateModel: stateModelFactory(configSchema),
14
+ trackType: 'SyntenyTrack',
15
+ viewType: 'LinearComparativeView',
16
+ ReactComponent: () => {
17
+ return null
18
+ },
19
+ })
20
+ })
21
+ }
@@ -0,0 +1,212 @@
1
+ import {
2
+ readConfObject,
3
+ ConfigurationReference,
4
+ AnyConfigurationSchemaType,
5
+ } from '@jbrowse/core/configuration'
6
+ import { types, getSnapshot, Instance } from 'mobx-state-tree'
7
+ import {
8
+ dedupe,
9
+ Feature,
10
+ getContainingView,
11
+ getSession,
12
+ makeAbortableReaction,
13
+ } from '@jbrowse/core/util'
14
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks'
15
+ import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
16
+ import { LinearComparativeViewModel } from '../LinearComparativeView/model'
17
+
18
+ /**
19
+ * #stateModel LinearComparativeDisplay
20
+ */
21
+ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
22
+ return types
23
+ .compose(
24
+ 'LinearComparativeDisplay',
25
+ BaseDisplay,
26
+ types.model({
27
+ /**
28
+ * #property
29
+ */
30
+ type: types.literal('LinearComparativeDisplay'),
31
+ /**
32
+ * #property
33
+ */
34
+ configuration: ConfigurationReference(configSchema),
35
+ /**
36
+ * #property
37
+ */
38
+ height: 100,
39
+ }),
40
+ )
41
+ .volatile((/* self */) => ({
42
+ renderInProgress: undefined as AbortController | undefined,
43
+ features: undefined as Feature[] | undefined,
44
+ message: undefined as string | undefined,
45
+ }))
46
+ .views(self => ({
47
+ /**
48
+ * #getter
49
+ */
50
+ renderProps() {
51
+ return {
52
+ rpcDriverName: self.rpcDriverName,
53
+ displayModel: self,
54
+ highResolutionScaling: 2,
55
+ }
56
+ },
57
+ }))
58
+ .actions(self => {
59
+ let renderInProgress: undefined | AbortController
60
+
61
+ return {
62
+ /**
63
+ * #action
64
+ * controlled by a reaction
65
+ */
66
+ setLoading(abortController: AbortController) {
67
+ self.message = undefined
68
+ self.error = undefined
69
+ renderInProgress = abortController
70
+ },
71
+
72
+ /**
73
+ * #action
74
+ * controlled by a reaction
75
+ */
76
+ setMessage(messageText: string) {
77
+ if (renderInProgress && !renderInProgress.signal.aborted) {
78
+ renderInProgress.abort()
79
+ }
80
+ self.message = messageText
81
+ self.error = undefined
82
+ renderInProgress = undefined
83
+ },
84
+
85
+ /**
86
+ * #action
87
+ * controlled by a reaction
88
+ */
89
+ setRendered(args?: { features: Feature[] }) {
90
+ if (!args) {
91
+ return
92
+ }
93
+ const { features } = args
94
+ const existingFeatures = self.features || []
95
+
96
+ const featIds = new Set(existingFeatures.map(f => f.id()) || [])
97
+ const newFeatIds = new Set(features?.map(f => f.id()) || [])
98
+
99
+ let foundNewFeatureNotInExistingMap = false
100
+ let foundExistingFeatureNotInNewMap = false
101
+ for (let i = 0; i < features.length; i++) {
102
+ if (!featIds.has(features[i].id())) {
103
+ foundNewFeatureNotInExistingMap = true
104
+ break
105
+ }
106
+ }
107
+ for (let i = 0; i < existingFeatures.length; i++) {
108
+ if (!newFeatIds.has(existingFeatures[i].id())) {
109
+ foundExistingFeatureNotInNewMap = true
110
+ break
111
+ }
112
+ }
113
+
114
+ self.message = undefined
115
+ self.error = undefined
116
+ renderInProgress = undefined
117
+
118
+ if (
119
+ foundNewFeatureNotInExistingMap ||
120
+ foundExistingFeatureNotInNewMap ||
121
+ !self.features
122
+ ) {
123
+ self.features = features
124
+ }
125
+ },
126
+
127
+ /**
128
+ * #action
129
+ * controlled by a reaction
130
+ */
131
+ setError(error: unknown) {
132
+ console.error(error)
133
+ if (renderInProgress && !renderInProgress.signal.aborted) {
134
+ renderInProgress.abort()
135
+ }
136
+ // the rendering failed for some reason
137
+ self.message = undefined
138
+ self.error = error
139
+ renderInProgress = undefined
140
+ },
141
+ }
142
+ })
143
+ .actions(self => ({
144
+ afterAttach() {
145
+ makeAbortableReaction(
146
+ // @ts-expect-error
147
+ self,
148
+ renderBlockData,
149
+ renderBlockEffect,
150
+ {
151
+ name: `${self.type} ${self.id} rendering`,
152
+ delay: 1000,
153
+ fireImmediately: true,
154
+ },
155
+ self.setLoading,
156
+ self.setRendered,
157
+ self.setError,
158
+ )
159
+ },
160
+ }))
161
+ }
162
+ function renderBlockData(self: LinearComparativeDisplay) {
163
+ const { rpcManager } = getSession(self)
164
+ const display = self
165
+
166
+ // Alternative to readConfObject(config) is below used because renderProps is
167
+ // something under our control. Compare to serverSideRenderedBlock
168
+ readConfObject(self.configuration)
169
+
170
+ const { adapterConfig } = self
171
+ const parent = getContainingView(self) as LinearComparativeViewModel
172
+ const sessionId = getRpcSessionId(self)
173
+ getSnapshot(parent)
174
+
175
+ return parent.initialized
176
+ ? {
177
+ rpcManager,
178
+ renderProps: {
179
+ ...display.renderProps(),
180
+ view: parent,
181
+ adapterConfig,
182
+ sessionId,
183
+ timeout: 1000000,
184
+ self,
185
+ },
186
+ }
187
+ : undefined
188
+ }
189
+
190
+ async function renderBlockEffect(props: ReturnType<typeof renderBlockData>) {
191
+ if (!props) {
192
+ return
193
+ }
194
+
195
+ const { rpcManager, renderProps } = props
196
+ const { adapterConfig } = renderProps
197
+ const view0 = renderProps.view.views[0]
198
+
199
+ const features = (await rpcManager.call('getFeats', 'CoreGetFeatures', {
200
+ regions: view0.staticBlocks.contentBlocks,
201
+ sessionId: 'getFeats',
202
+ adapterConfig,
203
+ })) as Feature[]
204
+
205
+ return {
206
+ features: dedupe(features, f => f.id()),
207
+ }
208
+ }
209
+
210
+ export default stateModelFactory
211
+ export type LinearComparativeDisplayModel = ReturnType<typeof stateModelFactory>
212
+ export type LinearComparativeDisplay = Instance<LinearComparativeDisplayModel>