@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.
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/dist/AlignmentsTrack/index.js +1 -0
- package/dist/AlignmentsTrack/index.js.map +1 -1
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +11 -18
- package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/dist/BamAdapter/index.js +1 -0
- package/dist/BamAdapter/index.js.map +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +6 -8
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/dist/CramAdapter/CramTestAdapters.js +2 -1
- package/dist/CramAdapter/CramTestAdapters.js.map +1 -1
- package/dist/CramAdapter/index.js +1 -0
- package/dist/CramAdapter/index.js.map +1 -1
- package/dist/GuessAlignmentsTypes/index.d.ts +3 -0
- package/dist/GuessAlignmentsTypes/index.js +56 -0
- package/dist/GuessAlignmentsTypes/index.js.map +1 -0
- package/dist/HtsgetBamAdapter/index.js +11 -11
- package/dist/HtsgetBamAdapter/index.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/index.js +1 -0
- package/dist/LinearAlignmentsDisplay/index.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +2 -3
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +22 -36
- package/dist/LinearAlignmentsDisplay/models/model.js +166 -151
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/dist/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
- package/dist/LinearPileupDisplay/components/ColorByModifications.js +7 -22
- package/dist/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
- package/dist/LinearPileupDisplay/components/ColorByTag.js +2 -22
- package/dist/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +3 -22
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js +2 -18
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearPileupDisplay/components/SortByTag.js +2 -23
- package/dist/LinearPileupDisplay/components/SortByTag.js.map +1 -1
- package/dist/LinearPileupDisplay/configSchema.d.ts +0 -3
- package/dist/LinearPileupDisplay/configSchema.js.map +1 -1
- package/dist/LinearPileupDisplay/index.js +2 -0
- package/dist/LinearPileupDisplay/index.js.map +1 -1
- package/dist/LinearPileupDisplay/model.d.ts +19 -16
- package/dist/LinearPileupDisplay/model.js +28 -13
- package/dist/LinearPileupDisplay/model.js.map +1 -1
- package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +49 -0
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
- package/dist/LinearReadArcsDisplay/configSchema.d.ts +6 -0
- package/dist/LinearReadArcsDisplay/configSchema.js +52 -0
- package/dist/LinearReadArcsDisplay/configSchema.js.map +1 -0
- package/dist/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
- package/dist/LinearReadArcsDisplay/drawFeats.js +162 -0
- package/dist/LinearReadArcsDisplay/drawFeats.js.map +1 -0
- package/dist/LinearReadArcsDisplay/index.d.ts +2 -0
- package/dist/LinearReadArcsDisplay/index.js +27 -0
- package/dist/LinearReadArcsDisplay/index.js.map +1 -0
- package/dist/LinearReadArcsDisplay/model.d.ts +342 -0
- package/dist/LinearReadArcsDisplay/model.js +327 -0
- package/dist/LinearReadArcsDisplay/model.js.map +1 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +49 -0
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +6 -0
- package/dist/LinearReadCloudDisplay/configSchema.js +51 -0
- package/dist/LinearReadCloudDisplay/configSchema.js.map +1 -0
- package/dist/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
- package/dist/LinearReadCloudDisplay/drawFeats.js +159 -0
- package/dist/LinearReadCloudDisplay/drawFeats.js.map +1 -0
- package/dist/LinearReadCloudDisplay/index.d.ts +2 -0
- package/dist/LinearReadCloudDisplay/index.js +27 -0
- package/dist/LinearReadCloudDisplay/index.js.map +1 -0
- package/dist/LinearReadCloudDisplay/model.d.ts +320 -0
- package/dist/LinearReadCloudDisplay/model.js +252 -0
- package/dist/LinearReadCloudDisplay/model.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js.map +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
- package/dist/LinearSNPCoverageDisplay/models/model.js +9 -12
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/dist/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
- package/dist/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +116 -3
- package/dist/MismatchParser/index.js.map +1 -0
- package/dist/PileupRPC/base.d.ts +8 -0
- package/dist/PileupRPC/base.js +22 -0
- package/dist/PileupRPC/base.js.map +1 -0
- package/dist/PileupRPC/index.d.ts +3 -0
- package/dist/PileupRPC/index.js +9 -0
- package/dist/PileupRPC/index.js.map +1 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js +29 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.js +61 -0
- package/dist/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.js +32 -0
- package/dist/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
- package/dist/PileupRPC/rpcMethods.d.ts +4 -34
- package/dist/PileupRPC/rpcMethods.js +7 -77
- package/dist/PileupRPC/rpcMethods.js.map +1 -1
- package/dist/PileupRPC/util.d.ts +8 -0
- package/dist/PileupRPC/util.js +20 -0
- package/dist/PileupRPC/util.js.map +1 -0
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +5 -5
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
- package/dist/PileupRenderer/configSchema.js +1 -1
- package/dist/PileupRenderer/configSchema.js.map +1 -1
- package/dist/PileupRenderer/index.js +1 -0
- package/dist/PileupRenderer/index.js.map +1 -1
- package/dist/PileupRenderer/sortUtil.d.ts +1 -1
- package/dist/PileupRenderer/sortUtil.js +2 -2
- package/dist/PileupRenderer/sortUtil.js.map +1 -1
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +3 -182
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
- package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +185 -0
- package/dist/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
- package/dist/SNPCoverageAdapter/index.js +1 -3
- package/dist/SNPCoverageAdapter/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -58
- package/dist/index.js.map +1 -1
- package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
- package/dist/{LinearPileupDisplay/components → shared}/FilterByTag.js +5 -24
- package/dist/shared/FilterByTag.js.map +1 -0
- package/dist/shared/color.d.ts +17 -0
- package/dist/shared/color.js +43 -0
- package/dist/shared/color.js.map +1 -0
- package/dist/shared/fetchChains.d.ts +27 -0
- package/dist/shared/fetchChains.js +30 -0
- package/dist/shared/fetchChains.js.map +1 -0
- package/dist/shared/index.d.ts +36 -0
- package/dist/{shared.js → shared/index.js} +12 -2
- package/dist/shared/index.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -1
- package/esm/AlignmentsTrack/index.js +1 -0
- package/esm/AlignmentsTrack/index.js.map +1 -1
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -4
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +11 -18
- package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -1
- package/esm/BamAdapter/index.js +1 -0
- package/esm/BamAdapter/index.js.map +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +5 -7
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +6 -8
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/esm/CramAdapter/CramTestAdapters.js +2 -1
- package/esm/CramAdapter/CramTestAdapters.js.map +1 -1
- package/esm/CramAdapter/index.js +1 -0
- package/esm/CramAdapter/index.js.map +1 -1
- package/esm/GuessAlignmentsTypes/index.d.ts +3 -0
- package/esm/GuessAlignmentsTypes/index.js +54 -0
- package/esm/GuessAlignmentsTypes/index.js.map +1 -0
- package/esm/HtsgetBamAdapter/index.js +11 -11
- package/esm/HtsgetBamAdapter/index.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +10 -13
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/index.js +1 -0
- package/esm/LinearAlignmentsDisplay/index.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +6 -3
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +2 -4
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +22 -36
- package/esm/LinearAlignmentsDisplay/models/model.js +167 -152
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +3 -1
- package/esm/LinearPileupDisplay/components/ColorByModifications.js +8 -23
- package/esm/LinearPileupDisplay/components/ColorByModifications.js.map +1 -1
- package/esm/LinearPileupDisplay/components/ColorByTag.js +3 -20
- package/esm/LinearPileupDisplay/components/ColorByTag.js.map +1 -1
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +2 -2
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +4 -20
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -1
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js +3 -16
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -1
- package/esm/LinearPileupDisplay/components/SortByTag.js +3 -21
- package/esm/LinearPileupDisplay/components/SortByTag.js.map +1 -1
- package/esm/LinearPileupDisplay/configSchema.d.ts +0 -3
- package/esm/LinearPileupDisplay/configSchema.js.map +1 -1
- package/esm/LinearPileupDisplay/index.js +2 -0
- package/esm/LinearPileupDisplay/index.js.map +1 -1
- package/esm/LinearPileupDisplay/model.d.ts +19 -16
- package/esm/LinearPileupDisplay/model.js +29 -14
- package/esm/LinearPileupDisplay/model.js.map +1 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +6 -0
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +44 -0
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js.map +1 -0
- package/esm/LinearReadArcsDisplay/configSchema.d.ts +6 -0
- package/esm/LinearReadArcsDisplay/configSchema.js +50 -0
- package/esm/LinearReadArcsDisplay/configSchema.js.map +1 -0
- package/esm/LinearReadArcsDisplay/drawFeats.d.ts +14 -0
- package/esm/LinearReadArcsDisplay/drawFeats.js +157 -0
- package/esm/LinearReadArcsDisplay/drawFeats.js.map +1 -0
- package/esm/LinearReadArcsDisplay/index.d.ts +2 -0
- package/esm/LinearReadArcsDisplay/index.js +21 -0
- package/esm/LinearReadArcsDisplay/index.js.map +1 -0
- package/esm/LinearReadArcsDisplay/model.d.ts +342 -0
- package/esm/LinearReadArcsDisplay/model.js +299 -0
- package/esm/LinearReadArcsDisplay/model.js.map +1 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +6 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +44 -0
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js.map +1 -0
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +6 -0
- package/esm/LinearReadCloudDisplay/configSchema.js +49 -0
- package/esm/LinearReadCloudDisplay/configSchema.js.map +1 -0
- package/esm/LinearReadCloudDisplay/drawFeats.d.ts +10 -0
- package/esm/LinearReadCloudDisplay/drawFeats.js +156 -0
- package/esm/LinearReadCloudDisplay/drawFeats.js.map +1 -0
- package/esm/LinearReadCloudDisplay/index.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/index.js +21 -0
- package/esm/LinearReadCloudDisplay/index.js.map +1 -0
- package/esm/LinearReadCloudDisplay/model.d.ts +320 -0
- package/esm/LinearReadCloudDisplay/model.js +224 -0
- package/esm/LinearReadCloudDisplay/model.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/index.js +1 -0
- package/esm/LinearSNPCoverageDisplay/index.js.map +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +22 -19
- package/esm/LinearSNPCoverageDisplay/models/model.js +11 -14
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/esm/{BamAdapter/MismatchParser.d.ts → MismatchParser/index.d.ts} +23 -0
- package/esm/{BamAdapter/MismatchParser.js → MismatchParser/index.js} +107 -2
- package/esm/MismatchParser/index.js.map +1 -0
- package/esm/PileupRPC/base.d.ts +8 -0
- package/esm/PileupRPC/base.js +16 -0
- package/esm/PileupRPC/base.js.map +1 -0
- package/esm/PileupRPC/index.d.ts +3 -0
- package/esm/PileupRPC/index.js +7 -0
- package/esm/PileupRPC/index.js.map +1 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +14 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js +23 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js.map +1 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +25 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.js +55 -0
- package/esm/PileupRPC/methods/GetReducedFeatures.js.map +1 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +14 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.js +26 -0
- package/esm/PileupRPC/methods/GetVisibleModifications.js.map +1 -0
- package/esm/PileupRPC/rpcMethods.d.ts +4 -34
- package/esm/PileupRPC/rpcMethods.js +4 -74
- package/esm/PileupRPC/rpcMethods.js.map +1 -1
- package/esm/PileupRPC/util.d.ts +8 -0
- package/esm/PileupRPC/util.js +15 -0
- package/esm/PileupRPC/util.js.map +1 -0
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +5 -5
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
- package/esm/PileupRenderer/configSchema.js +1 -1
- package/esm/PileupRenderer/configSchema.js.map +1 -1
- package/esm/PileupRenderer/index.js +1 -0
- package/esm/PileupRenderer/index.js.map +1 -1
- package/esm/PileupRenderer/sortUtil.d.ts +1 -1
- package/esm/PileupRenderer/sortUtil.js +1 -1
- package/esm/PileupRenderer/sortUtil.js.map +1 -1
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +0 -51
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +4 -183
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -1
- package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +53 -0
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +182 -0
- package/esm/SNPCoverageAdapter/generateCoverageBins.js.map +1 -0
- package/esm/SNPCoverageAdapter/index.js +1 -3
- package/esm/SNPCoverageAdapter/index.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +10 -56
- package/esm/index.js.map +1 -1
- package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.d.ts +0 -0
- package/esm/{LinearPileupDisplay/components → shared}/FilterByTag.js +6 -22
- package/esm/shared/FilterByTag.js.map +1 -0
- package/esm/shared/color.d.ts +17 -0
- package/esm/shared/color.js +37 -0
- package/esm/shared/color.js.map +1 -0
- package/esm/shared/fetchChains.d.ts +27 -0
- package/esm/shared/fetchChains.js +26 -0
- package/esm/shared/fetchChains.js.map +1 -0
- package/esm/shared/index.d.ts +36 -0
- package/esm/{shared.js → shared/index.js} +11 -1
- package/esm/shared/index.js.map +1 -0
- package/package.json +5 -5
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +1 -1
- package/src/AlignmentsTrack/index.ts +1 -0
- package/src/BamAdapter/BamSlightlyLazyFeature.ts +13 -19
- package/src/BamAdapter/index.ts +1 -0
- package/src/CramAdapter/CramSlightlyLazyFeature.ts +13 -15
- package/src/CramAdapter/CramTestAdapters.ts +1 -0
- package/src/CramAdapter/__snapshots__/CramAdapter.test.ts.snap +0 -10
- package/src/CramAdapter/index.ts +1 -0
- package/src/GuessAlignmentsTypes/index.ts +79 -0
- package/src/HtsgetBamAdapter/index.ts +11 -15
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +21 -29
- package/src/LinearAlignmentsDisplay/index.ts +1 -0
- package/src/LinearAlignmentsDisplay/models/configSchema.ts +2 -6
- package/src/LinearAlignmentsDisplay/models/model.tsx +238 -199
- package/src/LinearPileupDisplay/components/ColorByModifications.tsx +5 -34
- package/src/LinearPileupDisplay/components/ColorByTag.tsx +2 -29
- package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +5 -27
- package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +2 -24
- package/src/LinearPileupDisplay/components/SortByTag.tsx +2 -31
- package/src/LinearPileupDisplay/configSchema.ts +1 -3
- package/src/LinearPileupDisplay/index.ts +2 -0
- package/src/LinearPileupDisplay/model.ts +36 -23
- package/src/LinearReadArcsDisplay/components/ReactComponent.tsx +86 -0
- package/src/LinearReadArcsDisplay/configSchema.ts +58 -0
- package/src/LinearReadArcsDisplay/declare.d.ts +1 -0
- package/src/LinearReadArcsDisplay/drawFeats.ts +199 -0
- package/src/LinearReadArcsDisplay/index.ts +23 -0
- package/src/LinearReadArcsDisplay/model.tsx +370 -0
- package/src/LinearReadCloudDisplay/components/ReactComponent.tsx +86 -0
- package/src/LinearReadCloudDisplay/configSchema.ts +57 -0
- package/src/LinearReadCloudDisplay/drawFeats.ts +201 -0
- package/src/LinearReadCloudDisplay/index.ts +23 -0
- package/src/LinearReadCloudDisplay/model.tsx +289 -0
- package/src/LinearSNPCoverageDisplay/index.ts +1 -0
- package/src/LinearSNPCoverageDisplay/models/model.ts +15 -21
- package/src/{BamAdapter/MismatchParser.test.ts → MismatchParser/index.test.ts} +1 -1
- package/src/{BamAdapter/MismatchParser.ts → MismatchParser/index.ts} +129 -2
- package/src/PileupRPC/base.ts +24 -0
- package/src/PileupRPC/index.ts +12 -0
- package/src/PileupRPC/methods/GetGlobalValueForTag.ts +41 -0
- package/src/PileupRPC/methods/GetReducedFeatures.ts +76 -0
- package/src/PileupRPC/methods/GetVisibleModifications.ts +45 -0
- package/src/PileupRPC/rpcMethods.ts +8 -113
- package/src/PileupRPC/util.ts +19 -0
- package/src/PileupRenderer/PileupRenderer.ts +5 -8
- package/src/PileupRenderer/configSchema.ts +1 -1
- package/src/PileupRenderer/index.ts +1 -0
- package/src/PileupRenderer/sortUtil.ts +2 -3
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -249
- package/src/SNPCoverageAdapter/generateCoverageBins.ts +245 -0
- package/src/SNPCoverageAdapter/index.ts +1 -3
- package/src/index.ts +12 -93
- package/src/{LinearPileupDisplay/components → shared}/FilterByTag.tsx +5 -31
- package/src/shared/color.ts +47 -0
- package/src/shared/fetchChains.ts +63 -0
- package/src/{shared.ts → shared/index.ts} +17 -4
- package/dist/BamAdapter/MismatchParser.js.map +0 -1
- package/dist/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
- package/dist/shared.d.ts +0 -25
- package/dist/shared.js.map +0 -1
- package/esm/BamAdapter/MismatchParser.js.map +0 -1
- package/esm/LinearPileupDisplay/components/FilterByTag.js.map +0 -1
- package/esm/shared.d.ts +0 -25
- 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
|
-
|
|
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 =
|
|
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
|
|
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
|
|
20
|
-
import
|
|
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
|
|