@jbrowse/plugin-alignments 2.17.0 → 3.0.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 (471) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +2 -3
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +25 -24
  3. package/dist/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
  4. package/dist/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
  5. package/dist/AlignmentsFeatureDetail/Flags.d.ts +1 -2
  6. package/dist/AlignmentsFeatureDetail/Flags.js +8 -10
  7. package/dist/AlignmentsFeatureDetail/Formatter.d.ts +1 -2
  8. package/dist/AlignmentsFeatureDetail/Formatter.js +11 -39
  9. package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +4 -7
  10. package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +46 -54
  11. package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +4 -7
  12. package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +58 -61
  13. package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +3 -4
  14. package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +4 -5
  15. package/dist/AlignmentsFeatureDetail/PairLink.d.ts +2 -3
  16. package/dist/AlignmentsFeatureDetail/PairLink.js +3 -7
  17. package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +3 -4
  18. package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +6 -9
  19. package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +2 -3
  20. package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +21 -31
  21. package/dist/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
  22. package/dist/AlignmentsFeatureDetail/getSAFeatures.js +0 -4
  23. package/dist/AlignmentsFeatureDetail/index.d.ts +1 -1
  24. package/dist/AlignmentsFeatureDetail/index.js +17 -7
  25. package/dist/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
  26. package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +2 -2
  27. package/dist/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
  28. package/dist/AlignmentsFeatureDetail/tagInfo.js +1 -1
  29. package/dist/AlignmentsFeatureDetail/util.d.ts +1 -1
  30. package/dist/AlignmentsTrack/configSchemaF.d.ts +1 -1
  31. package/dist/AlignmentsTrack/configSchemaF.js +1 -8
  32. package/dist/AlignmentsTrack/index.d.ts +1 -1
  33. package/dist/AlignmentsTrack/index.js +0 -3
  34. package/dist/BamAdapter/BamAdapter.d.ts +6 -5
  35. package/dist/BamAdapter/BamAdapter.js +21 -39
  36. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -3
  37. package/dist/BamAdapter/BamSlightlyLazyFeature.js +0 -3
  38. package/dist/BamAdapter/configSchema.d.ts +0 -17
  39. package/dist/BamAdapter/configSchema.js +1 -22
  40. package/dist/BamAdapter/index.d.ts +1 -1
  41. package/dist/BamAdapter/index.js +17 -7
  42. package/dist/CramAdapter/CramAdapter.d.ts +6 -9
  43. package/dist/CramAdapter/CramAdapter.js +25 -43
  44. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +3 -3
  45. package/dist/CramAdapter/CramSlightlyLazyFeature.js +0 -17
  46. package/dist/CramAdapter/CramTestAdapters.d.ts +3 -3
  47. package/dist/CramAdapter/CramTestAdapters.js +6 -6
  48. package/dist/CramAdapter/configSchema.d.ts +0 -14
  49. package/dist/CramAdapter/configSchema.js +1 -19
  50. package/dist/CramAdapter/index.d.ts +1 -1
  51. package/dist/CramAdapter/index.js +17 -8
  52. package/dist/CramAdapter/util.d.ts +2 -2
  53. package/dist/CramAdapter/util.js +1 -24
  54. package/dist/GuessAlignmentsTypes/index.d.ts +1 -1
  55. package/dist/GuessAlignmentsTypes/index.js +19 -34
  56. package/dist/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
  57. package/dist/HtsgetBamAdapter/configSchema.d.ts +0 -9
  58. package/dist/HtsgetBamAdapter/configSchema.js +1 -14
  59. package/dist/HtsgetBamAdapter/index.d.ts +1 -1
  60. package/dist/HtsgetBamAdapter/index.js +18 -8
  61. package/dist/LinearAlignmentsDisplay/alignmentsModel.d.ts +2 -5
  62. package/dist/LinearAlignmentsDisplay/alignmentsModel.js +1 -31
  63. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -3
  64. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -18
  65. package/dist/LinearAlignmentsDisplay/configSchema.d.ts +2 -16
  66. package/dist/LinearAlignmentsDisplay/configSchema.js +3 -20
  67. package/dist/LinearAlignmentsDisplay/index.d.ts +1 -1
  68. package/dist/LinearAlignmentsDisplay/index.js +1 -2
  69. package/dist/LinearAlignmentsDisplay/model.d.ts +7 -77
  70. package/dist/LinearAlignmentsDisplay/model.js +10 -85
  71. package/dist/LinearAlignmentsDisplay/util.d.ts +1 -1
  72. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +52 -164
  73. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +71 -145
  74. package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +1 -2
  75. package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +12 -41
  76. package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +3 -4
  77. package/dist/LinearPileupDisplay/components/GroupByDialog.js +106 -92
  78. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +3 -8
  79. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +3 -7
  80. package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.d.ts +1 -2
  81. package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.js +15 -44
  82. package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts +1 -2
  83. package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.js +12 -40
  84. package/dist/LinearPileupDisplay/components/SortByTagDialog.d.ts +1 -2
  85. package/dist/LinearPileupDisplay/components/SortByTagDialog.js +17 -46
  86. package/dist/LinearPileupDisplay/configSchema.d.ts +13 -16
  87. package/dist/LinearPileupDisplay/configSchema.js +12 -30
  88. package/dist/LinearPileupDisplay/index.d.ts +1 -1
  89. package/dist/LinearPileupDisplay/index.js +2 -2
  90. package/dist/LinearPileupDisplay/model.d.ts +123 -111
  91. package/dist/LinearPileupDisplay/model.js +29 -109
  92. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +2 -3
  93. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +6 -33
  94. package/dist/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  95. package/dist/LinearReadArcsDisplay/configSchema.js +8 -31
  96. package/dist/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  97. package/dist/LinearReadArcsDisplay/drawFeats.js +1 -9
  98. package/dist/LinearReadArcsDisplay/index.d.ts +1 -1
  99. package/dist/LinearReadArcsDisplay/index.js +18 -9
  100. package/dist/LinearReadArcsDisplay/model.d.ts +16 -94
  101. package/dist/LinearReadArcsDisplay/model.js +34 -111
  102. package/dist/LinearReadArcsDisplay/util.d.ts +1 -1
  103. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +2 -3
  104. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +6 -33
  105. package/dist/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  106. package/dist/LinearReadCloudDisplay/configSchema.js +3 -28
  107. package/dist/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  108. package/dist/LinearReadCloudDisplay/drawFeats.js +2 -2
  109. package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  110. package/dist/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  111. package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  112. package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -3
  113. package/dist/LinearReadCloudDisplay/index.d.ts +1 -1
  114. package/dist/LinearReadCloudDisplay/index.js +18 -9
  115. package/dist/LinearReadCloudDisplay/model.d.ts +14 -56
  116. package/dist/LinearReadCloudDisplay/model.js +34 -75
  117. package/dist/LinearReadCloudDisplay/util.js +0 -1
  118. package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +2 -3
  119. package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +16 -55
  120. package/dist/LinearSNPCoverageDisplay/configSchema.d.ts +17 -22
  121. package/dist/LinearSNPCoverageDisplay/configSchema.js +16 -32
  122. package/dist/LinearSNPCoverageDisplay/index.d.ts +1 -1
  123. package/dist/LinearSNPCoverageDisplay/index.js +1 -2
  124. package/dist/LinearSNPCoverageDisplay/model.d.ts +13 -54
  125. package/dist/LinearSNPCoverageDisplay/model.js +69 -159
  126. package/dist/MismatchParser/cigarToMismatches.d.ts +2 -3
  127. package/dist/MismatchParser/cigarToMismatches.js +4 -7
  128. package/dist/MismatchParser/getNextRefPos.js +0 -2
  129. package/dist/MismatchParser/index.d.ts +3 -4
  130. package/dist/MismatchParser/index.js +1 -9
  131. package/dist/MismatchParser/mdToMismatches.d.ts +2 -3
  132. package/dist/MismatchParser/mdToMismatches.js +0 -6
  133. package/dist/ModificationParser/index.d.ts +1 -1
  134. package/dist/ModificationParser/index.js +1 -18
  135. package/dist/PileupRPC/base.d.ts +2 -2
  136. package/dist/PileupRPC/base.js +0 -1
  137. package/dist/PileupRPC/index.d.ts +1 -1
  138. package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  139. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  140. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +2 -3
  141. package/dist/PileupRPC/methods/GetReducedFeatures.js +3 -5
  142. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +3 -4
  143. package/dist/PileupRPC/methods/GetVisibleModifications.js +1 -1
  144. package/dist/PileupRPC/util.d.ts +1 -1
  145. package/dist/PileupRenderer/PileupLayoutSession.d.ts +5 -5
  146. package/dist/PileupRenderer/PileupLayoutSession.js +2 -5
  147. package/dist/PileupRenderer/PileupRenderer.d.ts +14 -24
  148. package/dist/PileupRenderer/PileupRenderer.js +28 -23
  149. package/dist/PileupRenderer/colorBy.d.ts +2 -2
  150. package/dist/PileupRenderer/colorBy.js +0 -6
  151. package/dist/PileupRenderer/components/PileupRendering.d.ts +2 -3
  152. package/dist/PileupRenderer/components/PileupRendering.js +15 -43
  153. package/dist/PileupRenderer/configSchema.d.ts +5 -31
  154. package/dist/PileupRenderer/configSchema.js +6 -35
  155. package/dist/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  156. package/dist/PileupRenderer/getAlignmentShapeColor.js +1 -6
  157. package/dist/PileupRenderer/index.d.ts +1 -1
  158. package/dist/PileupRenderer/index.js +1 -1
  159. package/dist/PileupRenderer/layoutFeature.d.ts +2 -2
  160. package/dist/PileupRenderer/layoutFeature.js +0 -1
  161. package/dist/PileupRenderer/layoutFeatures.d.ts +5 -2
  162. package/dist/PileupRenderer/layoutFeatures.js +6 -4
  163. package/dist/PileupRenderer/makeImageData.d.ts +3 -4
  164. package/dist/PileupRenderer/makeImageData.js +10 -2
  165. package/dist/PileupRenderer/renderAlignment.d.ts +3 -3
  166. package/dist/PileupRenderer/renderAlignment.js +3 -5
  167. package/dist/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  168. package/dist/PileupRenderer/renderAlignmentShape.js +1 -1
  169. package/dist/PileupRenderer/renderMethylation.d.ts +4 -4
  170. package/dist/PileupRenderer/renderMethylation.js +0 -4
  171. package/dist/PileupRenderer/renderMismatches.d.ts +5 -4
  172. package/dist/PileupRenderer/renderMismatches.js +19 -25
  173. package/dist/PileupRenderer/renderModifications.d.ts +3 -3
  174. package/dist/PileupRenderer/renderModifications.js +1 -3
  175. package/dist/PileupRenderer/renderPerBaseLettering.d.ts +2 -2
  176. package/dist/PileupRenderer/renderPerBaseLettering.js +0 -1
  177. package/dist/PileupRenderer/renderPerBaseQuality.d.ts +2 -2
  178. package/dist/PileupRenderer/renderPerBaseQuality.js +2 -2
  179. package/dist/PileupRenderer/renderSoftClipping.d.ts +5 -5
  180. package/dist/PileupRenderer/renderSoftClipping.js +0 -4
  181. package/dist/PileupRenderer/sortUtil.d.ts +2 -2
  182. package/dist/PileupRenderer/sortUtil.js +1 -4
  183. package/dist/PileupRenderer/types.d.ts +26 -0
  184. package/dist/PileupRenderer/types.js +2 -0
  185. package/dist/PileupRenderer/util.d.ts +2 -2
  186. package/dist/PileupRenderer/util.js +1 -3
  187. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  188. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +4 -6
  189. package/dist/SNPCoverageAdapter/configSchema.d.ts +0 -4
  190. package/dist/SNPCoverageAdapter/configSchema.js +1 -8
  191. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +4 -8
  192. package/dist/SNPCoverageAdapter/generateCoverageBins.js +25 -247
  193. package/dist/SNPCoverageAdapter/index.d.ts +1 -1
  194. package/dist/SNPCoverageAdapter/index.js +17 -7
  195. package/dist/SNPCoverageAdapter/processDepth.d.ts +8 -0
  196. package/dist/SNPCoverageAdapter/processDepth.js +38 -0
  197. package/dist/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  198. package/dist/SNPCoverageAdapter/processMismatches.js +58 -0
  199. package/dist/SNPCoverageAdapter/processModifications.d.ts +10 -0
  200. package/dist/SNPCoverageAdapter/processModifications.js +49 -0
  201. package/dist/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  202. package/dist/SNPCoverageAdapter/processReferenceCpGs.js +63 -0
  203. package/dist/SNPCoverageAdapter/util.d.ts +10 -0
  204. package/dist/SNPCoverageAdapter/util.js +41 -0
  205. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -18
  206. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +35 -288
  207. package/dist/SNPCoverageRenderer/configSchema.d.ts +3 -18
  208. package/dist/SNPCoverageRenderer/configSchema.js +4 -22
  209. package/dist/SNPCoverageRenderer/index.d.ts +1 -1
  210. package/dist/SNPCoverageRenderer/index.js +2 -2
  211. package/dist/SNPCoverageRenderer/makeImage.d.ts +2 -0
  212. package/dist/SNPCoverageRenderer/makeImage.js +270 -0
  213. package/dist/SNPCoverageRenderer/types.d.ts +19 -0
  214. package/dist/SNPCoverageRenderer/types.js +2 -0
  215. package/dist/index.d.ts +2 -2
  216. package/dist/index.js +29 -19
  217. package/dist/shared/afterAttach.d.ts +1 -1
  218. package/dist/shared/afterAttach.js +0 -2
  219. package/dist/shared/color.d.ts +1 -1
  220. package/dist/shared/color.js +0 -8
  221. package/dist/shared/components/BaseDisplayComponent.d.ts +3 -4
  222. package/dist/shared/components/BaseDisplayComponent.js +13 -19
  223. package/dist/shared/components/FilterByTagDialog.d.ts +2 -3
  224. package/dist/shared/components/FilterByTagDialog.js +44 -94
  225. package/dist/shared/fetchChains.d.ts +2 -2
  226. package/dist/shared/fetchChains.js +1 -2
  227. package/dist/shared/getMaximumModificationAtEachPosition.d.ts +1 -1
  228. package/dist/shared/getMaximumModificationAtEachPosition.js +1 -2
  229. package/dist/shared/getUniqueModifications.d.ts +5 -5
  230. package/dist/shared/getUniqueTags.d.ts +4 -4
  231. package/dist/shared/renderSvgUtil.d.ts +1 -2
  232. package/dist/shared/renderSvgUtil.js +20 -19
  233. package/dist/shared/util.d.ts +11 -1
  234. package/dist/shared/util.js +27 -1
  235. package/dist/util.d.ts +4 -4
  236. package/dist/util.js +3 -9
  237. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +2 -3
  238. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +8 -17
  239. package/esm/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
  240. package/esm/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
  241. package/esm/AlignmentsFeatureDetail/Flags.d.ts +1 -2
  242. package/esm/AlignmentsFeatureDetail/Flags.js +8 -10
  243. package/esm/AlignmentsFeatureDetail/Formatter.d.ts +1 -2
  244. package/esm/AlignmentsFeatureDetail/Formatter.js +11 -16
  245. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +4 -7
  246. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +30 -48
  247. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +4 -7
  248. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +41 -54
  249. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +3 -4
  250. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +4 -5
  251. package/esm/AlignmentsFeatureDetail/PairLink.d.ts +2 -3
  252. package/esm/AlignmentsFeatureDetail/PairLink.js +3 -4
  253. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +3 -4
  254. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +6 -9
  255. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +2 -3
  256. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +22 -29
  257. package/esm/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
  258. package/esm/AlignmentsFeatureDetail/getSAFeatures.js +0 -4
  259. package/esm/AlignmentsFeatureDetail/index.d.ts +1 -1
  260. package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
  261. package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +2 -2
  262. package/esm/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
  263. package/esm/AlignmentsFeatureDetail/tagInfo.js +1 -1
  264. package/esm/AlignmentsFeatureDetail/util.d.ts +1 -1
  265. package/esm/AlignmentsTrack/configSchemaF.d.ts +1 -1
  266. package/esm/AlignmentsTrack/configSchemaF.js +1 -8
  267. package/esm/AlignmentsTrack/index.d.ts +1 -1
  268. package/esm/AlignmentsTrack/index.js +0 -3
  269. package/esm/BamAdapter/BamAdapter.d.ts +6 -5
  270. package/esm/BamAdapter/BamAdapter.js +19 -37
  271. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -3
  272. package/esm/BamAdapter/BamSlightlyLazyFeature.js +0 -3
  273. package/esm/BamAdapter/configSchema.d.ts +0 -17
  274. package/esm/BamAdapter/configSchema.js +1 -22
  275. package/esm/BamAdapter/index.d.ts +1 -1
  276. package/esm/CramAdapter/CramAdapter.d.ts +6 -9
  277. package/esm/CramAdapter/CramAdapter.js +24 -42
  278. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +3 -3
  279. package/esm/CramAdapter/CramSlightlyLazyFeature.js +0 -17
  280. package/esm/CramAdapter/CramTestAdapters.d.ts +3 -3
  281. package/esm/CramAdapter/CramTestAdapters.js +6 -6
  282. package/esm/CramAdapter/configSchema.d.ts +0 -14
  283. package/esm/CramAdapter/configSchema.js +1 -19
  284. package/esm/CramAdapter/index.d.ts +1 -1
  285. package/esm/CramAdapter/index.js +0 -1
  286. package/esm/CramAdapter/util.d.ts +2 -2
  287. package/esm/CramAdapter/util.js +1 -24
  288. package/esm/GuessAlignmentsTypes/index.d.ts +1 -1
  289. package/esm/GuessAlignmentsTypes/index.js +20 -35
  290. package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
  291. package/esm/HtsgetBamAdapter/configSchema.d.ts +0 -9
  292. package/esm/HtsgetBamAdapter/configSchema.js +1 -14
  293. package/esm/HtsgetBamAdapter/index.d.ts +1 -1
  294. package/esm/HtsgetBamAdapter/index.js +1 -1
  295. package/esm/LinearAlignmentsDisplay/alignmentsModel.d.ts +2 -5
  296. package/esm/LinearAlignmentsDisplay/alignmentsModel.js +1 -31
  297. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -3
  298. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -15
  299. package/esm/LinearAlignmentsDisplay/configSchema.d.ts +2 -16
  300. package/esm/LinearAlignmentsDisplay/configSchema.js +3 -20
  301. package/esm/LinearAlignmentsDisplay/index.d.ts +1 -1
  302. package/esm/LinearAlignmentsDisplay/index.js +1 -2
  303. package/esm/LinearAlignmentsDisplay/model.d.ts +7 -77
  304. package/esm/LinearAlignmentsDisplay/model.js +11 -86
  305. package/esm/LinearAlignmentsDisplay/util.d.ts +1 -1
  306. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +52 -164
  307. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +56 -140
  308. package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +1 -2
  309. package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +12 -18
  310. package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +3 -4
  311. package/esm/LinearPileupDisplay/components/GroupByDialog.js +106 -69
  312. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +3 -8
  313. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +3 -4
  314. package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.d.ts +1 -2
  315. package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.js +15 -21
  316. package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts +1 -2
  317. package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.js +12 -17
  318. package/esm/LinearPileupDisplay/components/SortByTagDialog.d.ts +1 -2
  319. package/esm/LinearPileupDisplay/components/SortByTagDialog.js +17 -23
  320. package/esm/LinearPileupDisplay/configSchema.d.ts +13 -16
  321. package/esm/LinearPileupDisplay/configSchema.js +12 -30
  322. package/esm/LinearPileupDisplay/index.d.ts +1 -1
  323. package/esm/LinearPileupDisplay/index.js +2 -2
  324. package/esm/LinearPileupDisplay/model.d.ts +123 -111
  325. package/esm/LinearPileupDisplay/model.js +13 -103
  326. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +2 -3
  327. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +6 -10
  328. package/esm/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  329. package/esm/LinearReadArcsDisplay/configSchema.js +8 -31
  330. package/esm/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  331. package/esm/LinearReadArcsDisplay/drawFeats.js +1 -9
  332. package/esm/LinearReadArcsDisplay/index.d.ts +1 -1
  333. package/esm/LinearReadArcsDisplay/index.js +1 -2
  334. package/esm/LinearReadArcsDisplay/model.d.ts +16 -94
  335. package/esm/LinearReadArcsDisplay/model.js +18 -105
  336. package/esm/LinearReadArcsDisplay/util.d.ts +1 -1
  337. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +2 -3
  338. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +6 -10
  339. package/esm/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  340. package/esm/LinearReadCloudDisplay/configSchema.js +3 -28
  341. package/esm/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  342. package/esm/LinearReadCloudDisplay/drawFeats.js +2 -2
  343. package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  344. package/esm/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  345. package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  346. package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -3
  347. package/esm/LinearReadCloudDisplay/index.d.ts +1 -1
  348. package/esm/LinearReadCloudDisplay/index.js +1 -2
  349. package/esm/LinearReadCloudDisplay/model.d.ts +14 -56
  350. package/esm/LinearReadCloudDisplay/model.js +17 -68
  351. package/esm/LinearReadCloudDisplay/util.js +0 -1
  352. package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +2 -3
  353. package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +16 -52
  354. package/esm/LinearSNPCoverageDisplay/configSchema.d.ts +17 -22
  355. package/esm/LinearSNPCoverageDisplay/configSchema.js +16 -32
  356. package/esm/LinearSNPCoverageDisplay/index.d.ts +1 -1
  357. package/esm/LinearSNPCoverageDisplay/index.js +1 -2
  358. package/esm/LinearSNPCoverageDisplay/model.d.ts +13 -54
  359. package/esm/LinearSNPCoverageDisplay/model.js +53 -153
  360. package/esm/MismatchParser/cigarToMismatches.d.ts +2 -3
  361. package/esm/MismatchParser/cigarToMismatches.js +4 -7
  362. package/esm/MismatchParser/getNextRefPos.js +0 -2
  363. package/esm/MismatchParser/index.d.ts +3 -4
  364. package/esm/MismatchParser/index.js +1 -9
  365. package/esm/MismatchParser/mdToMismatches.d.ts +2 -3
  366. package/esm/MismatchParser/mdToMismatches.js +0 -6
  367. package/esm/ModificationParser/index.d.ts +1 -1
  368. package/esm/ModificationParser/index.js +1 -18
  369. package/esm/PileupRPC/base.d.ts +2 -2
  370. package/esm/PileupRPC/base.js +0 -1
  371. package/esm/PileupRPC/index.d.ts +1 -1
  372. package/esm/PileupRPC/index.js +1 -1
  373. package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  374. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  375. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +2 -3
  376. package/esm/PileupRPC/methods/GetReducedFeatures.js +3 -5
  377. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +3 -4
  378. package/esm/PileupRPC/methods/GetVisibleModifications.js +1 -1
  379. package/esm/PileupRPC/util.d.ts +1 -1
  380. package/esm/PileupRenderer/PileupLayoutSession.d.ts +5 -5
  381. package/esm/PileupRenderer/PileupLayoutSession.js +2 -5
  382. package/esm/PileupRenderer/PileupRenderer.d.ts +14 -24
  383. package/esm/PileupRenderer/PileupRenderer.js +12 -17
  384. package/esm/PileupRenderer/colorBy.d.ts +2 -2
  385. package/esm/PileupRenderer/colorBy.js +1 -7
  386. package/esm/PileupRenderer/components/PileupRendering.d.ts +2 -3
  387. package/esm/PileupRenderer/components/PileupRendering.js +15 -20
  388. package/esm/PileupRenderer/configSchema.d.ts +5 -31
  389. package/esm/PileupRenderer/configSchema.js +6 -35
  390. package/esm/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  391. package/esm/PileupRenderer/getAlignmentShapeColor.js +2 -7
  392. package/esm/PileupRenderer/index.d.ts +1 -1
  393. package/esm/PileupRenderer/index.js +1 -1
  394. package/esm/PileupRenderer/layoutFeature.d.ts +2 -2
  395. package/esm/PileupRenderer/layoutFeature.js +0 -1
  396. package/esm/PileupRenderer/layoutFeatures.d.ts +5 -2
  397. package/esm/PileupRenderer/layoutFeatures.js +7 -5
  398. package/esm/PileupRenderer/makeImageData.d.ts +3 -4
  399. package/esm/PileupRenderer/makeImageData.js +10 -2
  400. package/esm/PileupRenderer/renderAlignment.d.ts +3 -3
  401. package/esm/PileupRenderer/renderAlignment.js +3 -5
  402. package/esm/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  403. package/esm/PileupRenderer/renderAlignmentShape.js +1 -1
  404. package/esm/PileupRenderer/renderMethylation.d.ts +4 -4
  405. package/esm/PileupRenderer/renderMethylation.js +0 -4
  406. package/esm/PileupRenderer/renderMismatches.d.ts +5 -4
  407. package/esm/PileupRenderer/renderMismatches.js +19 -25
  408. package/esm/PileupRenderer/renderModifications.d.ts +3 -3
  409. package/esm/PileupRenderer/renderModifications.js +1 -3
  410. package/esm/PileupRenderer/renderPerBaseLettering.d.ts +2 -2
  411. package/esm/PileupRenderer/renderPerBaseLettering.js +0 -1
  412. package/esm/PileupRenderer/renderPerBaseQuality.d.ts +2 -2
  413. package/esm/PileupRenderer/renderPerBaseQuality.js +2 -2
  414. package/esm/PileupRenderer/renderSoftClipping.d.ts +5 -5
  415. package/esm/PileupRenderer/renderSoftClipping.js +1 -5
  416. package/esm/PileupRenderer/sortUtil.d.ts +2 -2
  417. package/esm/PileupRenderer/sortUtil.js +1 -4
  418. package/esm/PileupRenderer/types.d.ts +26 -0
  419. package/esm/PileupRenderer/types.js +1 -0
  420. package/esm/PileupRenderer/util.d.ts +2 -2
  421. package/esm/PileupRenderer/util.js +1 -3
  422. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  423. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +5 -7
  424. package/esm/SNPCoverageAdapter/configSchema.d.ts +0 -4
  425. package/esm/SNPCoverageAdapter/configSchema.js +1 -8
  426. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +4 -8
  427. package/esm/SNPCoverageAdapter/generateCoverageBins.js +24 -246
  428. package/esm/SNPCoverageAdapter/index.d.ts +1 -1
  429. package/esm/SNPCoverageAdapter/processDepth.d.ts +8 -0
  430. package/esm/SNPCoverageAdapter/processDepth.js +35 -0
  431. package/esm/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  432. package/esm/SNPCoverageAdapter/processMismatches.js +55 -0
  433. package/esm/SNPCoverageAdapter/processModifications.d.ts +10 -0
  434. package/esm/SNPCoverageAdapter/processModifications.js +46 -0
  435. package/esm/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  436. package/esm/SNPCoverageAdapter/processReferenceCpGs.js +60 -0
  437. package/esm/SNPCoverageAdapter/util.d.ts +10 -0
  438. package/esm/SNPCoverageAdapter/util.js +35 -0
  439. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -18
  440. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +3 -289
  441. package/esm/SNPCoverageRenderer/configSchema.d.ts +3 -18
  442. package/esm/SNPCoverageRenderer/configSchema.js +4 -22
  443. package/esm/SNPCoverageRenderer/index.d.ts +1 -1
  444. package/esm/SNPCoverageRenderer/index.js +2 -2
  445. package/esm/SNPCoverageRenderer/makeImage.d.ts +2 -0
  446. package/esm/SNPCoverageRenderer/makeImage.js +267 -0
  447. package/esm/SNPCoverageRenderer/types.d.ts +19 -0
  448. package/esm/SNPCoverageRenderer/types.js +1 -0
  449. package/esm/index.d.ts +2 -2
  450. package/esm/index.js +10 -10
  451. package/esm/shared/afterAttach.d.ts +1 -1
  452. package/esm/shared/afterAttach.js +0 -2
  453. package/esm/shared/color.d.ts +1 -1
  454. package/esm/shared/color.js +0 -8
  455. package/esm/shared/components/BaseDisplayComponent.d.ts +3 -4
  456. package/esm/shared/components/BaseDisplayComponent.js +13 -16
  457. package/esm/shared/components/FilterByTagDialog.d.ts +2 -3
  458. package/esm/shared/components/FilterByTagDialog.js +44 -71
  459. package/esm/shared/fetchChains.d.ts +2 -2
  460. package/esm/shared/fetchChains.js +1 -2
  461. package/esm/shared/getMaximumModificationAtEachPosition.d.ts +1 -1
  462. package/esm/shared/getMaximumModificationAtEachPosition.js +1 -2
  463. package/esm/shared/getUniqueModifications.d.ts +5 -5
  464. package/esm/shared/getUniqueTags.d.ts +4 -4
  465. package/esm/shared/renderSvgUtil.d.ts +1 -2
  466. package/esm/shared/renderSvgUtil.js +3 -9
  467. package/esm/shared/util.d.ts +11 -1
  468. package/esm/shared/util.js +24 -0
  469. package/esm/util.d.ts +4 -4
  470. package/esm/util.js +3 -9
  471. package/package.json +6 -7
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processMismatches = processMismatches;
4
+ const util_1 = require("./util");
5
+ function processMismatches({ feature, region, bins, skipmap, }) {
6
+ var _a;
7
+ const fstart = feature.get('start');
8
+ const fstrand = feature.get('strand');
9
+ const mismatches = (_a = feature.get('mismatches')) !== null && _a !== void 0 ? _a : [];
10
+ for (const mismatch of mismatches) {
11
+ const mstart = fstart + mismatch.start;
12
+ const mlen = (0, util_1.mismatchLen)(mismatch);
13
+ const mend = mstart + mlen;
14
+ for (let j = mstart; j < mstart + mlen; j++) {
15
+ const epos = j - region.start;
16
+ if (epos >= 0 && epos < bins.length) {
17
+ const bin = bins[epos];
18
+ const { base, altbase, type } = mismatch;
19
+ const interbase = (0, util_1.isInterbase)(type);
20
+ if (type === 'deletion' || type === 'skip') {
21
+ (0, util_1.inc)(bin, fstrand, 'delskips', type);
22
+ bin.depth--;
23
+ }
24
+ else if (!interbase) {
25
+ (0, util_1.inc)(bin, fstrand, 'snps', base);
26
+ bin.ref.entryDepth--;
27
+ bin.ref[fstrand]--;
28
+ bin.refbase = altbase;
29
+ }
30
+ else {
31
+ (0, util_1.inc)(bin, fstrand, 'noncov', type);
32
+ }
33
+ }
34
+ }
35
+ if (mismatch.type === 'skip') {
36
+ const tags = feature.get('tags');
37
+ const xs = (tags === null || tags === void 0 ? void 0 : tags.XS) || (tags === null || tags === void 0 ? void 0 : tags.TS);
38
+ const ts = tags === null || tags === void 0 ? void 0 : tags.ts;
39
+ const effectiveStrand = xs === '+'
40
+ ? 1
41
+ : xs === '-'
42
+ ? -1
43
+ : (ts === '+' ? 1 : xs === '-' ? -1 : 0) * fstrand;
44
+ const hash = `${mstart}_${mend}_${effectiveStrand}`;
45
+ if (skipmap[hash] === undefined) {
46
+ skipmap[hash] = {
47
+ feature: feature,
48
+ start: mstart,
49
+ end: mend,
50
+ strand: fstrand,
51
+ effectiveStrand,
52
+ score: 0,
53
+ };
54
+ }
55
+ skipmap[hash].score++;
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,10 @@
1
+ import type { ColorBy, PreBaseCoverageBin } from '../shared/types';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ import type { AugmentedRegion as Region } from '@jbrowse/core/util/types';
4
+ export declare function processModifications({ feature, colorBy, region, bins, regionSequence, }: {
5
+ bins: PreBaseCoverageBin[];
6
+ feature: Feature;
7
+ region: Region;
8
+ colorBy?: ColorBy;
9
+ regionSequence: string;
10
+ }): void;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processModifications = processModifications;
4
+ const util_1 = require("@jbrowse/core/util");
5
+ const util_2 = require("./util");
6
+ const getMaximumModificationAtEachPosition_1 = require("../shared/getMaximumModificationAtEachPosition");
7
+ function processModifications({ feature, colorBy, region, bins, regionSequence, }) {
8
+ var _a, _b, _c;
9
+ const fstart = feature.get('start');
10
+ const fstrand = feature.get('strand');
11
+ const fend = feature.get('end');
12
+ const twoColor = (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.twoColor;
13
+ const isolatedModification = (_b = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _b === void 0 ? void 0 : _b.isolatedModification;
14
+ (_c = (0, getMaximumModificationAtEachPosition_1.getMaxProbModAtEachPosition)(feature)) === null || _c === void 0 ? void 0 : _c.forEach(({ type, prob, allProbs }, pos) => {
15
+ if (isolatedModification && type !== isolatedModification) {
16
+ return;
17
+ }
18
+ const epos = pos + fstart - region.start;
19
+ if (epos >= 0 && epos < bins.length && pos + fstart < fend) {
20
+ if (bins[epos] === undefined) {
21
+ bins[epos] = {
22
+ depth: 0,
23
+ readsCounted: 0,
24
+ snps: {},
25
+ ref: {
26
+ probabilities: [],
27
+ entryDepth: 0,
28
+ '-1': 0,
29
+ 0: 0,
30
+ 1: 0,
31
+ },
32
+ mods: {},
33
+ nonmods: {},
34
+ delskips: {},
35
+ noncov: {},
36
+ };
37
+ }
38
+ const s = 1 - (0, util_1.sum)(allProbs);
39
+ const bin = bins[epos];
40
+ bin.refbase = regionSequence[epos];
41
+ if (twoColor && s > (0, util_1.max)(allProbs)) {
42
+ (0, util_2.incWithProbabilities)(bin, fstrand, 'nonmods', `nonmod_${type}`, s);
43
+ }
44
+ else {
45
+ (0, util_2.incWithProbabilities)(bin, fstrand, 'mods', `mod_${type}`, prob);
46
+ }
47
+ }
48
+ });
49
+ }
@@ -0,0 +1,9 @@
1
+ import type { PreBaseCoverageBin } from '../shared/types';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ import type { AugmentedRegion as Region } from '@jbrowse/core/util/types';
4
+ export declare function processReferenceCpGs({ feature, region, bins, regionSequence, }: {
5
+ bins: PreBaseCoverageBin[];
6
+ feature: Feature;
7
+ region: Region;
8
+ regionSequence: string;
9
+ }): void;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processReferenceCpGs = processReferenceCpGs;
4
+ const util_1 = require("@jbrowse/core/util");
5
+ const MismatchParser_1 = require("../MismatchParser");
6
+ const ModificationParser_1 = require("../ModificationParser");
7
+ const util_2 = require("./util");
8
+ function processReferenceCpGs({ feature, region, bins, regionSequence, }) {
9
+ var _a;
10
+ const fstart = feature.get('start');
11
+ const fend = feature.get('end');
12
+ const fstrand = feature.get('strand');
13
+ const seq = feature.get('seq');
14
+ const mismatches = (_a = feature.get('mismatches')) !== null && _a !== void 0 ? _a : [];
15
+ const r = regionSequence.toLowerCase();
16
+ if (seq) {
17
+ const cigarOps = (0, MismatchParser_1.parseCigar)(feature.get('CIGAR'));
18
+ const { methBins, methProbs } = (0, ModificationParser_1.getMethBins)(feature, cigarOps);
19
+ const dels = mismatches.filter(f => f.type === 'deletion');
20
+ for (let i = 0; i < fend - fstart; i++) {
21
+ const j = i + fstart;
22
+ const l1 = r[j - region.start + 1];
23
+ const l2 = r[j - region.start + 2];
24
+ if (l1 === 'c' && l2 === 'g') {
25
+ const bin0 = bins[j - region.start];
26
+ const bin1 = bins[j - region.start + 1];
27
+ const b0 = methBins[i];
28
+ const b1 = methBins[i + 1];
29
+ const p0 = methProbs[i];
30
+ const p1 = methProbs[i + 1];
31
+ if ((b0 && (p0 !== undefined ? p0 > 0.5 : true)) ||
32
+ (b1 && (p1 !== undefined ? p1 > 0.5 : true))) {
33
+ if (bin0) {
34
+ (0, util_2.incWithProbabilities)(bin0, fstrand, 'mods', 'cpg_meth', p0 || 0);
35
+ bin0.ref.entryDepth--;
36
+ bin0.ref[fstrand]--;
37
+ }
38
+ if (bin1) {
39
+ (0, util_2.incWithProbabilities)(bin1, fstrand, 'mods', 'cpg_meth', p1 || 0);
40
+ bin1.ref.entryDepth--;
41
+ bin1.ref[fstrand]--;
42
+ }
43
+ }
44
+ else {
45
+ if (bin0) {
46
+ if (!dels.some(d => (0, util_1.doesIntersect2)(j, j + 1, d.start + fstart, d.start + fstart + d.length))) {
47
+ (0, util_2.incWithProbabilities)(bin0, fstrand, 'nonmods', 'cpg_unmeth', 1 - (p0 || 0));
48
+ bin0.ref.entryDepth--;
49
+ bin0.ref[fstrand]--;
50
+ }
51
+ }
52
+ if (bin1) {
53
+ if (!dels.some(d => (0, util_1.doesIntersect2)(j + 1, j + 2, d.start + fstart, d.start + fstart + d.length))) {
54
+ (0, util_2.incWithProbabilities)(bin1, fstrand, 'nonmods', 'cpg_unmeth', 1 - (p1 || 0));
55
+ bin1.ref.entryDepth--;
56
+ bin1.ref[fstrand]--;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,10 @@
1
+ import type { ColorBy, Mismatch, PreBaseCoverageBin, PreBaseCoverageBinSubtypes } from '../shared/types';
2
+ export interface Opts {
3
+ bpPerPx?: number;
4
+ colorBy?: ColorBy;
5
+ stopToken?: string;
6
+ }
7
+ export declare function mismatchLen(mismatch: Mismatch): number;
8
+ export declare function isInterbase(type: string): type is "insertion" | "hardclip" | "softclip";
9
+ export declare function inc(bin: PreBaseCoverageBin, strand: -1 | 0 | 1, type: keyof PreBaseCoverageBinSubtypes, field: string): void;
10
+ export declare function incWithProbabilities(bin: PreBaseCoverageBin, strand: -1 | 0 | 1, type: keyof PreBaseCoverageBinSubtypes, field: string, probability: number): void;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mismatchLen = mismatchLen;
4
+ exports.isInterbase = isInterbase;
5
+ exports.inc = inc;
6
+ exports.incWithProbabilities = incWithProbabilities;
7
+ function mismatchLen(mismatch) {
8
+ return !isInterbase(mismatch.type) ? mismatch.length : 1;
9
+ }
10
+ function isInterbase(type) {
11
+ return type === 'softclip' || type === 'hardclip' || type === 'insertion';
12
+ }
13
+ function inc(bin, strand, type, field) {
14
+ let thisBin = bin[type][field];
15
+ if (thisBin === undefined) {
16
+ thisBin = bin[type][field] = {
17
+ entryDepth: 0,
18
+ probabilities: [],
19
+ '-1': 0,
20
+ '0': 0,
21
+ '1': 0,
22
+ };
23
+ }
24
+ thisBin.entryDepth++;
25
+ thisBin[strand]++;
26
+ }
27
+ function incWithProbabilities(bin, strand, type, field, probability) {
28
+ let thisBin = bin[type][field];
29
+ if (thisBin === undefined) {
30
+ thisBin = bin[type][field] = {
31
+ entryDepth: 0,
32
+ probabilities: [],
33
+ '-1': 0,
34
+ '0': 0,
35
+ '1': 0,
36
+ };
37
+ }
38
+ thisBin.entryDepth++;
39
+ thisBin.probabilities.push(probability);
40
+ thisBin[strand]++;
41
+ }
@@ -1,21 +1,5 @@
1
- import { Feature } from '@jbrowse/core/util';
2
- import { RenderArgsDeserialized as FeatureRenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType';
3
- import { ScaleOpts, WiggleBaseRenderer } from '@jbrowse/plugin-wiggle';
4
- import { ModificationTypeWithColor } from '../shared/types';
5
- export interface RenderArgsDeserialized extends FeatureRenderArgsDeserialized {
6
- bpPerPx: number;
7
- height: number;
8
- highResolutionScaling: number;
9
- scaleOpts: ScaleOpts;
10
- }
11
- export interface RenderArgsDeserializedWithFeatures extends RenderArgsDeserialized {
12
- features: Map<string, Feature>;
13
- ticks: {
14
- values: number[];
15
- };
16
- displayCrossHatches: boolean;
17
- visibleModifications?: Record<string, ModificationTypeWithColor>;
18
- }
1
+ import { WiggleBaseRenderer } from '@jbrowse/plugin-wiggle';
2
+ import type { RenderArgsDeserializedWithFeatures } from './types';
19
3
  export default class SNPCoverageRenderer extends WiggleBaseRenderer {
20
4
  draw(ctx: CanvasRenderingContext2D, props: RenderArgsDeserializedWithFeatures): Promise<undefined>;
21
5
  }
@@ -1,296 +1,43 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const ui_1 = require("@jbrowse/core/ui");
4
- const util_1 = require("@jbrowse/core/util");
5
- const configuration_1 = require("@jbrowse/core/configuration");
6
36
  const plugin_wiggle_1 = require("@jbrowse/plugin-wiggle");
7
- const util_2 = require("../shared/util");
8
- // width/height of the triangle above e.g. insertion indicators
9
- const INTERBASE_INDICATOR_WIDTH = 7;
10
- const INTERBASE_INDICATOR_HEIGHT = 4.5;
11
- // minimum read depth to draw the insertion indicators, below this the
12
- // 'statistical significance' is low
13
- const MINIMUM_INTERBASE_INDICATOR_READ_DEPTH = 7;
14
- const complementBase = {
15
- C: 'G',
16
- G: 'C',
17
- A: 'T',
18
- T: 'A',
19
- };
20
- const fudgeFactor = 0.6;
21
37
  class SNPCoverageRenderer extends plugin_wiggle_1.WiggleBaseRenderer {
22
- // note: the snps are drawn on linear scale even if the data is drawn in log
23
- // scape hence the two different scales being used
24
38
  async draw(ctx, props) {
25
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26
- const { features, regions, bpPerPx, colorBy, displayCrossHatches, visibleModifications = {}, scaleOpts, height: unadjustedHeight, theme: configTheme, config: cfg, ticks, } = props;
27
- const theme = (0, ui_1.createJBrowseTheme)(configTheme);
28
- const region = regions[0];
29
- const width = (region.end - region.start) / bpPerPx;
30
- // the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
31
- // wiggle display, and makes the height of the actual drawn area add
32
- // "padding" to the top and bottom of the display
33
- const offset = plugin_wiggle_1.YSCALEBAR_LABEL_OFFSET;
34
- const height = unadjustedHeight - offset * 2;
35
- const opts = { ...scaleOpts, range: [0, height] };
36
- const viewScale = (0, plugin_wiggle_1.getScale)(opts);
37
- // clipping and insertion indicators, uses a smaller height/2 scale
38
- const indicatorViewScale = (0, plugin_wiggle_1.getScale)({
39
- ...opts,
40
- range: [0, height / 2],
41
- scaleType: 'linear',
42
- });
43
- const originY = (0, plugin_wiggle_1.getOrigin)(scaleOpts.scaleType);
44
- const originLinear = (0, plugin_wiggle_1.getOrigin)('linear');
45
- const indicatorThreshold = (0, configuration_1.readConfObject)(cfg, 'indicatorThreshold');
46
- const drawInterbaseCounts = (0, configuration_1.readConfObject)(cfg, 'drawInterbaseCounts');
47
- const drawArcs = (0, configuration_1.readConfObject)(cfg, 'drawArcs');
48
- const drawIndicators = (0, configuration_1.readConfObject)(cfg, 'drawIndicators');
49
- // get the y coordinate that we are plotting at, this can be log scale
50
- const toY = (n) => height - (viewScale(n) || 0) + offset;
51
- const toHeight = (n) => toY(originY) - toY(n);
52
- // used specifically for indicator
53
- const toY2 = (n) => height - (indicatorViewScale(n) || 0) + offset;
54
- const toHeight2 = (n) => toY2(originLinear) - toY2(n);
55
- const { bases } = theme.palette;
56
- const colorForBase = {
57
- A: bases.A.main,
58
- C: bases.C.main,
59
- G: bases.G.main,
60
- T: bases.T.main,
61
- insertion: 'purple',
62
- softclip: 'blue',
63
- hardclip: 'red',
64
- total: (0, configuration_1.readConfObject)(cfg, 'color'),
65
- mod_NONE: 'blue',
66
- cpg_meth: 'red',
67
- cpg_unmeth: 'blue',
68
- };
69
- const feats = [...features.values()];
70
- // Use two pass rendering, which helps in visualizing the SNPs at higher
71
- // bpPerPx First pass: draw the gray background
72
- ctx.fillStyle = colorForBase.total;
73
- for (const feature of feats) {
74
- if (feature.get('type') === 'skip') {
75
- continue;
76
- }
77
- const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
78
- const w = rightPx - leftPx + fudgeFactor;
79
- const score = feature.get('score');
80
- ctx.fillRect(leftPx, toY(score), w, toHeight(score));
81
- }
82
- // Keep track of previous total which we will use it to draw the interbase
83
- // indicator (if there is a sudden clip, there will be no read coverage but
84
- // there will be "clip" coverage) at that position beyond the read.
85
- //
86
- // if the clip is right at a block boundary then prevTotal will not be
87
- // available, so this is a best attempt to plot interbase indicator at the
88
- // "cliffs"
89
- let prevTotal = 0;
90
- // extraHorizontallyFlippedOffset is used to draw interbase items, which
91
- // are located to the left when forward and right when reversed
92
- const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx : 0;
93
- // @ts-expect-error
94
- const drawingModifications = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications';
95
- // @ts-expect-error
96
- const drawingMethylation = (colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation';
97
- const isolatedModification =
98
- // @ts-expect-error
99
- (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
100
- // Second pass: draw the SNP data, and add a minimum feature width of 1px
101
- // which can be wider than the actual bpPerPx This reduces overdrawing of
102
- // the grey background over the SNPs
103
- for (const feature of feats) {
104
- if (feature.get('type') === 'skip') {
105
- continue;
106
- }
107
- const [leftPx, rightPx] = (0, util_1.featureSpanPx)(feature, region, bpPerPx);
108
- const snpinfo = feature.get('snpinfo');
109
- const w = Math.max(rightPx - leftPx, 1);
110
- const score0 = feature.get('score');
111
- if (drawingModifications) {
112
- let curr = 0;
113
- const refbase = (_b = snpinfo.refbase) === null || _b === void 0 ? void 0 : _b.toUpperCase();
114
- const { nonmods, mods, snps, ref } = snpinfo;
115
- for (const m of Object.keys(nonmods).sort().reverse()) {
116
- const mod = visibleModifications[m.replace('nonmod_', '')] ||
117
- visibleModifications[m.replace('mod_', '')];
118
- if (!mod) {
119
- console.warn(`${m} not known yet`);
120
- continue;
121
- }
122
- if (isolatedModification && mod.type !== isolatedModification) {
123
- continue;
124
- }
125
- const cmp = complementBase[mod.base];
126
- // this approach is inspired from the 'simplex' approach in igv
127
- // https://github.com/igvteam/igv/blob/af07c3b1be8806cfd77343ee04982aeff17d2beb/src/main/java/org/broad/igv/sam/mods/BaseModificationCoverageRenderer.java#L51
128
- const detectable = mod.base === 'N'
129
- ? score0
130
- : (((_c = snps[mod.base]) === null || _c === void 0 ? void 0 : _c.entryDepth) || 0) +
131
- (((_d = snps[cmp]) === null || _d === void 0 ? void 0 : _d.entryDepth) || 0) +
132
- (refbase === mod.base ? ref['1'] : 0) +
133
- (refbase === cmp ? ref['-1'] : 0);
134
- const modifiable = mod.base === 'N'
135
- ? score0
136
- : (((_e = snps[mod.base]) === null || _e === void 0 ? void 0 : _e.entryDepth) || 0) +
137
- (((_f = snps[cmp]) === null || _f === void 0 ? void 0 : _f.entryDepth) || 0) +
138
- (refbase === mod.base ? ref.entryDepth : 0) +
139
- (refbase === cmp ? ref.entryDepth : 0);
140
- const { entryDepth, avgProbability = 0 } = snpinfo.nonmods[m];
141
- const modFraction = (modifiable / score0) * (entryDepth / detectable);
142
- const nonModColor = 'blue';
143
- const c = (0, util_2.alphaColor)(nonModColor, avgProbability);
144
- const height = toHeight(score0);
145
- const bottom = toY(score0) + height;
146
- ctx.fillStyle = c;
147
- ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
148
- curr += modFraction * height;
149
- }
150
- for (const m of Object.keys(mods).sort().reverse()) {
151
- const mod = visibleModifications[m.replace('mod_', '')];
152
- if (!mod) {
153
- console.warn(`${m} not known yet`);
154
- continue;
155
- }
156
- if (isolatedModification && mod.type !== isolatedModification) {
157
- continue;
158
- }
159
- const cmp = complementBase[mod.base];
160
- // this approach is inspired from the 'simplex' approach in igv
161
- // https://github.com/igvteam/igv/blob/af07c3b1be8806cfd77343ee04982aeff17d2beb/src/main/java/org/broad/igv/sam/mods/BaseModificationCoverageRenderer.java#L51
162
- const detectable = mod.base === 'N'
163
- ? score0
164
- : (((_g = snps[mod.base]) === null || _g === void 0 ? void 0 : _g.entryDepth) || 0) +
165
- (((_h = snps[cmp]) === null || _h === void 0 ? void 0 : _h.entryDepth) || 0) +
166
- (refbase === mod.base ? ref['1'] : 0) +
167
- (refbase === cmp ? ref['-1'] : 0);
168
- const modifiable = mod.base === 'N'
169
- ? score0
170
- : (((_j = snps[mod.base]) === null || _j === void 0 ? void 0 : _j.entryDepth) || 0) +
171
- (((_k = snps[cmp]) === null || _k === void 0 ? void 0 : _k.entryDepth) || 0) +
172
- (refbase === mod.base ? ref.entryDepth : 0) +
173
- (refbase === cmp ? ref.entryDepth : 0);
174
- const { entryDepth, avgProbability = 0 } = mods[m];
175
- const modFraction = (modifiable / score0) * (entryDepth / detectable);
176
- const baseColor = mod.color || 'black';
177
- const c = (0, util_2.alphaColor)(baseColor, avgProbability);
178
- const height = toHeight(score0);
179
- const bottom = toY(score0) + height;
180
- ctx.fillStyle = c;
181
- ctx.fillRect(Math.round(leftPx), bottom - (curr + modFraction * height), w, modFraction * height);
182
- curr += modFraction * height;
183
- }
184
- }
185
- else if (drawingMethylation) {
186
- const { depth, nonmods, mods } = snpinfo;
187
- let curr = 0;
188
- for (const base of Object.keys(mods).sort().reverse()) {
189
- const { entryDepth } = mods[base];
190
- const height = toHeight(score0);
191
- const bottom = toY(score0) + height;
192
- ctx.fillStyle = colorForBase[base] || 'black';
193
- ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
194
- curr += entryDepth;
195
- }
196
- for (const base of Object.keys(nonmods).sort().reverse()) {
197
- const { entryDepth } = nonmods[base];
198
- const height = toHeight(score0);
199
- const bottom = toY(score0) + height;
200
- ctx.fillStyle = colorForBase[base] || 'black';
201
- ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
202
- curr += entryDepth;
203
- }
204
- }
205
- else {
206
- const { depth, snps } = snpinfo;
207
- let curr = 0;
208
- for (const base of Object.keys(snps).sort().reverse()) {
209
- const { entryDepth } = snps[base];
210
- const height = toHeight(score0);
211
- const bottom = toY(score0) + height;
212
- ctx.fillStyle = colorForBase[base] || 'black';
213
- ctx.fillRect(Math.round(leftPx), bottom - ((entryDepth + curr) / depth) * height, w, (entryDepth / depth) * height);
214
- curr += entryDepth;
215
- }
216
- }
217
- const interbaseEvents = Object.keys(snpinfo.noncov);
218
- if (drawInterbaseCounts) {
219
- let curr = 0;
220
- for (const base of interbaseEvents) {
221
- const { entryDepth } = snpinfo.noncov[base];
222
- const r = 0.6;
223
- ctx.fillStyle = colorForBase[base];
224
- ctx.fillRect(leftPx - r + extraHorizontallyFlippedOffset, INTERBASE_INDICATOR_HEIGHT + toHeight2(curr), r * 2, toHeight2(entryDepth));
225
- curr += entryDepth;
226
- }
227
- }
228
- if (drawIndicators) {
229
- let accum = 0;
230
- let max = 0;
231
- let maxBase = '';
232
- for (const base of interbaseEvents) {
233
- const { entryDepth } = snpinfo.noncov[base];
234
- accum += entryDepth;
235
- if (entryDepth > max) {
236
- max = entryDepth;
237
- maxBase = base;
238
- }
239
- }
240
- // avoid drawing a bunch of indicators if coverage is very low. note:
241
- // also uses the prev total in the case of the "cliff"
242
- const indicatorComparatorScore = Math.max(score0, prevTotal);
243
- if (accum > indicatorComparatorScore * indicatorThreshold &&
244
- indicatorComparatorScore > MINIMUM_INTERBASE_INDICATOR_READ_DEPTH) {
245
- ctx.fillStyle = colorForBase[maxBase];
246
- ctx.beginPath();
247
- const l = leftPx + extraHorizontallyFlippedOffset;
248
- ctx.moveTo(l - INTERBASE_INDICATOR_WIDTH / 2, 0);
249
- ctx.lineTo(l + INTERBASE_INDICATOR_WIDTH / 2, 0);
250
- ctx.lineTo(l, INTERBASE_INDICATOR_HEIGHT);
251
- ctx.fill();
252
- }
253
- }
254
- prevTotal = score0;
255
- }
256
- if (drawArcs) {
257
- for (const f of feats) {
258
- if (f.get('type') !== 'skip') {
259
- continue;
260
- }
261
- const s = f.get('start');
262
- const e = f.get('end');
263
- const [left, right] = (0, util_1.bpSpanPx)(s, e, region, bpPerPx);
264
- ctx.beginPath();
265
- const effectiveStrand = f.get('effectiveStrand');
266
- const pos = 'rgba(255,200,200,0.7)';
267
- const neg = 'rgba(200,200,255,0.7)';
268
- const neutral = 'rgba(200,200,200,0.7)';
269
- if (effectiveStrand === 1) {
270
- ctx.strokeStyle = pos;
271
- }
272
- else if (effectiveStrand === -1) {
273
- ctx.strokeStyle = neg;
274
- }
275
- else {
276
- ctx.strokeStyle = neutral;
277
- }
278
- ctx.lineWidth = Math.log(f.get('score') + 1);
279
- ctx.moveTo(left, height - offset * 2);
280
- ctx.bezierCurveTo(left, 0, right, 0, right, height - offset * 2);
281
- ctx.stroke();
282
- }
283
- }
284
- if (displayCrossHatches) {
285
- ctx.lineWidth = 1;
286
- ctx.strokeStyle = 'rgba(140,140,140,0.8)';
287
- for (const tick of ticks.values) {
288
- ctx.beginPath();
289
- ctx.moveTo(0, Math.round(toY(tick)));
290
- ctx.lineTo(width, Math.round(toY(tick)));
291
- ctx.stroke();
292
- }
293
- }
39
+ const { makeImage } = await Promise.resolve().then(() => __importStar(require('./makeImage')));
40
+ await makeImage(ctx, props);
294
41
  return undefined;
295
42
  }
296
43
  }
@@ -1,40 +1,25 @@
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
- drawArcs: {
12
+ showArcs: {
22
13
  type: string;
23
14
  description: string;
24
15
  defaultValue: boolean;
25
16
  };
26
- /**
27
- * #slot
28
- */
29
- drawInterbaseCounts: {
17
+ showInterbaseCounts: {
30
18
  type: string;
31
19
  description: string;
32
20
  defaultValue: boolean;
33
21
  };
34
- /**
35
- * #slot
36
- */
37
- drawIndicators: {
22
+ showInterbaseIndicators: {
38
23
  type: string;
39
24
  description: string;
40
25
  defaultValue: boolean;