@jbrowse/plugin-alignments 2.16.1 → 2.18.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 (474) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -13
  3. package/dist/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
  4. package/dist/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
  5. package/dist/AlignmentsFeatureDetail/Flags.js +2 -2
  6. package/dist/AlignmentsFeatureDetail/Formatter.js +0 -3
  7. package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +3 -5
  8. package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +4 -9
  9. package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +3 -5
  10. package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +37 -36
  11. package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +2 -2
  12. package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +3 -4
  13. package/dist/AlignmentsFeatureDetail/PairLink.d.ts +1 -1
  14. package/dist/AlignmentsFeatureDetail/PairLink.js +0 -1
  15. package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +2 -2
  16. package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +5 -6
  17. package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -1
  18. package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +1 -5
  19. package/dist/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
  20. package/dist/AlignmentsFeatureDetail/getSAFeatures.js +2 -6
  21. package/dist/AlignmentsFeatureDetail/index.d.ts +1 -1
  22. package/dist/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
  23. package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +3 -3
  24. package/dist/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
  25. package/dist/AlignmentsFeatureDetail/tagInfo.js +1 -1
  26. package/dist/AlignmentsFeatureDetail/util.d.ts +1 -1
  27. package/dist/AlignmentsTrack/configSchemaF.d.ts +1 -1
  28. package/dist/AlignmentsTrack/configSchemaF.js +1 -8
  29. package/dist/AlignmentsTrack/index.d.ts +1 -1
  30. package/dist/AlignmentsTrack/index.js +0 -3
  31. package/dist/BamAdapter/BamAdapter.d.ts +8 -6
  32. package/dist/BamAdapter/BamAdapter.js +35 -30
  33. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +6 -20
  34. package/dist/BamAdapter/BamSlightlyLazyFeature.js +42 -75
  35. package/dist/BamAdapter/configSchema.d.ts +0 -17
  36. package/dist/BamAdapter/configSchema.js +1 -22
  37. package/dist/BamAdapter/index.d.ts +1 -1
  38. package/dist/CramAdapter/CramAdapter.d.ts +8 -10
  39. package/dist/CramAdapter/CramAdapter.js +26 -32
  40. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +23 -29
  41. package/dist/CramAdapter/CramSlightlyLazyFeature.js +59 -75
  42. package/dist/CramAdapter/CramTestAdapters.d.ts +3 -3
  43. package/dist/CramAdapter/CramTestAdapters.js +4 -5
  44. package/dist/CramAdapter/configSchema.d.ts +0 -14
  45. package/dist/CramAdapter/configSchema.js +1 -19
  46. package/dist/CramAdapter/index.d.ts +1 -1
  47. package/dist/CramAdapter/index.js +0 -1
  48. package/dist/CramAdapter/util.d.ts +2 -11
  49. package/dist/CramAdapter/util.js +1 -24
  50. package/dist/GuessAlignmentsTypes/index.d.ts +1 -1
  51. package/dist/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
  52. package/dist/HtsgetBamAdapter/configSchema.d.ts +0 -9
  53. package/dist/HtsgetBamAdapter/configSchema.js +1 -14
  54. package/dist/HtsgetBamAdapter/index.d.ts +1 -1
  55. package/dist/HtsgetBamAdapter/index.js +1 -1
  56. package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +2 -5
  57. package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +1 -31
  58. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
  59. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
  60. package/dist/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +2 -16
  61. package/dist/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +3 -20
  62. package/dist/LinearAlignmentsDisplay/index.d.ts +1 -1
  63. package/dist/LinearAlignmentsDisplay/index.js +2 -3
  64. package/dist/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +7 -73
  65. package/dist/LinearAlignmentsDisplay/{models/model.js → model.js} +13 -82
  66. package/dist/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +1 -1
  67. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +34 -181
  68. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +72 -149
  69. package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
  70. package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +5 -3
  71. package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
  72. package/dist/LinearPileupDisplay/components/GroupByDialog.js +111 -56
  73. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
  74. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
  75. package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
  76. package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
  77. package/dist/LinearPileupDisplay/components/SortByTagDialog.js +8 -6
  78. package/dist/LinearPileupDisplay/configSchema.d.ts +13 -16
  79. package/dist/LinearPileupDisplay/configSchema.js +12 -30
  80. package/dist/LinearPileupDisplay/index.d.ts +1 -1
  81. package/dist/LinearPileupDisplay/index.js +2 -2
  82. package/dist/LinearPileupDisplay/model.d.ts +121 -123
  83. package/dist/LinearPileupDisplay/model.js +110 -124
  84. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
  85. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +3 -7
  86. package/dist/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  87. package/dist/LinearReadArcsDisplay/configSchema.js +8 -31
  88. package/dist/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  89. package/dist/LinearReadArcsDisplay/drawFeats.js +1 -9
  90. package/dist/LinearReadArcsDisplay/index.d.ts +1 -1
  91. package/dist/LinearReadArcsDisplay/index.js +1 -2
  92. package/dist/LinearReadArcsDisplay/model.d.ts +13 -90
  93. package/dist/LinearReadArcsDisplay/model.js +24 -112
  94. package/dist/LinearReadArcsDisplay/util.d.ts +1 -1
  95. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
  96. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +3 -7
  97. package/dist/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  98. package/dist/LinearReadCloudDisplay/configSchema.js +3 -28
  99. package/dist/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  100. package/dist/LinearReadCloudDisplay/drawFeats.js +2 -2
  101. package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  102. package/dist/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  103. package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  104. package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -3
  105. package/dist/LinearReadCloudDisplay/index.d.ts +1 -1
  106. package/dist/LinearReadCloudDisplay/index.js +1 -2
  107. package/dist/LinearReadCloudDisplay/model.d.ts +14 -64
  108. package/dist/LinearReadCloudDisplay/model.js +24 -76
  109. package/dist/LinearReadCloudDisplay/util.js +0 -1
  110. package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
  111. package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +50 -20
  112. package/dist/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +17 -22
  113. package/dist/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +16 -32
  114. package/dist/LinearSNPCoverageDisplay/index.d.ts +1 -1
  115. package/dist/LinearSNPCoverageDisplay/index.js +3 -3
  116. package/{esm/LinearSNPCoverageDisplay/models → dist/LinearSNPCoverageDisplay}/model.d.ts +9 -60
  117. package/dist/LinearSNPCoverageDisplay/{models/model.js → model.js} +68 -146
  118. package/dist/MismatchParser/cigarToMismatches.d.ts +3 -0
  119. package/dist/MismatchParser/cigarToMismatches.js +91 -0
  120. package/dist/MismatchParser/getNextRefPos.d.ts +4 -0
  121. package/dist/MismatchParser/getNextRefPos.js +38 -0
  122. package/dist/MismatchParser/index.d.ts +5 -30
  123. package/dist/MismatchParser/index.js +10 -335
  124. package/dist/MismatchParser/mdToMismatches.d.ts +3 -0
  125. package/dist/MismatchParser/mdToMismatches.js +74 -0
  126. package/dist/ModificationParser/index.d.ts +19 -0
  127. package/dist/ModificationParser/index.js +127 -0
  128. package/dist/PileupRPC/base.d.ts +2 -2
  129. package/dist/PileupRPC/base.js +0 -1
  130. package/dist/PileupRPC/index.d.ts +1 -1
  131. package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  132. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +2 -4
  133. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +3 -4
  134. package/dist/PileupRPC/methods/GetReducedFeatures.js +21 -20
  135. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +4 -4
  136. package/dist/PileupRPC/methods/GetVisibleModifications.js +10 -7
  137. package/dist/PileupRPC/util.d.ts +1 -1
  138. package/dist/PileupRenderer/PileupLayoutSession.d.ts +12 -11
  139. package/dist/PileupRenderer/PileupLayoutSession.js +2 -5
  140. package/dist/PileupRenderer/PileupRenderer.d.ts +11 -29
  141. package/dist/PileupRenderer/PileupRenderer.js +17 -20
  142. package/dist/PileupRenderer/colorBy.d.ts +2 -2
  143. package/dist/PileupRenderer/colorBy.js +0 -6
  144. package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
  145. package/dist/PileupRenderer/components/PileupRendering.js +0 -3
  146. package/dist/PileupRenderer/configSchema.d.ts +0 -31
  147. package/dist/PileupRenderer/configSchema.js +1 -35
  148. package/dist/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  149. package/dist/PileupRenderer/getAlignmentShapeColor.js +1 -6
  150. package/dist/PileupRenderer/index.d.ts +1 -1
  151. package/dist/PileupRenderer/index.js +1 -1
  152. package/dist/PileupRenderer/layoutFeature.d.ts +2 -2
  153. package/dist/PileupRenderer/layoutFeature.js +0 -1
  154. package/dist/PileupRenderer/layoutFeatures.d.ts +5 -2
  155. package/dist/PileupRenderer/layoutFeatures.js +6 -4
  156. package/dist/PileupRenderer/makeImageData.d.ts +3 -4
  157. package/dist/PileupRenderer/makeImageData.js +8 -2
  158. package/dist/PileupRenderer/renderAlignment.d.ts +3 -3
  159. package/dist/PileupRenderer/renderAlignment.js +19 -8
  160. package/dist/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  161. package/dist/PileupRenderer/renderAlignmentShape.js +102 -21
  162. package/dist/PileupRenderer/renderMethylation.d.ts +6 -5
  163. package/dist/PileupRenderer/renderMethylation.js +13 -9
  164. package/dist/PileupRenderer/renderMismatches.d.ts +3 -3
  165. package/dist/PileupRenderer/renderMismatches.js +17 -28
  166. package/dist/PileupRenderer/renderModifications.d.ts +6 -5
  167. package/dist/PileupRenderer/renderModifications.js +30 -35
  168. package/dist/PileupRenderer/renderPerBaseLettering.d.ts +4 -3
  169. package/dist/PileupRenderer/renderPerBaseLettering.js +1 -4
  170. package/dist/PileupRenderer/renderPerBaseQuality.d.ts +4 -3
  171. package/dist/PileupRenderer/renderPerBaseQuality.js +3 -5
  172. package/dist/PileupRenderer/renderSoftClipping.d.ts +5 -5
  173. package/dist/PileupRenderer/renderSoftClipping.js +6 -10
  174. package/dist/PileupRenderer/sortUtil.d.ts +3 -8
  175. package/dist/PileupRenderer/sortUtil.js +13 -16
  176. package/dist/PileupRenderer/types.d.ts +26 -0
  177. package/dist/PileupRenderer/types.js +2 -0
  178. package/dist/PileupRenderer/util.d.ts +2 -2
  179. package/dist/PileupRenderer/util.js +1 -3
  180. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  181. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +14 -11
  182. package/dist/SNPCoverageAdapter/configSchema.d.ts +0 -4
  183. package/dist/SNPCoverageAdapter/configSchema.js +1 -8
  184. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +11 -11
  185. package/dist/SNPCoverageAdapter/generateCoverageBins.js +74 -193
  186. package/dist/SNPCoverageAdapter/index.d.ts +1 -1
  187. package/dist/SNPCoverageAdapter/processDepth.d.ts +8 -0
  188. package/dist/SNPCoverageAdapter/processDepth.js +38 -0
  189. package/dist/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  190. package/dist/SNPCoverageAdapter/processMismatches.js +58 -0
  191. package/dist/SNPCoverageAdapter/processModifications.d.ts +10 -0
  192. package/dist/SNPCoverageAdapter/processModifications.js +49 -0
  193. package/dist/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  194. package/dist/SNPCoverageAdapter/processReferenceCpGs.js +63 -0
  195. package/dist/SNPCoverageAdapter/util.d.ts +9 -24
  196. package/dist/SNPCoverageAdapter/util.js +39 -0
  197. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +6 -4
  198. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +165 -72
  199. package/dist/SNPCoverageRenderer/configSchema.d.ts +0 -15
  200. package/dist/SNPCoverageRenderer/configSchema.js +1 -19
  201. package/dist/SNPCoverageRenderer/index.d.ts +1 -1
  202. package/dist/SNPCoverageRenderer/index.js +2 -2
  203. package/dist/index.d.ts +2 -2
  204. package/dist/index.js +12 -12
  205. package/dist/shared/afterAttach.d.ts +1 -1
  206. package/dist/shared/afterAttach.js +0 -2
  207. package/dist/shared/color.d.ts +1 -11
  208. package/dist/shared/color.js +1 -15
  209. package/{esm/shared → dist/shared/components}/BaseDisplayComponent.d.ts +2 -2
  210. package/dist/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +12 -11
  211. package/{esm/shared → dist/shared/components}/FilterByTagDialog.d.ts +3 -3
  212. package/dist/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +7 -3
  213. package/dist/shared/fetchChains.d.ts +2 -2
  214. package/dist/shared/fetchChains.js +2 -4
  215. package/dist/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
  216. package/dist/shared/getMaximumModificationAtEachPosition.js +41 -0
  217. package/dist/shared/getUniqueModifications.d.ts +14 -0
  218. package/dist/shared/getUniqueModifications.js +16 -0
  219. package/dist/shared/getUniqueTags.d.ts +15 -0
  220. package/dist/shared/getUniqueTags.js +18 -0
  221. package/dist/shared/{renderSvg.js → renderSvgUtil.js} +0 -2
  222. package/dist/shared/types.d.ts +94 -0
  223. package/dist/shared/types.js +2 -0
  224. package/dist/shared/util.d.ts +19 -1
  225. package/dist/shared/util.js +52 -0
  226. package/dist/util.d.ts +10 -7
  227. package/dist/util.js +26 -37
  228. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
  229. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -13
  230. package/esm/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
  231. package/esm/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
  232. package/esm/AlignmentsFeatureDetail/Flags.js +2 -2
  233. package/esm/AlignmentsFeatureDetail/Formatter.js +0 -3
  234. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +3 -5
  235. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +5 -10
  236. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +3 -5
  237. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +37 -36
  238. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +2 -2
  239. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +3 -4
  240. package/esm/AlignmentsFeatureDetail/PairLink.d.ts +1 -1
  241. package/esm/AlignmentsFeatureDetail/PairLink.js +0 -1
  242. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +2 -2
  243. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +5 -6
  244. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -1
  245. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +2 -6
  246. package/esm/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
  247. package/esm/AlignmentsFeatureDetail/getSAFeatures.js +2 -6
  248. package/esm/AlignmentsFeatureDetail/index.d.ts +1 -1
  249. package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
  250. package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +3 -3
  251. package/esm/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
  252. package/esm/AlignmentsFeatureDetail/tagInfo.js +1 -1
  253. package/esm/AlignmentsFeatureDetail/util.d.ts +1 -1
  254. package/esm/AlignmentsTrack/configSchemaF.d.ts +1 -1
  255. package/esm/AlignmentsTrack/configSchemaF.js +1 -8
  256. package/esm/AlignmentsTrack/index.d.ts +1 -1
  257. package/esm/AlignmentsTrack/index.js +0 -3
  258. package/esm/BamAdapter/BamAdapter.d.ts +8 -6
  259. package/esm/BamAdapter/BamAdapter.js +36 -31
  260. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +6 -20
  261. package/esm/BamAdapter/BamSlightlyLazyFeature.js +43 -76
  262. package/esm/BamAdapter/configSchema.d.ts +0 -17
  263. package/esm/BamAdapter/configSchema.js +1 -22
  264. package/esm/BamAdapter/index.d.ts +1 -1
  265. package/esm/CramAdapter/CramAdapter.d.ts +8 -10
  266. package/esm/CramAdapter/CramAdapter.js +28 -34
  267. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +23 -29
  268. package/esm/CramAdapter/CramSlightlyLazyFeature.js +59 -75
  269. package/esm/CramAdapter/CramTestAdapters.d.ts +3 -3
  270. package/esm/CramAdapter/CramTestAdapters.js +4 -5
  271. package/esm/CramAdapter/configSchema.d.ts +0 -14
  272. package/esm/CramAdapter/configSchema.js +1 -19
  273. package/esm/CramAdapter/index.d.ts +1 -1
  274. package/esm/CramAdapter/index.js +0 -1
  275. package/esm/CramAdapter/util.d.ts +2 -11
  276. package/esm/CramAdapter/util.js +1 -24
  277. package/esm/GuessAlignmentsTypes/index.d.ts +1 -1
  278. package/esm/GuessAlignmentsTypes/index.js +1 -1
  279. package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
  280. package/esm/HtsgetBamAdapter/configSchema.d.ts +0 -9
  281. package/esm/HtsgetBamAdapter/configSchema.js +1 -14
  282. package/esm/HtsgetBamAdapter/index.d.ts +1 -1
  283. package/esm/HtsgetBamAdapter/index.js +1 -1
  284. package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +2 -5
  285. package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +1 -31
  286. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
  287. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
  288. package/esm/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +2 -16
  289. package/esm/LinearAlignmentsDisplay/configSchema.js +16 -0
  290. package/esm/LinearAlignmentsDisplay/index.d.ts +1 -1
  291. package/esm/LinearAlignmentsDisplay/index.js +2 -3
  292. package/esm/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +7 -73
  293. package/esm/LinearAlignmentsDisplay/{models/model.js → model.js} +14 -83
  294. package/esm/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +1 -1
  295. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +34 -181
  296. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +74 -151
  297. package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
  298. package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +5 -3
  299. package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
  300. package/esm/LinearPileupDisplay/components/GroupByDialog.js +111 -56
  301. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
  302. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
  303. package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
  304. package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
  305. package/esm/LinearPileupDisplay/components/SortByTagDialog.js +8 -6
  306. package/esm/LinearPileupDisplay/configSchema.d.ts +13 -16
  307. package/esm/LinearPileupDisplay/configSchema.js +12 -30
  308. package/esm/LinearPileupDisplay/index.d.ts +1 -1
  309. package/esm/LinearPileupDisplay/index.js +2 -2
  310. package/esm/LinearPileupDisplay/model.d.ts +121 -123
  311. package/esm/LinearPileupDisplay/model.js +111 -125
  312. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
  313. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +3 -7
  314. package/esm/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  315. package/esm/LinearReadArcsDisplay/configSchema.js +8 -31
  316. package/esm/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  317. package/esm/LinearReadArcsDisplay/drawFeats.js +1 -9
  318. package/esm/LinearReadArcsDisplay/index.d.ts +1 -1
  319. package/esm/LinearReadArcsDisplay/index.js +1 -2
  320. package/esm/LinearReadArcsDisplay/model.d.ts +13 -90
  321. package/esm/LinearReadArcsDisplay/model.js +25 -113
  322. package/esm/LinearReadArcsDisplay/util.d.ts +1 -1
  323. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
  324. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +3 -7
  325. package/esm/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  326. package/esm/LinearReadCloudDisplay/configSchema.js +3 -28
  327. package/esm/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  328. package/esm/LinearReadCloudDisplay/drawFeats.js +2 -2
  329. package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  330. package/esm/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  331. package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  332. package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -3
  333. package/esm/LinearReadCloudDisplay/index.d.ts +1 -1
  334. package/esm/LinearReadCloudDisplay/index.js +1 -2
  335. package/esm/LinearReadCloudDisplay/model.d.ts +14 -64
  336. package/esm/LinearReadCloudDisplay/model.js +24 -76
  337. package/esm/LinearReadCloudDisplay/util.js +0 -1
  338. package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
  339. package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +50 -20
  340. package/esm/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +17 -22
  341. package/esm/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +16 -32
  342. package/esm/LinearSNPCoverageDisplay/index.d.ts +1 -1
  343. package/esm/LinearSNPCoverageDisplay/index.js +3 -3
  344. package/{dist/LinearSNPCoverageDisplay/models → esm/LinearSNPCoverageDisplay}/model.d.ts +9 -60
  345. package/esm/LinearSNPCoverageDisplay/{models/model.js → model.js} +69 -147
  346. package/esm/MismatchParser/cigarToMismatches.d.ts +3 -0
  347. package/esm/MismatchParser/cigarToMismatches.js +88 -0
  348. package/esm/MismatchParser/getNextRefPos.d.ts +4 -0
  349. package/esm/MismatchParser/getNextRefPos.js +35 -0
  350. package/esm/MismatchParser/index.d.ts +5 -30
  351. package/esm/MismatchParser/index.js +5 -325
  352. package/esm/MismatchParser/mdToMismatches.d.ts +3 -0
  353. package/esm/MismatchParser/mdToMismatches.js +71 -0
  354. package/esm/ModificationParser/index.d.ts +19 -0
  355. package/esm/ModificationParser/index.js +121 -0
  356. package/esm/PileupRPC/base.d.ts +2 -2
  357. package/esm/PileupRPC/base.js +0 -1
  358. package/esm/PileupRPC/index.d.ts +1 -1
  359. package/esm/PileupRPC/index.js +1 -1
  360. package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  361. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +2 -4
  362. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +3 -4
  363. package/esm/PileupRPC/methods/GetReducedFeatures.js +21 -20
  364. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +4 -4
  365. package/esm/PileupRPC/methods/GetVisibleModifications.js +10 -7
  366. package/esm/PileupRPC/util.d.ts +1 -1
  367. package/esm/PileupRenderer/PileupLayoutSession.d.ts +12 -11
  368. package/esm/PileupRenderer/PileupLayoutSession.js +2 -5
  369. package/esm/PileupRenderer/PileupRenderer.d.ts +11 -29
  370. package/esm/PileupRenderer/PileupRenderer.js +19 -22
  371. package/esm/PileupRenderer/colorBy.d.ts +2 -2
  372. package/esm/PileupRenderer/colorBy.js +1 -7
  373. package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -1
  374. package/esm/PileupRenderer/components/PileupRendering.js +1 -4
  375. package/esm/PileupRenderer/configSchema.d.ts +0 -31
  376. package/esm/PileupRenderer/configSchema.js +1 -35
  377. package/esm/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  378. package/esm/PileupRenderer/getAlignmentShapeColor.js +2 -7
  379. package/esm/PileupRenderer/index.d.ts +1 -1
  380. package/esm/PileupRenderer/index.js +1 -1
  381. package/esm/PileupRenderer/layoutFeature.d.ts +2 -2
  382. package/esm/PileupRenderer/layoutFeature.js +0 -1
  383. package/esm/PileupRenderer/layoutFeatures.d.ts +5 -2
  384. package/esm/PileupRenderer/layoutFeatures.js +7 -5
  385. package/esm/PileupRenderer/makeImageData.d.ts +3 -4
  386. package/esm/PileupRenderer/makeImageData.js +8 -2
  387. package/esm/PileupRenderer/renderAlignment.d.ts +3 -3
  388. package/esm/PileupRenderer/renderAlignment.js +19 -8
  389. package/esm/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  390. package/esm/PileupRenderer/renderAlignmentShape.js +102 -21
  391. package/esm/PileupRenderer/renderMethylation.d.ts +6 -5
  392. package/esm/PileupRenderer/renderMethylation.js +13 -9
  393. package/esm/PileupRenderer/renderMismatches.d.ts +3 -3
  394. package/esm/PileupRenderer/renderMismatches.js +17 -28
  395. package/esm/PileupRenderer/renderModifications.d.ts +6 -5
  396. package/esm/PileupRenderer/renderModifications.js +29 -34
  397. package/esm/PileupRenderer/renderPerBaseLettering.d.ts +4 -3
  398. package/esm/PileupRenderer/renderPerBaseLettering.js +1 -4
  399. package/esm/PileupRenderer/renderPerBaseQuality.d.ts +4 -3
  400. package/esm/PileupRenderer/renderPerBaseQuality.js +3 -5
  401. package/esm/PileupRenderer/renderSoftClipping.d.ts +5 -5
  402. package/esm/PileupRenderer/renderSoftClipping.js +7 -11
  403. package/esm/PileupRenderer/sortUtil.d.ts +3 -8
  404. package/esm/PileupRenderer/sortUtil.js +13 -16
  405. package/esm/PileupRenderer/types.d.ts +26 -0
  406. package/esm/PileupRenderer/types.js +1 -0
  407. package/esm/PileupRenderer/util.d.ts +2 -2
  408. package/esm/PileupRenderer/util.js +1 -3
  409. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  410. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +15 -12
  411. package/esm/SNPCoverageAdapter/configSchema.d.ts +0 -4
  412. package/esm/SNPCoverageAdapter/configSchema.js +1 -8
  413. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +11 -11
  414. package/esm/SNPCoverageAdapter/generateCoverageBins.js +73 -192
  415. package/esm/SNPCoverageAdapter/index.d.ts +1 -1
  416. package/esm/SNPCoverageAdapter/processDepth.d.ts +8 -0
  417. package/esm/SNPCoverageAdapter/processDepth.js +35 -0
  418. package/esm/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  419. package/esm/SNPCoverageAdapter/processMismatches.js +55 -0
  420. package/esm/SNPCoverageAdapter/processModifications.d.ts +10 -0
  421. package/esm/SNPCoverageAdapter/processModifications.js +46 -0
  422. package/esm/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  423. package/esm/SNPCoverageAdapter/processReferenceCpGs.js +60 -0
  424. package/esm/SNPCoverageAdapter/util.d.ts +9 -24
  425. package/esm/SNPCoverageAdapter/util.js +35 -1
  426. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +6 -4
  427. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +167 -74
  428. package/esm/SNPCoverageRenderer/configSchema.d.ts +0 -15
  429. package/esm/SNPCoverageRenderer/configSchema.js +1 -19
  430. package/esm/SNPCoverageRenderer/index.d.ts +1 -1
  431. package/esm/SNPCoverageRenderer/index.js +2 -2
  432. package/esm/index.d.ts +2 -2
  433. package/esm/index.js +10 -10
  434. package/esm/shared/afterAttach.d.ts +1 -1
  435. package/esm/shared/afterAttach.js +0 -2
  436. package/esm/shared/color.d.ts +1 -11
  437. package/esm/shared/color.js +0 -14
  438. package/{dist/shared → esm/shared/components}/BaseDisplayComponent.d.ts +2 -2
  439. package/esm/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +12 -11
  440. package/{dist/shared → esm/shared/components}/FilterByTagDialog.d.ts +3 -3
  441. package/esm/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +7 -3
  442. package/esm/shared/fetchChains.d.ts +2 -2
  443. package/esm/shared/fetchChains.js +2 -4
  444. package/esm/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
  445. package/esm/shared/getMaximumModificationAtEachPosition.js +38 -0
  446. package/esm/shared/getUniqueModifications.d.ts +14 -0
  447. package/esm/shared/getUniqueModifications.js +13 -0
  448. package/esm/shared/getUniqueTags.d.ts +15 -0
  449. package/esm/shared/getUniqueTags.js +15 -0
  450. package/esm/shared/{renderSvg.js → renderSvgUtil.js} +0 -2
  451. package/esm/shared/types.d.ts +94 -0
  452. package/esm/shared/types.js +1 -0
  453. package/esm/shared/util.d.ts +19 -1
  454. package/esm/shared/util.js +47 -0
  455. package/esm/util.d.ts +10 -7
  456. package/esm/util.js +24 -34
  457. package/package.json +4 -5
  458. package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
  459. package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -41
  460. package/dist/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
  461. package/dist/LinearPileupDisplay/components/ModificationsTable.js +0 -28
  462. package/dist/shared/index.d.ts +0 -49
  463. package/dist/shared/index.js +0 -41
  464. package/esm/LinearAlignmentsDisplay/models/configSchema.js +0 -33
  465. package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
  466. package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -36
  467. package/esm/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
  468. package/esm/LinearPileupDisplay/components/ModificationsTable.js +0 -22
  469. package/esm/shared/index.d.ts +0 -49
  470. package/esm/shared/index.js +0 -36
  471. /package/dist/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
  472. /package/dist/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
  473. /package/esm/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
  474. /package/esm/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
