@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
@@ -0,0 +1,152 @@
1
+ import { ConfigurationReference, } from '@jbrowse/core/configuration';
2
+ import { getSession, getContainingTrack, getContainingView, } from '@jbrowse/core/util';
3
+ import { MismatchParser, linearPileupDisplayStateModelFactory, } from '@jbrowse/plugin-alignments';
4
+ import { types } from 'mobx-state-tree';
5
+ import { when } from 'mobx';
6
+ const { parseCigar } = MismatchParser;
7
+ function findPosInCigar(cigar, startX) {
8
+ let featX = 0;
9
+ let mateX = 0;
10
+ for (let i = 0; i < cigar.length; i++) {
11
+ const len = +cigar[i];
12
+ const op = cigar[i + 1];
13
+ const min = Math.min(len, startX - featX);
14
+ if (featX >= startX) {
15
+ break;
16
+ }
17
+ else if (op === 'I') {
18
+ mateX += len;
19
+ }
20
+ else if (op === 'D') {
21
+ featX += min;
22
+ }
23
+ else if (op === 'M') {
24
+ mateX += min;
25
+ featX += min;
26
+ }
27
+ }
28
+ return [featX, mateX];
29
+ }
30
+ async function navToSynteny(feature, self) {
31
+ const session = getSession(self);
32
+ const track = getContainingTrack(self);
33
+ const view = getContainingView(self);
34
+ const reg = view.dynamicBlocks.contentBlocks[0];
35
+ const cigar = feature.get('CIGAR');
36
+ const strand = feature.get('strand');
37
+ const regStart = reg.start;
38
+ const regEnd = reg.end;
39
+ const featStart = feature.get('start');
40
+ const featEnd = feature.get('end');
41
+ const mate = feature.get('mate');
42
+ const mateStart = mate.start;
43
+ const mateEnd = mate.end;
44
+ const mateAsm = mate.assemblyName;
45
+ const mateRef = mate.refName;
46
+ const featAsm = reg.assemblyName;
47
+ const featRef = reg.refName;
48
+ let rMateStart;
49
+ let rMateEnd;
50
+ let rFeatStart;
51
+ let rFeatEnd;
52
+ if (cigar) {
53
+ const p = parseCigar(cigar);
54
+ const [fStartX, mStartX] = findPosInCigar(p, regStart - featStart);
55
+ const [fEndX, mEndX] = findPosInCigar(p, regEnd - featStart);
56
+ // avoid multiply by 0 with strand undefined
57
+ const flipper = strand === -1 ? -1 : 1;
58
+ rFeatStart = featStart + fStartX;
59
+ rFeatEnd = featStart + fEndX;
60
+ rMateStart = (strand === -1 ? mateEnd : mateStart) + mStartX * flipper;
61
+ rMateEnd = (strand === -1 ? mateEnd : mateStart) + mEndX * flipper;
62
+ }
63
+ else {
64
+ rFeatStart = featStart;
65
+ rFeatEnd = featEnd;
66
+ rMateStart = mateStart;
67
+ rMateEnd = mateEnd;
68
+ }
69
+ const trackId = track.configuration.trackId;
70
+ const view2 = session.addView('LinearSyntenyView', {
71
+ type: 'LinearSyntenyView',
72
+ views: [
73
+ {
74
+ id: `${Math.random()}`,
75
+ type: 'LinearGenomeView',
76
+ hideHeader: true,
77
+ },
78
+ {
79
+ id: `${Math.random()}`,
80
+ type: 'LinearGenomeView',
81
+ hideHeader: true,
82
+ },
83
+ ],
84
+ tracks: [
85
+ {
86
+ configuration: trackId,
87
+ type: 'SyntenyTrack',
88
+ displays: [
89
+ {
90
+ type: 'LinearSyntenyDisplay',
91
+ configuration: `${trackId}-LinearSyntenyDisplay`,
92
+ },
93
+ ],
94
+ },
95
+ ],
96
+ });
97
+ const f = (n) => Math.floor(n);
98
+ const l1 = `${featRef}:${f(rFeatStart)}-${f(rFeatEnd)}`;
99
+ const m1 = Math.min(rMateStart, rMateEnd);
100
+ const m2 = Math.max(rMateStart, rMateEnd);
101
+ const l2 = `${mateRef}:${f(m1)}-${f(m2)}${strand === -1 ? '[rev]' : ''}`;
102
+ await when(() => view2.width !== undefined);
103
+ await Promise.all([
104
+ view2.views[0].navToLocString(l1, featAsm),
105
+ view2.views[1].navToLocString(l2, mateAsm),
106
+ ]);
107
+ }
108
+ /**
109
+ * #stateModel LGVSyntenyDisplay
110
+ * extends `LinearPileupDisplay`, displays location of "synteny" feature in a
111
+ * plain LGV, allowing linking out to external synteny views
112
+ */
113
+ function stateModelFactory(schema) {
114
+ return types
115
+ .compose('LGVSyntenyDisplay', linearPileupDisplayStateModelFactory(schema), types.model({
116
+ /**
117
+ * #property
118
+ */
119
+ type: types.literal('LGVSyntenyDisplay'),
120
+ /**
121
+ * #property
122
+ */
123
+ configuration: ConfigurationReference(schema),
124
+ }))
125
+ .views(self => {
126
+ const superContextMenuItems = self.contextMenuItems;
127
+ return {
128
+ contextMenuItems() {
129
+ const feature = self.contextMenuFeature;
130
+ return [
131
+ ...superContextMenuItems(),
132
+ ...(feature
133
+ ? [
134
+ {
135
+ label: 'Open synteny view for this position',
136
+ onClick: () => navToSynteny(feature, self),
137
+ },
138
+ ]
139
+ : []),
140
+ ];
141
+ },
142
+ };
143
+ })
144
+ .actions(self => ({
145
+ afterCreate() {
146
+ // use color by strand to help indicate inversions better
147
+ self.setColorScheme({ type: 'strand' });
148
+ },
149
+ }));
150
+ }
151
+ export default stateModelFactory;
152
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LGVSyntenyDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,cAAc,EACd,oCAAoC,GACrC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAqB,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAA;AAErC,SAAS,cAAc,CAAC,KAAe,EAAE,MAAc;IACrD,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,IAAI,CA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I,CAAC,EAAE,CAAC,CAAC;QAChB,WAAW;YACT,yDAAyD;YACzD,IAAI,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QACzC,CAAC;KACF,CAAC,CAAC,CAAA;AACP,CAAC;AAED,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ export default function LaunchLinearSyntenyView(pluginManager: PluginManager): void;
@@ -0,0 +1,55 @@
1
+ import { when } from 'mobx';
2
+ export default function LaunchLinearSyntenyView(pluginManager) {
3
+ pluginManager.addToExtensionPoint('LaunchView-LinearSyntenyView',
4
+ // @ts-expect-error
5
+ async ({ session, views, tracks = [], }) => {
6
+ try {
7
+ const { assemblyManager } = session;
8
+ const model = session.addView('LinearSyntenyView', {});
9
+ await when(() => !!model.width);
10
+ model.setViews(await Promise.all(views.map(async (view) => {
11
+ const asm = await assemblyManager.waitForAssembly(view.assembly);
12
+ if (!asm) {
13
+ throw new Error(`Assembly ${view.assembly} failed to load`);
14
+ }
15
+ return {
16
+ type: 'LinearGenomeView',
17
+ bpPerPx: 1,
18
+ offsetPx: 0,
19
+ hideHeader: true,
20
+ displayedRegions: asm.regions,
21
+ };
22
+ })));
23
+ await Promise.all(model.views.map(view => when(() => view.initialized)));
24
+ const idsNotFound = [];
25
+ await Promise.all(views.map(async (data, idx) => {
26
+ const view = model.views[idx];
27
+ const { loc, tracks = [] } = data;
28
+ await view.navToLocString(loc);
29
+ tracks.forEach(track => tryTrack(view, track, idsNotFound));
30
+ }));
31
+ tracks.forEach(track => tryTrack(model, track, idsNotFound));
32
+ if (idsNotFound.length) {
33
+ throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
34
+ }
35
+ }
36
+ catch (e) {
37
+ session.notify(`${e}`, 'error');
38
+ throw e;
39
+ }
40
+ });
41
+ }
42
+ function tryTrack(model, trackId, idsNotFound) {
43
+ try {
44
+ model.showTrack(trackId);
45
+ }
46
+ catch (e) {
47
+ if (`${e}`.match('Could not resolve identifier')) {
48
+ idsNotFound.push(trackId);
49
+ }
50
+ else {
51
+ throw e;
52
+ }
53
+ }
54
+ }
55
+ //# sourceMappingURL=LaunchLinearSyntenyView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LaunchLinearSyntenyView.js","sourceRoot":"","sources":["../src/LaunchLinearSyntenyView.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAI3B,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,aAA4B;IAC1E,aAAa,CAAC,mBAAmB,CAC/B,8BAA8B;IAC9B,mBAAmB;IACnB,KAAK,EAAE,EACL,OAAO,EACP,KAAK,EACL,MAAM,GAAG,EAAE,GAKZ,EAAE,EAAE;QACH,IAAI;YACF,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAA;YACnC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAQ,CAAA;YAE7D,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAE/B,KAAK,CAAC,QAAQ,CACZ,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,GAAG,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE;gBACrB,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;gBAChE,IAAI,CAAC,GAAG,EAAE;oBACR,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,QAAQ,iBAAiB,CAAC,CAAA;iBAC5D;gBACD,OAAO;oBACL,IAAI,EAAE,kBAA2B;oBACjC,OAAO,EAAE,CAAC;oBACV,QAAQ,EAAE,CAAC;oBACX,UAAU,EAAE,IAAI;oBAChB,gBAAgB,EAAE,GAAG,CAAC,OAAO;iBAC9B,CAAA;YACH,CAAC,CAAC,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I,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE;YAChD,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;SAC1B;aAAM;YACL,MAAM,CAAC,CAAA;SACR;KACF;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * #config LinearComparativeDisplay
3
+ */
4
+ declare function configSchemaFactory(pluginManager: any): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
5
+ export default configSchemaFactory;
@@ -0,0 +1,16 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
3
+ /**
4
+ * #config LinearComparativeDisplay
5
+ */
6
+ function configSchemaFactory(pluginManager) {
7
+ return ConfigurationSchema('LinearComparativeDisplay', {}, {
8
+ explicitlyTyped: true,
9
+ /**
10
+ * #identifier
11
+ */
12
+ explicitIdentifier: 'displayId',
13
+ });
14
+ }
15
+ export default configSchemaFactory;
16
+ //# sourceMappingURL=configSchemaF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configSchemaF.js","sourceRoot":"","sources":["../../src/LinearComparativeDisplay/configSchemaF.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,mBAAmB,CAAC,aAAkB;IAC7C,OAAO,mBAAmB,CACxB,0BAA0B,EAC1B,EAAE,EACF;QACE,eAAe,EAAE,IAAI;QAErB;;WAEG;QACH,kBAAkB,EAAE,WAAW;KAChC,CACF,CAAA;AACH,CAAC;AAED,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager';
2
+ declare const _default: (pluginManager: PluginManager) => void;
3
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
2
+ import configSchemaFactory from './configSchemaF';
3
+ import stateModelFactory from './stateModelFactory';
4
+ export default (pluginManager) => {
5
+ pluginManager.addDisplayType(() => {
6
+ const configSchema = configSchemaFactory(pluginManager);
7
+ return new DisplayType({
8
+ name: 'LinearComparativeDisplay',
9
+ configSchema,
10
+ stateModel: stateModelFactory(configSchema),
11
+ trackType: 'SyntenyTrack',
12
+ viewType: 'LinearComparativeView',
13
+ ReactComponent: () => {
14
+ return null;
15
+ },
16
+ });
17
+ });
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LinearComparativeDisplay/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,iDAAiD,CAAA;AAGzE,OAAO,mBAAmB,MAAM,iBAAiB,CAAA;AACjD,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AAEnD,eAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;QAChC,MAAM,YAAY,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvD,OAAO,IAAI,WAAW,CAAC;YACrB,IAAI,EAAE,0BAA0B;YAChC,YAAY;YACZ,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC3C,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,uBAAuB;YACjC,cAAc,EAAE,GAAG,EAAE;gBACnB,OAAO,IAAI,CAAA;YACb,CAAC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,275 @@
1
+ /// <reference types="react" />
2
+ import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ import { Instance } from 'mobx-state-tree';
4
+ import { Feature } from '@jbrowse/core/util';
5
+ /**
6
+ * #stateModel LinearComparativeDisplay
7
+ */
8
+ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
9
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
10
+ type: import("mobx-state-tree").ISimpleType<string>;
11
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
12
+ } & {
13
+ type: import("mobx-state-tree").ISimpleType<"LinearComparativeDisplay">;
14
+ configuration: AnyConfigurationSchemaType;
15
+ height: import("mobx-state-tree").IType<number | undefined, number, number>;
16
+ }, {
17
+ rendererTypeName: string;
18
+ error: unknown;
19
+ message: string | undefined;
20
+ } & {
21
+ readonly RenderingComponent: import("react").FC<{
22
+ model: {
23
+ id: string;
24
+ type: string;
25
+ rpcDriverName: string | undefined;
26
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
27
+ rendererTypeName: string;
28
+ error: unknown;
29
+ message: string | undefined;
30
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
31
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
32
+ type: import("mobx-state-tree").ISimpleType<string>;
33
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>; /**
34
+ * #action
35
+ * controlled by a reaction
36
+ */
37
+ }, {
38
+ rendererTypeName: string;
39
+ error: unknown;
40
+ message: string | undefined;
41
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
42
+ onHorizontalScroll?: Function | undefined;
43
+ blockState?: Record<string, any> | undefined;
44
+ }>;
45
+ readonly DisplayBlurb: import("react").FC<{
46
+ model: {
47
+ id: string;
48
+ type: string;
49
+ rpcDriverName: string | undefined;
50
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
51
+ rendererTypeName: string; /**
52
+ * #action
53
+ * controlled by a reaction
54
+ */
55
+ error: unknown;
56
+ message: string | undefined;
57
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
58
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
59
+ type: import("mobx-state-tree").ISimpleType<string>;
60
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
61
+ }, {
62
+ rendererTypeName: string;
63
+ error: unknown;
64
+ message: string | undefined;
65
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
66
+ }> | null;
67
+ readonly adapterConfig: any;
68
+ readonly parentTrack: any;
69
+ renderProps(): any;
70
+ readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
71
+ readonly DisplayMessageComponent: import("react").FC<any> | undefined;
72
+ trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
73
+ readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
74
+ regionCannotBeRendered(): null;
75
+ } & {
76
+ setMessage(arg?: string | undefined): void;
77
+ setError(error?: unknown): void;
78
+ setRpcDriverName(rpcDriverName: string): void;
79
+ reload(): void;
80
+ } & {
81
+ renderInProgress: AbortController | undefined;
82
+ features: Feature[] | undefined;
83
+ message: string | undefined;
84
+ } & {
85
+ /**
86
+ * #getter
87
+ */
88
+ renderProps(): {
89
+ rpcDriverName: string | undefined;
90
+ displayModel: {
91
+ id: string;
92
+ type: "LinearComparativeDisplay";
93
+ rpcDriverName: string | undefined;
94
+ configuration: {
95
+ [x: string]: any;
96
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
97
+ setSubschema(slotName: string, data: unknown): any;
98
+ } & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
99
+ height: number;
100
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
101
+ rendererTypeName: string;
102
+ error: unknown;
103
+ message: string | undefined;
104
+ } & {
105
+ readonly RenderingComponent: import("react").FC<{
106
+ model: {
107
+ id: string;
108
+ type: string;
109
+ rpcDriverName: string | undefined;
110
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
111
+ rendererTypeName: string;
112
+ error: unknown;
113
+ message: string | undefined;
114
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
115
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
116
+ type: import("mobx-state-tree").ISimpleType<string>;
117
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>; /**
118
+ * #action
119
+ * controlled by a reaction
120
+ */
121
+ }, {
122
+ rendererTypeName: string;
123
+ error: unknown;
124
+ message: string | undefined;
125
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
126
+ onHorizontalScroll?: Function | undefined;
127
+ blockState?: Record<string, any> | undefined;
128
+ }>;
129
+ readonly DisplayBlurb: import("react").FC<{
130
+ model: {
131
+ id: string;
132
+ type: string;
133
+ rpcDriverName: string | undefined;
134
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
135
+ rendererTypeName: string; /**
136
+ * #action
137
+ * controlled by a reaction
138
+ */
139
+ error: unknown;
140
+ message: string | undefined;
141
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
142
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
143
+ type: import("mobx-state-tree").ISimpleType<string>;
144
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
145
+ }, {
146
+ rendererTypeName: string;
147
+ error: unknown;
148
+ message: string | undefined;
149
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
150
+ }> | null;
151
+ readonly adapterConfig: any;
152
+ readonly parentTrack: any;
153
+ renderProps(): any;
154
+ readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
155
+ readonly DisplayMessageComponent: import("react").FC<any> | undefined;
156
+ trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
157
+ readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
158
+ regionCannotBeRendered(): null;
159
+ } & {
160
+ setMessage(arg?: string | undefined): void;
161
+ setError(error?: unknown): void;
162
+ setRpcDriverName(rpcDriverName: string): void;
163
+ reload(): void;
164
+ } & {
165
+ renderInProgress: AbortController | undefined;
166
+ features: Feature[] | undefined;
167
+ message: string | undefined;
168
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
169
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
170
+ type: import("mobx-state-tree").ISimpleType<string>;
171
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
172
+ } & {
173
+ type: import("mobx-state-tree").ISimpleType<"LinearComparativeDisplay">;
174
+ configuration: AnyConfigurationSchemaType;
175
+ height: import("mobx-state-tree").IType<number | undefined, number, number>;
176
+ }, {
177
+ rendererTypeName: string;
178
+ error: unknown;
179
+ message: string | undefined;
180
+ } & {
181
+ readonly RenderingComponent: import("react").FC<{
182
+ model: {
183
+ id: string;
184
+ type: string;
185
+ rpcDriverName: string | undefined;
186
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
187
+ rendererTypeName: string;
188
+ error: unknown;
189
+ message: string | undefined;
190
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
191
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
192
+ type: import("mobx-state-tree").ISimpleType<string>;
193
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>; /**
194
+ * #action
195
+ * controlled by a reaction
196
+ */
197
+ }, {
198
+ rendererTypeName: string;
199
+ error: unknown;
200
+ message: string | undefined;
201
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
202
+ onHorizontalScroll?: Function | undefined;
203
+ blockState?: Record<string, any> | undefined;
204
+ }>;
205
+ readonly DisplayBlurb: import("react").FC<{
206
+ model: {
207
+ id: string;
208
+ type: string;
209
+ rpcDriverName: string | undefined;
210
+ } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
211
+ rendererTypeName: string; /**
212
+ * #action
213
+ * controlled by a reaction
214
+ */
215
+ error: unknown;
216
+ message: string | undefined;
217
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
218
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
219
+ type: import("mobx-state-tree").ISimpleType<string>;
220
+ rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
221
+ }, {
222
+ rendererTypeName: string;
223
+ error: unknown;
224
+ message: string | undefined;
225
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
226
+ }> | null;
227
+ readonly adapterConfig: any;
228
+ readonly parentTrack: any;
229
+ renderProps(): any;
230
+ readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
231
+ readonly DisplayMessageComponent: import("react").FC<any> | undefined;
232
+ trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
233
+ readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
234
+ regionCannotBeRendered(): null;
235
+ } & {
236
+ setMessage(arg?: string | undefined): void;
237
+ setError(error?: unknown): void;
238
+ setRpcDriverName(rpcDriverName: string): void;
239
+ reload(): void;
240
+ } & {
241
+ renderInProgress: AbortController | undefined;
242
+ features: Feature[] | undefined;
243
+ message: string | undefined;
244
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
245
+ highResolutionScaling: number;
246
+ };
247
+ } & {
248
+ /**
249
+ * #action
250
+ * controlled by a reaction
251
+ */
252
+ setLoading(abortController: AbortController): void;
253
+ /**
254
+ * #action
255
+ * controlled by a reaction
256
+ */
257
+ setMessage(messageText: string): void;
258
+ /**
259
+ * #action
260
+ * controlled by a reaction
261
+ */
262
+ setRendered(args?: {
263
+ features: Feature[];
264
+ }): void;
265
+ /**
266
+ * #action
267
+ * controlled by a reaction
268
+ */
269
+ setError(error: unknown): void;
270
+ } & {
271
+ afterAttach(): void;
272
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
273
+ export default stateModelFactory;
274
+ export type LinearComparativeDisplayModel = ReturnType<typeof stateModelFactory>;
275
+ export type LinearComparativeDisplay = Instance<LinearComparativeDisplayModel>;