@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,9 +1,10 @@
1
- import { Region } from '@jbrowse/core/util';
2
- import { LayoutFeature } from './util';
3
- export declare function renderPerBaseQuality({ ctx, feat, region, bpPerPx, canvasWidth, }: {
1
+ import type { LayoutFeature } from './util';
2
+ import type { Region } from '@jbrowse/core/util';
3
+ export declare function renderPerBaseQuality({ ctx, feat, region, bpPerPx, canvasWidth, cigarOps, }: {
4
4
  ctx: CanvasRenderingContext2D;
5
5
  feat: LayoutFeature;
6
6
  region: Region;
7
7
  bpPerPx: number;
8
8
  canvasWidth: number;
9
+ cigarOps: string[];
9
10
  }): void;
@@ -1,15 +1,13 @@
1
1
  import { bpSpanPx } from '@jbrowse/core/util';
2
- import { parseCigar } from '../MismatchParser';
3
2
  import { fillRect } from './util';
4
- export function renderPerBaseQuality({ ctx, feat, region, bpPerPx, canvasWidth, }) {
3
+ export function renderPerBaseQuality({ ctx, feat, region, bpPerPx, canvasWidth, cigarOps, }) {
5
4
  const { feature, topPx, heightPx } = feat;
6
5
  const qual = feature.get('qual') || '';
7
6
  const scores = qual.split(' ').map(val => +val);
8
- const cigarOps = parseCigar(feature.get('CIGAR'));
9
7
  const w = 1 / bpPerPx;
10
8
  const start = feature.get('start');
11
- let soffset = 0; // sequence offset
12
- let roffset = 0; // reference offset
9
+ let soffset = 0;
10
+ let roffset = 0;
13
11
  for (let i = 0; i < cigarOps.length; i += 2) {
14
12
  const len = +cigarOps[i];
15
13
  const op = cigarOps[i + 1];
@@ -1,11 +1,11 @@
1
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
- import { Theme } from '@mui/material';
3
- import { RenderArgsDeserializedWithFeaturesAndLayout } from './PileupRenderer';
4
- import { LayoutFeature } from './util';
1
+ import type { ProcessedRenderArgs } from './types';
2
+ import type { LayoutFeature } from './util';
3
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
+ import type { Theme } from '@mui/material';
5
5
  export declare function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase, canvasWidth, }: {
6
6
  ctx: CanvasRenderingContext2D;
7
7
  feat: LayoutFeature;
8
- renderArgs: RenderArgsDeserializedWithFeaturesAndLayout;
8
+ renderArgs: ProcessedRenderArgs;
9
9
  config: AnyConfigurationModel;
10
10
  colorForBase: Record<string, string>;
11
11
  theme: Theme;
@@ -1,8 +1,7 @@
1
- import { readConfObject, } from '@jbrowse/core/configuration';
1
+ import { readConfObject } from '@jbrowse/core/configuration';
2
2
  import { bpSpanPx } from '@jbrowse/core/util';
3
- // locals
4
- import { parseCigar } from '../MismatchParser';
5
3
  import { fillRect, getCharWidthHeight } from './util';
4
+ import { parseCigar } from '../MismatchParser';
6
5
  export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, colorForBase, canvasWidth, }) {
7
6
  const { feature, topPx, heightPx } = feat;
8
7
  const { regions, bpPerPx } = renderArgs;
@@ -11,25 +10,23 @@ export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, color
11
10
  const mismatches = feature.get('mismatches');
12
11
  const seq = feature.get('seq');
13
12
  const { charWidth, charHeight } = getCharWidthHeight();
14
- // Display all bases softclipped off in lightened colors
15
13
  if (!(seq && mismatches)) {
16
14
  return;
17
15
  }
18
16
  const heightLim = charHeight - 2;
19
- const CIGAR = parseCigar(feature.get('CIGAR'));
20
17
  let seqOffset = 0;
21
18
  let refOffset = 0;
22
- for (let i = 0; i < CIGAR.length; i += 2) {
23
- const op = CIGAR[i + 1];
24
- const len = +CIGAR[i];
19
+ const CIGAR = feature.get('CIGAR');
20
+ const cigarOps = parseCigar(CIGAR);
21
+ for (let i = 0; i < cigarOps.length; i += 2) {
22
+ const op = cigarOps[i + 1];
23
+ const len = +cigarOps[i];
25
24
  if (op === 'S') {
26
25
  for (let k = 0; k < len; k++) {
27
26
  const base = seq[seqOffset + k];
28
27
  const s0 = feature.get('start') - (i === 0 ? len : 0) + refOffset + k;
29
28
  const [leftPx, rightPx] = bpSpanPx(s0, s0 + 1, region, bpPerPx);
30
29
  const widthPx = Math.max(minFeatWidth, rightPx - leftPx);
31
- // Black accounts for IUPAC ambiguity code bases such as N that
32
- // show in soft clipping
33
30
  const baseColor = colorForBase[base] || '#000000';
34
31
  ctx.fillStyle = baseColor;
35
32
  fillRect(ctx, leftPx, topPx, widthPx, heightPx, canvasWidth);
@@ -48,7 +45,6 @@ export function renderSoftClipping({ ctx, feat, renderArgs, config, theme, color
48
45
  seqOffset += len;
49
46
  }
50
47
  if (op === 'H') {
51
- // do nothing
52
48
  }
53
49
  if (op === 'D') {
54
50
  refOffset += len;
@@ -1,8 +1,3 @@
1
- import { Feature } from '@jbrowse/core/util';
2
- interface SortObject {
3
- pos: number;
4
- type: string;
5
- tag?: string;
6
- }
7
- export declare const sortFeature: (features: Map<string, Feature>, sortedBy: SortObject) => Map<string, Feature>;
8
- export {};
1
+ import type { SortedBy } from '../shared/types';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ export declare const sortFeature: (features: Map<string, Feature>, sortedBy: SortedBy) => Map<string, Feature>;
@@ -4,7 +4,6 @@ export const sortFeature = (features, sortedBy) => {
4
4
  const featuresInCenterLine = [];
5
5
  const featuresOutsideCenter = [];
6
6
  const { pos, type } = sortedBy;
7
- // only sort on features that intersect center line, append those outside post-sort
8
7
  featureArray.forEach(innerArray => {
9
8
  const feature = innerArray;
10
9
  const start = feature.get('start');
@@ -37,36 +36,34 @@ export const sortFeature = (features, sortedBy) => {
37
36
  }
38
37
  break;
39
38
  }
40
- // first sort all mismatches, then all reference bases at the end
41
39
  case 'Base pair': {
42
40
  const baseSortArray = [];
43
- featuresInCenterLine.forEach(feature => {
41
+ for (const feature of featuresInCenterLine) {
44
42
  const mismatches = feature.get('mismatches');
45
- mismatches.forEach(mismatch => {
43
+ for (const m of mismatches) {
46
44
  const start = feature.get('start');
47
- const offset = start + mismatch.start + 1;
48
- const consuming = mismatch.type === 'insertion' || mismatch.type === 'softclip';
49
- const len = consuming ? 0 : mismatch.length;
45
+ const offset = start + m.start + 1;
46
+ const consuming = m.type === 'insertion' || m.type === 'softclip';
47
+ const len = consuming ? 0 : m.length;
50
48
  if (pos >= offset && pos < offset + len) {
51
- baseSortArray.push([feature.id(), mismatch]);
49
+ baseSortArray.push([feature.id(), m]);
52
50
  }
53
- });
54
- });
51
+ }
52
+ }
55
53
  const baseMap = new Map(baseSortArray);
56
54
  featuresInCenterLine.sort((a, b) => {
57
55
  const aMismatch = baseMap.get(a.id());
58
56
  const bMismatch = baseMap.get(b.id());
59
57
  const acode = bMismatch === null || bMismatch === void 0 ? void 0 : bMismatch.base.toUpperCase();
60
58
  const bcode = aMismatch === null || aMismatch === void 0 ? void 0 : aMismatch.base.toUpperCase();
61
- if (acode === bcode && acode === '*') {
62
- // @ts-expect-error
63
- return aMismatch.length - bMismatch.length;
64
- }
65
- return ((acode ? acode.charCodeAt(0) : 0) - (bcode ? bcode.charCodeAt(0) : 0));
59
+ return acode === bcode && acode === '*'
60
+ ?
61
+ aMismatch.length - bMismatch.length
62
+ : (acode ? acode.charCodeAt(0) : 0) -
63
+ (bcode ? bcode.charCodeAt(0) : 0);
66
64
  });
67
65
  break;
68
66
  }
69
- // sorts positive strands then negative strands
70
67
  case 'Read strand': {
71
68
  featuresInCenterLine.sort((a, b) => a.get('strand') <= b.get('strand') ? 1 : -1);
72
69
  break;
@@ -0,0 +1,26 @@
1
+ import type { ColorBy, ModificationTypeWithColor, SortedBy } from '../shared/types';
2
+ import type { RenderArgsDeserialized as BoxRenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
3
+ import type { Feature } from '@jbrowse/core/util';
4
+ import type { BaseLayout } from '@jbrowse/core/util/layouts/BaseLayout';
5
+ export interface LayoutFeature {
6
+ heightPx: number;
7
+ topPx: number;
8
+ feature: Feature;
9
+ }
10
+ export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
11
+ colorBy?: ColorBy;
12
+ colorTagMap?: Record<string, string>;
13
+ visibleModifications?: Record<string, ModificationTypeWithColor>;
14
+ sortedBy?: SortedBy;
15
+ showSoftClip: boolean;
16
+ highResolutionScaling: number;
17
+ }
18
+ export interface ProcessedRenderArgs extends RenderArgsDeserialized {
19
+ features: Map<string, Feature>;
20
+ layout: BaseLayout<Feature>;
21
+ regionSequence: string | undefined;
22
+ }
23
+ export interface PreProcessedRenderArgs extends RenderArgsDeserialized {
24
+ features: Map<string, Feature>;
25
+ layout: BaseLayout<Feature>;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { Feature } from '@jbrowse/core/util';
2
- import { Theme } from '@mui/material';
1
+ import type { Feature } from '@jbrowse/core/util';
2
+ import type { Theme } from '@mui/material';
3
3
  export declare function fillRect(ctx: CanvasRenderingContext2D, l: number, t: number, w: number, h: number, cw: number, color?: string): void;
4
4
  export declare function getColorBaseMap(theme: Theme): {
5
5
  A: string;
@@ -15,7 +15,7 @@ export function getColorBaseMap(theme) {
15
15
  C: bases.C.main,
16
16
  G: bases.G.main,
17
17
  T: bases.T.main,
18
- deletion: '#808080', // gray
18
+ deletion: '#808080',
19
19
  };
20
20
  }
21
21
  export function getContrastBaseMap(theme) {
@@ -30,8 +30,6 @@ export function shouldDrawSNPsMuted(type) {
30
30
  export function shouldDrawIndels() {
31
31
  return true;
32
32
  }
33
- // get width and height of chars the height is an approximation: width letter M
34
- // is approximately the height
35
33
  export function getCharWidthHeight() {
36
34
  const charWidth = measureText('A');
37
35
  const charHeight = measureText('M') - 2;
@@ -1,6 +1,7 @@
1
- import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { AugmentedRegion as Region } from '@jbrowse/core/util/types';
3
- import { Feature } from '@jbrowse/core/util/simpleFeature';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
2
+ import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import type { Feature } from '@jbrowse/core/util/simpleFeature';
4
+ import type { AugmentedRegion as Region } from '@jbrowse/core/util/types';
4
5
  export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
5
6
  protected configure(): Promise<{
6
7
  subadapter: BaseFeatureDataAdapter;
@@ -1,11 +1,10 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import SimpleFeature from '@jbrowse/core/util/simpleFeature';
1
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
2
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
4
- import { toArray } from 'rxjs/operators';
3
+ import SimpleFeature from '@jbrowse/core/util/simpleFeature';
5
4
  import { firstValueFrom } from 'rxjs';
6
- // locals
7
- import generateCoverageBins from './generateCoverageBins';
5
+ import { toArray } from 'rxjs/operators';
8
6
  import { fetchSequence } from '../util';
7
+ import { generateCoverageBins } from './generateCoverageBins';
9
8
  export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
10
9
  async configure() {
11
10
  var _a, _b;
@@ -33,14 +32,19 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
33
32
  getFeatures(region, opts = {}) {
34
33
  return ObservableCreate(async (observer) => {
35
34
  const { subadapter } = await this.configure();
36
- const feats = await firstValueFrom(subadapter.getFeatures(region, opts).pipe(toArray()));
37
- const { bins, skipmap } = await generateCoverageBins(feats, region, opts, arg => this.fetchSequence(arg));
35
+ const features = await firstValueFrom(subadapter.getFeatures(region, opts).pipe(toArray()));
36
+ const { bins, skipmap } = await generateCoverageBins({
37
+ features,
38
+ region,
39
+ opts,
40
+ fetchSequence: (region) => this.fetchSequence(region),
41
+ });
38
42
  bins.forEach((bin, index) => {
39
43
  const start = region.start + index;
40
44
  observer.next(new SimpleFeature({
41
45
  id: `${this.id}-${start}`,
42
46
  data: {
43
- score: bin.total,
47
+ score: bin.depth,
44
48
  snpinfo: bin,
45
49
  start,
46
50
  end: start + 1,
@@ -48,7 +52,6 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
48
52
  },
49
53
  }));
50
54
  });
51
- // make fake features from the coverage
52
55
  Object.entries(skipmap).forEach(([key, skip]) => {
53
56
  observer.next(new SimpleFeature({
54
57
  id: key,
@@ -58,12 +61,12 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
58
61
  end: skip.end,
59
62
  strand: skip.strand,
60
63
  score: skip.score,
61
- xs: skip.xs,
64
+ effectiveStrand: skip.effectiveStrand,
62
65
  },
63
66
  }));
64
67
  });
65
68
  observer.complete();
66
- }, opts.signal);
69
+ }, opts.stopToken);
67
70
  }
68
71
  async getMultiRegionFeatureDensityStats(regions, opts) {
69
72
  const { subadapter } = await this.configure();
@@ -73,5 +76,5 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
73
76
  const { subadapter } = await this.configure();
74
77
  return subadapter.getRefNames(opts);
75
78
  }
76
- freeResources( /* { region } */) { }
79
+ freeResources() { }
77
80
  }
@@ -1,8 +1,4 @@
1
1
  declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- * normally refers to a BAM or CRAM adapter
5
- */
6
2
  subadapter: {
7
3
  type: string;
8
4
  defaultValue: null;
@@ -1,13 +1,6 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- /**
3
- * #config SNPCoverageAdapter
4
- */
5
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ function x() { }
6
3
  const configSchema = ConfigurationSchema('SNPCoverageAdapter', {
7
- /**
8
- * #slot
9
- * normally refers to a BAM or CRAM adapter
10
- */
11
4
  subadapter: {
12
5
  type: 'frozen',
13
6
  defaultValue: null,
@@ -1,13 +1,13 @@
1
- import { AugmentedRegion as Region } from '@jbrowse/core/util/types';
2
- import { Feature } from '@jbrowse/core/util/simpleFeature';
3
- import { Bin, SkipMap } from './util';
4
- export default function generateCoverageBins(features: Feature[], region: Region, opts: {
5
- bpPerPx?: number;
6
- colorBy?: {
7
- type: string;
8
- tag?: string;
9
- };
10
- }, fetchSequence: (arg: Region) => Promise<string>): Promise<{
11
- bins: Bin[];
1
+ import type { Opts } from './util';
2
+ import type { PreBaseCoverageBin, SkipMap } from '../shared/types';
3
+ import type { Feature } from '@jbrowse/core/util';
4
+ import type { AugmentedRegion as Region } from '@jbrowse/core/util/types';
5
+ export declare function generateCoverageBins({ fetchSequence, features, region, opts, }: {
6
+ features: Feature[];
7
+ region: Region;
8
+ opts: Opts;
9
+ fetchSequence: (arg: Region) => Promise<string>;
10
+ }): Promise<{
11
+ bins: PreBaseCoverageBin[];
12
12
  skipmap: SkipMap;
13
13
  }>;
@@ -1,202 +1,83 @@
1
- import { getTag, getTagAlt, shouldFetchReferenceSequence } from '../util';
2
- import { parseCigar, getNextRefPos, getModificationPositions, getMethBins, } from '../MismatchParser';
3
- import { doesIntersect2 } from '@jbrowse/core/util';
4
- function mismatchLen(mismatch) {
5
- return !isInterbase(mismatch.type) ? mismatch.length : 1;
6
- }
7
- function isInterbase(type) {
8
- return type === 'softclip' || type === 'hardclip' || type === 'insertion';
9
- }
10
- function inc(bin, strand, type, field) {
11
- let thisBin = bin[type][field];
12
- if (thisBin === undefined) {
13
- thisBin = bin[type][field] = {
14
- total: 0,
15
- '-1': 0,
16
- '0': 0,
17
- '1': 0,
18
- };
19
- }
20
- thisBin.total++;
21
- thisBin[strand]++;
22
- }
23
- export default async function generateCoverageBins(features, region, opts, fetchSequence) {
24
- var _a, _b, _c;
25
- const { colorBy } = opts;
26
- const extendedRegion = {
27
- ...region,
28
- start: Math.max(0, region.start - 1),
29
- end: region.end + 1,
30
- };
31
- const binMax = Math.ceil(extendedRegion.end - extendedRegion.start);
1
+ import { sum } from '@jbrowse/core/util';
2
+ import { checkStopToken } from '@jbrowse/core/util/stopToken';
3
+ import { processDepth } from './processDepth';
4
+ import { processMismatches } from './processMismatches';
5
+ import { processModifications } from './processModifications';
6
+ import { processReferenceCpGs } from './processReferenceCpGs';
7
+ export async function generateCoverageBins({ fetchSequence, features, region, opts, }) {
8
+ const { stopToken, colorBy } = opts;
32
9
  const skipmap = {};
33
- const regionSequence = features.length && shouldFetchReferenceSequence((_a = opts.colorBy) === null || _a === void 0 ? void 0 : _a.type)
34
- ? await fetchSequence(region)
35
- : undefined;
36
10
  const bins = [];
11
+ const start2 = Math.max(0, region.start - 1);
12
+ const diff = region.start - start2;
13
+ let start = performance.now();
37
14
  for (const feature of features) {
38
- const fstart = feature.get('start');
39
- const fend = feature.get('end');
40
- const fstrand = feature.get('strand');
41
- const mismatches = feature.get('mismatches') || [];
42
- for (let j = fstart; j < fend + 1; j++) {
43
- const i = j - region.start;
44
- if (i >= 0 && i < binMax) {
45
- if (bins[i] === undefined) {
46
- bins[i] = {
47
- total: 0,
48
- all: 0,
49
- ref: 0,
50
- '-1': 0,
51
- '0': 0,
52
- '1': 0,
53
- lowqual: {},
54
- cov: {},
55
- delskips: {},
56
- noncov: {},
57
- };
58
- }
59
- if (j !== fend) {
60
- bins[i].total++;
61
- bins[i].all++;
62
- bins[i].ref++;
63
- bins[i][fstrand]++;
64
- }
65
- }
15
+ if (performance.now() - start > 400) {
16
+ checkStopToken(stopToken);
17
+ start = performance.now();
66
18
  }
19
+ processDepth({
20
+ feature,
21
+ bins,
22
+ region,
23
+ });
67
24
  if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
68
- const seq = feature.get('seq');
69
- const mm = getTagAlt(feature, 'MM', 'Mm') || '';
70
- const ops = parseCigar(feature.get('CIGAR'));
71
- const fend = feature.get('end');
72
- if (seq) {
73
- const modifications = getModificationPositions(mm, seq, fstrand);
74
- for (const { type, positions } of modifications) {
75
- const mod = `mod_${type}`;
76
- for (const pos of getNextRefPos(ops, positions)) {
77
- const epos = pos + fstart - region.start;
78
- if (epos >= 0 && epos < bins.length && pos + fstart < fend) {
79
- if (bins[epos] === undefined) {
80
- bins[epos] = {
81
- total: 0,
82
- all: 0,
83
- ref: 0,
84
- '-1': 0,
85
- '0': 0,
86
- '1': 0,
87
- lowqual: {},
88
- cov: {},
89
- delskips: {},
90
- noncov: {},
91
- };
92
- }
93
- const bin = bins[epos];
94
- inc(bin, fstrand, 'cov', mod);
95
- }
96
- }
97
- }
98
- }
25
+ const regionSequence = (await fetchSequence({
26
+ ...region,
27
+ start: start2,
28
+ end: region.end + 1,
29
+ })) || '';
30
+ processModifications({
31
+ feature,
32
+ colorBy,
33
+ bins,
34
+ region,
35
+ regionSequence: regionSequence.slice(diff),
36
+ });
99
37
  }
100
- if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation') {
101
- if (!regionSequence) {
102
- throw new Error('no region sequence detected, need sequenceAdapter configuration');
103
- }
104
- const seq = feature.get('seq');
105
- if (!seq) {
106
- continue;
107
- }
108
- const { methBins, methProbs } = getMethBins(feature);
109
- const dels = mismatches.filter(f => f.type === 'deletion');
110
- // methylation based coloring takes into account both reference sequence
111
- // CpG detection and reads
112
- for (let i = 0; i < fend - fstart; i++) {
113
- const j = i + fstart;
114
- const l1 = (_b = regionSequence[j - region.start + 1]) === null || _b === void 0 ? void 0 : _b.toLowerCase();
115
- const l2 = (_c = regionSequence[j - region.start + 2]) === null || _c === void 0 ? void 0 : _c.toLowerCase();
116
- if (l1 === 'c' && l2 === 'g') {
117
- const bin0 = bins[j - region.start];
118
- const bin1 = bins[j - region.start + 1];
119
- const b0 = methBins[i];
120
- const b1 = methBins[i + 1];
121
- const p0 = methProbs[i];
122
- const p1 = methProbs[i + 1];
123
- // color
124
- if ((b0 && (p0 !== undefined ? p0 > 0.5 : true)) ||
125
- (b1 && (p1 !== undefined ? p1 > 0.5 : true))) {
126
- if (bin0) {
127
- inc(bin0, fstrand, 'cov', 'meth');
128
- bin0.ref--;
129
- bin0[fstrand]--;
130
- }
131
- if (bin1) {
132
- inc(bin1, fstrand, 'cov', 'meth');
133
- bin1.ref--;
134
- bin1[fstrand]--;
135
- }
136
- }
137
- else {
138
- if (bin0) {
139
- if (!dels.some(d => doesIntersect2(j, j + 1, d.start + fstart, d.start + fstart + d.length))) {
140
- inc(bin0, fstrand, 'cov', 'unmeth');
141
- bin0.ref--;
142
- bin0[fstrand]--;
143
- }
144
- }
145
- if (bin1) {
146
- if (!dels.some(d => doesIntersect2(j + 1, j + 2, d.start + fstart, d.start + fstart + d.length))) {
147
- inc(bin1, fstrand, 'cov', 'unmeth');
148
- bin1.ref--;
149
- bin1[fstrand]--;
150
- }
151
- }
152
- }
153
- }
154
- }
38
+ else if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation') {
39
+ const regionSequence = (await fetchSequence({
40
+ ...region,
41
+ start: start2,
42
+ end: region.end + 1,
43
+ })) || '';
44
+ processReferenceCpGs({
45
+ feature,
46
+ bins,
47
+ region,
48
+ regionSequence,
49
+ });
155
50
  }
156
- // normal SNP based coloring
157
- const colorSNPs = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) !== 'modifications' && (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) !== 'methylation';
158
- for (const mismatch of mismatches) {
159
- const mstart = fstart + mismatch.start;
160
- const mlen = mismatchLen(mismatch);
161
- const mend = mstart + mlen;
162
- for (let j = mstart; j < mstart + mlen; j++) {
163
- const epos = j - region.start;
164
- if (epos >= 0 && epos < bins.length) {
165
- const bin = bins[epos];
166
- const { base, type } = mismatch;
167
- const interbase = isInterbase(type);
168
- if (!interbase) {
169
- bin.ref--;
170
- bin[fstrand]--;
171
- }
172
- else {
173
- inc(bin, fstrand, 'noncov', type);
174
- }
175
- if (type === 'deletion' || type === 'skip') {
176
- inc(bin, fstrand, 'delskips', type);
177
- bin.total--;
178
- }
179
- else if (!interbase && colorSNPs) {
180
- inc(bin, fstrand, 'cov', base);
181
- bin.refbase = mismatch.altbase;
182
- }
183
- }
184
- }
185
- if (mismatch.type === 'skip') {
186
- const hash = `${mstart}_${mend}_${fstrand}`;
187
- if (skipmap[hash] === undefined) {
188
- skipmap[hash] = {
189
- feature: feature,
190
- start: mstart,
191
- end: mend,
192
- strand: fstrand,
193
- xs: getTag(feature, 'XS') || getTag(feature, 'TS'),
194
- score: 0,
195
- };
196
- }
197
- skipmap[hash].score++;
198
- }
51
+ processMismatches({ feature, skipmap, bins, region });
52
+ }
53
+ for (const bin of bins) {
54
+ if (bin) {
55
+ bin.mods = Object.fromEntries(Object.entries(bin.mods).map(([key, val]) => {
56
+ return [
57
+ key,
58
+ {
59
+ ...val,
60
+ avgProbability: val.probabilities.length
61
+ ? sum(val.probabilities) / val.probabilities.length
62
+ : undefined,
63
+ },
64
+ ];
65
+ }));
66
+ bin.nonmods = Object.fromEntries(Object.entries(bin.nonmods).map(([key, val]) => {
67
+ return [
68
+ key,
69
+ {
70
+ ...val,
71
+ avgProbability: val.probabilities.length
72
+ ? sum(val.probabilities) / val.probabilities.length
73
+ : undefined,
74
+ },
75
+ ];
76
+ }));
199
77
  }
200
78
  }
201
- return { bins, skipmap };
79
+ return {
80
+ bins,
81
+ skipmap,
82
+ };
202
83
  }
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function SNPCoverageAdapterF(pluginManager: PluginManager): void;