@jbrowse/plugin-alignments 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
  3. package/dist/AlignmentsTrack/index.js +1 -0
  4. package/dist/AlignmentsTrack/index.js.map +1 -1
  5. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
  6. package/dist/BamAdapter/BamSlightlyLazyFeature.js +11 -18
  7. package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
  8. package/dist/BamAdapter/index.js +1 -0
  9. package/dist/BamAdapter/index.js.map +1 -1
  10. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
  11. package/dist/CramAdapter/CramSlightlyLazyFeature.js +6 -8
  12. package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
  13. package/dist/CramAdapter/CramTestAdapters.js +2 -1
  14. package/dist/CramAdapter/CramTestAdapters.js.map +1 -1
  15. package/dist/CramAdapter/index.js +1 -0
  16. package/dist/CramAdapter/index.js.map +1 -1
  17. package/dist/GuessAlignmentsTypes/index.d.ts +3 -0
  18. package/dist/GuessAlignmentsTypes/index.js +56 -0
  19. package/dist/GuessAlignmentsTypes/index.js.map +1 -0
  20. package/dist/HtsgetBamAdapter/index.js +11 -11
  21. package/dist/HtsgetBamAdapter/index.js.map +1 -1
  22. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
  23. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
  24. package/dist/LinearAlignmentsDisplay/index.js +1 -0
  25. package/dist/LinearAlignmentsDisplay/index.js.map +1 -1
  26. package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
  27. package/dist/LinearAlignmentsDisplay/models/configSchema.js +2 -3
  28. package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
  29. package/dist/LinearAlignmentsDisplay/models/model.d.ts +22 -36
  30. package/dist/LinearAlignmentsDisplay/models/model.js +166 -151
  31. package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
  32. package/dist/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
  33. package/dist/LinearPileupDisplay/components/ColorByModifications.js +7 -22
  34. package/dist/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
  35. package/dist/LinearPileupDisplay/components/ColorByTag.js +2 -22
  36. package/dist/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
  37. package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
  38. package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +3 -22
  39. package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
  40. package/dist/LinearPileupDisplay/components/SetMaxHeight.js +2 -18
  41. package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
  42. package/dist/LinearPileupDisplay/components/SortByTag.js +2 -23
  43. package/dist/LinearPileupDisplay/components/SortByTag.js.map +1 -1
  44. package/dist/LinearPileupDisplay/configSchema.d.ts +0 -3
  45. package/dist/LinearPileupDisplay/configSchema.js.map +1 -1
  46. package/dist/LinearPileupDisplay/index.js +2 -0
  47. package/dist/LinearPileupDisplay/index.js.map +1 -1
  48. package/dist/LinearPileupDisplay/model.d.ts +19 -16
  49. package/dist/LinearPileupDisplay/model.js +28 -13
  50. package/dist/LinearPileupDisplay/model.js.map +1 -1
  51. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
  52. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +49 -0
  53. package/dist/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
  54. package/dist/LinearReadArcsDisplay/configSchema.d.ts +6 -0
  55. package/dist/LinearReadArcsDisplay/configSchema.js +52 -0
  56. package/dist/LinearReadArcsDisplay/configSchema.js.map +1 -0
  57. package/dist/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
  58. package/dist/LinearReadArcsDisplay/drawFeats.js +162 -0
  59. package/dist/LinearReadArcsDisplay/drawFeats.js.map +1 -0
  60. package/dist/LinearReadArcsDisplay/index.d.ts +2 -0
  61. package/dist/LinearReadArcsDisplay/index.js +27 -0
  62. package/dist/LinearReadArcsDisplay/index.js.map +1 -0
  63. package/dist/LinearReadArcsDisplay/model.d.ts +342 -0
  64. package/dist/LinearReadArcsDisplay/model.js +327 -0
  65. package/dist/LinearReadArcsDisplay/model.js.map +1 -0
  66. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
  67. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +49 -0
  68. package/dist/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
  69. package/dist/LinearReadCloudDisplay/configSchema.d.ts +6 -0
  70. package/dist/LinearReadCloudDisplay/configSchema.js +51 -0
  71. package/dist/LinearReadCloudDisplay/configSchema.js.map +1 -0
  72. package/dist/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
  73. package/dist/LinearReadCloudDisplay/drawFeats.js +159 -0
  74. package/dist/LinearReadCloudDisplay/drawFeats.js.map +1 -0
  75. package/dist/LinearReadCloudDisplay/index.d.ts +2 -0
  76. package/dist/LinearReadCloudDisplay/index.js +27 -0
  77. package/dist/LinearReadCloudDisplay/index.js.map +1 -0
  78. package/dist/LinearReadCloudDisplay/model.d.ts +320 -0
  79. package/dist/LinearReadCloudDisplay/model.js +252 -0
  80. package/dist/LinearReadCloudDisplay/model.js.map +1 -0
  81. package/dist/LinearSNPCoverageDisplay/index.js +1 -0
  82. package/dist/LinearSNPCoverageDisplay/index.js.map +1 -1
  83. package/dist/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
  84. package/dist/LinearSNPCoverageDisplay/models/model.js +9 -12
  85. package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
  86. package/dist/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
  87. package/dist/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +116 -3
  88. package/dist/MismatchParser/index.js.map +1 -0
  89. package/dist/PileupRPC/base.d.ts +8 -0
  90. package/dist/PileupRPC/base.js +22 -0
  91. package/dist/PileupRPC/base.js.map +1 -0
  92. package/dist/PileupRPC/index.d.ts +3 -0
  93. package/dist/PileupRPC/index.js +9 -0
  94. package/dist/PileupRPC/index.js.map +1 -0
  95. package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
  96. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +29 -0
  97. package/dist/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
  98. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
  99. package/dist/PileupRPC/methods/GetReducedFeatures.js +61 -0
  100. package/dist/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
  101. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
  102. package/dist/PileupRPC/methods/GetVisibleModifications.js +32 -0
  103. package/dist/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
  104. package/dist/PileupRPC/rpcMethods.d.ts +4 -34
  105. package/dist/PileupRPC/rpcMethods.js +7 -77
  106. package/dist/PileupRPC/rpcMethods.js.map +1 -1
  107. package/dist/PileupRPC/util.d.ts +8 -0
  108. package/dist/PileupRPC/util.js +20 -0
  109. package/dist/PileupRPC/util.js.map +1 -0
  110. package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
  111. package/dist/PileupRenderer/PileupRenderer.js +5 -5
  112. package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
  113. package/dist/PileupRenderer/configSchema.js +1 -1
  114. package/dist/PileupRenderer/configSchema.js.map +1 -1
  115. package/dist/PileupRenderer/index.js +1 -0
  116. package/dist/PileupRenderer/index.js.map +1 -1
  117. package/dist/PileupRenderer/sortUtil.d.ts +1 -1
  118. package/dist/PileupRenderer/sortUtil.js +2 -2
  119. package/dist/PileupRenderer/sortUtil.js.map +1 -1
  120. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
  121. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +3 -182
  122. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
  123. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
  124. package/dist/SNPCoverageAdapter/generateCoverageBins.js +185 -0
  125. package/dist/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
  126. package/dist/SNPCoverageAdapter/index.js +1 -3
  127. package/dist/SNPCoverageAdapter/index.js.map +1 -1
  128. package/dist/index.d.ts +2 -2
  129. package/dist/index.js +12 -58
  130. package/dist/index.js.map +1 -1
  131. package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
  132. package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.js +5 -24
  133. package/dist/shared/FilterByTag.js.map +1 -0
  134. package/dist/shared/color.d.ts +17 -0
  135. package/dist/shared/color.js +43 -0
  136. package/dist/shared/color.js.map +1 -0
  137. package/dist/shared/fetchChains.d.ts +27 -0
  138. package/dist/shared/fetchChains.js +30 -0
  139. package/dist/shared/fetchChains.js.map +1 -0
  140. package/dist/shared/index.d.ts +36 -0
  141. package/dist/{shared.js → shared/index.js} +12 -2
  142. package/dist/shared/index.js.map +1 -0
  143. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
  144. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
  145. package/esm/AlignmentsTrack/index.js +1 -0
  146. package/esm/AlignmentsTrack/index.js.map +1 -1
  147. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
  148. package/esm/BamAdapter/BamSlightlyLazyFeature.js +11 -18
  149. package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
  150. package/esm/BamAdapter/index.js +1 -0
  151. package/esm/BamAdapter/index.js.map +1 -1
  152. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
  153. package/esm/CramAdapter/CramSlightlyLazyFeature.js +6 -8
  154. package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
  155. package/esm/CramAdapter/CramTestAdapters.js +2 -1
  156. package/esm/CramAdapter/CramTestAdapters.js.map +1 -1
  157. package/esm/CramAdapter/index.js +1 -0
  158. package/esm/CramAdapter/index.js.map +1 -1
  159. package/esm/GuessAlignmentsTypes/index.d.ts +3 -0
  160. package/esm/GuessAlignmentsTypes/index.js +54 -0
  161. package/esm/GuessAlignmentsTypes/index.js.map +1 -0
  162. package/esm/HtsgetBamAdapter/index.js +11 -11
  163. package/esm/HtsgetBamAdapter/index.js.map +1 -1
  164. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
  165. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
  166. package/esm/LinearAlignmentsDisplay/index.js +1 -0
  167. package/esm/LinearAlignmentsDisplay/index.js.map +1 -1
  168. package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
  169. package/esm/LinearAlignmentsDisplay/models/configSchema.js +2 -4
  170. package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
  171. package/esm/LinearAlignmentsDisplay/models/model.d.ts +22 -36
  172. package/esm/LinearAlignmentsDisplay/models/model.js +167 -152
  173. package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
  174. package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
  175. package/esm/LinearPileupDisplay/components/ColorByModifications.js +8 -23
  176. package/esm/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
  177. package/esm/LinearPileupDisplay/components/ColorByTag.js +3 -20
  178. package/esm/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
  179. package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
  180. package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +4 -20
  181. package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
  182. package/esm/LinearPileupDisplay/components/SetMaxHeight.js +3 -16
  183. package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
  184. package/esm/LinearPileupDisplay/components/SortByTag.js +3 -21
  185. package/esm/LinearPileupDisplay/components/SortByTag.js.map +1 -1
  186. package/esm/LinearPileupDisplay/configSchema.d.ts +0 -3
  187. package/esm/LinearPileupDisplay/configSchema.js.map +1 -1
  188. package/esm/LinearPileupDisplay/index.js +2 -0
  189. package/esm/LinearPileupDisplay/index.js.map +1 -1
  190. package/esm/LinearPileupDisplay/model.d.ts +19 -16
  191. package/esm/LinearPileupDisplay/model.js +29 -14
  192. package/esm/LinearPileupDisplay/model.js.map +1 -1
  193. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
  194. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +44 -0
  195. package/esm/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
  196. package/esm/LinearReadArcsDisplay/configSchema.d.ts +6 -0
  197. package/esm/LinearReadArcsDisplay/configSchema.js +50 -0
  198. package/esm/LinearReadArcsDisplay/configSchema.js.map +1 -0
  199. package/esm/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
  200. package/esm/LinearReadArcsDisplay/drawFeats.js +157 -0
  201. package/esm/LinearReadArcsDisplay/drawFeats.js.map +1 -0
  202. package/esm/LinearReadArcsDisplay/index.d.ts +2 -0
  203. package/esm/LinearReadArcsDisplay/index.js +21 -0
  204. package/esm/LinearReadArcsDisplay/index.js.map +1 -0
  205. package/esm/LinearReadArcsDisplay/model.d.ts +342 -0
  206. package/esm/LinearReadArcsDisplay/model.js +299 -0
  207. package/esm/LinearReadArcsDisplay/model.js.map +1 -0
  208. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
  209. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +44 -0
  210. package/esm/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
  211. package/esm/LinearReadCloudDisplay/configSchema.d.ts +6 -0
  212. package/esm/LinearReadCloudDisplay/configSchema.js +49 -0
  213. package/esm/LinearReadCloudDisplay/configSchema.js.map +1 -0
  214. package/esm/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
  215. package/esm/LinearReadCloudDisplay/drawFeats.js +156 -0
  216. package/esm/LinearReadCloudDisplay/drawFeats.js.map +1 -0
  217. package/esm/LinearReadCloudDisplay/index.d.ts +2 -0
  218. package/esm/LinearReadCloudDisplay/index.js +21 -0
  219. package/esm/LinearReadCloudDisplay/index.js.map +1 -0
  220. package/esm/LinearReadCloudDisplay/model.d.ts +320 -0
  221. package/esm/LinearReadCloudDisplay/model.js +224 -0
  222. package/esm/LinearReadCloudDisplay/model.js.map +1 -0
  223. package/esm/LinearSNPCoverageDisplay/index.js +1 -0
  224. package/esm/LinearSNPCoverageDisplay/index.js.map +1 -1
  225. package/esm/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
  226. package/esm/LinearSNPCoverageDisplay/models/model.js +11 -14
  227. package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
  228. package/esm/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
  229. package/esm/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +107 -2
  230. package/esm/MismatchParser/index.js.map +1 -0
  231. package/esm/PileupRPC/base.d.ts +8 -0
  232. package/esm/PileupRPC/base.js +16 -0
  233. package/esm/PileupRPC/base.js.map +1 -0
  234. package/esm/PileupRPC/index.d.ts +3 -0
  235. package/esm/PileupRPC/index.js +7 -0
  236. package/esm/PileupRPC/index.js.map +1 -0
  237. package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
  238. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +23 -0
  239. package/esm/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
  240. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
  241. package/esm/PileupRPC/methods/GetReducedFeatures.js +55 -0
  242. package/esm/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
  243. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
  244. package/esm/PileupRPC/methods/GetVisibleModifications.js +26 -0
  245. package/esm/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
  246. package/esm/PileupRPC/rpcMethods.d.ts +4 -34
  247. package/esm/PileupRPC/rpcMethods.js +4 -74
  248. package/esm/PileupRPC/rpcMethods.js.map +1 -1
  249. package/esm/PileupRPC/util.d.ts +8 -0
  250. package/esm/PileupRPC/util.js +15 -0
  251. package/esm/PileupRPC/util.js.map +1 -0
  252. package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
  253. package/esm/PileupRenderer/PileupRenderer.js +5 -5
  254. package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
  255. package/esm/PileupRenderer/configSchema.js +1 -1
  256. package/esm/PileupRenderer/configSchema.js.map +1 -1
  257. package/esm/PileupRenderer/index.js +1 -0
  258. package/esm/PileupRenderer/index.js.map +1 -1
  259. package/esm/PileupRenderer/sortUtil.d.ts +1 -1
  260. package/esm/PileupRenderer/sortUtil.js +1 -1
  261. package/esm/PileupRenderer/sortUtil.js.map +1 -1
  262. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
  263. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +4 -183
  264. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
  265. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
  266. package/esm/SNPCoverageAdapter/generateCoverageBins.js +182 -0
  267. package/esm/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
  268. package/esm/SNPCoverageAdapter/index.js +1 -3
  269. package/esm/SNPCoverageAdapter/index.js.map +1 -1
  270. package/esm/index.d.ts +2 -2
  271. package/esm/index.js +10 -56
  272. package/esm/index.js.map +1 -1
  273. package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
  274. package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.js +6 -22
  275. package/esm/shared/FilterByTag.js.map +1 -0
  276. package/esm/shared/color.d.ts +17 -0
  277. package/esm/shared/color.js +37 -0
  278. package/esm/shared/color.js.map +1 -0
  279. package/esm/shared/fetchChains.d.ts +27 -0
  280. package/esm/shared/fetchChains.js +26 -0
  281. package/esm/shared/fetchChains.js.map +1 -0
  282. package/esm/shared/index.d.ts +36 -0
  283. package/esm/{shared.js → shared/index.js} +11 -1
  284. package/esm/shared/index.js.map +1 -0
  285. package/package.json +5 -5
  286. package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +1 -1
  287. package/src/AlignmentsTrack/index.ts +1 -0
  288. package/src/BamAdapter/BamSlightlyLazyFeature.ts +13 -19
  289. package/src/BamAdapter/index.ts +1 -0
  290. package/src/CramAdapter/CramSlightlyLazyFeature.ts +13 -15
  291. package/src/CramAdapter/CramTestAdapters.ts +1 -0
  292. package/src/CramAdapter/__snapshots__/CramAdapter.test.ts.snap +0 -10
  293. package/src/CramAdapter/index.ts +1 -0
  294. package/src/GuessAlignmentsTypes/index.ts +79 -0
  295. package/src/HtsgetBamAdapter/index.ts +11 -15
  296. package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +21 -29
  297. package/src/LinearAlignmentsDisplay/index.ts +1 -0
  298. package/src/LinearAlignmentsDisplay/models/configSchema.ts +2 -6
  299. package/src/LinearAlignmentsDisplay/models/model.tsx +238 -199
  300. package/src/LinearPileupDisplay/components/ColorByModifications.tsx +5 -34
  301. package/src/LinearPileupDisplay/components/ColorByTag.tsx +2 -29
  302. package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +5 -27
  303. package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +2 -24
  304. package/src/LinearPileupDisplay/components/SortByTag.tsx +2 -31
  305. package/src/LinearPileupDisplay/configSchema.ts +1 -3
  306. package/src/LinearPileupDisplay/index.ts +2 -0
  307. package/src/LinearPileupDisplay/model.ts +36 -23
  308. package/src/LinearReadArcsDisplay/components/ReactComponent.tsx +86 -0
  309. package/src/LinearReadArcsDisplay/configSchema.ts +58 -0
  310. package/src/LinearReadArcsDisplay/declare.d.ts +1 -0
  311. package/src/LinearReadArcsDisplay/drawFeats.ts +199 -0
  312. package/src/LinearReadArcsDisplay/index.ts +23 -0
  313. package/src/LinearReadArcsDisplay/model.tsx +370 -0
  314. package/src/LinearReadCloudDisplay/components/ReactComponent.tsx +86 -0
  315. package/src/LinearReadCloudDisplay/configSchema.ts +57 -0
  316. package/src/LinearReadCloudDisplay/drawFeats.ts +201 -0
  317. package/src/LinearReadCloudDisplay/index.ts +23 -0
  318. package/src/LinearReadCloudDisplay/model.tsx +289 -0
  319. package/src/LinearSNPCoverageDisplay/index.ts +1 -0
  320. package/src/LinearSNPCoverageDisplay/models/model.ts +15 -21
  321. package/src/{BamAdapter/MismatchParser.test.ts → MismatchParser/index.test.ts} +1 -1
  322. package/src/{BamAdapter/MismatchParser.ts → MismatchParser/index.ts} +129 -2
  323. package/src/PileupRPC/base.ts +24 -0
  324. package/src/PileupRPC/index.ts +12 -0
  325. package/src/PileupRPC/methods/GetGlobalValueForTag.ts +41 -0
  326. package/src/PileupRPC/methods/GetReducedFeatures.ts +76 -0
  327. package/src/PileupRPC/methods/GetVisibleModifications.ts +45 -0
  328. package/src/PileupRPC/rpcMethods.ts +8 -113
  329. package/src/PileupRPC/util.ts +19 -0
  330. package/src/PileupRenderer/PileupRenderer.ts +5 -8
  331. package/src/PileupRenderer/configSchema.ts +1 -1
  332. package/src/PileupRenderer/index.ts +1 -0
  333. package/src/PileupRenderer/sortUtil.ts +2 -3
  334. package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -249
  335. package/src/SNPCoverageAdapter/generateCoverageBins.ts +245 -0
  336. package/src/SNPCoverageAdapter/index.ts +1 -3
  337. package/src/index.ts +12 -93
  338. package/src/{LinearPileupDisplay/components → shared}/FilterByTag.tsx +5 -31
  339. package/src/shared/color.ts +47 -0
  340. package/src/shared/fetchChains.ts +63 -0
  341. package/src/{shared.ts → shared/index.ts} +17 -4
  342. package/dist/BamAdapter/MismatchParser.js.map +0 -1
  343. package/dist/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
  344. package/dist/shared.d.ts +0 -25
  345. package/dist/shared.js.map +0 -1
  346. package/esm/BamAdapter/MismatchParser.js.map +0 -1
  347. package/esm/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
  348. package/esm/shared.d.ts +0 -25
  349. package/esm/shared.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