@@ -1,24 +1,30 @@
1
- import { createJBrowseTheme } from '@jbrowse/core/ui';
2
- import { featureSpanPx, bpSpanPx } from '@jbrowse/core/util';
3
1
  import { readConfObject } from '@jbrowse/core/configuration';
4
- import { getOrigin, getScale, WiggleBaseRenderer, YSCALEBAR_LABEL_OFFSET, } from '@jbrowse/plugin-wiggle';
2
+ import { createJBrowseTheme } from '@jbrowse/core/ui';
3
+ import { bpSpanPx, featureSpanPx } from '@jbrowse/core/util';
4
+ import { checkStopToken } from '@jbrowse/core/util/stopToken';
5
+ import { WiggleBaseRenderer, YSCALEBAR_LABEL_OFFSET, getOrigin, getScale, } from '@jbrowse/plugin-wiggle';
6
+ import { alphaColor } from '../shared/util';
7
+ const INTERBASE_INDICATOR_WIDTH = 7;
8
+ const INTERBASE_INDICATOR_HEIGHT = 4.5;
9
+ const MINIMUM_INTERBASE_INDICATOR_READ_DEPTH = 7;
10
+ const complementBase = {
11
+ C: 'G',
12
+ G: 'C',
13
+ A: 'T',
14
+ T: 'A',
15
+ };
5
16
  const fudgeFactor = 0.6;
