@jbrowse/plugin-alignments 2.17.0 → 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 (445) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -12
  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 +0 -4
  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 +2 -2
  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 +6 -5
  32. package/dist/BamAdapter/BamAdapter.js +21 -39
  33. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -3
  34. package/dist/BamAdapter/BamSlightlyLazyFeature.js +0 -3
  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 +6 -9
  39. package/dist/CramAdapter/CramAdapter.js +18 -41
  40. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +3 -3
  41. package/dist/CramAdapter/CramSlightlyLazyFeature.js +0 -17
  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 -2
  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/alignmentsModel.d.ts +2 -5
  57. package/dist/LinearAlignmentsDisplay/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/configSchema.d.ts +2 -16
  61. package/dist/LinearAlignmentsDisplay/configSchema.js +3 -20
  62. package/dist/LinearAlignmentsDisplay/index.d.ts +1 -1
  63. package/dist/LinearAlignmentsDisplay/index.js +1 -2
  64. package/dist/LinearAlignmentsDisplay/model.d.ts +6 -75
  65. package/dist/LinearAlignmentsDisplay/model.js +5 -78
  66. package/dist/LinearAlignmentsDisplay/util.d.ts +1 -1
  67. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +31 -157
  68. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +34 -133
  69. package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +2 -2
  70. package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
  71. package/dist/LinearPileupDisplay/components/GroupByDialog.js +109 -56
  72. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
  73. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
  74. package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
  75. package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
  76. package/dist/LinearPileupDisplay/components/SortByTagDialog.js +2 -2
  77. package/dist/LinearPileupDisplay/configSchema.d.ts +13 -16
  78. package/dist/LinearPileupDisplay/configSchema.js +12 -30
  79. package/dist/LinearPileupDisplay/index.d.ts +1 -1
  80. package/dist/LinearPileupDisplay/index.js +2 -2
  81. package/dist/LinearPileupDisplay/model.d.ts +103 -105
  82. package/dist/LinearPileupDisplay/model.js +10 -101
  83. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
  84. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +2 -6
  85. package/dist/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  86. package/dist/LinearReadArcsDisplay/configSchema.js +8 -31
  87. package/dist/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  88. package/dist/LinearReadArcsDisplay/drawFeats.js +1 -9
  89. package/dist/LinearReadArcsDisplay/index.d.ts +1 -1
  90. package/dist/LinearReadArcsDisplay/index.js +1 -2
  91. package/dist/LinearReadArcsDisplay/model.d.ts +15 -93
  92. package/dist/LinearReadArcsDisplay/model.js +17 -104
  93. package/dist/LinearReadArcsDisplay/util.d.ts +1 -1
  94. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
  95. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +2 -6
  96. package/dist/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  97. package/dist/LinearReadCloudDisplay/configSchema.js +3 -28
  98. package/dist/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  99. package/dist/LinearReadCloudDisplay/drawFeats.js +2 -2
  100. package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  101. package/dist/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  102. package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  103. package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -3
  104. package/dist/LinearReadCloudDisplay/index.d.ts +1 -1
  105. package/dist/LinearReadCloudDisplay/index.js +1 -2
  106. package/dist/LinearReadCloudDisplay/model.d.ts +13 -55
  107. package/dist/LinearReadCloudDisplay/model.js +17 -68
  108. package/dist/LinearReadCloudDisplay/util.js +0 -1
  109. package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
  110. package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
  111. package/dist/LinearSNPCoverageDisplay/configSchema.d.ts +17 -22
  112. package/dist/LinearSNPCoverageDisplay/configSchema.js +16 -32
  113. package/dist/LinearSNPCoverageDisplay/index.d.ts +1 -1
  114. package/dist/LinearSNPCoverageDisplay/index.js +1 -2
  115. package/dist/LinearSNPCoverageDisplay/model.d.ts +9 -50
  116. package/dist/LinearSNPCoverageDisplay/model.js +20 -124
  117. package/dist/MismatchParser/cigarToMismatches.d.ts +1 -1
  118. package/dist/MismatchParser/cigarToMismatches.js +4 -7
  119. package/dist/MismatchParser/getNextRefPos.js +0 -2
  120. package/dist/MismatchParser/index.d.ts +2 -2
  121. package/dist/MismatchParser/index.js +1 -9
  122. package/dist/MismatchParser/mdToMismatches.d.ts +2 -2
  123. package/dist/MismatchParser/mdToMismatches.js +0 -6
  124. package/dist/ModificationParser/index.d.ts +1 -1
  125. package/dist/ModificationParser/index.js +1 -18
  126. package/dist/PileupRPC/base.d.ts +2 -2
  127. package/dist/PileupRPC/base.js +0 -1
  128. package/dist/PileupRPC/index.d.ts +1 -1
  129. package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  130. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  131. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +2 -3
  132. package/dist/PileupRPC/methods/GetReducedFeatures.js +3 -5
  133. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +3 -4
  134. package/dist/PileupRPC/methods/GetVisibleModifications.js +1 -1
  135. package/dist/PileupRPC/util.d.ts +1 -1
  136. package/dist/PileupRenderer/PileupLayoutSession.d.ts +5 -5
  137. package/dist/PileupRenderer/PileupLayoutSession.js +2 -5
  138. package/dist/PileupRenderer/PileupRenderer.d.ts +10 -20
  139. package/dist/PileupRenderer/PileupRenderer.js +11 -16
  140. package/dist/PileupRenderer/colorBy.d.ts +2 -2
  141. package/dist/PileupRenderer/colorBy.js +0 -6
  142. package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
  143. package/dist/PileupRenderer/components/PileupRendering.js +0 -3
  144. package/dist/PileupRenderer/configSchema.d.ts +0 -31
  145. package/dist/PileupRenderer/configSchema.js +1 -35
  146. package/dist/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  147. package/dist/PileupRenderer/getAlignmentShapeColor.js +1 -6
  148. package/dist/PileupRenderer/index.d.ts +1 -1
  149. package/dist/PileupRenderer/index.js +1 -1
  150. package/dist/PileupRenderer/layoutFeature.d.ts +2 -2
  151. package/dist/PileupRenderer/layoutFeature.js +0 -1
  152. package/dist/PileupRenderer/layoutFeatures.d.ts +5 -2
  153. package/dist/PileupRenderer/layoutFeatures.js +6 -4
  154. package/dist/PileupRenderer/makeImageData.d.ts +3 -4
  155. package/dist/PileupRenderer/makeImageData.js +8 -2
  156. package/dist/PileupRenderer/renderAlignment.d.ts +3 -3
  157. package/dist/PileupRenderer/renderAlignment.js +3 -5
  158. package/dist/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  159. package/dist/PileupRenderer/renderAlignmentShape.js +1 -1
  160. package/dist/PileupRenderer/renderMethylation.d.ts +4 -4
  161. package/dist/PileupRenderer/renderMethylation.js +0 -4
  162. package/dist/PileupRenderer/renderMismatches.d.ts +3 -3
  163. package/dist/PileupRenderer/renderMismatches.js +1 -12
  164. package/dist/PileupRenderer/renderModifications.d.ts +3 -3
  165. package/dist/PileupRenderer/renderModifications.js +1 -3
  166. package/dist/PileupRenderer/renderPerBaseLettering.d.ts +2 -2
  167. package/dist/PileupRenderer/renderPerBaseLettering.js +0 -1
  168. package/dist/PileupRenderer/renderPerBaseQuality.d.ts +2 -2
  169. package/dist/PileupRenderer/renderPerBaseQuality.js +2 -2
  170. package/dist/PileupRenderer/renderSoftClipping.d.ts +5 -5
  171. package/dist/PileupRenderer/renderSoftClipping.js +0 -4
  172. package/dist/PileupRenderer/sortUtil.d.ts +2 -2
  173. package/dist/PileupRenderer/sortUtil.js +1 -4
  174. package/dist/PileupRenderer/types.d.ts +26 -0
  175. package/dist/PileupRenderer/types.js +2 -0
  176. package/dist/PileupRenderer/util.d.ts +2 -2
  177. package/dist/PileupRenderer/util.js +1 -3
  178. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  179. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +4 -6
  180. package/dist/SNPCoverageAdapter/configSchema.d.ts +0 -4
  181. package/dist/SNPCoverageAdapter/configSchema.js +1 -8
  182. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +4 -8
  183. package/dist/SNPCoverageAdapter/generateCoverageBins.js +25 -247
  184. package/dist/SNPCoverageAdapter/index.d.ts +1 -1
  185. package/dist/SNPCoverageAdapter/processDepth.d.ts +8 -0
  186. package/dist/SNPCoverageAdapter/processDepth.js +38 -0
  187. package/dist/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  188. package/dist/SNPCoverageAdapter/processMismatches.js +58 -0
  189. package/dist/SNPCoverageAdapter/processModifications.d.ts +10 -0
  190. package/dist/SNPCoverageAdapter/processModifications.js +49 -0
  191. package/dist/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  192. package/dist/SNPCoverageAdapter/processReferenceCpGs.js +63 -0
  193. package/dist/SNPCoverageAdapter/util.d.ts +10 -0
  194. package/dist/SNPCoverageAdapter/util.js +41 -0
  195. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +5 -4
  196. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +14 -38
  197. package/dist/SNPCoverageRenderer/configSchema.d.ts +0 -15
  198. package/dist/SNPCoverageRenderer/configSchema.js +1 -19
  199. package/dist/SNPCoverageRenderer/index.d.ts +1 -1
  200. package/dist/SNPCoverageRenderer/index.js +2 -2
  201. package/dist/index.d.ts +2 -2
  202. package/dist/index.js +12 -12
  203. package/dist/shared/afterAttach.d.ts +1 -1
  204. package/dist/shared/afterAttach.js +0 -2
  205. package/dist/shared/color.d.ts +1 -1
  206. package/dist/shared/color.js +0 -8
  207. package/dist/shared/components/BaseDisplayComponent.d.ts +2 -2
  208. package/dist/shared/components/BaseDisplayComponent.js +12 -11
  209. package/dist/shared/components/FilterByTagDialog.d.ts +1 -1
  210. package/dist/shared/components/FilterByTagDialog.js +2 -2
  211. package/dist/shared/fetchChains.d.ts +2 -2
  212. package/dist/shared/fetchChains.js +1 -2
  213. package/dist/shared/getMaximumModificationAtEachPosition.d.ts +1 -1
  214. package/dist/shared/getMaximumModificationAtEachPosition.js +1 -2
  215. package/dist/shared/getUniqueModifications.d.ts +5 -5
  216. package/dist/shared/getUniqueTags.d.ts +4 -4
  217. package/dist/shared/renderSvgUtil.js +0 -2
  218. package/dist/shared/util.d.ts +11 -1
  219. package/dist/shared/util.js +27 -1
  220. package/dist/util.d.ts +4 -4
  221. package/dist/util.js +3 -9
  222. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
  223. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -12
  224. package/esm/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
  225. package/esm/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
  226. package/esm/AlignmentsFeatureDetail/Flags.js +2 -2
  227. package/esm/AlignmentsFeatureDetail/Formatter.js +0 -3
  228. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +3 -5
  229. package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +5 -10
  230. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +3 -5
  231. package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +37 -36
  232. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +2 -2
  233. package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +3 -4
  234. package/esm/AlignmentsFeatureDetail/PairLink.d.ts +1 -1
  235. package/esm/AlignmentsFeatureDetail/PairLink.js +0 -1
  236. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +2 -2
  237. package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +5 -6
  238. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -1
  239. package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +2 -6
  240. package/esm/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
  241. package/esm/AlignmentsFeatureDetail/getSAFeatures.js +0 -4
  242. package/esm/AlignmentsFeatureDetail/index.d.ts +1 -1
  243. package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
  244. package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +2 -2
  245. package/esm/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
  246. package/esm/AlignmentsFeatureDetail/tagInfo.js +1 -1
  247. package/esm/AlignmentsFeatureDetail/util.d.ts +1 -1
  248. package/esm/AlignmentsTrack/configSchemaF.d.ts +1 -1
  249. package/esm/AlignmentsTrack/configSchemaF.js +1 -8
  250. package/esm/AlignmentsTrack/index.d.ts +1 -1
  251. package/esm/AlignmentsTrack/index.js +0 -3
  252. package/esm/BamAdapter/BamAdapter.d.ts +6 -5
  253. package/esm/BamAdapter/BamAdapter.js +19 -37
  254. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -3
  255. package/esm/BamAdapter/BamSlightlyLazyFeature.js +0 -3
  256. package/esm/BamAdapter/configSchema.d.ts +0 -17
  257. package/esm/BamAdapter/configSchema.js +1 -22
  258. package/esm/BamAdapter/index.d.ts +1 -1
  259. package/esm/CramAdapter/CramAdapter.d.ts +6 -9
  260. package/esm/CramAdapter/CramAdapter.js +17 -40
  261. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +3 -3
  262. package/esm/CramAdapter/CramSlightlyLazyFeature.js +0 -17
  263. package/esm/CramAdapter/CramTestAdapters.d.ts +3 -3
  264. package/esm/CramAdapter/CramTestAdapters.js +4 -5
  265. package/esm/CramAdapter/configSchema.d.ts +0 -14
  266. package/esm/CramAdapter/configSchema.js +1 -19
  267. package/esm/CramAdapter/index.d.ts +1 -1
  268. package/esm/CramAdapter/index.js +0 -1
  269. package/esm/CramAdapter/util.d.ts +2 -2
  270. package/esm/CramAdapter/util.js +1 -24
  271. package/esm/GuessAlignmentsTypes/index.d.ts +1 -1
  272. package/esm/GuessAlignmentsTypes/index.js +1 -1
  273. package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
  274. package/esm/HtsgetBamAdapter/configSchema.d.ts +0 -9
  275. package/esm/HtsgetBamAdapter/configSchema.js +1 -14
  276. package/esm/HtsgetBamAdapter/index.d.ts +1 -1
  277. package/esm/HtsgetBamAdapter/index.js +1 -1
  278. package/esm/LinearAlignmentsDisplay/alignmentsModel.d.ts +2 -5
  279. package/esm/LinearAlignmentsDisplay/alignmentsModel.js +1 -31
  280. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
  281. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
  282. package/esm/LinearAlignmentsDisplay/configSchema.d.ts +2 -16
  283. package/esm/LinearAlignmentsDisplay/configSchema.js +3 -20
  284. package/esm/LinearAlignmentsDisplay/index.d.ts +1 -1
  285. package/esm/LinearAlignmentsDisplay/index.js +1 -2
  286. package/esm/LinearAlignmentsDisplay/model.d.ts +6 -75
  287. package/esm/LinearAlignmentsDisplay/model.js +6 -79
  288. package/esm/LinearAlignmentsDisplay/util.d.ts +1 -1
  289. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +31 -157
  290. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +36 -135
  291. package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +2 -2
  292. package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
  293. package/esm/LinearPileupDisplay/components/GroupByDialog.js +109 -56
  294. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
  295. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
  296. package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
  297. package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
  298. package/esm/LinearPileupDisplay/components/SortByTagDialog.js +2 -2
  299. package/esm/LinearPileupDisplay/configSchema.d.ts +13 -16
  300. package/esm/LinearPileupDisplay/configSchema.js +12 -30
  301. package/esm/LinearPileupDisplay/index.d.ts +1 -1
  302. package/esm/LinearPileupDisplay/index.js +2 -2
  303. package/esm/LinearPileupDisplay/model.d.ts +103 -105
  304. package/esm/LinearPileupDisplay/model.js +11 -102
  305. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
  306. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +2 -6
  307. package/esm/LinearReadArcsDisplay/configSchema.d.ts +12 -20
  308. package/esm/LinearReadArcsDisplay/configSchema.js +8 -31
  309. package/esm/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
  310. package/esm/LinearReadArcsDisplay/drawFeats.js +1 -9
  311. package/esm/LinearReadArcsDisplay/index.d.ts +1 -1
  312. package/esm/LinearReadArcsDisplay/index.js +1 -2
  313. package/esm/LinearReadArcsDisplay/model.d.ts +15 -93
  314. package/esm/LinearReadArcsDisplay/model.js +18 -105
  315. package/esm/LinearReadArcsDisplay/util.d.ts +1 -1
  316. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
  317. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +2 -6
  318. package/esm/LinearReadCloudDisplay/configSchema.d.ts +5 -17
  319. package/esm/LinearReadCloudDisplay/configSchema.js +3 -28
  320. package/esm/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
  321. package/esm/LinearReadCloudDisplay/drawFeats.js +2 -2
  322. package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
  323. package/esm/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
  324. package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
  325. package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -3
  326. package/esm/LinearReadCloudDisplay/index.d.ts +1 -1
  327. package/esm/LinearReadCloudDisplay/index.js +1 -2
  328. package/esm/LinearReadCloudDisplay/model.d.ts +13 -55
  329. package/esm/LinearReadCloudDisplay/model.js +17 -68
  330. package/esm/LinearReadCloudDisplay/util.js +0 -1
  331. package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
  332. package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
  333. package/esm/LinearSNPCoverageDisplay/configSchema.d.ts +17 -22
  334. package/esm/LinearSNPCoverageDisplay/configSchema.js +16 -32
  335. package/esm/LinearSNPCoverageDisplay/index.d.ts +1 -1
  336. package/esm/LinearSNPCoverageDisplay/index.js +1 -2
  337. package/esm/LinearSNPCoverageDisplay/model.d.ts +9 -50
  338. package/esm/LinearSNPCoverageDisplay/model.js +21 -125
  339. package/esm/MismatchParser/cigarToMismatches.d.ts +1 -1
  340. package/esm/MismatchParser/cigarToMismatches.js +4 -7
  341. package/esm/MismatchParser/getNextRefPos.js +0 -2
  342. package/esm/MismatchParser/index.d.ts +2 -2
  343. package/esm/MismatchParser/index.js +1 -9
  344. package/esm/MismatchParser/mdToMismatches.d.ts +2 -2
  345. package/esm/MismatchParser/mdToMismatches.js +0 -6
  346. package/esm/ModificationParser/index.d.ts +1 -1
  347. package/esm/ModificationParser/index.js +1 -18
  348. package/esm/PileupRPC/base.d.ts +2 -2
  349. package/esm/PileupRPC/base.js +0 -1
  350. package/esm/PileupRPC/index.d.ts +1 -1
  351. package/esm/PileupRPC/index.js +1 -1
  352. package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
  353. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  354. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +2 -3
  355. package/esm/PileupRPC/methods/GetReducedFeatures.js +3 -5
  356. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +3 -4
  357. package/esm/PileupRPC/methods/GetVisibleModifications.js +1 -1
  358. package/esm/PileupRPC/util.d.ts +1 -1
  359. package/esm/PileupRenderer/PileupLayoutSession.d.ts +5 -5
  360. package/esm/PileupRenderer/PileupLayoutSession.js +2 -5
  361. package/esm/PileupRenderer/PileupRenderer.d.ts +10 -20
  362. package/esm/PileupRenderer/PileupRenderer.js +12 -17
  363. package/esm/PileupRenderer/colorBy.d.ts +2 -2
  364. package/esm/PileupRenderer/colorBy.js +1 -7
  365. package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -1
  366. package/esm/PileupRenderer/components/PileupRendering.js +1 -4
  367. package/esm/PileupRenderer/configSchema.d.ts +0 -31
  368. package/esm/PileupRenderer/configSchema.js +1 -35
  369. package/esm/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
  370. package/esm/PileupRenderer/getAlignmentShapeColor.js +2 -7
  371. package/esm/PileupRenderer/index.d.ts +1 -1
  372. package/esm/PileupRenderer/index.js +1 -1
  373. package/esm/PileupRenderer/layoutFeature.d.ts +2 -2
  374. package/esm/PileupRenderer/layoutFeature.js +0 -1
  375. package/esm/PileupRenderer/layoutFeatures.d.ts +5 -2
  376. package/esm/PileupRenderer/layoutFeatures.js +7 -5
  377. package/esm/PileupRenderer/makeImageData.d.ts +3 -4
  378. package/esm/PileupRenderer/makeImageData.js +8 -2
  379. package/esm/PileupRenderer/renderAlignment.d.ts +3 -3
  380. package/esm/PileupRenderer/renderAlignment.js +3 -5
  381. package/esm/PileupRenderer/renderAlignmentShape.d.ts +3 -3
  382. package/esm/PileupRenderer/renderAlignmentShape.js +1 -1
  383. package/esm/PileupRenderer/renderMethylation.d.ts +4 -4
  384. package/esm/PileupRenderer/renderMethylation.js +0 -4
  385. package/esm/PileupRenderer/renderMismatches.d.ts +3 -3
  386. package/esm/PileupRenderer/renderMismatches.js +1 -12
  387. package/esm/PileupRenderer/renderModifications.d.ts +3 -3
  388. package/esm/PileupRenderer/renderModifications.js +1 -3
  389. package/esm/PileupRenderer/renderPerBaseLettering.d.ts +2 -2
  390. package/esm/PileupRenderer/renderPerBaseLettering.js +0 -1
  391. package/esm/PileupRenderer/renderPerBaseQuality.d.ts +2 -2
  392. package/esm/PileupRenderer/renderPerBaseQuality.js +2 -2
  393. package/esm/PileupRenderer/renderSoftClipping.d.ts +5 -5
  394. package/esm/PileupRenderer/renderSoftClipping.js +1 -5
  395. package/esm/PileupRenderer/sortUtil.d.ts +2 -2
  396. package/esm/PileupRenderer/sortUtil.js +1 -4
  397. package/esm/PileupRenderer/types.d.ts +26 -0
  398. package/esm/PileupRenderer/types.js +1 -0
  399. package/esm/PileupRenderer/util.d.ts +2 -2
  400. package/esm/PileupRenderer/util.js +1 -3
  401. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
  402. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +5 -7
  403. package/esm/SNPCoverageAdapter/configSchema.d.ts +0 -4
  404. package/esm/SNPCoverageAdapter/configSchema.js +1 -8
  405. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +4 -8
  406. package/esm/SNPCoverageAdapter/generateCoverageBins.js +24 -246
  407. package/esm/SNPCoverageAdapter/index.d.ts +1 -1
  408. package/esm/SNPCoverageAdapter/processDepth.d.ts +8 -0
  409. package/esm/SNPCoverageAdapter/processDepth.js +35 -0
  410. package/esm/SNPCoverageAdapter/processMismatches.d.ts +9 -0
  411. package/esm/SNPCoverageAdapter/processMismatches.js +55 -0
  412. package/esm/SNPCoverageAdapter/processModifications.d.ts +10 -0
  413. package/esm/SNPCoverageAdapter/processModifications.js +46 -0
  414. package/esm/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
  415. package/esm/SNPCoverageAdapter/processReferenceCpGs.js +60 -0
  416. package/esm/SNPCoverageAdapter/util.d.ts +10 -0
  417. package/esm/SNPCoverageAdapter/util.js +35 -0
  418. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +5 -4
  419. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +16 -40
  420. package/esm/SNPCoverageRenderer/configSchema.d.ts +0 -15
  421. package/esm/SNPCoverageRenderer/configSchema.js +1 -19
  422. package/esm/SNPCoverageRenderer/index.d.ts +1 -1
  423. package/esm/SNPCoverageRenderer/index.js +2 -2
  424. package/esm/index.d.ts +2 -2
  425. package/esm/index.js +10 -10
  426. package/esm/shared/afterAttach.d.ts +1 -1
  427. package/esm/shared/afterAttach.js +0 -2
  428. package/esm/shared/color.d.ts +1 -1
  429. package/esm/shared/color.js +0 -8
  430. package/esm/shared/components/BaseDisplayComponent.d.ts +2 -2
  431. package/esm/shared/components/BaseDisplayComponent.js +12 -11
  432. package/esm/shared/components/FilterByTagDialog.d.ts +1 -1
  433. package/esm/shared/components/FilterByTagDialog.js +2 -2
  434. package/esm/shared/fetchChains.d.ts +2 -2
  435. package/esm/shared/fetchChains.js +1 -2
  436. package/esm/shared/getMaximumModificationAtEachPosition.d.ts +1 -1
  437. package/esm/shared/getMaximumModificationAtEachPosition.js +1 -2
  438. package/esm/shared/getUniqueModifications.d.ts +5 -5
  439. package/esm/shared/getUniqueTags.d.ts +4 -4
  440. package/esm/shared/renderSvgUtil.js +0 -2
  441. package/esm/shared/util.d.ts +11 -1
  442. package/esm/shared/util.js +24 -0
  443. package/esm/util.d.ts +4 -4
  444. package/esm/util.js +3 -9
  445. package/package.json +3 -4
