@jbrowse/plugin-alignments 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
  3. package/dist/AlignmentsTrack/index.js +1 -0
  4. package/dist/AlignmentsTrack/index.js.map +1 -1
  5. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
  6. package/dist/BamAdapter/BamSlightlyLazyFeature.js +11 -18
  7. package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
  8. package/dist/BamAdapter/index.js +1 -0
  9. package/dist/BamAdapter/index.js.map +1 -1
  10. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
  11. package/dist/CramAdapter/CramSlightlyLazyFeature.js +6 -8
  12. package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
  13. package/dist/CramAdapter/CramTestAdapters.js +2 -1
  14. package/dist/CramAdapter/CramTestAdapters.js.map +1 -1
  15. package/dist/CramAdapter/index.js +1 -0
  16. package/dist/CramAdapter/index.js.map +1 -1
  17. package/dist/GuessAlignmentsTypes/index.d.ts +3 -0
  18. package/dist/GuessAlignmentsTypes/index.js +56 -0
  19. package/dist/GuessAlignmentsTypes/index.js.map +1 -0
  20. package/dist/HtsgetBamAdapter/index.js +11 -11
  21. package/dist/HtsgetBamAdapter/index.js.map +1 -1
  22. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
  23. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
  24. package/dist/LinearAlignmentsDisplay/index.js +1 -0
  25. package/dist/LinearAlignmentsDisplay/index.js.map +1 -1
  26. package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
  27. package/dist/LinearAlignmentsDisplay/models/configSchema.js +2 -3
  28. package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
  29. package/dist/LinearAlignmentsDisplay/models/model.d.ts +22 -36
  30. package/dist/LinearAlignmentsDisplay/models/model.js +166 -151
  31. package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
  32. package/dist/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
  33. package/dist/LinearPileupDisplay/components/ColorByModifications.js +7 -22
  34. package/dist/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
  35. package/dist/LinearPileupDisplay/components/ColorByTag.js +2 -22
  36. package/dist/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
  37. package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
  38. package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +3 -22
  39. package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
  40. package/dist/LinearPileupDisplay/components/SetMaxHeight.js +2 -18
  41. package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
  42. package/dist/LinearPileupDisplay/components/SortByTag.js +2 -23
  43. package/dist/LinearPileupDisplay/components/SortByTag.js.map +1 -1
  44. package/dist/LinearPileupDisplay/configSchema.d.ts +0 -3
  45. package/dist/LinearPileupDisplay/configSchema.js.map +1 -1
  46. package/dist/LinearPileupDisplay/index.js +2 -0
  47. package/dist/LinearPileupDisplay/index.js.map +1 -1
  48. package/dist/LinearPileupDisplay/model.d.ts +19 -16
  49. package/dist/LinearPileupDisplay/model.js +28 -13
  50. package/dist/LinearPileupDisplay/model.js.map +1 -1
  51. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
  52. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +49 -0
  53. package/dist/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
  54. package/dist/LinearReadArcsDisplay/configSchema.d.ts +6 -0
  55. package/dist/LinearReadArcsDisplay/configSchema.js +52 -0
  56. package/dist/LinearReadArcsDisplay/configSchema.js.map +1 -0
  57. package/dist/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
  58. package/dist/LinearReadArcsDisplay/drawFeats.js +162 -0
  59. package/dist/LinearReadArcsDisplay/drawFeats.js.map +1 -0
  60. package/dist/LinearReadArcsDisplay/index.d.ts +2 -0
  61. package/dist/LinearReadArcsDisplay/index.js +27 -0
  62. package/dist/LinearReadArcsDisplay/index.js.map +1 -0
  63. package/dist/LinearReadArcsDisplay/model.d.ts +342 -0
  64. package/dist/LinearReadArcsDisplay/model.js +327 -0
  65. package/dist/LinearReadArcsDisplay/model.js.map +1 -0
  66. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
  67. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +49 -0
  68. package/dist/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
  69. package/dist/LinearReadCloudDisplay/configSchema.d.ts +6 -0
  70. package/dist/LinearReadCloudDisplay/configSchema.js +51 -0
  71. package/dist/LinearReadCloudDisplay/configSchema.js.map +1 -0
  72. package/dist/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
  73. package/dist/LinearReadCloudDisplay/drawFeats.js +159 -0
  74. package/dist/LinearReadCloudDisplay/drawFeats.js.map +1 -0
  75. package/dist/LinearReadCloudDisplay/index.d.ts +2 -0
  76. package/dist/LinearReadCloudDisplay/index.js +27 -0
  77. package/dist/LinearReadCloudDisplay/index.js.map +1 -0
  78. package/dist/LinearReadCloudDisplay/model.d.ts +320 -0
  79. package/dist/LinearReadCloudDisplay/model.js +252 -0
  80. package/dist/LinearReadCloudDisplay/model.js.map +1 -0
  81. package/dist/LinearSNPCoverageDisplay/index.js +1 -0
  82. package/dist/LinearSNPCoverageDisplay/index.js.map +1 -1
  83. package/dist/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
  84. package/dist/LinearSNPCoverageDisplay/models/model.js +9 -12
  85. package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
  86. package/dist/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
  87. package/dist/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +116 -3
  88. package/dist/MismatchParser/index.js.map +1 -0
  89. package/dist/PileupRPC/base.d.ts +8 -0
  90. package/dist/PileupRPC/base.js +22 -0
  91. package/dist/PileupRPC/base.js.map +1 -0
  92. package/dist/PileupRPC/index.d.ts +3 -0
  93. package/dist/PileupRPC/index.js +9 -0
  94. package/dist/PileupRPC/index.js.map +1 -0
  95. package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
  96. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +29 -0
  97. package/dist/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
  98. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
  99. package/dist/PileupRPC/methods/GetReducedFeatures.js +61 -0
  100. package/dist/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
  101. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
  102. package/dist/PileupRPC/methods/GetVisibleModifications.js +32 -0
  103. package/dist/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
  104. package/dist/PileupRPC/rpcMethods.d.ts +4 -34
  105. package/dist/PileupRPC/rpcMethods.js +7 -77
  106. package/dist/PileupRPC/rpcMethods.js.map +1 -1
  107. package/dist/PileupRPC/util.d.ts +8 -0
  108. package/dist/PileupRPC/util.js +20 -0
  109. package/dist/PileupRPC/util.js.map +1 -0
  110. package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
  111. package/dist/PileupRenderer/PileupRenderer.js +5 -5
  112. package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
  113. package/dist/PileupRenderer/configSchema.js +1 -1
  114. package/dist/PileupRenderer/configSchema.js.map +1 -1
  115. package/dist/PileupRenderer/index.js +1 -0
  116. package/dist/PileupRenderer/index.js.map +1 -1
  117. package/dist/PileupRenderer/sortUtil.d.ts +1 -1
  118. package/dist/PileupRenderer/sortUtil.js +2 -2
  119. package/dist/PileupRenderer/sortUtil.js.map +1 -1
  120. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
  121. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +3 -182
  122. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
  123. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
  124. package/dist/SNPCoverageAdapter/generateCoverageBins.js +185 -0
  125. package/dist/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
  126. package/dist/SNPCoverageAdapter/index.js +1 -3
  127. package/dist/SNPCoverageAdapter/index.js.map +1 -1
  128. package/dist/index.d.ts +2 -2
  129. package/dist/index.js +12 -58
  130. package/dist/index.js.map +1 -1
  131. package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
  132. package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.js +5 -24
  133. package/dist/shared/FilterByTag.js.map +1 -0
  134. package/dist/shared/color.d.ts +17 -0
  135. package/dist/shared/color.js +43 -0
  136. package/dist/shared/color.js.map +1 -0
  137. package/dist/shared/fetchChains.d.ts +27 -0
  138. package/dist/shared/fetchChains.js +30 -0
  139. package/dist/shared/fetchChains.js.map +1 -0
  140. package/dist/shared/index.d.ts +36 -0
  141. package/dist/{shared.js → shared/index.js} +12 -2
  142. package/dist/shared/index.js.map +1 -0
  143. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
  144. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
  145. package/esm/AlignmentsTrack/index.js +1 -0
  146. package/esm/AlignmentsTrack/index.js.map +1 -1
  147. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
  148. package/esm/BamAdapter/BamSlightlyLazyFeature.js +11 -18
  149. package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
  150. package/esm/BamAdapter/index.js +1 -0
  151. package/esm/BamAdapter/index.js.map +1 -1
  152. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
  153. package/esm/CramAdapter/CramSlightlyLazyFeature.js +6 -8
  154. package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
  155. package/esm/CramAdapter/CramTestAdapters.js +2 -1
  156. package/esm/CramAdapter/CramTestAdapters.js.map +1 -1
  157. package/esm/CramAdapter/index.js +1 -0
  158. package/esm/CramAdapter/index.js.map +1 -1
  159. package/esm/GuessAlignmentsTypes/index.d.ts +3 -0
  160. package/esm/GuessAlignmentsTypes/index.js +54 -0
  161. package/esm/GuessAlignmentsTypes/index.js.map +1 -0
  162. package/esm/HtsgetBamAdapter/index.js +11 -11
  163. package/esm/HtsgetBamAdapter/index.js.map +1 -1
  164. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
  165. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
  166. package/esm/LinearAlignmentsDisplay/index.js +1 -0
  167. package/esm/LinearAlignmentsDisplay/index.js.map +1 -1
  168. package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
  169. package/esm/LinearAlignmentsDisplay/models/configSchema.js +2 -4
  170. package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
  171. package/esm/LinearAlignmentsDisplay/models/model.d.ts +22 -36
  172. package/esm/LinearAlignmentsDisplay/models/model.js +167 -152
  173. package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
  174. package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
  175. package/esm/LinearPileupDisplay/components/ColorByModifications.js +8 -23
  176. package/esm/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
  177. package/esm/LinearPileupDisplay/components/ColorByTag.js +3 -20
  178. package/esm/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
  179. package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
  180. package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +4 -20
  181. package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
  182. package/esm/LinearPileupDisplay/components/SetMaxHeight.js +3 -16
  183. package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
  184. package/esm/LinearPileupDisplay/components/SortByTag.js +3 -21
  185. package/esm/LinearPileupDisplay/components/SortByTag.js.map +1 -1
  186. package/esm/LinearPileupDisplay/configSchema.d.ts +0 -3
  187. package/esm/LinearPileupDisplay/configSchema.js.map +1 -1
  188. package/esm/LinearPileupDisplay/index.js +2 -0
  189. package/esm/LinearPileupDisplay/index.js.map +1 -1
  190. package/esm/LinearPileupDisplay/model.d.ts +19 -16
  191. package/esm/LinearPileupDisplay/model.js +29 -14
  192. package/esm/LinearPileupDisplay/model.js.map +1 -1
  193. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
  194. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +44 -0
  195. package/esm/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
  196. package/esm/LinearReadArcsDisplay/configSchema.d.ts +6 -0
  197. package/esm/LinearReadArcsDisplay/configSchema.js +50 -0
  198. package/esm/LinearReadArcsDisplay/configSchema.js.map +1 -0
  199. package/esm/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
  200. package/esm/LinearReadArcsDisplay/drawFeats.js +157 -0
  201. package/esm/LinearReadArcsDisplay/drawFeats.js.map +1 -0
  202. package/esm/LinearReadArcsDisplay/index.d.ts +2 -0
  203. package/esm/LinearReadArcsDisplay/index.js +21 -0
  204. package/esm/LinearReadArcsDisplay/index.js.map +1 -0
  205. package/esm/LinearReadArcsDisplay/model.d.ts +342 -0
  206. package/esm/LinearReadArcsDisplay/model.js +299 -0
  207. package/esm/LinearReadArcsDisplay/model.js.map +1 -0
  208. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
  209. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +44 -0
  210. package/esm/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
  211. package/esm/LinearReadCloudDisplay/configSchema.d.ts +6 -0
  212. package/esm/LinearReadCloudDisplay/configSchema.js +49 -0
  213. package/esm/LinearReadCloudDisplay/configSchema.js.map +1 -0
  214. package/esm/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
  215. package/esm/LinearReadCloudDisplay/drawFeats.js +156 -0
  216. package/esm/LinearReadCloudDisplay/drawFeats.js.map +1 -0
  217. package/esm/LinearReadCloudDisplay/index.d.ts +2 -0
  218. package/esm/LinearReadCloudDisplay/index.js +21 -0
  219. package/esm/LinearReadCloudDisplay/index.js.map +1 -0
  220. package/esm/LinearReadCloudDisplay/model.d.ts +320 -0
  221. package/esm/LinearReadCloudDisplay/model.js +224 -0
  222. package/esm/LinearReadCloudDisplay/model.js.map +1 -0
  223. package/esm/LinearSNPCoverageDisplay/index.js +1 -0
  224. package/esm/LinearSNPCoverageDisplay/index.js.map +1 -1
  225. package/esm/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
  226. package/esm/LinearSNPCoverageDisplay/models/model.js +11 -14
  227. package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
  228. package/esm/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
  229. package/esm/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +107 -2
  230. package/esm/MismatchParser/index.js.map +1 -0
  231. package/esm/PileupRPC/base.d.ts +8 -0
  232. package/esm/PileupRPC/base.js +16 -0
  233. package/esm/PileupRPC/base.js.map +1 -0
  234. package/esm/PileupRPC/index.d.ts +3 -0
  235. package/esm/PileupRPC/index.js +7 -0
  236. package/esm/PileupRPC/index.js.map +1 -0
  237. package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
  238. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +23 -0
  239. package/esm/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
  240. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
  241. package/esm/PileupRPC/methods/GetReducedFeatures.js +55 -0
  242. package/esm/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
  243. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
  244. package/esm/PileupRPC/methods/GetVisibleModifications.js +26 -0
  245. package/esm/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
  246. package/esm/PileupRPC/rpcMethods.d.ts +4 -34
  247. package/esm/PileupRPC/rpcMethods.js +4 -74
  248. package/esm/PileupRPC/rpcMethods.js.map +1 -1
  249. package/esm/PileupRPC/util.d.ts +8 -0
  250. package/esm/PileupRPC/util.js +15 -0
  251. package/esm/PileupRPC/util.js.map +1 -0
  252. package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
  253. package/esm/PileupRenderer/PileupRenderer.js +5 -5
  254. package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
  255. package/esm/PileupRenderer/configSchema.js +1 -1
  256. package/esm/PileupRenderer/configSchema.js.map +1 -1
  257. package/esm/PileupRenderer/index.js +1 -0
  258. package/esm/PileupRenderer/index.js.map +1 -1
  259. package/esm/PileupRenderer/sortUtil.d.ts +1 -1
  260. package/esm/PileupRenderer/sortUtil.js +1 -1
  261. package/esm/PileupRenderer/sortUtil.js.map +1 -1
  262. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
  263. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +4 -183
  264. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
  265. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
  266. package/esm/SNPCoverageAdapter/generateCoverageBins.js +182 -0
  267. package/esm/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
  268. package/esm/SNPCoverageAdapter/index.js +1 -3
  269. package/esm/SNPCoverageAdapter/index.js.map +1 -1
  270. package/esm/index.d.ts +2 -2
  271. package/esm/index.js +10 -56
  272. package/esm/index.js.map +1 -1
  273. package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
  274. package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.js +6 -22
  275. package/esm/shared/FilterByTag.js.map +1 -0
  276. package/esm/shared/color.d.ts +17 -0
  277. package/esm/shared/color.js +37 -0
  278. package/esm/shared/color.js.map +1 -0
  279. package/esm/shared/fetchChains.d.ts +27 -0
  280. package/esm/shared/fetchChains.js +26 -0
  281. package/esm/shared/fetchChains.js.map +1 -0
  282. package/esm/shared/index.d.ts +36 -0
  283. package/esm/{shared.js → shared/index.js} +11 -1
  284. package/esm/shared/index.js.map +1 -0
  285. package/package.json +5 -5
  286. package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +1 -1
  287. package/src/AlignmentsTrack/index.ts +1 -0
  288. package/src/BamAdapter/BamSlightlyLazyFeature.ts +13 -19
  289. package/src/BamAdapter/index.ts +1 -0
  290. package/src/CramAdapter/CramSlightlyLazyFeature.ts +13 -15
  291. package/src/CramAdapter/CramTestAdapters.ts +1 -0
  292. package/src/CramAdapter/__snapshots__/CramAdapter.test.ts.snap +0 -10
  293. package/src/CramAdapter/index.ts +1 -0
  294. package/src/GuessAlignmentsTypes/index.ts +79 -0
  295. package/src/HtsgetBamAdapter/index.ts +11 -15
  296. package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +21 -29
  297. package/src/LinearAlignmentsDisplay/index.ts +1 -0
  298. package/src/LinearAlignmentsDisplay/models/configSchema.ts +2 -6
  299. package/src/LinearAlignmentsDisplay/models/model.tsx +238 -199
  300. package/src/LinearPileupDisplay/components/ColorByModifications.tsx +5 -34
  301. package/src/LinearPileupDisplay/components/ColorByTag.tsx +2 -29
  302. package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +5 -27
  303. package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +2 -24
  304. package/src/LinearPileupDisplay/components/SortByTag.tsx +2 -31
  305. package/src/LinearPileupDisplay/configSchema.ts +1 -3
  306. package/src/LinearPileupDisplay/index.ts +2 -0
  307. package/src/LinearPileupDisplay/model.ts +36 -23
  308. package/src/LinearReadArcsDisplay/components/ReactComponent.tsx +86 -0
  309. package/src/LinearReadArcsDisplay/configSchema.ts +58 -0
  310. package/src/LinearReadArcsDisplay/declare.d.ts +1 -0
  311. package/src/LinearReadArcsDisplay/drawFeats.ts +199 -0
  312. package/src/LinearReadArcsDisplay/index.ts +23 -0
  313. package/src/LinearReadArcsDisplay/model.tsx +370 -0
  314. package/src/LinearReadCloudDisplay/components/ReactComponent.tsx +86 -0
  315. package/src/LinearReadCloudDisplay/configSchema.ts +57 -0
  316. package/src/LinearReadCloudDisplay/drawFeats.ts +201 -0
  317. package/src/LinearReadCloudDisplay/index.ts +23 -0
  318. package/src/LinearReadCloudDisplay/model.tsx +289 -0
  319. package/src/LinearSNPCoverageDisplay/index.ts +1 -0
  320. package/src/LinearSNPCoverageDisplay/models/model.ts +15 -21
  321. package/src/{BamAdapter/MismatchParser.test.ts → MismatchParser/index.test.ts} +1 -1
  322. package/src/{BamAdapter/MismatchParser.ts → MismatchParser/index.ts} +129 -2
  323. package/src/PileupRPC/base.ts +24 -0
  324. package/src/PileupRPC/index.ts +12 -0
  325. package/src/PileupRPC/methods/GetGlobalValueForTag.ts +41 -0
  326. package/src/PileupRPC/methods/GetReducedFeatures.ts +76 -0
  327. package/src/PileupRPC/methods/GetVisibleModifications.ts +45 -0
  328. package/src/PileupRPC/rpcMethods.ts +8 -113
  329. package/src/PileupRPC/util.ts +19 -0
  330. package/src/PileupRenderer/PileupRenderer.ts +5 -8
  331. package/src/PileupRenderer/configSchema.ts +1 -1
  332. package/src/PileupRenderer/index.ts +1 -0
  333. package/src/PileupRenderer/sortUtil.ts +2 -3
  334. package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -249
  335. package/src/SNPCoverageAdapter/generateCoverageBins.ts +245 -0
  336. package/src/SNPCoverageAdapter/index.ts +1 -3
  337. package/src/index.ts +12 -93
  338. package/src/{LinearPileupDisplay/components → shared}/FilterByTag.tsx +5 -31
  339. package/src/shared/color.ts +47 -0
  340. package/src/shared/fetchChains.ts +63 -0
  341. package/src/{shared.ts → shared/index.ts} +17 -4
  342. package/dist/BamAdapter/MismatchParser.js.map +0 -1
  343. package/dist/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
  344. package/dist/shared.d.ts +0 -25
  345. package/dist/shared.js.map +0 -1
  346. package/esm/BamAdapter/MismatchParser.js.map +0 -1
  347. package/esm/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
  348. package/esm/shared.d.ts +0 -25
  349. package/esm/shared.js.map +0 -1