6
17
  export default class SNPCoverageRenderer extends WiggleBaseRenderer {
7
- // note: the snps are drawn on linear scale even if the data is drawn in log
8
- // scape hence the two different scales being used
9
18
  async draw(ctx, props) {
10
- const { features, regions, bpPerPx, displayCrossHatches, modificationTagMap = {}, scaleOpts, height: unadjustedHeight, theme: configTheme, config: cfg, ticks, } = props;
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
20
+ const { features, regions, bpPerPx, colorBy, displayCrossHatches, visibleModifications = {}, scaleOpts, height: unadjustedHeight, theme: configTheme, config: cfg, ticks, stopToken, } = props;
11
21
  const theme = createJBrowseTheme(configTheme);
12
22
  const region = regions[0];
13
23
  const width = (region.end - region.start) / bpPerPx;
14
- // the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
15
- // wiggle display, and makes the height of the actual drawn area add
16
- // "padding" to the top and bottom of the display
17
24
  const offset = YSCALEBAR_LABEL_OFFSET;
18
25
  const height = unadjustedHeight - offset * 2;
19
26
  const opts = { ...scaleOpts, range: [0, height] };
20
27
  const viewScale = getScale(opts);
21
- // clipping and insertion indicators, uses a smaller height/2 scale
22
28
  const indicatorViewScale = getScale({
23
29
  ...opts,
24
30
  range: [0, height / 2],
@@ -30,10 +36,8 @@ export default class SNPCoverageRenderer extends WiggleBaseRenderer {
30
36
  const drawInterbaseCounts = readConfObject(cfg, 'drawInterbaseCounts');
31
37
  const drawArcs = readConfObject(cfg, 'drawArcs');
32
38
  const drawIndicators = readConfObject(cfg, 'drawIndicators');
33
- // get the y coordinate that we are plotting at, this can be log scale
34
39
  const toY = (n) => height - (viewScale(n) || 0) + offset;
35
40
  const toHeight = (n) => toY(originY) - toY(n);
36
- // used specifically for indicator
37
41
  const toY2 = (n) => height - (indicatorViewScale(n) || 0) + offset;
38
42
  const toHeight2 = (n) => toY2(originLinear) - toY2(n);
39
43
  const { bases } = theme.palette;
@@ -46,62 +50,155 @@ export default class SNPCoverageRenderer extends WiggleBaseRenderer {
46
50
  softclip: 'blue',
47
51
  hardclip: 'red',
48
52
  total: readConfObject(cfg, 'color'),
49
- meth: 'red',
50
- unmeth: 'blue',
53
+ mod_NONE: 'blue',
54
+ cpg_meth: 'red',
55
+ cpg_unmeth: 'blue',
51
56
  };
52
57
  const feats = [...features.values()];
53
- const coverage = feats.filter(f => f.get('type') !== 'skip');
54
- const skips = feats.filter(f => f.get('type') === 'skip');
55
- // Use two pass rendering, which helps in visualizing the SNPs at higher
56
- // bpPerPx First pass: draw the gray background
57
58
  ctx.fillStyle = colorForBase.total;
58
- for (const feature of coverage) {
59
+ let start = performance.now();
60
+ for (const feature of feats) {
61
+ if (feature.get('type') === 'skip') {
62
+ continue;
63
+ }
59
64
  const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
60
65
  const w = rightPx - leftPx + fudgeFactor;
61
66
  const score = feature.get('score');
62
67
  ctx.fillRect(leftPx, toY(score), w, toHeight(score));
68
+ if (performance.now() - start > 400) {
69
+ checkStopToken(stopToken);
70
+ start = performance.now();
71
+ }
63
72
  }
64
- // Keep track of previous total which we will use it to draw the interbase
65
- // indicator (if there is a sudden clip, there will be no read coverage but
66
- // there will be "clip" coverage) at that position beyond the read. if the
67
- // clip is right at a block boundary then prevTotal will not be available,
68
- // so this is a best attempt to plot interbase indicator at the "cliffs"
69
73
  let prevTotal = 0;
70
- // extraHorizontallyFlippedOffset is used to draw interbase items, which
71
- // are located to the left when forward and right when reversed
72
74
  const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx : 0;
73
- // Second pass: draw the SNP data, and add a minimum feature width of 1px
74
- // which can be wider than the actual bpPerPx This reduces overdrawing of
75
- // the grey background over the SNPs
76
- for (const feature of coverage) {
75
+ const drawingModifications = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications';
76
+ const drawingMethylation = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation';
77
+ const isolatedModification = (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
78
+ start = performance.now();
79
+ for (const feature of feats) {
80
+ const now = performance.now();
81
+ if (now - start > 400) {
82
+ checkStopToken(stopToken);
83
+ }
84
+ if (feature.get('type') === 'skip') {
85
+ continue;
86
+ }
77
87
  const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
78
- const score = feature.get('score');
79
88
  const snpinfo = feature.get('snpinfo');
80
89
  const w = Math.max(rightPx - leftPx, 1);
81
- const totalScore = snpinfo.total;
82
- const keys = Object.keys(snpinfo.cov).sort();
83
- let curr = 0;
84
- for (const base of keys) {
85
- const { total } = snpinfo.cov[base];
86
- ctx.fillStyle =
87
- colorForBase[base] ||
88
- modificationTagMap[base.replace('mod_', '')] ||
89
- 'black';
90
- const height = toHeight(score);
91
- const bottom = toY(score) + height;
92
- ctx.fillRect(Math.round(leftPx), bottom - ((total + curr) / score) * height, w, (total / score) * height);
93
- curr += total;
90
+ const score0 = feature.get('score');
91
+ if (drawingModifications) {
92
+ let curr = 0;
93
+ const refbase = (_b = snpinfo.refbase) === null || _b === void 0 ? void 0 : _b.toUpperCase();
94
+ const { nonmods, mods, snps, ref } = snpinfo;
95
+ for (const m of Object.keys(nonmods).sort().reverse()) {
96
+ const mod = visibleModifications[m.replace('nonmod_', '')] ||
97
+ visibleModifications[m.replace('mod_', '')];
98
+ if (!mod) {
99
+ console.warn(`${m} not known yet`);
100
+ continue;
101
+ }
102
+ if (isolatedModification && mod.type !== isolatedModification) {
103
+ continue;
104
+ }
105
+ const cmp = complementBase[mod.base];
106
+ const detectable = mod.base === 'N'
107
+ ? score0
108
+ : (((_c = snps[mod.base]) === null || _c === void 0 ? void 0 : _c.entryDepth) || 0) +
109
+ (((_d = snps[cmp]) === null || _d === void 0 ? void 0 : _d.entryDepth) || 0) +
110
+ (refbase === mod.base ? ref['1'] : 0) +
111
+ (refbase === cmp ? ref['-1'] : 0);
112
+ const modifiable = mod.base === 'N'
113
+ ? score0
114
+ : (((_e = snps[mod.base]) === null || _e === void 0 ? void 0 : _e.entryDepth) || 0) +
115
+ (((_f = snps[cmp]) === null || _f === void 0 ? void 0 : _f.entryDepth) || 0) +
116
+ (refbase === mod.base ? ref.entryDepth : 0) +
117
+ (refbase === cmp ? ref.entryDepth : 0);
118
+ const { entryDepth, avgProbability = 0 } = snpinfo.nonmods[m];
119
+ const modFraction = (modifiable / score0) * (entryDepth / detectable);
120
+ const nonModColor = 'blue';
121
+ const c = alphaColor(nonModColor, avgProbability);
122
+ const height = toHeight(score0);
123
+ const bottom = toY(score0) + height;
124
+ ctx.fillStyle = c;
125
+ ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
126
+ curr += modFraction * height;
127
+ }
128
+ for (const m of Object.keys(mods).sort().reverse()) {
129
+ const mod = visibleModifications[m.replace('mod_', '')];
130
+ if (!mod) {
131
+ console.warn(`${m} not known yet`);
132
+ continue;
133
+ }
134
+ if (isolatedModification && mod.type !== isolatedModification) {
135
+ continue;
136
+ }
137
+ const cmp = complementBase[mod.base];
138
+ const detectable = mod.base === 'N'
139
+ ? score0
140
+ : (((_g = snps[mod.base]) === null || _g === void 0 ? void 0 : _g.entryDepth) || 0) +
141
+ (((_h = snps[cmp]) === null || _h === void 0 ? void 0 : _h.entryDepth) || 0) +
142
+ (refbase === mod.base ? ref['1'] : 0) +
143
+ (refbase === cmp ? ref['-1'] : 0);
144
+ const modifiable = mod.base === 'N'
145
+ ? score0
146
+ : (((_j = snps[mod.base]) === null || _j === void 0 ? void 0 : _j.entryDepth) || 0) +
147
+ (((_k = snps[cmp]) === null || _k === void 0 ? void 0 : _k.entryDepth) || 0) +
148
+ (refbase === mod.base ? ref.entryDepth : 0) +
149
+ (refbase === cmp ? ref.entryDepth : 0);
150
+ const { entryDepth, avgProbability = 0 } = mods[m];
151
+ const modFraction = (modifiable / score0) * (entryDepth / detectable);
152
+ const baseColor = mod.color || 'black';
153
+ const c = alphaColor(baseColor, avgProbability);
154
+ const height = toHeight(score0);
155
+ const bottom = toY(score0) + height;
156
+ ctx.fillStyle = c;
157
+ ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
158
+ curr += modFraction * height;
159
+ }
160
+ }
161
+ else if (drawingMethylation) {
162
+ const { depth, nonmods, mods } = snpinfo;
163
+ let curr = 0;
164
+ for (const base of Object.keys(mods).sort().reverse()) {
165
+ const { entryDepth } = mods[base];
166
+ const height = toHeight(score0);
167
+ const bottom = toY(score0) + height;
168
+ ctx.fillStyle = colorForBase[base] || 'black';
169
+ ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
170
+ curr += entryDepth;
171
+ }
172
+ for (const base of Object.keys(nonmods).sort().reverse()) {
173
+ const { entryDepth } = nonmods[base];
174
+ const height = toHeight(score0);
175
+ const bottom = toY(score0) + height;
176
+ ctx.fillStyle = colorForBase[base] || 'black';
177
+ ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
178
+ curr += entryDepth;
179
+ }
180
+ }
181
+ else {
182
+ const { depth, snps } = snpinfo;
183
+ let curr = 0;
184
+ for (const base of Object.keys(snps).sort().reverse()) {
185
+ const { entryDepth } = snps[base];
186
+ const height = toHeight(score0);
187
+ const bottom = toY(score0) + height;
188
+ ctx.fillStyle = colorForBase[base] || 'black';
189
+ ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
190
+ curr += entryDepth;
191
+ }
94
192
  }
95
193
  const interbaseEvents = Object.keys(snpinfo.noncov);
96
- const indicatorHeight = 4.5;
97
194
  if (drawInterbaseCounts) {
98
195
  let curr = 0;
99
196
  for (const base of interbaseEvents) {
100
- const { total } = snpinfo.noncov[base];
197
+ const { entryDepth } = snpinfo.noncov[base];
101
198
  const r = 0.6;
102
199
  ctx.fillStyle = colorForBase[base];
103
- ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset, indicatorHeight + toHeight2(curr), r * 2, toHeight2(total));
104
- curr += total;
200
+ ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset, INTERBASE_INDICATOR_HEIGHT + toHeight2(curr), r * 2, toHeight2(entryDepth));
201
+ curr += entryDepth;
105
202
  }
106
203
  }
107
204
  if (drawIndicators) {
@@ -109,48 +206,44 @@ export default class SNPCoverageRenderer extends WiggleBaseRenderer {
109
206
  let max = 0;
110
207
  let maxBase = '';
111
208
  for (const base of interbaseEvents) {
112
- const { total } = snpinfo.noncov[base];
113
- accum += total;
114
- if (total > max) {
115
- max = total;
209
+ const { entryDepth } = snpinfo.noncov[base];
210
+ accum += entryDepth;
211
+ if (entryDepth > max) {
212
+ max = entryDepth;
116
213
  maxBase = base;
117
214
  }
118
215
  }
119
- // avoid drawing a bunch of indicators if coverage is very low e.g.
120
- // less than 7, uses the prev total in the case of the "cliff"
121
- const indicatorComparatorScore = Math.max(totalScore, prevTotal);
216
+ const indicatorComparatorScore = Math.max(score0, prevTotal);
122
217
  if (accum > indicatorComparatorScore * indicatorThreshold &&
123
- indicatorComparatorScore > 7) {
218
+ indicatorComparatorScore > MINIMUM_INTERBASE_INDICATOR_READ_DEPTH) {
124
219
  ctx.fillStyle = colorForBase[maxBase];
125
220
  ctx.beginPath();
126
221
  const l = leftPx + extraHorizontallyFlippedOffset;
127
- ctx.moveTo(l - 3.5, 0);
128
- ctx.lineTo(l + 3.5, 0);
129
- ctx.lineTo(l, indicatorHeight);
222
+ ctx.moveTo(l - INTERBASE_INDICATOR_WIDTH / 2, 0);
223
+ ctx.lineTo(l + INTERBASE_INDICATOR_WIDTH / 2, 0);
224
+ ctx.lineTo(l, INTERBASE_INDICATOR_HEIGHT);
130
225
  ctx.fill();
131
226
  }
132
227
  }
133
- prevTotal = totalScore;
228
+ prevTotal = score0;
134
229
  }
135
230
  if (drawArcs) {
136
- for (const f of skips) {
137
- const [left, right] = bpSpanPx(f.get('start'), f.get('end'), region, bpPerPx);
231
+ for (const f of feats) {
232
+ if (f.get('type') !== 'skip') {
233
+ continue;
234
+ }
235
+ const s = f.get('start');
236
+ const e = f.get('end');
237
+ const [left, right] = bpSpanPx(s, e, region, bpPerPx);
138
238
  ctx.beginPath();
139
- const str = f.get('strand');
140
- const xs = f.get('xs');
239
+ const effectiveStrand = f.get('effectiveStrand');
141
240
  const pos = 'rgba(255,200,200,0.7)';
142
241
  const neg = 'rgba(200,200,255,0.7)';
143
242
  const neutral = 'rgba(200,200,200,0.7)';
144
- if (xs === '+') {
145
- ctx.strokeStyle = pos;
146
- }
147
- else if (xs === '-') {
148
- ctx.strokeStyle = neg;
149
- }
150
- else if (str === 1) {
243
+ if (effectiveStrand === 1) {
151
244
  ctx.strokeStyle = pos;
152
245
  }
153
- else if (str === -1) {
246
+ else if (effectiveStrand === -1) {
154
247
  ctx.strokeStyle = neg;
155
248
  }
156
249
  else {
@@ -165,12 +258,12 @@ export default class SNPCoverageRenderer extends WiggleBaseRenderer {
165
258
  if (displayCrossHatches) {
166
259
  ctx.lineWidth = 1;
167
260
  ctx.strokeStyle = 'rgba(140,140,140,0.8)';
168
- ticks.values.forEach(tick => {
261
+ for (const tick of ticks.values) {
169
262
  ctx.beginPath();
170
263
  ctx.moveTo(0, Math.round(toY(tick)));
171
264
  ctx.lineTo(width, Math.round(toY(tick)));
172
265
  ctx.stroke();
173
- });
266
+ }
174
267
  }
175
268
  return undefined;
176
269
  }
@@ -1,39 +1,24 @@
1
1
  declare const SNPCoverageRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  clipColor: {
6
3
  type: string;
7
4
  description: string;
8
5
  defaultValue: string;
9
6
  };
10
- /**
11
- * #slot
12
- */
13
7
  indicatorThreshold: {
14
8
  type: string;
15
9
  description: string;
16
10
  defaultValue: number;
17
11
  };
18
- /**
19
- * #slot
20
- */
21
12
  drawArcs: {
22
13
  type: string;
23
14
  description: string;
24
15
  defaultValue: boolean;
25
16
  };
26
- /**
27
- * #slot
28
- */
29
17
  drawInterbaseCounts: {
30
18
  type: string;
31
19
  description: string;
32
20
  defaultValue: boolean;
33
21
  };
34
- /**
35
- * #slot
36
- */
37
22
  drawIndicators: {
38
23
  type: string;
39
24
  description: string;
@@ -1,44 +1,26 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config SNPCoverageRenderer
4
- */
5
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
6
3
  const SNPCoverageRenderer = ConfigurationSchema('SNPCoverageRenderer', {
7
- /**
8
- * #slot
9
- */
10
4
  clipColor: {
11
5
  type: 'color',
12
6
  description: 'the color of the clipping marker',
13
7
  defaultValue: 'red',
14
8
  },
15
- /**
16
- * #slot
17
- */
18
9
  indicatorThreshold: {
19
10
  type: 'number',
20
11
  description: 'the proportion of reads containing a insertion/clip indicator',
21
12
  defaultValue: 0.4,
22
13
  },
23
- /**
24
- * #slot
25
- */
26
14
  drawArcs: {
27
15
  type: 'boolean',
28
16
  description: 'Draw sashimi-style arcs for intron features',
29
17
  defaultValue: true,
30
18
  },
31
- /**
32
- * #slot
33
- */
34
19
  drawInterbaseCounts: {
35
20
  type: 'boolean',
36
21
  description: 'draw count "upsidedown histogram" of the interbase events that don\'t contribute to the coverage count so are not drawn in the normal histogram',
37
22
  defaultValue: true,
38
23
  },
39
- /**
40
- * #slot
41
- */
42
24
  drawIndicators: {
43
25
  type: 'boolean',
44
26
  description: 'draw a triangular indicator where an event has been detected',
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function register(pluginManager: PluginManager): void;
@@ -1,6 +1,6 @@
1
- import configSchema from './configSchema';
2
- import SNPCoverageRenderer from './SNPCoverageRenderer';
3
1
  import { WiggleRendering } from '@jbrowse/plugin-wiggle';
2
+ import SNPCoverageRenderer from './SNPCoverageRenderer';
3
+ import configSchema from './configSchema';
4
4
  export default function register(pluginManager) {
5
5
  pluginManager.addRendererType(() => new SNPCoverageRenderer({
6
6
  name: 'SNPCoverageRenderer',
package/esm/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class AlignmentsPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
6
6
  }
7
- export { linearPileupDisplayStateModelFactory, linearPileupDisplayConfigSchemaFactory, SharedLinearPileupDisplayMixin, } from './LinearPileupDisplay';
7
+ export { SharedLinearPileupDisplayMixin, linearPileupDisplayConfigSchemaFactory, linearPileupDisplayStateModelFactory, } from './LinearPileupDisplay';
8
8
  export { type LinearPileupDisplayModel } from './LinearPileupDisplay/model';
9
9
  export * as MismatchParser from './MismatchParser';
package/esm/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import BamAdapterF from './CramAdapter';
2
+ import AlignmentsFeatureWidgetF from './AlignmentsFeatureDetail';
3
+ import AlignmentsTrackF from './AlignmentsTrack';
3
4
  import CramAdapterF from './BamAdapter';
5
+ import BamAdapterF from './CramAdapter';
6
+ import GuessAlignmentsTypesF from './GuessAlignmentsTypes';
4
7
  import HtsgetBamAdapterF from './HtsgetBamAdapter';
5
- import SNPCoverageAdapterF from './SNPCoverageAdapter';
6
- import SNPCoverageRendererF from './SNPCoverageRenderer';
7
- import PileupRendererF from './PileupRenderer';
8
8
  import LinearAlignmentsDisplayF from './LinearAlignmentsDisplay';
9
- import LinearSNPCoverageDisplayF from './LinearSNPCoverageDisplay';
9
+ import LinearPileupDisplayF from './LinearPileupDisplay';
10
10
  import LinearReadArcsDisplayF from './LinearReadArcsDisplay';
11
11
  import LinearReadCloudDisplayF from './LinearReadCloudDisplay';
12
- import AlignmentsTrackF from './AlignmentsTrack';
13
- import AlignmentsFeatureWidgetF from './AlignmentsFeatureDetail';
12
+ import LinearSNPCoverageDisplayF from './LinearSNPCoverageDisplay';
14
13
  import PileupRPCMethodsF from './PileupRPC';
15
- import GuessAlignmentsTypesF from './GuessAlignmentsTypes';
16
- import LinearPileupDisplayF from './LinearPileupDisplay';
14
+ import PileupRendererF from './PileupRenderer';
15
+ import SNPCoverageAdapterF from './SNPCoverageAdapter';
16
+ import SNPCoverageRendererF from './SNPCoverageRenderer';
17
17
  export default class AlignmentsPlugin extends Plugin {
18
18
  constructor() {
19
19
  super(...arguments);
@@ -42,5 +42,5 @@ export default class AlignmentsPlugin extends Plugin {
42
42
  });
43
43
  }
44
44
  }
45
- export { linearPileupDisplayStateModelFactory, linearPileupDisplayConfigSchemaFactory, SharedLinearPileupDisplayMixin, } from './LinearPileupDisplay';
45
+ export { SharedLinearPileupDisplayMixin, linearPileupDisplayConfigSchemaFactory, linearPileupDisplayStateModelFactory, } from './LinearPileupDisplay';
46
46
  export * as MismatchParser from './MismatchParser';
@@ -1,2 +1,2 @@
1
- import { IAnyStateTreeNode } from 'mobx-state-tree';
1
+ import type { IAnyStateTreeNode } from 'mobx-state-tree';
2
2
  export declare function doAfterAttach<T extends IAnyStateTreeNode>(self: T, cb: (self: T, ctx: CanvasRenderingContext2D, width: number, height: number) => void): void;
@@ -24,14 +24,12 @@ export function doAfterAttach(self, cb) {
24
24
  self.setLastDrawnOffsetPx(view.offsetPx);
25
25
  self.setLastDrawnBpPerPx(view.bpPerPx);
26
26
  }
27
- // first autorun instantly draws if bpPerPx changes
28
27
  createAutorun(self, async () => {
29
28
  const view = getContainingView(self);
30
29
  if (view.bpPerPx !== self.lastDrawnBpPerPx) {
31
30
  draw(view);
32
31
  }
33
32
  });
34
- // second autorun draws after delay 1000 e.g. if offsetPx changes
35
33
  createAutorun(self, async () => {
36
34
  const view = getContainingView(self);
37
35
  draw(view);
@@ -1,5 +1,4 @@
1
- import { Instance } from 'mobx-state-tree';
2
- import { ChainStats } from './fetchChains';
1
+ import type { ChainStats } from './fetchChains';
3
2
  export declare const fillColor: {
4
3
  color_fwd_strand_not_proper: string;
5
4
  color_rev_strand_not_proper: string;
@@ -57,12 +56,3 @@ export declare function getPairedOrientationColorOrDefault(f: {
57
56
  export declare function getPairedOrientationColor(f: {
58
57
  pair_orientation?: string;
59
58
  }): readonly [string, string];
60
- export interface ExtraColorBy {
61
- custom?: Record<string, string>;
62
- }
63
- export declare const ColorByModel: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
64
- type: import("mobx-state-tree").ISimpleType<string>;
65
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
66
- extra: import("mobx-state-tree").IType<any, any, any>;
67
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
68
- export type IColorByModel = Instance<typeof ColorByModel>;
@@ -1,4 +1,3 @@
1
- import { types } from 'mobx-state-tree';
2
1
  import { orientationTypes, pairMap } from '../util';
3
2
  export const fillColor = {
4
3
  color_fwd_strand_not_proper: '#ECC8C8',
@@ -19,12 +18,6 @@ export const fillColor = {
19
18
  color_shortinsert: 'pink',
20
19
  color_unknown: 'grey',
21
20
  };
22
- // manually calculated by running
23
- // const color = require('color')
24
- // Object.fromEntries(Object.entries(fillColor).map(([key,val])=>{
25
- // return [key, color(val).darken('0.3').hex()]
26
- // }))
27
- // this avoids (expensive) use of Color module at runtime
28
21
  export const strokeColor = {
29
22
  color_fwd_strand_not_proper: '#CA6767',
30
23
  color_rev_strand_not_proper: '#7272AA',
@@ -61,8 +54,6 @@ export function getPairedInsertSizeColor(f1, f2, stats) {
61
54
  }
62
55
  }
63
56
  const defaultColor = [fillColor.color_unknown, fillColor.color_unknown];
64
- // return color scheme with both insert size and orientation coloring,
65
- // prioritzing orientation coloring
66
57
  export function getPairedInsertSizeAndOrientationColor(f1, f2, stats) {
67
58
  return (getPairedOrientationColorOrDefault(f1) ||
68
59
  getPairedInsertSizeColor(f1, f2, stats) ||
@@ -79,8 +70,3 @@ export function getPairedOrientationColorOrDefault(f) {
79
70
  export function getPairedOrientationColor(f) {
80
71
  return getPairedOrientationColorOrDefault(f) || defaultColor;
81
72
  }
82
- export const ColorByModel = types.maybe(types.model({
83
- type: types.string,
84
- tag: types.maybe(types.string),
85
- extra: types.frozen(),
86
- }));
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { LinearReadCloudDisplayModel } from '../LinearReadCloudDisplay/model';
3
- import { LinearReadArcsDisplayModel } from '../LinearReadArcsDisplay/model';
2
+ import type { LinearReadArcsDisplayModel } from '../../LinearReadArcsDisplay/model';
3
+ import type { LinearReadCloudDisplayModel } from '../../LinearReadCloudDisplay/model';
4
4
  declare const BaseDisplayComponent: ({ model, children, }: {
5
5
  model: LinearReadArcsDisplayModel | LinearReadCloudDisplayModel;
6
6
  children?: React.ReactNode;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { LoadingEllipses } from '@jbrowse/core/ui';
3
- import { BlockMsg, } from '@jbrowse/plugin-linear-genome-view';
4
- import { makeStyles } from 'tss-react/mui';
5
- import { observer } from 'mobx-react';
6
3
  import { getContainingView } from '@jbrowse/core/util';
4
+ import { BlockMsg } from '@jbrowse/plugin-linear-genome-view';
7
5
  import { Button, Tooltip } from '@mui/material';
6
+ import { observer } from 'mobx-react';
7
+ import { makeStyles } from 'tss-react/mui';
8
8
  const useStyles = makeStyles()(theme => ({
9
9
  loading: {
10
10
  backgroundColor: theme.palette.background.default,
@@ -18,21 +18,22 @@ const useStyles = makeStyles()(theme => ({
18
18
  textAlign: 'center',
19
19
  },
20
20
  }));
21
- const BaseDisplayComponent = observer(function ({ model, children, }) {
22
- const { error, regionTooLarge } = model;
23
- return error ? (React.createElement(BlockMsg, { message: `${error}`, severity: "error", action: React.createElement(Tooltip, { title: "Reload" },
21
+ const BlockError = observer(function ({ model, }) {
22
+ const { error } = model;
23
+ return (React.createElement(BlockMsg, { message: `${error}`, severity: "error", action: React.createElement(Tooltip, { title: "Reload" },
24
24
  React.createElement(Button, { "data-testid": "reload_button", onClick: () => {
25
25
  model.reload();
26
- } }, "Reload")) })) : regionTooLarge ? (model.regionCannotBeRendered()) : (React.createElement(DataDisplay, { model: model }, children));
26
+ } }, "Reload")) }));
27
+ });
28
+ const BaseDisplayComponent = observer(function ({ model, children, }) {
29
+ const { error, regionTooLarge } = model;
30
+ return error ? (React.createElement(BlockError, { model: model })) : regionTooLarge ? (model.regionCannotBeRendered()) : (React.createElement(DataDisplay, { model: model }, children));
27
31
  });
28
32
  const DataDisplay = observer(function ({ model, children, }) {
29
33
  const { drawn, loading } = model;
30
34
  const view = getContainingView(model);
31
35
  const left = (model.lastDrawnOffsetPx || 0) - view.offsetPx;
32
- return (
33
- // this data-testid is located here because changing props on the canvas
34
- // itself is very sensitive to triggering ref invalidation
35
- React.createElement("div", { "data-testid": `drawn-${drawn}` },
36
+ return (React.createElement("div", { "data-testid": `drawn-${drawn}` },
36
37
  React.createElement("div", { style: { position: 'absolute', left } }, children),
37
38
  left !== 0 || loading ? React.createElement(LoadingBar, { model: model }) : null));
38
39
  });
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { IFilter } from '.';
2
+ import type { FilterBy } from '../types';
3
3
  declare const FilterByTagDialog: (props: {
4
4
  model: {
5
- filterBy: IFilter;
6
- setFilterBy: (arg: IFilter) => void;
5
+ filterBy: FilterBy;
6
+ setFilterBy: (arg: FilterBy) => void;
7
7
  };
8
8
  handleClose: () => void;
9
9
  }) => React.JSX.Element;