@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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { revcom } from '@jbrowse/core/util'
|
|
1
|
+
import { revcom, Feature } from '@jbrowse/core/util'
|
|
2
|
+
|
|
2
3
|
export interface Mismatch {
|
|
3
4
|
qual?: number
|
|
4
5
|
start: number
|
|
@@ -11,9 +12,14 @@ export interface Mismatch {
|
|
|
11
12
|
}
|
|
12
13
|
const mdRegex = new RegExp(/(\d+|\^[a-z]+|[a-z])/gi)
|
|
13
14
|
const modificationRegex = new RegExp(/([A-Z])([-+])([^,.?]+)([.?])?/)
|
|
15
|
+
const cigarRegex = new RegExp(/([MIDNSHPX=])/)
|
|
16
|
+
const startClip = new RegExp(/(\d+)[SH]$/)
|
|
17
|
+
const endClip = new RegExp(/^(\d+)([SH])/)
|
|
18
|
+
|
|
14
19
|
export function parseCigar(cigar = '') {
|
|
15
|
-
return cigar.split(
|
|
20
|
+
return cigar.split(cigarRegex).slice(0, -1)
|
|
16
21
|
}
|
|
22
|
+
|
|
17
23
|
export function cigarToMismatches(
|
|
18
24
|
ops: string[],
|
|
19
25
|
seq?: string,
|
|
@@ -339,3 +345,124 @@ export function getModificationTypes(mm: string) {
|
|
|
339
345
|
})
|
|
340
346
|
.flat()
|
|
341
347
|
}
|
|
348
|
+
|
|
349
|
+
export function getOrientedCigar(flip: boolean, cigar: string[]) {
|
|
350
|
+
if (flip) {
|
|
351
|
+
const ret = []
|
|
352
|
+
for (let i = 0; i < cigar.length; i += 2) {
|
|
353
|
+
const len = cigar[i]
|
|
354
|
+
let op = cigar[i + 1]
|
|
355
|
+
if (op === 'D') {
|
|
356
|
+
op = 'I'
|
|
357
|
+
} else if (op === 'I') {
|
|
358
|
+
op = 'D'
|
|
359
|
+
}
|
|
360
|
+
ret.push(len)
|
|
361
|
+
ret.push(op)
|
|
362
|
+
}
|
|
363
|
+
return ret
|
|
364
|
+
} else {
|
|
365
|
+
return cigar
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function getOrientedMismatches(flip: boolean, cigar: string) {
|
|
370
|
+
const p = parseCigar(cigar)
|
|
371
|
+
return cigarToMismatches(flip ? getOrientedCigar(flip, p) : p)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export function getLengthOnRef(cigar: string) {
|
|
375
|
+
const cigarOps = parseCigar(cigar)
|
|
376
|
+
let lengthOnRef = 0
|
|
377
|
+
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
378
|
+
const len = +cigarOps[i]
|
|
379
|
+
const op = cigarOps[i + 1]
|
|
380
|
+
if (op !== 'H' && op !== 'S' && op !== 'I') {
|
|
381
|
+
lengthOnRef += len
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return lengthOnRef
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export function getLength(cigar: string) {
|
|
388
|
+
const cigarOps = parseCigar(cigar)
|
|
389
|
+
let length = 0
|
|
390
|
+
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
391
|
+
const len = +cigarOps[i]
|
|
392
|
+
const op = cigarOps[i + 1]
|
|
393
|
+
if (op !== 'D' && op !== 'N') {
|
|
394
|
+
length += len
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return length
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function getLengthSansClipping(cigar: string) {
|
|
401
|
+
const cigarOps = parseCigar(cigar)
|
|
402
|
+
let length = 0
|
|
403
|
+
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
404
|
+
const len = +cigarOps[i]
|
|
405
|
+
const op = cigarOps[i + 1]
|
|
406
|
+
if (op !== 'H' && op !== 'S' && op !== 'D' && op !== 'N') {
|
|
407
|
+
length += len
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return length
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export function getClip(cigar: string, strand: number) {
|
|
414
|
+
return strand === -1
|
|
415
|
+
? +(cigar.match(startClip) || [])[1] || 0
|
|
416
|
+
: +(cigar.match(endClip) || [])[1] || 0
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export function getTag(f: Feature, tag: string) {
|
|
420
|
+
const tags = f.get('tags')
|
|
421
|
+
return tags ? tags[tag] : f.get(tag)
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// produces a list of "feature-like" object from parsing supplementary
|
|
425
|
+
// alignments in the SA tag
|
|
426
|
+
//
|
|
427
|
+
// @param normalize - used specifically in the linear-read-vs-ref context, it
|
|
428
|
+
// flips features around relative to the original feature. other contexts of
|
|
429
|
+
// usage can keep this false
|
|
430
|
+
export function featurizeSA(
|
|
431
|
+
SA: string | undefined,
|
|
432
|
+
id: string,
|
|
433
|
+
strand: number,
|
|
434
|
+
readName: string,
|
|
435
|
+
normalize?: boolean,
|
|
436
|
+
) {
|
|
437
|
+
return (
|
|
438
|
+
SA?.split(';')
|
|
439
|
+
.filter(aln => !!aln)
|
|
440
|
+
.map((aln, index) => {
|
|
441
|
+
const [saRef, saStart, saStrand, saCigar] = aln.split(',')
|
|
442
|
+
const saLengthOnRef = getLengthOnRef(saCigar)
|
|
443
|
+
const saLength = getLength(saCigar)
|
|
444
|
+
const saLengthSansClipping = getLengthSansClipping(saCigar)
|
|
445
|
+
const saStrandNormalized = saStrand === '-' ? -1 : 1
|
|
446
|
+
const saClipPos = getClip(
|
|
447
|
+
saCigar,
|
|
448
|
+
(normalize ? strand : 1) * saStrandNormalized,
|
|
449
|
+
)
|
|
450
|
+
const saRealStart = +saStart - 1
|
|
451
|
+
return {
|
|
452
|
+
refName: saRef,
|
|
453
|
+
start: saRealStart,
|
|
454
|
+
end: saRealStart + saLengthOnRef,
|
|
455
|
+
seqLength: saLength,
|
|
456
|
+
clipPos: saClipPos,
|
|
457
|
+
CIGAR: saCigar,
|
|
458
|
+
strand: (normalize ? strand : 1) * saStrandNormalized,
|
|
459
|
+
uniqueId: `${id}_SA${index}`,
|
|
460
|
+
mate: {
|
|
461
|
+
start: saClipPos,
|
|
462
|
+
end: saClipPos + saLengthSansClipping,
|
|
463
|
+
refName: readName,
|
|
464
|
+
},
|
|
465
|
+
}
|
|
466
|
+
}) || []
|
|
467
|
+
)
|
|
468
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType'
|
|
2
|
+
import { renameRegionsIfNeeded } from '@jbrowse/core/util'
|
|
3
|
+
import { RenderArgs } from '@jbrowse/core/rpc/coreRpcMethods'
|
|
4
|
+
|
|
5
|
+
// specialized get features to return limited data about alignments
|
|
6
|
+
export default abstract class PileupBaseRPC extends RpcMethodType {
|
|
7
|
+
async serializeArguments(
|
|
8
|
+
args: RenderArgs & {
|
|
9
|
+
signal?: AbortSignal
|
|
10
|
+
statusCallback?: (arg: string) => void
|
|
11
|
+
},
|
|
12
|
+
rpcDriver: string,
|
|
13
|
+
) {
|
|
14
|
+
const { rootModel } = this.pluginManager
|
|
15
|
+
const assemblyManager = rootModel?.session?.assemblyManager
|
|
16
|
+
if (!assemblyManager) {
|
|
17
|
+
throw new Error('no assembly manager available')
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const renamedArgs = await renameRegionsIfNeeded(assemblyManager, args)
|
|
21
|
+
|
|
22
|
+
return super.serializeArguments(renamedArgs, rpcDriver)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import {
|
|
3
|
+
PileupGetGlobalValueForTag,
|
|
4
|
+
PileupGetVisibleModifications,
|
|
5
|
+
PileupGetReducedFeatures,
|
|
6
|
+
} from './rpcMethods'
|
|
7
|
+
|
|
8
|
+
export default (pm: PluginManager) => {
|
|
9
|
+
pm.addRpcMethod(() => new PileupGetGlobalValueForTag(pm))
|
|
10
|
+
pm.addRpcMethod(() => new PileupGetVisibleModifications(pm))
|
|
11
|
+
pm.addRpcMethod(() => new PileupGetReducedFeatures(pm))
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
2
|
+
import { Region } from '@jbrowse/core/util'
|
|
3
|
+
import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals'
|
|
4
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
+
import { toArray } from 'rxjs/operators'
|
|
6
|
+
import PileupBaseRPC from '../base'
|
|
7
|
+
import { getTag } from '../../util'
|
|
8
|
+
|
|
9
|
+
export default class PileupGetGlobalValueForTag extends PileupBaseRPC {
|
|
10
|
+
name = 'PileupGetGlobalValueForTag'
|
|
11
|
+
|
|
12
|
+
async execute(
|
|
13
|
+
args: {
|
|
14
|
+
adapterConfig: {}
|
|
15
|
+
signal?: RemoteAbortSignal
|
|
16
|
+
headers?: Record<string, string>
|
|
17
|
+
regions: Region[]
|
|
18
|
+
sessionId: string
|
|
19
|
+
tag: string
|
|
20
|
+
},
|
|
21
|
+
rpcDriver: string,
|
|
22
|
+
) {
|
|
23
|
+
const { adapterConfig, sessionId, regions, tag } =
|
|
24
|
+
await this.deserializeArguments(args, rpcDriver)
|
|
25
|
+
|
|
26
|
+
const dataAdapter = (
|
|
27
|
+
await getAdapter(this.pluginManager, sessionId, adapterConfig)
|
|
28
|
+
).dataAdapter as BaseFeatureDataAdapter
|
|
29
|
+
|
|
30
|
+
const features = dataAdapter.getFeaturesInMultipleRegions(regions)
|
|
31
|
+
const featuresArray = await features.pipe(toArray()).toPromise()
|
|
32
|
+
return [
|
|
33
|
+
...new Set(
|
|
34
|
+
featuresArray
|
|
35
|
+
.map(feature => getTag(feature, tag))
|
|
36
|
+
.filter(f => f !== undefined)
|
|
37
|
+
.map(f => `${f}`),
|
|
38
|
+
),
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
2
|
+
import { Region, dedupe } from '@jbrowse/core/util'
|
|
3
|
+
import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals'
|
|
4
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
+
import { toArray } from 'rxjs/operators'
|
|
6
|
+
|
|
7
|
+
// locals
|
|
8
|
+
import { filterForPairs, getInsertSizeStats } from '../util'
|
|
9
|
+
import { ReducedFeature } from '../../shared/fetchChains'
|
|
10
|
+
import PileupBaseRPC from '../base'
|
|
11
|
+
import { getTag } from '../../util'
|
|
12
|
+
|
|
13
|
+
// specialized get features to return limited data about alignments
|
|
14
|
+
export default class PileupGetReducedFeatures extends PileupBaseRPC {
|
|
15
|
+
name = 'PileupGetReducedFeatures'
|
|
16
|
+
|
|
17
|
+
async execute(
|
|
18
|
+
args: {
|
|
19
|
+
adapterConfig: {}
|
|
20
|
+
signal?: RemoteAbortSignal
|
|
21
|
+
headers?: Record<string, string>
|
|
22
|
+
regions: Region[]
|
|
23
|
+
sessionId: string
|
|
24
|
+
tag: string
|
|
25
|
+
},
|
|
26
|
+
rpcDriver: string,
|
|
27
|
+
) {
|
|
28
|
+
const des = await this.deserializeArguments(args, rpcDriver)
|
|
29
|
+
const { adapterConfig, sessionId, regions } = des
|
|
30
|
+
const dataAdapter = (
|
|
31
|
+
await getAdapter(this.pluginManager, sessionId, adapterConfig)
|
|
32
|
+
).dataAdapter as BaseFeatureDataAdapter
|
|
33
|
+
|
|
34
|
+
const featuresArray = await dataAdapter
|
|
35
|
+
.getFeaturesInMultipleRegions(regions, des)
|
|
36
|
+
.pipe(toArray())
|
|
37
|
+
.toPromise()
|
|
38
|
+
|
|
39
|
+
const reduced = dedupe(
|
|
40
|
+
featuresArray.map(f => ({
|
|
41
|
+
id: f.id(),
|
|
42
|
+
refName: f.get('refName'),
|
|
43
|
+
name: f.get('name'),
|
|
44
|
+
start: f.get('start'),
|
|
45
|
+
strand: f.get('strand'),
|
|
46
|
+
end: f.get('end'),
|
|
47
|
+
flags: f.get('flags'),
|
|
48
|
+
tlen: f.get('template_length'),
|
|
49
|
+
pair_orientation: f.get('pair_orientation'),
|
|
50
|
+
next_ref: f.get('next_ref'),
|
|
51
|
+
next_pos: f.get('next_pos'),
|
|
52
|
+
clipPos: f.get('clipPos'),
|
|
53
|
+
SA: getTag(f, 'SA'),
|
|
54
|
+
})),
|
|
55
|
+
f => f.id,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
const filtered = filterForPairs(reduced)
|
|
59
|
+
const stats = filtered.length ? getInsertSizeStats(filtered) : undefined
|
|
60
|
+
const chains = {} as { [key: string]: ReducedFeature[] }
|
|
61
|
+
|
|
62
|
+
// pair features
|
|
63
|
+
reduced.forEach(f => {
|
|
64
|
+
if (!chains[f.name]) {
|
|
65
|
+
chains[f.name] = []
|
|
66
|
+
}
|
|
67
|
+
chains[f.name].push(f)
|
|
68
|
+
})
|
|
69
|
+
return {
|
|
70
|
+
chains: Object.values(chains),
|
|
71
|
+
stats,
|
|
72
|
+
hasPaired: !!stats,
|
|
73
|
+
containsNoTransferables: true,
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
2
|
+
import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals'
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
4
|
+
import { Region } from '@jbrowse/core/util'
|
|
5
|
+
import { toArray } from 'rxjs/operators'
|
|
6
|
+
|
|
7
|
+
// locals
|
|
8
|
+
import { getModificationTypes } from '../../MismatchParser'
|
|
9
|
+
import PileupBaseRPC from '../base'
|
|
10
|
+
import { getTagAlt } from '../../util'
|
|
11
|
+
|
|
12
|
+
export default class PileupGetVisibleModifications extends PileupBaseRPC {
|
|
13
|
+
name = 'PileupGetVisibleModifications'
|
|
14
|
+
|
|
15
|
+
async execute(
|
|
16
|
+
args: {
|
|
17
|
+
adapterConfig: {}
|
|
18
|
+
signal?: RemoteAbortSignal
|
|
19
|
+
headers?: Record<string, string>
|
|
20
|
+
regions: Region[]
|
|
21
|
+
sessionId: string
|
|
22
|
+
tag: string
|
|
23
|
+
},
|
|
24
|
+
rpcDriver: string,
|
|
25
|
+
) {
|
|
26
|
+
const { adapterConfig, sessionId, regions } =
|
|
27
|
+
await this.deserializeArguments(args, rpcDriver)
|
|
28
|
+
const dataAdapter = (
|
|
29
|
+
await getAdapter(this.pluginManager, sessionId, adapterConfig)
|
|
30
|
+
).dataAdapter as BaseFeatureDataAdapter
|
|
31
|
+
|
|
32
|
+
const featuresArray = await dataAdapter
|
|
33
|
+
.getFeaturesInMultipleRegions(regions)
|
|
34
|
+
.pipe(toArray())
|
|
35
|
+
.toPromise()
|
|
36
|
+
|
|
37
|
+
const uniqueValues = new Set<string>()
|
|
38
|
+
featuresArray.forEach(f => {
|
|
39
|
+
getModificationTypes(getTagAlt(f, 'MM', 'Mm') || '').forEach(t =>
|
|
40
|
+
uniqueValues.add(t),
|
|
41
|
+
)
|
|
42
|
+
})
|
|
43
|
+
return [...uniqueValues]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,114 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// locals
|
|
10
|
-
import { getTagAlt } from '../util'
|
|
11
|
-
import { getModificationTypes } from '../BamAdapter/MismatchParser'
|
|
12
|
-
|
|
13
|
-
export class PileupGetGlobalValueForTag extends RpcMethodType {
|
|
14
|
-
name = 'PileupGetGlobalValueForTag'
|
|
15
|
-
|
|
16
|
-
async serializeArguments(
|
|
17
|
-
args: RenderArgs & {
|
|
18
|
-
signal?: AbortSignal
|
|
19
|
-
statusCallback?: (arg: string) => void
|
|
20
|
-
},
|
|
21
|
-
rpcDriverClassName: string,
|
|
22
|
-
) {
|
|
23
|
-
const { rootModel } = this.pluginManager
|
|
24
|
-
const assemblyManager = rootModel?.session?.assemblyManager
|
|
25
|
-
if (!assemblyManager) {
|
|
26
|
-
throw new Error('no assembly manager available')
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const renamedArgs = await renameRegionsIfNeeded(assemblyManager, args)
|
|
30
|
-
|
|
31
|
-
return super.serializeArguments(renamedArgs, rpcDriverClassName)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async execute(
|
|
35
|
-
args: {
|
|
36
|
-
adapterConfig: {}
|
|
37
|
-
signal?: RemoteAbortSignal
|
|
38
|
-
headers?: Record<string, string>
|
|
39
|
-
regions: Region[]
|
|
40
|
-
sessionId: string
|
|
41
|
-
tag: string
|
|
42
|
-
},
|
|
43
|
-
rpcDriverClassName: string,
|
|
44
|
-
) {
|
|
45
|
-
const pm = this.pluginManager
|
|
46
|
-
const deArgs = await this.deserializeArguments(args, rpcDriverClassName)
|
|
47
|
-
const { adapterConfig, sessionId, regions, tag } = deArgs
|
|
48
|
-
const dataAdapter = (await getAdapter(pm, sessionId, adapterConfig))
|
|
49
|
-
.dataAdapter as BaseFeatureDataAdapter
|
|
50
|
-
|
|
51
|
-
const features = dataAdapter.getFeaturesInMultipleRegions(regions)
|
|
52
|
-
const featuresArray = await features.pipe(toArray()).toPromise()
|
|
53
|
-
const uniqueValues = new Set<string>()
|
|
54
|
-
featuresArray.forEach(feature => {
|
|
55
|
-
const tags = feature.get('tags')
|
|
56
|
-
const val = tags ? tags[tag] : feature.get(tag)
|
|
57
|
-
if (val !== undefined) {
|
|
58
|
-
uniqueValues.add(`${val}`)
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
return [...uniqueValues]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class PileupGetVisibleModifications extends RpcMethodType {
|
|
66
|
-
name = 'PileupGetVisibleModifications'
|
|
67
|
-
|
|
68
|
-
async serializeArguments(
|
|
69
|
-
args: RenderArgs & {
|
|
70
|
-
signal?: AbortSignal
|
|
71
|
-
statusCallback?: (arg: string) => void
|
|
72
|
-
},
|
|
73
|
-
rpcDriverClassName: string,
|
|
74
|
-
) {
|
|
75
|
-
const { rootModel } = this.pluginManager
|
|
76
|
-
const assemblyManager = rootModel?.session?.assemblyManager
|
|
77
|
-
if (!assemblyManager) {
|
|
78
|
-
throw new Error('no assembly manager available')
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const renamedArgs = await renameRegionsIfNeeded(assemblyManager, args)
|
|
82
|
-
|
|
83
|
-
return super.serializeArguments(renamedArgs, rpcDriverClassName)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async execute(
|
|
87
|
-
args: {
|
|
88
|
-
adapterConfig: {}
|
|
89
|
-
signal?: RemoteAbortSignal
|
|
90
|
-
headers?: Record<string, string>
|
|
91
|
-
regions: Region[]
|
|
92
|
-
sessionId: string
|
|
93
|
-
tag: string
|
|
94
|
-
},
|
|
95
|
-
rpcDriverClassName: string,
|
|
96
|
-
) {
|
|
97
|
-
const pm = this.pluginManager
|
|
98
|
-
const deArgs = await this.deserializeArguments(args, rpcDriverClassName)
|
|
99
|
-
const { adapterConfig, sessionId, regions } = deArgs
|
|
100
|
-
const dataAdapter = (await getAdapter(pm, sessionId, adapterConfig))
|
|
101
|
-
.dataAdapter as BaseFeatureDataAdapter
|
|
102
|
-
|
|
103
|
-
const features = dataAdapter.getFeaturesInMultipleRegions(regions)
|
|
104
|
-
const featuresArray = await features.pipe(toArray()).toPromise()
|
|
105
|
-
const uniqueValues = new Set<string>()
|
|
106
|
-
featuresArray.forEach(feature => {
|
|
107
|
-
const val = (getTagAlt(feature, 'MM', 'Mm') as string) || ''
|
|
108
|
-
if (val !== undefined) {
|
|
109
|
-
getModificationTypes(val).forEach(t => uniqueValues.add(t))
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
return [...uniqueValues]
|
|
113
|
-
}
|
|
1
|
+
import PileupGetReducedFeatures from './methods/GetReducedFeatures'
|
|
2
|
+
import PileupGetGlobalValueForTag from './methods/GetGlobalValueForTag'
|
|
3
|
+
import PileupGetVisibleModifications from './methods/GetVisibleModifications'
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
PileupGetReducedFeatures,
|
|
7
|
+
PileupGetVisibleModifications,
|
|
8
|
+
PileupGetGlobalValueForTag,
|
|
114
9
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReducedFeature } from '../shared/fetchChains'
|
|
2
|
+
|
|
3
|
+
export function getInsertSizeStats(features: ReducedFeature[]) {
|
|
4
|
+
const filtered = features.map(f => Math.abs(f.tlen))
|
|
5
|
+
const sum = filtered.reduce((a, b) => a + b, 0)
|
|
6
|
+
const sum2 = filtered.map(a => a * a).reduce((a, b) => a + b, 0)
|
|
7
|
+
const total = filtered.length
|
|
8
|
+
const avg = sum / total
|
|
9
|
+
const sd = Math.sqrt((total * sum2 - sum * sum) / (total * total))
|
|
10
|
+
const upper = avg + 4 * sd
|
|
11
|
+
const lower = avg - 3 * sd
|
|
12
|
+
return { upper, lower, avg, sd }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function filterForPairs(features: ReducedFeature[]) {
|
|
16
|
+
return features.filter(
|
|
17
|
+
f => f.flags & 2 && !(f.flags & 256) && !(f.flags & 2048),
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
parseCigar,
|
|
30
30
|
getModificationPositions,
|
|
31
31
|
getNextRefPos,
|
|
32
|
-
} from '../
|
|
32
|
+
} from '../MismatchParser'
|
|
33
33
|
import { sortFeature } from './sortUtil'
|
|
34
34
|
import {
|
|
35
35
|
getTagAlt,
|
|
@@ -271,7 +271,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
271
271
|
|
|
272
272
|
colorByInsertSize(feature: Feature, _config: AnyConfigurationModel) {
|
|
273
273
|
return feature.get('is_paired') &&
|
|
274
|
-
feature.get('
|
|
274
|
+
feature.get('refName') !== feature.get('next_ref')
|
|
275
275
|
? '#555'
|
|
276
276
|
: `hsl(${Math.abs(feature.get('template_length')) / 10},50%,50%)`
|
|
277
277
|
}
|
|
@@ -292,7 +292,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
292
292
|
? 'color_rev_missing_mate'
|
|
293
293
|
: 'color_fwd_missing_mate'
|
|
294
294
|
}
|
|
295
|
-
if (feature.get('
|
|
295
|
+
if (feature.get('refName') === feature.get('next_refName')) {
|
|
296
296
|
return strand * flipper === 1
|
|
297
297
|
? 'color_rev_strand_not_proper'
|
|
298
298
|
: 'color_fwd_strand_not_proper'
|
|
@@ -919,7 +919,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
919
919
|
ctx,
|
|
920
920
|
leftPx,
|
|
921
921
|
topPx,
|
|
922
|
-
|
|
922
|
+
Math.abs(leftPx - rightPx),
|
|
923
923
|
heightPx,
|
|
924
924
|
canvasWidth,
|
|
925
925
|
colorForBase.deletion,
|
|
@@ -938,10 +938,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
938
938
|
ctx.fillStyle = 'purple'
|
|
939
939
|
const pos = leftPx + extraHorizontallyFlippedOffset
|
|
940
940
|
const len = +mismatch.base || mismatch.length
|
|
941
|
-
const insW = Math.max(
|
|
942
|
-
minSubfeatureWidth / 2,
|
|
943
|
-
Math.min(1.2, 1 / bpPerPx),
|
|
944
|
-
)
|
|
941
|
+
const insW = Math.max(0, Math.min(1.2, 1 / bpPerPx))
|
|
945
942
|
if (len < 10) {
|
|
946
943
|
fillRect(ctx, pos, topPx, insW, heightPx, canvasWidth, 'purple')
|
|
947
944
|
if (1 / bpPerPx >= charWidth && heightPx >= heightLim) {
|
|
@@ -28,7 +28,7 @@ const PileupRenderer = ConfigurationSchema(
|
|
|
28
28
|
model: types.enumeration('orientationType', ['fr', 'rf', 'ff']),
|
|
29
29
|
defaultValue: 'fr',
|
|
30
30
|
description:
|
|
31
|
-
'read sequencer
|
|
31
|
+
'read sequencer orientation. fr is normal "reads pointing at each other ---> <--- while some other sequencers can use other options',
|
|
32
32
|
},
|
|
33
33
|
/**
|
|
34
34
|
* #slot
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Feature } from '@jbrowse/core/util
|
|
2
|
-
import {
|
|
3
|
-
import { Mismatch } from '../BamAdapter/MismatchParser'
|
|
1
|
+
import { doesIntersect2, Feature } from '@jbrowse/core/util'
|
|
2
|
+
import { Mismatch } from '../MismatchParser'
|
|
4
3
|
|
|
5
4
|
interface SortObject {
|
|
6
5
|
pos: number
|