@@ -6,46 +6,13 @@ import { AugmentedRegion as Region } from '@jbrowse/core/util/types'
6
6
  import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature'
7
7
  import { ObservableCreate } from '@jbrowse/core/util/rxjs'
8
8
  import { toArray } from 'rxjs/operators'
9
- import {
10
- getTag,
11
- getTagAlt,
12
- fetchSequence,
13
- shouldFetchReferenceSequence,
14
- } from '../util'
15
- import {
16
- parseCigar,
17
- getNextRefPos,
18
- getModificationPositions,
19
- Mismatch,
20
- } from '../BamAdapter/MismatchParser'
21
-
22
- function mismatchLen(mismatch: Mismatch) {
23
- return !isInterbase(mismatch.type) ? mismatch.length : 1
24
- }
25
-
26
- function isInterbase(type: string) {
27
- return type === 'softclip' || type === 'hardclip' || type === 'insertion'
28
- }
29
-
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
- function inc(bin: any, strand: number, type: string, field: string) {
32
- let thisBin = bin[type][field]
33
- if (thisBin === undefined) {
34
- thisBin = bin[type][field] = {
35
- total: 0,
36
- '-1': 0,
37
- '0': 0,
38
- '1': 0,
39
- }
40
- }
41
- thisBin.total++
42
- thisBin[strand]++
43
- }
9
+ import generateCoverageBins from './generateCoverageBins'
10
+ import { fetchSequence } from '../util'
44
11
 