3
+ import { linearBasicDisplayConfigSchemaFactory } from '@jbrowse/plugin-linear-genome-view'
4
+ import { types } from 'mobx-state-tree'
5
+
6
+ /**
7
+ * #config LinearReadCloudDisplay
8
+ */
9
+ function configSchemaF(pluginManager: PluginManager) {
10
+ return ConfigurationSchema(
11
+ 'LinearReadCloudDisplay',
12
+ {
13
+ /**
14
+ * #slot
15
+ */
16
+ maxFeatureScreenDensity: {
17
+ type: 'number',
18
+ description: 'maximum features per pixel that is displayed in the view',
19
+ defaultValue: 5,
20
+ },
21
+
22
+ /**
23
+ * #slot
24
+ */
25
+ featureHeight: {
26
+ type: 'number',
27
+ defaultValue: 7,
28
+ },
29
+
30
+ /**
31
+ * #slot
32
+ */
33
+ colorScheme: {
34
+ type: 'stringEnum',
35
+ model: types.enumeration('colorScheme', [
36
+ 'strand',
37
+ 'normal',
38
+ 'insertSize',
39
+ 'insertSizeAndOrientation',
40
+ 'mappingQuality',
41
+ 'tag',
42
+ ]),
43
+ description: 'color scheme to use',
44
+ defaultValue: 'normal',
45
+ },
46
+ },
47
+ {
48
+ /**
49
+ * #baseConfiguration
50
+ */
51
+ baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager),
52
+ explicitlyTyped: true,
53
+ },
54
+ )
55
+ }
56
+
57
+ export default configSchemaF
@@ -0,0 +1,201 @@
1
+ import { getConf } from '@jbrowse/core/configuration'
2
+ import { getContainingView } from '@jbrowse/core/util'
3
+
4
+ import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
5
+ // locals
6
+ import {
7
+ getOrientationColor,
8
+ getInsertSizeColor,
9
+ getInsertSizeAndOrientationColor,
10
+ } from '../shared/color'
11
+ import { ChainData, ReducedFeature } from '../shared/fetchChains'
12
+
13
+ type LGV = LinearGenomeViewModel
14
+
15
+ interface ChainCoord {
16
+ distance: number
17
+ r1s: number
18
+ r1e: number
19
+ r2s: number
20
+ r2e: number
21
+ v0: ReducedFeature
22
+ v1: ReducedFeature
23
+ }
24
+
25
+ // avoid drawing negative width features for SVG exports
26
+ function fillRectCtx(
27
+ x: number,
28
+ y: number,
29
+ width: number,
30
+ height: number,
31
+ ctx: CanvasRenderingContext2D,
32
+ color?: string,
33
+ ) {
34
+ if (width < 0) {
35
+ x += width
36
+ width = -width
37
+ }
38
+ if (height < 0) {
39
+ y += height
40
+ height = -height
41
+ }
42
+
43
+ if (color) {
44
+ ctx.fillStyle = color
45
+ }
46
+ ctx.fillRect(x, y, width, height)
47
+ }
48
+
49
+ export default async function drawFeats(
50
+ self: {
51
+ setLastDrawnOffsetPx: (n: number) => void
52
+ setError: (e: unknown) => void
53
+ colorBy?: { type: string }
54
+ height: number
55
+ chainData?: ChainData
56
+ },
57
+ ctx: CanvasRenderingContext2D,
58
+ ) {
59
+ const { chainData } = self
60
+ if (!chainData) {
61
+ return
62
+ }
63
+ const featureHeight = getConf(self, 'featureHeight')
64
+ const displayHeight = self.height
65
+ const view = getContainingView(self) as LGV
66
+
67
+ self.setLastDrawnOffsetPx(view.offsetPx)
68
+
69
+ const { chains, stats } = chainData
70
+ const coords: ChainCoord[] = []
71
+ for (let i = 0; i < chains.length; i++) {
72
+ const chain = chains[i]
73
+ // if we're looking at a paired read (flag 1) then assume it is just two
74
+ // reads (some small cases may defy this assumption such as secondary
75
+ // alignments but this may be uncommon)
76
+ if (chain[0].flags & 1 && chain.length > 1) {
77
+ const v0 = chain[0]
78
+ const v1 = chain[1]
79
+ const r1s = view.bpToPx({
80
+ refName: v0.refName,
81
+ coord: v0.start,
82
+ })
83
+ const r1e = view.bpToPx({
84
+ refName: v0.refName,
85
+ coord: v0.end,
86
+ })
87
+ const r2s = view.bpToPx({
88
+ refName: v1.refName,
89
+ coord: v1.start,
90
+ })
91
+ const r2e = view.bpToPx({
92
+ refName: v1.refName,
93
+ coord: v1.end,
94
+ })
95
+ let distance = 0
96
+
97
+ if (
98
+ r1s !== undefined &&
99
+ r1e !== undefined &&
100
+ r2s !== undefined &&
101
+ r2e !== undefined
102
+ ) {
103
+ if (v0.refName === v1.refName) {
104
+ const s = Math.min(v0.start, v1.start)
105
+ const e = Math.max(v0.end, v1.end)
106
+ distance = Math.abs(e - s)
107
+ }
108
+ coords.push({
109
+ r1s: r1s.offsetPx,
110
+ r1e: r1e.offsetPx,
111
+ r2s: r2s.offsetPx,
112
+ r2e: r2e.offsetPx,
113
+ v0,
114
+ v1,
115
+ distance,
116
+ })
117
+ }
118
+ } else {
119
+ // if we're not looking at pairs, then it could be a multiply-split-long
120
+ // read, so traverse chain
121
+ for (let i = 1; i < chain.length; i++) {
122
+ const v0 = chain[i - 1]
123
+ const v1 = chain[i]
124
+ const r1s = view.bpToPx({
125
+ refName: v0.refName,
126
+ coord: v0.start,
127
+ })
128
+ const r1e = view.bpToPx({
129
+ refName: v0.refName,
130
+ coord: v0.end,
131
+ })
132
+ const r2s = view.bpToPx({
133
+ refName: v1.refName,
134
+ coord: v1.start,
135
+ })
136
+ const r2e = view.bpToPx({
137
+ refName: v1.refName,
138
+ coord: v1.end,
139
+ })
140
+ let distance = 0
141
+
142
+ if (
143
+ r1s !== undefined &&
144
+ r1e !== undefined &&
145
+ r2s !== undefined &&
146
+ r2e !== undefined
147
+ ) {
148
+ if (v0.refName === v1.refName) {
149
+ const s = Math.min(v0.start, v1.start)
150
+ const e = Math.max(v0.end, v1.end)
151
+ distance = Math.abs(e - s)
152
+ }
153
+ coords.push({
154
+ r1s: r1s.offsetPx,
155
+ r1e: r1e.offsetPx,
156
+ r2s: r2s.offsetPx,
157
+ r2e: r2e.offsetPx,
158
+ v0,
159
+ v1,
160
+ distance,
161
+ })
162
+ }
163
+ }
164
+ }
165
+ }
166
+
167
+ let max = 0
168
+ for (let i = 0; i < coords.length; i++) {
169
+ const { distance } = coords[i]
170
+ max = Math.max(max, distance)
171
+ }
172
+ const halfHeight = featureHeight / 2 - 0.5
173
+ const scaler = (displayHeight - 20) / Math.log(max)
174
+
175
+ for (let i = 0; i < coords.length; i++) {
176
+ const { r1s, r1e, r2s, r2e, v0, v1, distance } = coords[i]
177
+ const type = self.colorBy?.type || 'insertSizeAndOrientation'
178
+
179
+ const top = Math.log(distance) * scaler
180
+ ctx.fillStyle = 'black'
181
+ const w = r2s - r1e
182
+ fillRectCtx(r1e - view.offsetPx, top + halfHeight, w, 1, ctx)
183
+
184
+ if (type === 'insertSizeAndOrientation') {
185
+ ctx.fillStyle = getInsertSizeAndOrientationColor(v0, v1, stats)
186
+ } else if (type === 'orientation') {
187
+ ctx.fillStyle = getOrientationColor(v0)
188
+ } else if (type === 'insertSize') {
189
+ ctx.fillStyle = getInsertSizeColor(v0, v1, stats) || 'grey'
190
+ } else if (type === 'gradient') {
191
+ const s = Math.min(v0.start, v1.start)
192
+ const e = Math.max(v0.end, v1.end)
193
+ ctx.fillStyle = `hsl(${Math.log10(Math.abs(e - s)) * 10},50%,50%)`
194
+ }
195
+
196
+ const w1 = Math.max(r1e - r1s, 2)
197
+ const w2 = Math.max(r2e - r2s, 2)
198
+ fillRectCtx(r1s - view.offsetPx, top, w1, featureHeight, ctx)
199
+ fillRectCtx(r2s - view.offsetPx, top, w2, featureHeight, ctx)
200
+ }
201
+ }
@@ -0,0 +1,23 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
3
+
4
+ // locals
5
+ import ReactComponent from './components/ReactComponent'
6
+ import configSchemaF from './configSchema'
7
+ import stateModelF from './model'
8
+
9
+ export default function register(pluginManager: PluginManager) {
10
+ pluginManager.addDisplayType(() => {
11
+ const configSchema = configSchemaF(pluginManager)
12
+ return new DisplayType({
13
+ name: 'LinearReadCloudDisplay',
14
+ displayName: 'Read cloud display',
15
+ configSchema,
16
+ stateModel: stateModelF(configSchema),
17
+ trackType: 'AlignmentsTrack',
18
+ viewType: 'LinearGenomeView',
19
+ subDisplay: { type: 'LinearAlignmentsDisplay', lowerPanel: true },
20
+ ReactComponent,
21
+ })
22
+ })
23
+ }
@@ -0,0 +1,289 @@
1
+ import React, { lazy } from 'react'
2
+ import { autorun } from 'mobx'
3
+ import { addDisposer, cast, types, Instance } from 'mobx-state-tree'
4
+ import {
5
+ AnyConfigurationSchemaType,
6
+ ConfigurationReference,
7
+ ConfigurationSchema,
8
+ } from '@jbrowse/core/configuration'
9
+ import { getContainingView, getSession } from '@jbrowse/core/util'
10
+ import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view'
11
+
12
+ // icons
13
+ import PaletteIcon from '@mui/icons-material/Palette'
14
+ import FilterListIcon from '@mui/icons-material/ClearAll'
15
+
16
+ // locals
17
+ import { FilterModel } from '../shared'
18
+ import { fetchChains, ChainData } from '../shared/fetchChains'
19
+ import drawFeats from './drawFeats'
20
+ import {
21
+ ExportSvgOptions,
22
+ LinearGenomeViewModel,
23
+ } from '@jbrowse/plugin-linear-genome-view/src/LinearGenomeView'
24
+
25
+ // async
26
+ const FilterByTagDlg = lazy(() => import('../shared/FilterByTag'))
27
+
28
+ interface Filter {
29
+ flagInclude: number
30
+ flagExclude: number
31
+ readName?: string
32
+ tagFilter?: { tag: string; value: string }
33
+ }
34
+
35
+ /**
36
+ * #stateModel LinearReadCloudDisplay
37
+ * extends `BaseLinearDisplay`
38
+ */
39
+ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
40
+ return types
41
+ .compose(
42
+ 'LinearReadCloudDisplay',
43
+ BaseLinearDisplay,
44
+ types.model({
45
+ /**
46
+ * #property
47
+ */
48
+ type: types.literal('LinearReadCloudDisplay'),
49
+ /**
50
+ * #property
51
+ */
52
+ configuration: ConfigurationReference(configSchema),
53
+
54
+ /**
55
+ * #property
56
+ */
57
+ filterBy: types.optional(FilterModel, {}),
58
+
59
+ /**
60
+ * #property
61
+ */
62
+ colorBy: types.maybe(
63
+ types.model({
64
+ type: types.string,
65
+ tag: types.maybe(types.string),
66
+ extra: types.frozen(),
67
+ }),
68
+ ),
69
+ }),
70
+ )
71
+ .volatile(() => ({
72
+ loading: false,
73
+ drawn: false,
74
+ chainData: undefined as ChainData | undefined,
75
+ ref: null as HTMLCanvasElement | null,
76
+ lastDrawnOffsetPx: 0,
77
+ }))
78
+ .actions(self => ({
79
+ /**
80
+ * #action
81
+ * internal, a reference to a HTMLCanvas because we use a autorun to draw the canvas
82
+ */
83
+ reload() {
84
+ self.error = undefined
85
+ },
86
+ /**
87
+ * #action
88
+ */
89
+ setRef(ref: HTMLCanvasElement | null) {
90
+ self.ref = ref
91
+ },
92
+
93
+ setColorScheme(s: { type: string }) {
94
+ self.colorBy = cast(s)
95
+ },
96
+
97
+ /**
98
+ * #action
99
+ */
100
+ setChainData(args: ChainData) {
101
+ self.chainData = args
102
+ },
103
+
104
+ /**
105
+ * #action
106
+ */
107
+ setLoading(f: boolean) {
108
+ self.loading = f
109
+ },
110
+
111
+ /**
112
+ * #action
113
+ */
114
+ setDrawn(f: boolean) {
115
+ self.drawn = f
116
+ },
117
+
118
+ /**
119
+ * #action
120
+ */
121
+ setFilterBy(filter: Filter) {
122
+ self.filterBy = cast(filter)
123
+ },
124
+
125
+ /**
126
+ * #action
127
+ */
128
+ setLastDrawnOffsetPx(n: number) {
129
+ self.lastDrawnOffsetPx = n
130
+ },
131
+ }))
132
+
133
+ .views(self => {
134
+ const {
135
+ trackMenuItems: superTrackMenuItems,
136
+ renderProps: superRenderProps,
137
+ } = self
138
+
139
+ return {
140
+ /**
141
+ * #getter
142
+ */
143
+ get ready() {
144
+ return !!self.chainData
145
+ },
146
+ // we don't use a server side renderer, but we need to provide this
147
+ // to avoid confusing the system currently
148
+ get rendererTypeName() {
149
+ return 'PileupRenderer'
150
+ },
151
+ // we don't use a server side renderer, so this fills in minimal
152
+ // info so as not to crash
153
+ renderProps() {
154
+ return {
155
+ ...superRenderProps(),
156
+ // never ready, we don't want to use server side render
157
+ notReady: true,
158
+ config: ConfigurationSchema('empty', {}).create(),
159
+ }
160
+ },
161
+
162
+ /**
163
+ * #method
164
+ */
165
+ trackMenuItems() {
166
+ return [
167
+ ...superTrackMenuItems(),
168
+ {
169
+ label: 'Filter by',
170
+ icon: FilterListIcon,
171
+ onClick: () => {
172
+ getSession(self).queueDialog(handleClose => [
173
+ FilterByTagDlg,
174
+ { model: self, handleClose },
175
+ ])
176
+ },
177
+ },
178
+
179
+ {
180
+ label: 'Color scheme',
181
+ icon: PaletteIcon,
182
+ subMenu: [
183
+ {
184
+ label: 'Insert size ± 3σ and orientation',
185
+ onClick: () =>
186
+ self.setColorScheme({ type: 'insertSizeAndOrientation' }),
187
+ },
188
+ {
189
+ label: 'Insert size ± 3σ',
190
+ onClick: () => self.setColorScheme({ type: 'insertSize' }),
191
+ },
192
+ {
193
+ label: 'Orientation',
194
+ onClick: () => self.setColorScheme({ type: 'orientation' }),
195
+ },
196
+ {
197
+ label: 'Insert size gradient',
198
+ onClick: () => self.setColorScheme({ type: 'gradient' }),
199
+ },
200
+ ],
201
+ },
202
+ ]
203
+ },
204
+
205
+ /**
206
+ * #method
207
+ */
208
+ async renderSvg(opts: ExportSvgOptions) {
209
+ const view = getContainingView(self) as LinearGenomeViewModel
210
+ const width = view.dynamicBlocks.totalWidthPx
211
+ const height = self.height
212
+ let str
213
+ if (opts.rasterizeLayers) {
214
+ const canvas = document.createElement('canvas')
215
+ canvas.width = width * 2
216
+ canvas.height = height * 2
217
+ const ctx = canvas.getContext('2d')
218
+ if (!ctx) {
219
+ return
220
+ }
221
+ ctx.scale(2, 2)
222
+ await drawFeats(self, ctx)
223
+ str = (
224
+ <image
225
+ width={width}
226
+ height={height}
227
+ xlinkHref={canvas.toDataURL('image/png')}
228
+ />
229
+ )
230
+ } else {
231
+ // @ts-ignore
232
+ const C2S = await import('canvas2svg')
233
+ const ctx = new C2S.default(width, height)
234
+ await drawFeats(self, ctx)
235
+ str = (
236
+ // eslint-disable-next-line react/no-danger
237
+ <g dangerouslySetInnerHTML={{ __html: ctx.getSvg().innerHTML }} />
238
+ )
239
+ }
240
+
241
+ return <g>{str}</g>
242
+ },
243
+ }
244
+ })
245
+ .actions(self => ({
246
+ afterAttach() {
247
+ addDisposer(
248
+ self,
249
+ autorun(() => fetchChains(self), { delay: 1000 }),
250
+ )
251
+
252
+ addDisposer(
253
+ self,
254
+ autorun(
255
+ async () => {
256
+ try {
257
+ const canvas = self.ref
258
+ if (!canvas) {
259
+ return
260
+ }
261
+ const ctx = canvas.getContext('2d')
262
+ if (!ctx) {
263
+ return
264
+ }
265
+ ctx.clearRect(0, 0, canvas.width, self.height * 2)
266
+ ctx.resetTransform()
267
+ ctx.scale(2, 2)
268
+
269
+ await drawFeats(self, ctx)
270
+ self.setDrawn(true)
271
+ } catch (e) {
272
+ console.error(e)
273
+ self.setError(e)
274
+ }
275
+ },
276
+ { delay: 1000 },
277
+ ),
278
+ )
279
+ },
280
+ }))
281
+ }
282
+
283
+ export type LinearReadCloudDisplayStateModel = ReturnType<
284
+ typeof stateModelFactory
285
+ >
286
+ export type LinearReadCloudDisplayModel =
287
+ Instance<LinearReadCloudDisplayStateModel>
288
+
289
+ export default stateModelFactory
@@ -9,6 +9,7 @@ export default function register(pluginManager: PluginManager) {
9
9
  const configSchema = configSchemaFactory(pluginManager)
10
10
  return new DisplayType({
11
11
  name: 'LinearSNPCoverageDisplay',
12
+ displayName: 'SNPCoverage display',
12
13
  configSchema,
13
14
  stateModel: modelFactory(pluginManager, configSchema),
14
15
  trackType: 'AlignmentsTrack',
@@ -1,5 +1,9 @@
1
1
  import { addDisposer, types, cast, getEnv, getSnapshot } from 'mobx-state-tree'
2
- import { observable, autorun } from 'mobx'
2
+ import clone from 'clone'
3
+ import { autorun } from 'mobx'
4
+
5
+ // jbrowse
6
+ import PluginManager from '@jbrowse/core/PluginManager'
3
7
  import {
4
8
  getConf,
5
9
  readConfObject,
@@ -7,13 +11,12 @@ import {
7
11
  AnyConfigurationModel,
8
12
  } from '@jbrowse/core/configuration'
9
13
  import { linearWiggleDisplayModelFactory } from '@jbrowse/plugin-wiggle'
10
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
11
- import PluginManager from '@jbrowse/core/PluginManager'
12
14
  import { getContainingView } from '@jbrowse/core/util'
15
+ import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
13
16
 
14
17
  // locals
15
18
  import Tooltip from '../components/Tooltip'
16
- import { getUniqueModificationValues } from '../../shared'
19
+ import { FilterModel, getUniqueModificationValues } from '../../shared'
17
20
 
18
21
  // using a map because it preserves order
19
22
  const rendererTypes = new Map([['snpcoverage', 'SNPCoverageRenderer']])
@@ -52,17 +55,7 @@ function stateModelFactory(
52
55
  /**
53
56
  * #property
54
57
  */
55
- filterBy: types.optional(
56
- types.model({
57
- flagInclude: types.optional(types.number, 0),
58
- flagExclude: types.optional(types.number, 1540),
59
- readName: types.maybe(types.string),
60
- tagFilter: types.maybe(
61
- types.model({ tag: types.string, value: types.string }),
62
- ),
63
- }),
64
- {},
65
- ),
58
+ filterBy: types.optional(FilterModel, {}),
66
59
  /**
67
60
  * #property
68
61
  */
@@ -75,7 +68,7 @@ function stateModelFactory(
75
68
  }),
76
69
  )
77
70
  .volatile(() => ({
78
- modificationTagMap: observable.map({}),
71
+ modificationTagMap: undefined as Record<string, string> | undefined,
79
72
  }))
80
73
  .actions(self => ({
81
74
  /**
@@ -109,12 +102,14 @@ function stateModelFactory(
109
102
  const colorPalette = ['red', 'blue', 'green', 'orange', 'purple']
110
103
  let i = 0
111
104
 
105
+ const newMap = clone(self.modificationTagMap) || {}
112
106
  uniqueModifications.forEach(value => {
113
- if (!self.modificationTagMap.has(value)) {
107
+ if (!newMap[value]) {
114
108
  const newColor = colorPalette[i++]
115
- self.modificationTagMap.set(value, newColor)
109
+ newMap[value] = newColor
116
110
  }
117
111
  })
112
+ self.modificationTagMap = newMap
118
113
  },
119
114
  }))
120
115
  .views(self => {
@@ -170,8 +165,7 @@ function stateModelFactory(
170
165
  */
171
166
  get modificationsReady() {
172
167
  return self.colorBy?.type === 'modifications'
173
- ? Object.keys(JSON.parse(JSON.stringify(self.modificationTagMap)))
174
- .length > 0
168
+ ? self.modificationTagMap !== undefined
175
169
  : true
176
170
  },
177
171
 
@@ -184,7 +178,7 @@ function stateModelFactory(
184
178
  return {
185
179
  ...superProps,
186
180
  notReady: superProps.notReady || !this.modificationsReady,
187
- modificationTagMap: Object.fromEntries(modificationTagMap.toJSON()),
181
+ modificationTagMap: modificationTagMap,
188
182
 
189
183
  // must use getSnapshot because otherwise changes to e.g. just the
190
184
  // colorBy.type are not read
@@ -5,7 +5,7 @@ import {
5
5
  parseCigar,
6
6
  getNextRefPos,
7
7
  getModificationPositions,
8
- } from './MismatchParser'
8
+ } from './index'
9
9
 
10
10
  const seq =
11
11
  'AAAAAAAAAACAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGGGGGGGTTTTTTTTTTTTTTTTTTTTTTTTT'