@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
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getContainingView, getSession } from '@jbrowse/core/util'
|
|
2
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
3
|
+
|
|
4
|
+
// locals
|
|
5
|
+
import {
|
|
6
|
+
getOrientationColor,
|
|
7
|
+
getInsertSizeColor,
|
|
8
|
+
getInsertSizeAndOrientationColor,
|
|
9
|
+
} from '../shared/color'
|
|
10
|
+
import { ChainData } from '../shared/fetchChains'
|
|
11
|
+
import { featurizeSA } from '../MismatchParser'
|
|
12
|
+
|
|
13
|
+
export function hasPairedReads(features: ChainData) {
|
|
14
|
+
for (const f of features.chains.values()) {
|
|
15
|
+
if (f[0].flags & 1) {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type LGV = LinearGenomeViewModel
|
|
23
|
+
|
|
24
|
+
export default async function drawFeats(
|
|
25
|
+
self: {
|
|
26
|
+
setLastDrawnOffsetPx: (n: number) => void
|
|
27
|
+
drawInter?: boolean
|
|
28
|
+
drawLongRange?: boolean
|
|
29
|
+
setError: (e: unknown) => void
|
|
30
|
+
colorBy?: { type: string }
|
|
31
|
+
height: number
|
|
32
|
+
chainData?: ChainData
|
|
33
|
+
lineWidthSetting: number
|
|
34
|
+
},
|
|
35
|
+
ctx: CanvasRenderingContext2D,
|
|
36
|
+
) {
|
|
37
|
+
const { chainData } = self
|
|
38
|
+
if (!chainData) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
const displayHeight = self.height
|
|
42
|
+
const view = getContainingView(self) as LGV
|
|
43
|
+
const { assemblyManager } = getSession(self)
|
|
44
|
+
self.setLastDrawnOffsetPx(view.offsetPx)
|
|
45
|
+
ctx.lineWidth = self.lineWidthSetting
|
|
46
|
+
const { chains, stats } = chainData
|
|
47
|
+
const hasPaired = hasPairedReads(chainData)
|
|
48
|
+
const assemblyName = view.assemblyNames[0]
|
|
49
|
+
const asm = assemblyManager.get(assemblyName)
|
|
50
|
+
const type = self.colorBy?.type || 'insertSizeAndOrientation'
|
|
51
|
+
|
|
52
|
+
function draw(
|
|
53
|
+
k1: {
|
|
54
|
+
strand: number
|
|
55
|
+
refName: string
|
|
56
|
+
start: number
|
|
57
|
+
end: number
|
|
58
|
+
tlen?: number
|
|
59
|
+
pair_orientation?: string
|
|
60
|
+
},
|
|
61
|
+
k2: { strand: number; refName: string; start: number; end: number },
|
|
62
|
+
longRange?: boolean,
|
|
63
|
+
) {
|
|
64
|
+
const s1 = k1.strand
|
|
65
|
+
const s2 = k2.strand
|
|
66
|
+
const f1 = s1 === -1
|
|
67
|
+
const f2 = s2 === -1
|
|
68
|
+
|
|
69
|
+
const p1 = f1 ? k1.start : k1.end
|
|
70
|
+
const p2 = hasPaired ? (f2 ? k2.start : k2.end) : f2 ? k2.end : k2.start
|
|
71
|
+
|
|
72
|
+
const r1 = view.bpToPx({ refName: k1.refName, coord: p1 })
|
|
73
|
+
const r2 = view.bpToPx({ refName: k2.refName, coord: p2 })
|
|
74
|
+
|
|
75
|
+
if (r1 && r2) {
|
|
76
|
+
const radius = (r2.offsetPx - r1.offsetPx) / 2
|
|
77
|
+
const absrad = Math.abs(radius)
|
|
78
|
+
const p = r1.offsetPx - view.offsetPx
|
|
79
|
+
|
|
80
|
+
// bezier (used for non-long-range arcs) requires moveTo before beginPath
|
|
81
|
+
// arc (used for long-range) requires moveTo after beginPath (or else a
|
|
82
|
+
// unwanted line at y=0 is rendered along with the arc)
|
|
83
|
+
if (longRange) {
|
|
84
|
+
ctx.moveTo(p, 0)
|
|
85
|
+
ctx.beginPath()
|
|
86
|
+
} else {
|
|
87
|
+
ctx.beginPath()
|
|
88
|
+
ctx.moveTo(p, 0)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (longRange) {
|
|
92
|
+
ctx.strokeStyle = 'red'
|
|
93
|
+
} else {
|
|
94
|
+
if (hasPaired) {
|
|
95
|
+
if (type === 'insertSizeAndOrientation') {
|
|
96
|
+
ctx.strokeStyle = getInsertSizeAndOrientationColor(k1, k2, stats)
|
|
97
|
+
} else if (type === 'orientation') {
|
|
98
|
+
ctx.strokeStyle = getOrientationColor(k1)
|
|
99
|
+
} else if (type === 'insertSize') {
|
|
100
|
+
ctx.strokeStyle = getInsertSizeColor(k1, k2, stats) || 'grey'
|
|
101
|
+
} else if (type === 'gradient') {
|
|
102
|
+
ctx.strokeStyle = `hsl(${
|
|
103
|
+
Math.log10(Math.abs(p1 - p2)) * 10
|
|
104
|
+
},50%,50%)`
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
if (type === 'orientation' || type === 'insertSizeAndOrientation') {
|
|
108
|
+
if (s1 === -1 && s2 === 1) {
|
|
109
|
+
ctx.strokeStyle = 'navy'
|
|
110
|
+
} else if (s1 === 1 && s2 === -1) {
|
|
111
|
+
ctx.strokeStyle = 'green'
|
|
112
|
+
} else {
|
|
113
|
+
ctx.strokeStyle = 'grey'
|
|
114
|
+
}
|
|
115
|
+
} else if (type === 'gradient') {
|
|
116
|
+
ctx.strokeStyle = `hsl(${
|
|
117
|
+
Math.log10(Math.abs(p1 - p2)) * 10
|
|
118
|
+
},50%,50%)`
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const destX = p + radius * 2
|
|
124
|
+
const destY = Math.min(displayHeight, absrad)
|
|
125
|
+
if (longRange) {
|
|
126
|
+
ctx.arc(p + radius, 0, absrad, 0, Math.PI)
|
|
127
|
+
} else {
|
|
128
|
+
ctx.bezierCurveTo(p, destY, destX, destY, destX, 0)
|
|
129
|
+
}
|
|
130
|
+
ctx.stroke()
|
|
131
|
+
} else if (r1 && self.drawInter) {
|
|
132
|
+
// draws a vertical line off to middle of nowhere if the second end not found
|
|
133
|
+
const p = r1.offsetPx - view.offsetPx
|
|
134
|
+
ctx.strokeStyle = 'purple'
|
|
135
|
+
ctx.beginPath()
|
|
136
|
+
ctx.moveTo(p, 0)
|
|
137
|
+
ctx.lineTo(p, displayHeight)
|
|
138
|
+
ctx.stroke()
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
for (let i = 0; i < chains.length; i++) {
|
|
143
|
+
let chain = chains[i]
|
|
144
|
+
|
|
145
|
+
if (chain.length === 1 && self.drawLongRange) {
|
|
146
|
+
// singleton feature
|
|
147
|
+
const f = chain[0]
|
|
148
|
+
|
|
149
|
+
// special case where we look at RPOS/RNEXT
|
|
150
|
+
if (hasPaired) {
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
152
|
+
const refName = asm?.getCanonicalRefName(f.next_ref!) || f.next_ref!
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
154
|
+
const coord = f.next_pos!
|
|
155
|
+
draw(
|
|
156
|
+
f,
|
|
157
|
+
{
|
|
158
|
+
refName,
|
|
159
|
+
start: coord,
|
|
160
|
+
end: coord,
|
|
161
|
+
strand: f.strand,
|
|
162
|
+
},
|
|
163
|
+
true,
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// special case where we look at SA
|
|
168
|
+
else {
|
|
169
|
+
const suppAlns = featurizeSA(f.SA, f.id, f.strand, f.name)
|
|
170
|
+
const features = [f, ...suppAlns].sort((a, b) => a.clipPos - b.clipPos)
|
|
171
|
+
for (let i = 0; i < features.length - 1; i++) {
|
|
172
|
+
const f = features[i]
|
|
173
|
+
const v1 = features[i + 1]
|
|
174
|
+
draw(
|
|
175
|
+
f,
|
|
176
|
+
{
|
|
177
|
+
refName: asm?.getCanonicalRefName(v1.refName) || v1.refName,
|
|
178
|
+
start: v1.start,
|
|
179
|
+
end: v1.end,
|
|
180
|
+
strand: v1.strand,
|
|
181
|
+
},
|
|
182
|
+
true,
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
if (!hasPaired) {
|
|
188
|
+
chain.sort((a, b) => a.clipPos - b.clipPos)
|
|
189
|
+
chain = chain.filter(f => !(f.flags & 256))
|
|
190
|
+
} else {
|
|
191
|
+
// ignore split/supplementary reads for hasPaired=true for now
|
|
192
|
+
chain = chain.filter(f => !(f.flags & 2048))
|
|
193
|
+
}
|
|
194
|
+
for (let i = 0; i < chain.length - 1; i++) {
|
|
195
|
+
draw(chain[i], chain[i + 1], false)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
+
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
3
|
+
|
|
4
|
+
// locals
|
|
5
|
+
import ReactComponent from './components/ReactComponent'
|
|
6
|
+
import configSchemaF from './configSchema'
|
|
7
|
+
import stateModelF from './model'
|
|
8
|
+
|
|
9
|
+
export default function register(pluginManager: PluginManager) {
|
|
10
|
+
pluginManager.addDisplayType(() => {
|
|
11
|
+
const configSchema = configSchemaF(pluginManager)
|
|
12
|
+
return new DisplayType({
|
|
13
|
+
name: 'LinearReadArcsDisplay',
|
|
14
|
+
displayName: 'Arc display',
|
|
15
|
+
configSchema,
|
|
16
|
+
stateModel: stateModelF(configSchema),
|
|
17
|
+
trackType: 'AlignmentsTrack',
|
|
18
|
+
viewType: 'LinearGenomeView',
|
|
19
|
+
subDisplay: { type: 'LinearAlignmentsDisplay', lowerPanel: true },
|
|
20
|
+
ReactComponent,
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import React, { lazy } from 'react'
|
|
2
|
+
import { autorun } from 'mobx'
|
|
3
|
+
import { addDisposer, cast, types, Instance } from 'mobx-state-tree'
|
|
4
|
+
import {
|
|
5
|
+
AnyConfigurationSchemaType,
|
|
6
|
+
ConfigurationReference,
|
|
7
|
+
ConfigurationSchema,
|
|
8
|
+
getConf,
|
|
9
|
+
} from '@jbrowse/core/configuration'
|
|
10
|
+
import { getSession, getContainingView } from '@jbrowse/core/util'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
BaseLinearDisplay,
|
|
14
|
+
LinearGenomeViewModel,
|
|
15
|
+
} from '@jbrowse/plugin-linear-genome-view'
|
|
16
|
+
|
|
17
|
+
// icons
|
|
18
|
+
import PaletteIcon from '@mui/icons-material/Palette'
|
|
19
|
+
import FilterListIcon from '@mui/icons-material/ClearAll'
|
|
20
|
+
|
|
21
|
+
// locals
|
|
22
|
+
import { FilterModel } from '../shared'
|
|
23
|
+
import drawFeats from './drawFeats'
|
|
24
|
+
import { fetchChains, ChainData } from '../shared/fetchChains'
|
|
25
|
+
import { ExportSvgOptions } from '@jbrowse/plugin-linear-genome-view/src/LinearGenomeView'
|
|
26
|
+
|
|
27
|
+
// async
|
|
28
|
+
const FilterByTagDlg = lazy(() => import('../shared/FilterByTag'))
|
|
29
|
+
|
|
30
|
+
interface Filter {
|
|
31
|
+
flagInclude: number
|
|
32
|
+
flagExclude: number
|
|
33
|
+
readName?: string
|
|
34
|
+
tagFilter?: { tag: string; value: string }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type LGV = LinearGenomeViewModel
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* #stateModel LinearReadArcsDisplay
|
|
41
|
+
* extends `BaseLinearDisplay`
|
|
42
|
+
*/
|
|
43
|
+
function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
44
|
+
return types
|
|
45
|
+
.compose(
|
|
46
|
+
'LinearReadArcsDisplay',
|
|
47
|
+
BaseLinearDisplay,
|
|
48
|
+
types.model({
|
|
49
|
+
/**
|
|
50
|
+
* #property
|
|
51
|
+
*/
|
|
52
|
+
type: types.literal('LinearReadArcsDisplay'),
|
|
53
|
+
/**
|
|
54
|
+
* #property
|
|
55
|
+
*/
|
|
56
|
+
configuration: ConfigurationReference(configSchema),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* #property
|
|
60
|
+
*/
|
|
61
|
+
filterBy: types.optional(FilterModel, {}),
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* #property
|
|
65
|
+
*/
|
|
66
|
+
lineWidth: types.maybe(types.number),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* #property
|
|
70
|
+
*/
|
|
71
|
+
colorBy: types.maybe(
|
|
72
|
+
types.model({
|
|
73
|
+
type: types.string,
|
|
74
|
+
tag: types.maybe(types.string),
|
|
75
|
+
extra: types.frozen(),
|
|
76
|
+
}),
|
|
77
|
+
),
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* #property
|
|
81
|
+
*/
|
|
82
|
+
drawInter: true,
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* #property
|
|
86
|
+
*/
|
|
87
|
+
drawLongRange: true,
|
|
88
|
+
}),
|
|
89
|
+
)
|
|
90
|
+
.volatile(() => ({
|
|
91
|
+
loading: false,
|
|
92
|
+
drawn: false,
|
|
93
|
+
chainData: undefined as ChainData | undefined,
|
|
94
|
+
ref: null as HTMLCanvasElement | null,
|
|
95
|
+
lastDrawnOffsetPx: 0,
|
|
96
|
+
}))
|
|
97
|
+
.actions(self => ({
|
|
98
|
+
/**
|
|
99
|
+
* #action
|
|
100
|
+
* internal, a reference to a HTMLCanvas because we use a autorun to draw the canvas
|
|
101
|
+
*/
|
|
102
|
+
reload() {
|
|
103
|
+
self.error = undefined
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* #action
|
|
107
|
+
* internal, a reference to a HTMLCanvas because we use a autorun to draw the canvas
|
|
108
|
+
*/
|
|
109
|
+
setRef(ref: HTMLCanvasElement | null) {
|
|
110
|
+
self.ref = ref
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* #action
|
|
115
|
+
*/
|
|
116
|
+
setColorScheme(s: { type: string }) {
|
|
117
|
+
self.colorBy = cast(s)
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* #action
|
|
122
|
+
*/
|
|
123
|
+
setChainData(args: ChainData) {
|
|
124
|
+
self.chainData = args
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* #action
|
|
129
|
+
*/
|
|
130
|
+
setDrawInter(f: boolean) {
|
|
131
|
+
self.drawInter = f
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* #action
|
|
136
|
+
*/
|
|
137
|
+
setDrawLongRange(f: boolean) {
|
|
138
|
+
self.drawLongRange = f
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* #action
|
|
143
|
+
*/
|
|
144
|
+
setLoading(f: boolean) {
|
|
145
|
+
self.loading = f
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* #action
|
|
150
|
+
* used during tests to detect when we can complete a snapshot test
|
|
151
|
+
*/
|
|
152
|
+
setDrawn(f: boolean) {
|
|
153
|
+
self.drawn = f
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* #action
|
|
158
|
+
*/
|
|
159
|
+
setFilterBy(filter: Filter) {
|
|
160
|
+
self.filterBy = cast(filter)
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* #action
|
|
165
|
+
* allows the drawing to slide around a little bit if it takes a long time to refresh
|
|
166
|
+
*/
|
|
167
|
+
setLastDrawnOffsetPx(n: number) {
|
|
168
|
+
self.lastDrawnOffsetPx = n
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* #action
|
|
173
|
+
* thin, bold, extrabold, etc
|
|
174
|
+
*/
|
|
175
|
+
setLineWidth(n: number) {
|
|
176
|
+
self.lineWidth = n
|
|
177
|
+
},
|
|
178
|
+
}))
|
|
179
|
+
|
|
180
|
+
.views(self => {
|
|
181
|
+
const {
|
|
182
|
+
trackMenuItems: superTrackMenuItems,
|
|
183
|
+
renderProps: superRenderProps,
|
|
184
|
+
} = self
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
/**
|
|
188
|
+
* #getter
|
|
189
|
+
*/
|
|
190
|
+
get lineWidthSetting() {
|
|
191
|
+
return self.lineWidth ?? getConf(self, 'lineWidth')
|
|
192
|
+
},
|
|
193
|
+
/**
|
|
194
|
+
* #getter
|
|
195
|
+
*/
|
|
196
|
+
get ready() {
|
|
197
|
+
return !!self.chainData
|
|
198
|
+
},
|
|
199
|
+
// we don't use a server side renderer, but we need to provide this
|
|
200
|
+
// to avoid confusing the system currently
|
|
201
|
+
get rendererTypeName() {
|
|
202
|
+
return 'PileupRenderer'
|
|
203
|
+
},
|
|
204
|
+
// we don't use a server side renderer, so this fills in minimal
|
|
205
|
+
// info so as not to crash
|
|
206
|
+
renderProps() {
|
|
207
|
+
return {
|
|
208
|
+
...superRenderProps(),
|
|
209
|
+
// never ready, we don't want to use server side render
|
|
210
|
+
notReady: true,
|
|
211
|
+
config: ConfigurationSchema('empty', {}).create(),
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* #method
|
|
217
|
+
*/
|
|
218
|
+
trackMenuItems() {
|
|
219
|
+
return [
|
|
220
|
+
...superTrackMenuItems(),
|
|
221
|
+
{
|
|
222
|
+
label: 'Filter by',
|
|
223
|
+
icon: FilterListIcon,
|
|
224
|
+
onClick: () => {
|
|
225
|
+
getSession(self).queueDialog(handleClose => [
|
|
226
|
+
FilterByTagDlg,
|
|
227
|
+
{ model: self, handleClose },
|
|
228
|
+
])
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: 'Line width',
|
|
233
|
+
subMenu: [
|
|
234
|
+
{
|
|
235
|
+
label: 'Thin',
|
|
236
|
+
onClick: () => self.setLineWidth(1),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: 'Bold',
|
|
240
|
+
onClick: () => self.setLineWidth(2),
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: 'Extra bold',
|
|
244
|
+
onClick: () => self.setLineWidth(5),
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: 'Draw inter-region vertical lines',
|
|
250
|
+
type: 'checkbox',
|
|
251
|
+
checked: self.drawInter,
|
|
252
|
+
onClick: () => self.setDrawInter(!self.drawInter),
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: 'Draw long range connections',
|
|
256
|
+
type: 'checkbox',
|
|
257
|
+
checked: self.drawLongRange,
|
|
258
|
+
onClick: () => self.setDrawLongRange(!self.drawLongRange),
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: 'Color scheme',
|
|
262
|
+
icon: PaletteIcon,
|
|
263
|
+
subMenu: [
|
|
264
|
+
{
|
|
265
|
+
label: 'Insert size ± 3σ and orientation',
|
|
266
|
+
onClick: () =>
|
|
267
|
+
self.setColorScheme({ type: 'insertSizeAndOrientation' }),
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
label: 'Insert size ± 3σ',
|
|
271
|
+
onClick: () => self.setColorScheme({ type: 'insertSize' }),
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: 'Orientation',
|
|
275
|
+
onClick: () => self.setColorScheme({ type: 'orientation' }),
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
label: 'Insert size gradient',
|
|
279
|
+
onClick: () => self.setColorScheme({ type: 'gradient' }),
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
.views(self => ({
|
|
288
|
+
/**
|
|
289
|
+
* #method
|
|
290
|
+
*/
|
|
291
|
+
async renderSvg(opts: ExportSvgOptions) {
|
|
292
|
+
const view = getContainingView(self) as LGV
|
|
293
|
+
const width = view.dynamicBlocks.totalWidthPx
|
|
294
|
+
const height = self.height
|
|
295
|
+
let str
|
|
296
|
+
if (opts.rasterizeLayers) {
|
|
297
|
+
const canvas = document.createElement('canvas')
|
|
298
|
+
canvas.width = width * 2
|
|
299
|
+
canvas.height = height * 2
|
|
300
|
+
const ctx = canvas.getContext('2d')
|
|
301
|
+
if (!ctx) {
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
ctx.scale(2, 2)
|
|
305
|
+
await drawFeats(self, ctx)
|
|
306
|
+
str = (
|
|
307
|
+
<image
|
|
308
|
+
width={width}
|
|
309
|
+
height={height}
|
|
310
|
+
xlinkHref={canvas.toDataURL('image/png')}
|
|
311
|
+
/>
|
|
312
|
+
)
|
|
313
|
+
} else {
|
|
314
|
+
// @ts-ignore
|
|
315
|
+
const C2S = await import('canvas2svg')
|
|
316
|
+
const ctx = new C2S.default(width, height)
|
|
317
|
+
await drawFeats(self, ctx)
|
|
318
|
+
str = (
|
|
319
|
+
// eslint-disable-next-line react/no-danger
|
|
320
|
+
<g dangerouslySetInnerHTML={{ __html: ctx.getSvg().innerHTML }} />
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return <g>{str}</g>
|
|
325
|
+
},
|
|
326
|
+
}))
|
|
327
|
+
.actions(self => ({
|
|
328
|
+
afterAttach() {
|
|
329
|
+
addDisposer(
|
|
330
|
+
self,
|
|
331
|
+
autorun(() => fetchChains(self), { delay: 1000 }),
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
addDisposer(
|
|
335
|
+
self,
|
|
336
|
+
autorun(
|
|
337
|
+
async () => {
|
|
338
|
+
try {
|
|
339
|
+
const canvas = self.ref
|
|
340
|
+
if (!canvas) {
|
|
341
|
+
return
|
|
342
|
+
}
|
|
343
|
+
const ctx = canvas.getContext('2d')
|
|
344
|
+
if (!ctx) {
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
ctx.clearRect(0, 0, canvas.width, self.height * 2)
|
|
348
|
+
ctx.resetTransform()
|
|
349
|
+
ctx.scale(2, 2)
|
|
350
|
+
await drawFeats(self, ctx)
|
|
351
|
+
self.setDrawn(true)
|
|
352
|
+
} catch (e) {
|
|
353
|
+
console.error(e)
|
|
354
|
+
self.setError(e)
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
{ delay: 1000 },
|
|
358
|
+
),
|
|
359
|
+
)
|
|
360
|
+
},
|
|
361
|
+
}))
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export type LinearReadArcsDisplayStateModel = ReturnType<
|
|
365
|
+
typeof stateModelFactory
|
|
366
|
+
>
|
|
367
|
+
export type LinearReadArcsDisplayModel =
|
|
368
|
+
Instance<LinearReadArcsDisplayStateModel>
|
|
369
|
+
|
|
370
|
+
export default stateModelFactory
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { isAlive } from 'mobx-state-tree'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
5
|
+
import { getContainingView } from '@jbrowse/core/util'
|
|
6
|
+
import { LoadingEllipses } from '@jbrowse/core/ui'
|
|
7
|
+
import {
|
|
8
|
+
BlockMsg,
|
|
9
|
+
LinearGenomeViewModel,
|
|
10
|
+
} from '@jbrowse/plugin-linear-genome-view'
|
|
11
|
+
|
|
12
|
+
// local
|
|
13
|
+
import { LinearReadCloudDisplayModel } from '../model'
|
|
14
|
+
|
|
15
|
+
type LGV = LinearGenomeViewModel
|
|
16
|
+
|
|
17
|
+
const useStyles = makeStyles()(theme => ({
|
|
18
|
+
loading: {
|
|
19
|
+
paddingLeft: '0.6em',
|
|
20
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
21
|
+
backgroundImage:
|
|
22
|
+
'repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.5) 5px, rgba(255,255,255,.5) 10px)',
|
|
23
|
+
height: '100%',
|
|
24
|
+
width: '100%',
|
|
25
|
+
pointerEvents: 'none',
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
},
|
|
28
|
+
}))
|
|
29
|
+
|
|
30
|
+
const Cloud = observer(function ({
|
|
31
|
+
model,
|
|
32
|
+
}: {
|
|
33
|
+
model: LinearReadCloudDisplayModel
|
|
34
|
+
}) {
|
|
35
|
+
const view = getContainingView(model) as LGV
|
|
36
|
+
return (
|
|
37
|
+
<canvas
|
|
38
|
+
data-testid={`ReadCloud-display-${model.drawn}`}
|
|
39
|
+
ref={ref => {
|
|
40
|
+
if (isAlive(model)) {
|
|
41
|
+
model.setRef(ref)
|
|
42
|
+
}
|
|
43
|
+
}}
|
|
44
|
+
style={{
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
left: -view.offsetPx + model.lastDrawnOffsetPx,
|
|
47
|
+
width: view.dynamicBlocks.totalWidthPx,
|
|
48
|
+
height: model.height,
|
|
49
|
+
}}
|
|
50
|
+
width={view.dynamicBlocks.totalWidthPx * 2}
|
|
51
|
+
height={model.height * 2}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export default observer(function ({
|
|
57
|
+
model,
|
|
58
|
+
}: {
|
|
59
|
+
model: LinearReadCloudDisplayModel
|
|
60
|
+
}) {
|
|
61
|
+
const view = getContainingView(model)
|
|
62
|
+
const { classes } = useStyles()
|
|
63
|
+
const err = model.error
|
|
64
|
+
return err ? (
|
|
65
|
+
<BlockMsg
|
|
66
|
+
message={`${err}`}
|
|
67
|
+
severity="error"
|
|
68
|
+
buttonText={'Reload'}
|
|
69
|
+
action={model.reload}
|
|
70
|
+
/>
|
|
71
|
+
) : model.loading ? (
|
|
72
|
+
<div
|
|
73
|
+
className={classes.loading}
|
|
74
|
+
style={{
|
|
75
|
+
width: view.dynamicBlocks.totalWidthPx,
|
|
76
|
+
height: 20,
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
left: Math.max(0, -view.offsetPx),
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
<LoadingEllipses message={model.message} />
|
|
82
|
+
</div>
|
|
83
|
+
) : (
|
|
84
|
+
<Cloud model={model} />
|
|
85
|
+
)
|
|
86
|
+
})
|