45
12
  export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
46
13
  protected async configure() {
47
14
  const subadapterConfig = this.getConf('subadapter')
48
- const sequenceConf = this.getConf(['subadapter', 'sequenceAdapter'])
15
+ const sequenceConf = subadapterConfig.sequenceAdapter
49
16
  const dataAdapter = await this.getSubAdapter?.(subadapterConfig)
50
17
 
51
18
  const sequenceAdapter = sequenceConf
@@ -81,10 +48,11 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
81
48
  .pipe(toArray())
82
49
  .toPromise()
83
50
 
84
- const { bins, skipmap } = await this.generateCoverageBins(
51
+ const { bins, skipmap } = await generateCoverageBins(
85
52
  feats,
86
53
  region,
87
54
  opts,
55
+ arg => this.fetchSequence(arg),
88
56
  )
89
57
 
90
58
  bins.forEach((bin, index) => {
@@ -135,218 +103,6 @@ export default class SNPCoverageAdapter extends BaseFeatureDataAdapter {
135
103
  }
136
104
 
137
105
  freeResources(/* { region } */): void {}
138
-
139
- async generateCoverageBins(
140
- features: Feature[],
141
- region: Region,
142
- opts: { bpPerPx?: number; colorBy?: { type: string; tag?: string } },
143
- ) {
144
- const { colorBy } = opts
145
- const binMax = Math.ceil(region.end - region.start)
146
-
147
- const skipmap = {} as {
148
- [key: string]: {
149
- score: number
150
- feature: unknown
151
- start: number
152
- end: number
153
- strand: number
154
- xs: string
155
- }
156
- }
157
-
158
- // bins contain:
159
- // - cov feature if they contribute to coverage
160
- // - noncov are insertions/clip features that don't contribute to coverage
161
- // - delskips deletions or introns that don't contribute to coverage
162
- type BinType = { total: number; strands: { [key: string]: number } }
163
-
164
- const regionSeq =
165
- features.length && shouldFetchReferenceSequence(opts.colorBy?.type)
166
- ? await this.fetchSequence(region)
167
- : undefined
168
-
169
- const bins = [] as {
170
- refbase?: string
171
- total: number
172
- all: number
173
- ref: number
174
- '-1': 0
175
- '0': 0
176
- '1': 0
177
- lowqual: BinType
178
- cov: BinType
179
- delskips: BinType
180
- noncov: BinType
181
- }[]
182
-
183
- for (let i = 0; i < features.length; i++) {
184
- const feature = features[i]
185
- const fstart = feature.get('start')
186
- const fend = feature.get('end')
187
- const fstrand = feature.get('strand') as -1 | 0 | 1
188
-
189
- for (let j = fstart; j < fend + 1; j++) {
190
- const i = j - region.start
191
- if (i >= 0 && i < binMax) {
192
- if (bins[i] === undefined) {
193
- bins[i] = {
194
- total: 0,
195
- all: 0,
196
- ref: 0,
197
- '-1': 0,
198
- '0': 0,
199
- '1': 0,
200
- lowqual: {} as BinType,
201
- cov: {} as BinType,
202
- delskips: {} as BinType,
203
- noncov: {} as BinType,
204
- }
205
- }
206
- if (j !== fend) {
207
- bins[i].total++
208
- bins[i].all++
209
- bins[i].ref++
210
- bins[i][fstrand]++
211
- }
212
- }
213
- }
214
-
215
- if (colorBy?.type === 'modifications') {
216
- const seq = feature.get('seq') as string
217
- const mm = (getTagAlt(feature, 'MM', 'Mm') as string) || ''
218
- const ops = parseCigar(feature.get('CIGAR'))
219
- const fend = feature.get('end')
220
-
221
- getModificationPositions(mm, seq, fstrand).forEach(
222
- ({ type, positions }) => {
223
- const mod = `mod_${type}`
224
- for (const pos of getNextRefPos(ops, positions)) {
225
- const epos = pos + fstart - region.start
226
- if (epos >= 0 && epos < bins.length && pos + fstart < fend) {
227
- const bin = bins[epos]
228
- if (bin) {
229
- inc(bin, fstrand, 'cov', mod)
230
- } else {
231
- console.warn(
232
- 'Undefined position in modifications snpcoverage encountered',
233
- )
234
- }
235
- }
236
- }
237
- },
238
- )
239
- }
240
-
241
- // methylation based coloring takes into account both reference
242
- // sequence CpG detection and reads
243
- else if (colorBy?.type === 'methylation') {
244
- if (!regionSeq) {
245
- throw new Error(
246
- 'no region sequence detected, need sequenceAdapter configuration',
247
- )
248
- }
249
- const seq = feature.get('seq')
250
- const mm = getTagAlt(feature, 'MM', 'Mm') || ''
251
- const methBins = new Array(region.end - region.start).fill(0)
252
- const ops = parseCigar(feature.get('CIGAR'))
253
-
254
- getModificationPositions(mm, seq, fstrand).forEach(
255
- ({ type, positions }) => {
256
- // we are processing methylation
257
- if (type === 'm') {
258
- for (const pos of getNextRefPos(ops, positions)) {
259
- const epos = pos + fstart - region.start
260
- if (epos >= 0 && epos < methBins.length) {
261
- methBins[epos] = 1
262
- }
263
- }
264
- }
265
- },
266
- )
267
-
268
- for (let j = fstart; j < fend; j++) {
269
- const i = j - region.start
270
- if (i >= 0 && i < bins.length - 1) {
271
- const l1 = regionSeq[i].toLowerCase()
272
- const l2 = regionSeq[i + 1].toLowerCase()
273
- const bin = bins[i]
274
- const bin1 = bins[i + 1]
275
-
276
- // color
277
- if (l1 === 'c' && l2 === 'g') {
278
- if (methBins[i] || methBins[i + 1]) {
279
- inc(bin, fstrand, 'cov', 'meth')
280
- inc(bin1, fstrand, 'cov', 'meth')
281
- bins[i].ref--
282
- bins[i][fstrand]--
283
- bins[i + 1].ref--
284
- bins[i + 1][fstrand]--
285
- } else {
286
- inc(bin, fstrand, 'cov', 'unmeth')
287
- inc(bin1, fstrand, 'cov', 'unmeth')
288
- bins[i].ref--
289
- bins[i][fstrand]--
290
- bins[i + 1].ref--
291
- bins[i + 1][fstrand]--
292
- }
293
- }
294
- }
295
- }
296
- }
297
-
298
- // normal SNP based coloring
299
- const mismatches = (feature.get('mismatches') as Mismatch[]) || []
300
- const colorSNPs =
301
- colorBy?.type !== 'modifications' && colorBy?.type !== 'methylation'
302
-
303
- for (let i = 0; i < mismatches.length; i++) {
304
- const mismatch = mismatches[i]
305
- const mstart = fstart + mismatch.start
306
- const mlen = mismatchLen(mismatch)
307
- const mend = mstart + mlen
308
- for (let j = mstart; j < mstart + mlen; j++) {
309
- const epos = j - region.start
310
- if (epos >= 0 && epos < bins.length) {
311
- const bin = bins[epos]
312
- const { base, type } = mismatch
313
- const interbase = isInterbase(type)
314
- if (!interbase) {
315
- bin.ref--
316
- bin[fstrand]--
317
- } else {
318
- inc(bin, fstrand, 'noncov', type)
319
- }
320
-
321
- if (type === 'deletion' || type === 'skip') {
322
- inc(bin, fstrand, 'delskips', type)
323
- bin.total--
324
- } else if (!interbase && colorSNPs) {
325
- inc(bin, fstrand, 'cov', base)
326
- bin.refbase = mismatch.altbase
327
- }
328
- }
329
- }
330
-
331
- if (mismatch.type === 'skip') {
332
- const hash = `${mstart}_${mend}_${fstrand}`
333
- if (skipmap[hash] === undefined) {
334
- skipmap[hash] = {
335
- feature: feature,
336
- start: mstart,
337
- end: mend,
338
- strand: fstrand,
339
- xs: getTag(feature, 'XS') || getTag(feature, 'TS'),
340
- score: 0,
341
- }
342
- }
343
- skipmap[hash].score++
344
- }
345
- }
346
- }
347
-
348
- return { bins, skipmap }
349
- }
350
106
  }
351
107
 
352
108
  const { capabilities } = SNPCoverageAdapter
@@ -0,0 +1,245 @@
1
+ import { AugmentedRegion as Region } from '@jbrowse/core/util/types'
2
+ import { Feature } from '@jbrowse/core/util/simpleFeature'
3
+ import { getTag, getTagAlt, shouldFetchReferenceSequence } from '../util'
4
+ import {
5
+ parseCigar,
6
+ getNextRefPos,
7
+ getModificationPositions,
8
+ Mismatch,
9
+ } from '../MismatchParser'
10
+
11
+ function mismatchLen(mismatch: Mismatch) {
12
+ return !isInterbase(mismatch.type) ? mismatch.length : 1
13
+ }
14
+
15
+ function isInterbase(type: string) {
16
+ return type === 'softclip' || type === 'hardclip' || type === 'insertion'
17
+ }
18
+
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ function inc(bin: any, strand: number, type: string, field: string) {
21
+ let thisBin = bin[type][field]
22
+ if (thisBin === undefined) {
23
+ thisBin = bin[type][field] = {
24
+ total: 0,
25
+ '-1': 0,
26
+ '0': 0,
27
+ '1': 0,
28
+ }
29
+ }
30
+ thisBin.total++
31
+ thisBin[strand]++
32
+ }
33
+
34
+ export default async function generateCoverageBins(
35
+ features: Feature[],
36
+ region: Region,
37
+ opts: { bpPerPx?: number; colorBy?: { type: string; tag?: string } },
38
+ fetchSequence: (arg: Region) => Promise<string>,
39
+ ) {
40
+ const { colorBy } = opts
41
+ const binMax = Math.ceil(region.end - region.start)
42
+
43
+ const skipmap = {} as {
44
+ [key: string]: {
45
+ score: number
46
+ feature: unknown
47
+ start: number
48
+ end: number
49
+ strand: number
50
+ xs: string
51
+ }
52
+ }
53
+
54
+ // bins contain:
55
+ // - cov feature if they contribute to coverage
56
+ // - noncov are insertions/clip features that don't contribute to coverage
57
+ // - delskips deletions or introns that don't contribute to coverage
58
+ type BinType = { total: number; strands: { [key: string]: number } }
59
+
60
+ const regionSeq =
61
+ features.length && shouldFetchReferenceSequence(opts.colorBy?.type)
62
+ ? await fetchSequence(region)
63
+ : undefined
64
+
65
+ const bins = [] as {
66
+ refbase?: string
67
+ total: number
68
+ all: number
69
+ ref: number
70
+ '-1': 0
71
+ '0': 0
72
+ '1': 0
73
+ lowqual: BinType
74
+ cov: BinType
75
+ delskips: BinType
76
+ noncov: BinType
77
+ }[]
78
+
79
+ for (let i = 0; i < features.length; i++) {
80
+ const feature = features[i]
81
+ const fstart = feature.get('start')
82
+ const fend = feature.get('end')
83
+ const fstrand = feature.get('strand') as -1 | 0 | 1
84
+
85
+ for (let j = fstart; j < fend + 1; j++) {
86
+ const i = j - region.start
87
+ if (i >= 0 && i < binMax) {
88
+ if (bins[i] === undefined) {
89
+ bins[i] = {
90
+ total: 0,
91
+ all: 0,
92
+ ref: 0,
93
+ '-1': 0,
94
+ '0': 0,
95
+ '1': 0,
96
+ lowqual: {} as BinType,
97
+ cov: {} as BinType,
98
+ delskips: {} as BinType,
99
+ noncov: {} as BinType,
100
+ }
101
+ }
102
+ if (j !== fend) {
103
+ bins[i].total++
104
+ bins[i].all++
105
+ bins[i].ref++
106
+ bins[i][fstrand]++
107
+ }
108
+ }
109
+ }
110
+
111
+ if (colorBy?.type === 'modifications') {
112
+ const seq = feature.get('seq') as string
113
+ const mm = (getTagAlt(feature, 'MM', 'Mm') as string) || ''
114
+ const ops = parseCigar(feature.get('CIGAR'))
115
+ const fend = feature.get('end')
116
+
117
+ getModificationPositions(mm, seq, fstrand).forEach(
118
+ ({ type, positions }) => {
119
+ const mod = `mod_${type}`
120
+ for (const pos of getNextRefPos(ops, positions)) {
121
+ const epos = pos + fstart - region.start
122
+ if (epos >= 0 && epos < bins.length && pos + fstart < fend) {
123
+ const bin = bins[epos]
124
+ if (bin) {
125
+ inc(bin, fstrand, 'cov', mod)
126
+ } else {
127
+ console.warn(
128
+ 'Undefined position in modifications snpcoverage encountered',
129
+ )
130
+ }
131
+ }
132
+ }
133
+ },
134
+ )
135
+ }
136
+
137
+ // methylation based coloring takes into account both reference
138
+ // sequence CpG detection and reads
139
+ else if (colorBy?.type === 'methylation') {
140
+ if (!regionSeq) {
141
+ throw new Error(
142
+ 'no region sequence detected, need sequenceAdapter configuration',
143
+ )
144
+ }
145
+ const seq = feature.get('seq')
146
+ const mm = getTagAlt(feature, 'MM', 'Mm') || ''
147
+ const methBins = new Array(region.end - region.start).fill(0)
148
+ const ops = parseCigar(feature.get('CIGAR'))
149
+
150
+ getModificationPositions(mm, seq, fstrand).forEach(
151
+ ({ type, positions }) => {
152
+ // we are processing methylation
153
+ if (type === 'm') {
154
+ for (const pos of getNextRefPos(ops, positions)) {
155
+ const epos = pos + fstart - region.start
156
+ if (epos >= 0 && epos < methBins.length) {
157
+ methBins[epos] = 1
158
+ }
159
+ }
160
+ }
161
+ },
162
+ )
163
+
164
+ for (let j = fstart; j < fend; j++) {
165
+ const i = j - region.start
166
+ if (i >= 0 && i < bins.length - 1) {
167
+ const l1 = regionSeq[i].toLowerCase()
168
+ const l2 = regionSeq[i + 1].toLowerCase()
169
+ const bin = bins[i]
170
+ const bin1 = bins[i + 1]
171
+
172
+ // color
173
+ if (l1 === 'c' && l2 === 'g') {
174
+ if (methBins[i] || methBins[i + 1]) {
175
+ inc(bin, fstrand, 'cov', 'meth')
176
+ inc(bin1, fstrand, 'cov', 'meth')
177
+ bins[i].ref--
178
+ bins[i][fstrand]--
179
+ bins[i + 1].ref--
180
+ bins[i + 1][fstrand]--
181
+ } else {
182
+ inc(bin, fstrand, 'cov', 'unmeth')
183
+ inc(bin1, fstrand, 'cov', 'unmeth')
184
+ bins[i].ref--
185
+ bins[i][fstrand]--
186
+ bins[i + 1].ref--
187
+ bins[i + 1][fstrand]--
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ // normal SNP based coloring
195
+ const mismatches = (feature.get('mismatches') as Mismatch[]) || []
196
+ const colorSNPs =
197
+ colorBy?.type !== 'modifications' && colorBy?.type !== 'methylation'
198
+
199
+ for (let i = 0; i < mismatches.length; i++) {
200
+ const mismatch = mismatches[i]
201
+ const mstart = fstart + mismatch.start
202
+ const mlen = mismatchLen(mismatch)
203
+ const mend = mstart + mlen
204
+ for (let j = mstart; j < mstart + mlen; j++) {
205
+ const epos = j - region.start
206
+ if (epos >= 0 && epos < bins.length) {
207
+ const bin = bins[epos]
208
+ const { base, type } = mismatch
209
+ const interbase = isInterbase(type)
210
+ if (!interbase) {
211
+ bin.ref--
212
+ bin[fstrand]--
213
+ } else {
214
+ inc(bin, fstrand, 'noncov', type)
215
+ }
216
+
217
+ if (type === 'deletion' || type === 'skip') {
218
+ inc(bin, fstrand, 'delskips', type)
219
+ bin.total--
220
+ } else if (!interbase && colorSNPs) {
221
+ inc(bin, fstrand, 'cov', base)
222
+ bin.refbase = mismatch.altbase
223
+ }
224
+ }
225
+ }
226
+
227
+ if (mismatch.type === 'skip') {
228
+ const hash = `${mstart}_${mend}_${fstrand}`
229
+ if (skipmap[hash] === undefined) {
230
+ skipmap[hash] = {
231
+ feature: feature,
232
+ start: mstart,
233
+ end: mend,
234
+ strand: fstrand,
235
+ xs: getTag(feature, 'XS') || getTag(feature, 'TS'),
236
+ score: 0,
237
+ }
238
+ }
239
+ skipmap[hash].score++
240
+ }
241
+ }
242
+ }
243
+
244
+ return { bins, skipmap }
245
+ }
@@ -7,11 +7,9 @@ export default function (pluginManager: PluginManager) {
7
7
  pluginManager.addAdapterType(() => {
8
8
  return new AdapterType({
9
9
  name: 'SNPCoverageAdapter',
10
+ displayName: 'SNPCoverage adapter',
10
11
  adapterMetadata: {
11
- category: null,
12
- displayName: null,
13
12
  hiddenFromGUI: true,
14
- description: null,
15
13
  },
16
14
  getAdapterClass: () =>
17
15
  import('./SNPCoverageAdapter').then(r => r.default),
package/src/index.ts CHANGED
@@ -1,9 +1,5 @@
1
- import { FileLocation } from '@jbrowse/core/util/types'
2
1
  import Plugin from '@jbrowse/core/Plugin'
3
2
  import PluginManager from '@jbrowse/core/PluginManager'
4
- import * as MismatchParser from './BamAdapter/MismatchParser'
5
- import { LinearPileupDisplayModel } from './LinearPileupDisplay/model'
6
-
7
3
  import BamAdapterF from './CramAdapter'
8
4
  import CramAdapterF from './BamAdapter'
9
5
  import HtsgetBamAdapterF from './HtsgetBamAdapter'
@@ -12,24 +8,18 @@ import SNPCoverageRendererF from './SNPCoverageRenderer'
12
8
  import PileupRendererF from './PileupRenderer'
13
9
  import LinearAlignmentsDisplayF from './LinearAlignmentsDisplay'
14
10
  import LinearSNPCoverageDisplayF from './LinearSNPCoverageDisplay'
11
+ import LinearReadArcsDisplayF from './LinearReadArcsDisplay'
12
+ import LinearReadCloudDisplayF from './LinearReadCloudDisplay'
13
+ import AlignmentsTrackF from './AlignmentsTrack'
14
+ import AlignmentsFeatureWidgetF from './AlignmentsFeatureDetail'
15
+ import PileupRPCMethodsF from './PileupRPC'
16
+ import GuessAlignmentsTypesF from './GuessAlignmentsTypes'
15
17
  import LinearPileupDisplayF, {
16
18
  linearPileupDisplayStateModelFactory,
17
19
  linearPileupDisplayConfigSchemaFactory,
18
20
  } from './LinearPileupDisplay'
19
- import AlignmentsTrackF from './AlignmentsTrack'
20
- import AlignmentsFeatureWidgetF from './AlignmentsFeatureDetail'
21
-
22
- import {
23
- PileupGetGlobalValueForTag,
24
- PileupGetVisibleModifications,
25
- } from './PileupRPC/rpcMethods'
26
- import {
27
- makeIndex,
28
- makeIndexType,
29
- getFileName,
30
- AdapterGuesser,
31
- TrackTypeGuesser,
32
- } from '@jbrowse/core/util/tracks'
21
+ import { LinearPileupDisplayModel } from './LinearPileupDisplay/model'
22
+ import * as MismatchParser from './MismatchParser'
33
23
 
34
24
  export default class AlignmentsPlugin extends Plugin {
35
25
  name = 'AlignmentsPlugin'
@@ -44,85 +34,14 @@ export default class AlignmentsPlugin extends Plugin {
44
34
  SNPCoverageAdapterF,
45
35
  HtsgetBamAdapterF,
46
36
  PileupRendererF,
37
+ PileupRPCMethodsF,
47
38
  SNPCoverageRendererF,
39
+ LinearReadArcsDisplayF,
40
+ LinearReadCloudDisplayF,
48
41
  LinearAlignmentsDisplayF,
49
42
  AlignmentsFeatureWidgetF,
43
+ GuessAlignmentsTypesF,
50
44
  ].map(f => f(pluginManager))
51
-
52
- pluginManager.addToExtensionPoint(
53
- 'Core-guessAdapterForLocation',
54
- (adapterGuesser: AdapterGuesser) => {
55
- return (
56
- file: FileLocation,
57
- index?: FileLocation,
58
- adapterHint?: string,
59
- ) => {
60
- const regexGuess = /\.cram$/i
61
- const adapterName = 'CramAdapter'
62
- const fileName = getFileName(file)
63
- const obj = {
64
- type: adapterName,
65
- cramLocation: file,
66
- craiLocation: index || makeIndex(file, '.crai'),
67
- }
68
- if (regexGuess.test(fileName) && !adapterHint) {
69
- return obj
70
- } else if (adapterHint === adapterName) {
71
- return obj
72
- }
73
- return adapterGuesser(file, index, adapterHint)
74
- }
75
- },
76
- )
77
-
78
- pluginManager.addToExtensionPoint(
79
- 'Core-guessAdapterForLocation',
80
- (adapterGuesser: AdapterGuesser) => {
81
- return (
82
- file: FileLocation,
83
- index?: FileLocation,
84
- adapterHint?: string,
85
- ) => {
86
- const regexGuess = /\.bam$/i
87
- const adapterName = 'BamAdapter'
88
- const fileName = getFileName(file)
89
- const indexName = index && getFileName(index)
90
-
91
- const obj = {
92
- type: adapterName,
93
- bamLocation: file,
94
- index: {
95
- location: index || makeIndex(file, '.bai'),
96
- indexType: makeIndexType(indexName, 'CSI', 'BAI'),
97
- },
98
- }
99
- if (regexGuess.test(fileName) && !adapterHint) {
100
- return obj
101
- } else if (adapterHint === adapterName) {
102
- return obj
103
- }
104
- return adapterGuesser(file, index, adapterHint)
105
- }
106
- },
107
- )
108
- pluginManager.addToExtensionPoint(
109
- 'Core-guessTrackTypeForLocation',
110
- (trackTypeGuesser: TrackTypeGuesser) => {
111
- return (adapterName: string) => {
112
- if (adapterName === 'BamAdapter' || adapterName === 'CramAdapter') {
113
- return 'AlignmentsTrack'
114
- }
115
- return trackTypeGuesser(adapterName)
116
- }
117
- },
118
- )
119
-
120
- pluginManager.addRpcMethod(
121
- () => new PileupGetGlobalValueForTag(pluginManager),
122
- )
123
- pluginManager.addRpcMethod(
124
- () => new PileupGetVisibleModifications(pluginManager),
125
- )
126
45
  }
127
46
  }
128
47