@@ -2,261 +2,35 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateCoverageBins = generateCoverageBins;
4
4
  const util_1 = require("@jbrowse/core/util");
5
- // locals
6
- const MismatchParser_1 = require("../MismatchParser");
7
- const ModificationParser_1 = require("../ModificationParser");
8
- const getMaximumModificationAtEachPosition_1 = require("../shared/getMaximumModificationAtEachPosition");
9
- function mismatchLen(mismatch) {
10
- return !isInterbase(mismatch.type) ? mismatch.length : 1;
11
- }
12
- function isInterbase(type) {
13
- return type === 'softclip' || type === 'hardclip' || type === 'insertion';
14
- }
15
- function inc(bin, strand, type, field) {
16
- let thisBin = bin[type][field];
17
- if (thisBin === undefined) {
18
- thisBin = bin[type][field] = {
19
- entryDepth: 0,
20
- probabilities: [],
21
- '-1': 0,
22
- '0': 0,
23
- '1': 0,
24
- };
25
- }
26
- thisBin.entryDepth++;
27
- thisBin[strand]++;
28
- }
29
- function processDepth({ feature, bins, region, regionSequence, }) {
30
- const fstart = feature.get('start');
31
- const fend = feature.get('end');
32
- const fstrand = feature.get('strand');
33
- const regionLength = region.end - region.start;
34
- for (let j = fstart; j < fend + 1; j++) {
35
- const i = j - region.start;
36
- if (i >= 0 && i < regionLength) {
37
- if (bins[i] === undefined) {
38
- bins[i] = {
39
- depth: 0,
40
- readsCounted: 0,
41
- refbase: regionSequence[i],
42
- ref: {
43
- probabilities: [],
44
- entryDepth: 0,
45
- '-1': 0,
46
- 0: 0,
47
- 1: 0,
48
- },
49
- snps: {},
50
- mods: {},
51
- nonmods: {},
52
- delskips: {},
53
- noncov: {},
54
- };
55
- }
56
- if (j !== fend) {
57
- bins[i].depth++;
58
- bins[i].readsCounted++;
59
- bins[i].ref.entryDepth++;
60
- bins[i].ref[fstrand]++;
61
- }
62
- }
63
- }
64
- }
65
- function processSNPs({ feature, region, bins, skipmap, }) {
66
- var _a;
67
- const fstart = feature.get('start');
68
- const fstrand = feature.get('strand');
69
- const mismatches = (_a = feature.get('mismatches')) !== null && _a !== void 0 ? _a : [];
70
- // normal SNP based coloring
71
- for (const mismatch of mismatches) {
72
- const mstart = fstart + mismatch.start;
73
- const mlen = mismatchLen(mismatch);
74
- const mend = mstart + mlen;
75
- for (let j = mstart; j < mstart + mlen; j++) {
76
- const epos = j - region.start;
77
- if (epos >= 0 && epos < bins.length) {
78
- const bin = bins[epos];
79
- const { base, type } = mismatch;
80
- const interbase = isInterbase(type);
81
- if (type === 'deletion' || type === 'skip') {
82
- inc(bin, fstrand, 'delskips', type);
83
- bin.depth--;
84
- }
85
- else if (!interbase) {
86
- inc(bin, fstrand, 'snps', base);
87
- bin.ref.entryDepth--;
88
- bin.ref[fstrand]--;
89
- }
90
- else {
91
- inc(bin, fstrand, 'noncov', type);
92
- }
93
- }
94
- }
95
- if (mismatch.type === 'skip') {
96
- // for upper case XS and TS: reports the literal strand of the genomic
97
- // transcript
98
- const tags = feature.get('tags');
99
- const xs = (tags === null || tags === void 0 ? void 0 : tags.XS) || (tags === null || tags === void 0 ? void 0 : tags.TS);
100
- // for lower case ts from minimap2: genomic transcript flipped by read
101
- // strand
102
- const ts = tags === null || tags === void 0 ? void 0 : tags.ts;
103
- const effectiveStrand = xs === '+'
104
- ? 1
105
- : xs === '-'
106
- ? -1
107
- : (ts === '+' ? 1 : xs === '-' ? -1 : 0) * fstrand;
108
- const hash = `${mstart}_${mend}_${effectiveStrand}`;
109
- if (skipmap[hash] === undefined) {
110
- skipmap[hash] = {
111
- feature: feature,
112
- start: mstart,
113
- end: mend,
114
- strand: fstrand,
115
- effectiveStrand,
116
- score: 0,
117
- };
118
- }
119
- skipmap[hash].score++;
120
- }
121
- }
122
- }
123
- function processReferenceCpGs({ feature, region, bins, regionSequence, }) {
124
- var _a;
125
- const fstart = feature.get('start');
126
- const fend = feature.get('end');
127
- const fstrand = feature.get('strand');
128
- const seq = feature.get('seq');
129
- const mismatches = (_a = feature.get('mismatches')) !== null && _a !== void 0 ? _a : [];
130
- const r = regionSequence.toLowerCase();
131
- if (seq) {
132
- const cigarOps = (0, MismatchParser_1.parseCigar)(feature.get('CIGAR'));
133
- const { methBins, methProbs } = (0, ModificationParser_1.getMethBins)(feature, cigarOps);
134
- const dels = mismatches.filter(f => f.type === 'deletion');
135
- // methylation based coloring takes into account both reference sequence
136
- // CpG detection and reads
137
- for (let i = 0; i < fend - fstart; i++) {
138
- const j = i + fstart;
139
- const l1 = r[j - region.start + 1];
140
- const l2 = r[j - region.start + 2];
141
- if (l1 === 'c' && l2 === 'g') {
142
- const bin0 = bins[j - region.start];
143
- const bin1 = bins[j - region.start + 1];
144
- const b0 = methBins[i];
145
- const b1 = methBins[i + 1];
146
- const p0 = methProbs[i];
147
- const p1 = methProbs[i + 1];
148
- // color
149
- if ((b0 && (p0 !== undefined ? p0 > 0.5 : true)) ||
150
- (b1 && (p1 !== undefined ? p1 > 0.5 : true))) {
151
- if (bin0) {
152
- incWithProbabilities(bin0, fstrand, 'mods', 'cpg_meth', p0 || 0);
153
- bin0.ref.entryDepth--;
154
- bin0.ref[fstrand]--;
155
- }
156
- if (bin1) {
157
- incWithProbabilities(bin1, fstrand, 'mods', 'cpg_meth', p1 || 0);
158
- bin1.ref.entryDepth--;
159
- bin1.ref[fstrand]--;
160
- }
161
- }
162
- else {
163
- if (bin0) {
164
- if (!dels.some(d => (0, util_1.doesIntersect2)(j, j + 1, d.start + fstart, d.start + fstart + d.length))) {
165
- incWithProbabilities(bin0, fstrand, 'nonmods', 'cpg_unmeth', 1 - (p0 || 0));
166
- bin0.ref.entryDepth--;
167
- bin0.ref[fstrand]--;
168
- }
169
- }
170
- if (bin1) {
171
- if (!dels.some(d => (0, util_1.doesIntersect2)(j + 1, j + 2, d.start + fstart, d.start + fstart + d.length))) {
172
- incWithProbabilities(bin1, fstrand, 'nonmods', 'cpg_unmeth', 1 - (p1 || 0));
173
- bin1.ref.entryDepth--;
174
- bin1.ref[fstrand]--;
175
- }
176
- }
177
- }
178
- }
179
- }
180
- }
181
- }
182
- function processModification({ feature, colorBy, region, bins, regionSequence, }) {
183
- var _a, _b, _c;
184
- const fstart = feature.get('start');
185
- const fstrand = feature.get('strand');
186
- const fend = feature.get('end');
187
- const twoColor = (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.twoColor;
188
- const isolatedModification = (_b = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _b === void 0 ? void 0 : _b.isolatedModification;
189
- (_c = (0, getMaximumModificationAtEachPosition_1.getMaxProbModAtEachPosition)(feature)) === null || _c === void 0 ? void 0 : _c.forEach(({ type, prob, allProbs }, pos) => {
190
- if (isolatedModification && type !== isolatedModification) {
191
- return;
192
- }
193
- const epos = pos + fstart - region.start;
194
- if (epos >= 0 && epos < bins.length && pos + fstart < fend) {
195
- if (bins[epos] === undefined) {
196
- bins[epos] = {
197
- depth: 0,
198
- readsCounted: 0,
199
- refbase: regionSequence[epos],
200
- snps: {},
201
- ref: {
202
- probabilities: [],
203
- entryDepth: 0,
204
- '-1': 0,
205
- 0: 0,
206
- 1: 0,
207
- },
208
- mods: {},
209
- nonmods: {},
210
- delskips: {},
211
- noncov: {},
212
- };
213
- }
214
- const s = 1 - (0, util_1.sum)(allProbs);
215
- const bin = bins[epos];
216
- if (twoColor && s > (0, util_1.max)(allProbs)) {
217
- incWithProbabilities(bin, fstrand, 'nonmods', `nonmod_${type}`, s);
218
- }
219
- else {
220
- incWithProbabilities(bin, fstrand, 'mods', `mod_${type}`, prob);
221
- }
222
- }
223
- });
224
- }
225
- function incWithProbabilities(bin, strand, type, field, probability) {
226
- let thisBin = bin[type][field];
227
- if (thisBin === undefined) {
228
- thisBin = bin[type][field] = {
229
- entryDepth: 0,
230
- probabilities: [],
231
- '-1': 0,
232
- '0': 0,
233
- '1': 0,
234
- };
235
- }
236
- thisBin.entryDepth++;
237
- thisBin.probabilities.push(probability);
238
- thisBin[strand]++;
239
- }
5
+ const stopToken_1 = require("@jbrowse/core/util/stopToken");
6
+ const processDepth_1 = require("./processDepth");
7
+ const processMismatches_1 = require("./processMismatches");
8
+ const processModifications_1 = require("./processModifications");
9
+ const processReferenceCpGs_1 = require("./processReferenceCpGs");
240
10
  async function generateCoverageBins({ fetchSequence, features, region, opts, }) {
241
- const { colorBy } = opts;
11
+ const { stopToken, colorBy } = opts;
242
12
  const skipmap = {};
243
13
  const bins = [];
244
14
  const start2 = Math.max(0, region.start - 1);
245
15
  const diff = region.start - start2;
246
- const regionSequence = (await fetchSequence({
247
- ...region,
248
- start: start2,
249
- end: region.end + 1,
250
- })) || '';
16
+ let start = performance.now();
251
17
  for (const feature of features) {
252
- processDepth({
18
+ if (performance.now() - start > 400) {
19
+ (0, stopToken_1.checkStopToken)(stopToken);
20
+ start = performance.now();
21
+ }
22
+ (0, processDepth_1.processDepth)({
253
23
  feature,
254
24
  bins,
255
25
  region,
256
- regionSequence: regionSequence.slice(diff),
257
26
  });
258
27
  if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
259
- processModification({
28
+ const regionSequence = (await fetchSequence({
29
+ ...region,
30
+ start: start2,
31
+ end: region.end + 1,
32
+ })) || '';
33
+ (0, processModifications_1.processModifications)({
260
34
  feature,
261
35
  colorBy,
262
36
  bins,
@@ -265,17 +39,21 @@ async function generateCoverageBins({ fetchSequence, features, region, opts, })
265
39
  });
266
40
  }
267
41
  else if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'methylation') {
268
- processReferenceCpGs({
42
+ const regionSequence = (await fetchSequence({
43
+ ...region,
44
+ start: start2,
45
+ end: region.end + 1,
46
+ })) || '';
47
+ (0, processReferenceCpGs_1.processReferenceCpGs)({
269
48
  feature,
270
49
  bins,
271
50
  region,
272
51
  regionSequence,
273
52
  });
274
53
  }
275
- processSNPs({ feature, skipmap, bins, region });
54
+ (0, processMismatches_1.processMismatches)({ feature, skipmap, bins, region });
276
55
  }
277
56
  for (const bin of bins) {
278
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
279
57
  if (bin) {
280
58
  bin.mods = Object.fromEntries(Object.entries(bin.mods).map(([key, val]) => {
281
59
  return [
@@ -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;
@@ -0,0 +1,8 @@
1
+ import type { PreBaseCoverageBin } from '../shared/types';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ import type { AugmentedRegion } from '@jbrowse/core/util/types';
4
+ export declare function processDepth({ feature, bins, region, }: {
5
+ feature: Feature;
6
+ bins: PreBaseCoverageBin[];
7
+ region: AugmentedRegion;
8
+ }): void;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processDepth = processDepth;
4
+ function processDepth({ feature, bins, region, }) {
5
+ const fstart = feature.get('start');
6
+ const fend = feature.get('end');
7
+ const fstrand = feature.get('strand');
8
+ const regionLength = region.end - region.start;
9
+ for (let j = fstart; j < fend + 1; j++) {
10
+ const i = j - region.start;
11
+ if (i >= 0 && i < regionLength) {
12
+ if (bins[i] === undefined) {
13
+ bins[i] = {
14
+ depth: 0,
15
+ readsCounted: 0,
16
+ ref: {
17
+ probabilities: [],
18
+ entryDepth: 0,
19
+ '-1': 0,
20
+ 0: 0,
21
+ 1: 0,
22
+ },
23
+ snps: {},
24
+ mods: {},
25
+ nonmods: {},
26
+ delskips: {},
27
+ noncov: {},
28
+ };
29
+ }
30
+ if (j !== fend) {
31
+ bins[i].depth++;
32
+ bins[i].readsCounted++;
33
+ bins[i].ref.entryDepth++;
34
+ bins[i].ref[fstrand]++;
35
+ }
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,9 @@
1
+ import type { PreBaseCoverageBin, SkipMap } from '../shared/types';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ import type { AugmentedRegion } from '@jbrowse/core/util/types';
4
+ export declare function processMismatches({ feature, region, bins, skipmap, }: {
5
+ region: AugmentedRegion;
6
+ bins: PreBaseCoverageBin[];
7
+ feature: Feature;
8
+ skipmap: SkipMap;
9
+ }): void;
@@ -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
+ refbase: regionSequence[epos],
25
+ snps: {},
26
+ ref: {
27
+ probabilities: [],
28
+ entryDepth: 0,
29
+ '-1': 0,
30
+ 0: 0,
31
+ 1: 0,
32
+ },
33
+ mods: {},
34
+ nonmods: {},
35
+ delskips: {},
36
+ noncov: {},
37
+ };
38
+ }
39
+ const s = 1 - (0, util_1.sum)(allProbs);
40
+ const bin = bins[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,7 +1,8 @@
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';
1
+ import { WiggleBaseRenderer } from '@jbrowse/plugin-wiggle';
2
+ import type { ModificationTypeWithColor } from '../shared/types';
3
+ import type { RenderArgsDeserialized as FeatureRenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType';
4
+ import type { Feature } from '@jbrowse/core/util';
5
+ import type { ScaleOpts } from '@jbrowse/plugin-wiggle';
5
6
  export interface RenderArgsDeserialized extends FeatureRenderArgsDeserialized {
6
7
  bpPerPx: number;
7
8
  height: number;