@jbrowse/plugin-alignments 2.16.1 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -13
- package/dist/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
- package/dist/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
- package/dist/AlignmentsFeatureDetail/Flags.js +2 -2
- package/dist/AlignmentsFeatureDetail/Formatter.js +0 -3
- package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +3 -5
- package/dist/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +4 -9
- package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +3 -5
- package/dist/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +37 -36
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +2 -2
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +3 -4
- package/dist/AlignmentsFeatureDetail/PairLink.d.ts +1 -1
- package/dist/AlignmentsFeatureDetail/PairLink.js +0 -1
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +2 -2
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +5 -6
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -1
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +1 -5
- package/dist/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
- package/dist/AlignmentsFeatureDetail/getSAFeatures.js +2 -6
- package/dist/AlignmentsFeatureDetail/index.d.ts +1 -1
- package/dist/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
- package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +3 -3
- package/dist/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
- package/dist/AlignmentsFeatureDetail/tagInfo.js +1 -1
- package/dist/AlignmentsFeatureDetail/util.d.ts +1 -1
- package/dist/AlignmentsTrack/configSchemaF.d.ts +1 -1
- package/dist/AlignmentsTrack/configSchemaF.js +1 -8
- package/dist/AlignmentsTrack/index.d.ts +1 -1
- package/dist/AlignmentsTrack/index.js +0 -3
- package/dist/BamAdapter/BamAdapter.d.ts +8 -6
- package/dist/BamAdapter/BamAdapter.js +35 -30
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +6 -20
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +42 -75
- package/dist/BamAdapter/configSchema.d.ts +0 -17
- package/dist/BamAdapter/configSchema.js +1 -22
- package/dist/BamAdapter/index.d.ts +1 -1
- package/dist/CramAdapter/CramAdapter.d.ts +8 -10
- package/dist/CramAdapter/CramAdapter.js +26 -32
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +23 -29
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +59 -75
- package/dist/CramAdapter/CramTestAdapters.d.ts +3 -3
- package/dist/CramAdapter/CramTestAdapters.js +4 -5
- package/dist/CramAdapter/configSchema.d.ts +0 -14
- package/dist/CramAdapter/configSchema.js +1 -19
- package/dist/CramAdapter/index.d.ts +1 -1
- package/dist/CramAdapter/index.js +0 -1
- package/dist/CramAdapter/util.d.ts +2 -11
- package/dist/CramAdapter/util.js +1 -24
- package/dist/GuessAlignmentsTypes/index.d.ts +1 -1
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
- package/dist/HtsgetBamAdapter/configSchema.d.ts +0 -9
- package/dist/HtsgetBamAdapter/configSchema.js +1 -14
- package/dist/HtsgetBamAdapter/index.d.ts +1 -1
- package/dist/HtsgetBamAdapter/index.js +1 -1
- package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +2 -5
- package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +1 -31
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/dist/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +2 -16
- package/dist/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +3 -20
- package/dist/LinearAlignmentsDisplay/index.d.ts +1 -1
- package/dist/LinearAlignmentsDisplay/index.js +2 -3
- package/dist/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +7 -73
- package/dist/LinearAlignmentsDisplay/{models/model.js → model.js} +13 -82
- package/dist/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +1 -1
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +34 -181
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +72 -149
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +5 -3
- package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +111 -56
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
- package/dist/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
- package/dist/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
- package/dist/LinearPileupDisplay/components/SortByTagDialog.js +8 -6
- package/dist/LinearPileupDisplay/configSchema.d.ts +13 -16
- package/dist/LinearPileupDisplay/configSchema.js +12 -30
- package/dist/LinearPileupDisplay/index.d.ts +1 -1
- package/dist/LinearPileupDisplay/index.js +2 -2
- package/dist/LinearPileupDisplay/model.d.ts +121 -123
- package/dist/LinearPileupDisplay/model.js +110 -124
- package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +3 -7
- package/dist/LinearReadArcsDisplay/configSchema.d.ts +12 -20
- package/dist/LinearReadArcsDisplay/configSchema.js +8 -31
- package/dist/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
- package/dist/LinearReadArcsDisplay/drawFeats.js +1 -9
- package/dist/LinearReadArcsDisplay/index.d.ts +1 -1
- package/dist/LinearReadArcsDisplay/index.js +1 -2
- package/dist/LinearReadArcsDisplay/model.d.ts +13 -90
- package/dist/LinearReadArcsDisplay/model.js +24 -112
- package/dist/LinearReadArcsDisplay/util.d.ts +1 -1
- package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +3 -7
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +5 -17
- package/dist/LinearReadCloudDisplay/configSchema.js +3 -28
- package/dist/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
- package/dist/LinearReadCloudDisplay/drawFeats.js +2 -2
- package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
- package/dist/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
- package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
- package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -3
- package/dist/LinearReadCloudDisplay/index.d.ts +1 -1
- package/dist/LinearReadCloudDisplay/index.js +1 -2
- package/dist/LinearReadCloudDisplay/model.d.ts +14 -64
- package/dist/LinearReadCloudDisplay/model.js +24 -76
- package/dist/LinearReadCloudDisplay/util.js +0 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +50 -20
- package/dist/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +17 -22
- package/dist/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +16 -32
- package/dist/LinearSNPCoverageDisplay/index.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/index.js +3 -3
- package/{esm/LinearSNPCoverageDisplay/models → dist/LinearSNPCoverageDisplay}/model.d.ts +9 -60
- package/dist/LinearSNPCoverageDisplay/{models/model.js → model.js} +68 -146
- package/dist/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/dist/MismatchParser/cigarToMismatches.js +91 -0
- package/dist/MismatchParser/getNextRefPos.d.ts +4 -0
- package/dist/MismatchParser/getNextRefPos.js +38 -0
- package/dist/MismatchParser/index.d.ts +5 -30
- package/dist/MismatchParser/index.js +10 -335
- package/dist/MismatchParser/mdToMismatches.d.ts +3 -0
- package/dist/MismatchParser/mdToMismatches.js +74 -0
- package/dist/ModificationParser/index.d.ts +19 -0
- package/dist/ModificationParser/index.js +127 -0
- package/dist/PileupRPC/base.d.ts +2 -2
- package/dist/PileupRPC/base.js +0 -1
- package/dist/PileupRPC/index.d.ts +1 -1
- package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js +2 -4
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +3 -4
- package/dist/PileupRPC/methods/GetReducedFeatures.js +21 -20
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +4 -4
- package/dist/PileupRPC/methods/GetVisibleModifications.js +10 -7
- package/dist/PileupRPC/util.d.ts +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +12 -11
- package/dist/PileupRenderer/PileupLayoutSession.js +2 -5
- package/dist/PileupRenderer/PileupRenderer.d.ts +11 -29
- package/dist/PileupRenderer/PileupRenderer.js +17 -20
- package/dist/PileupRenderer/colorBy.d.ts +2 -2
- package/dist/PileupRenderer/colorBy.js +0 -6
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +0 -3
- package/dist/PileupRenderer/configSchema.d.ts +0 -31
- package/dist/PileupRenderer/configSchema.js +1 -35
- package/dist/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
- package/dist/PileupRenderer/getAlignmentShapeColor.js +1 -6
- package/dist/PileupRenderer/index.d.ts +1 -1
- package/dist/PileupRenderer/index.js +1 -1
- package/dist/PileupRenderer/layoutFeature.d.ts +2 -2
- package/dist/PileupRenderer/layoutFeature.js +0 -1
- package/dist/PileupRenderer/layoutFeatures.d.ts +5 -2
- package/dist/PileupRenderer/layoutFeatures.js +6 -4
- package/dist/PileupRenderer/makeImageData.d.ts +3 -4
- package/dist/PileupRenderer/makeImageData.js +8 -2
- package/dist/PileupRenderer/renderAlignment.d.ts +3 -3
- package/dist/PileupRenderer/renderAlignment.js +19 -8
- package/dist/PileupRenderer/renderAlignmentShape.d.ts +3 -3
- package/dist/PileupRenderer/renderAlignmentShape.js +102 -21
- package/dist/PileupRenderer/renderMethylation.d.ts +6 -5
- package/dist/PileupRenderer/renderMethylation.js +13 -9
- package/dist/PileupRenderer/renderMismatches.d.ts +3 -3
- package/dist/PileupRenderer/renderMismatches.js +17 -28
- package/dist/PileupRenderer/renderModifications.d.ts +6 -5
- package/dist/PileupRenderer/renderModifications.js +30 -35
- package/dist/PileupRenderer/renderPerBaseLettering.d.ts +4 -3
- package/dist/PileupRenderer/renderPerBaseLettering.js +1 -4
- package/dist/PileupRenderer/renderPerBaseQuality.d.ts +4 -3
- package/dist/PileupRenderer/renderPerBaseQuality.js +3 -5
- package/dist/PileupRenderer/renderSoftClipping.d.ts +5 -5
- package/dist/PileupRenderer/renderSoftClipping.js +6 -10
- package/dist/PileupRenderer/sortUtil.d.ts +3 -8
- package/dist/PileupRenderer/sortUtil.js +13 -16
- package/dist/PileupRenderer/types.d.ts +26 -0
- package/dist/PileupRenderer/types.js +2 -0
- package/dist/PileupRenderer/util.d.ts +2 -2
- package/dist/PileupRenderer/util.js +1 -3
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +14 -11
- package/dist/SNPCoverageAdapter/configSchema.d.ts +0 -4
- package/dist/SNPCoverageAdapter/configSchema.js +1 -8
- package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +11 -11
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +74 -193
- package/dist/SNPCoverageAdapter/index.d.ts +1 -1
- package/dist/SNPCoverageAdapter/processDepth.d.ts +8 -0
- package/dist/SNPCoverageAdapter/processDepth.js +38 -0
- package/dist/SNPCoverageAdapter/processMismatches.d.ts +9 -0
- package/dist/SNPCoverageAdapter/processMismatches.js +58 -0
- package/dist/SNPCoverageAdapter/processModifications.d.ts +10 -0
- package/dist/SNPCoverageAdapter/processModifications.js +49 -0
- package/dist/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
- package/dist/SNPCoverageAdapter/processReferenceCpGs.js +63 -0
- package/dist/SNPCoverageAdapter/util.d.ts +9 -24
- package/dist/SNPCoverageAdapter/util.js +39 -0
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +6 -4
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +165 -72
- package/dist/SNPCoverageRenderer/configSchema.d.ts +0 -15
- package/dist/SNPCoverageRenderer/configSchema.js +1 -19
- package/dist/SNPCoverageRenderer/index.d.ts +1 -1
- package/dist/SNPCoverageRenderer/index.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/shared/afterAttach.d.ts +1 -1
- package/dist/shared/afterAttach.js +0 -2
- package/dist/shared/color.d.ts +1 -11
- package/dist/shared/color.js +1 -15
- package/{esm/shared → dist/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/dist/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +12 -11
- package/{esm/shared → dist/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/dist/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +7 -3
- package/dist/shared/fetchChains.d.ts +2 -2
- package/dist/shared/fetchChains.js +2 -4
- package/dist/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/dist/shared/getMaximumModificationAtEachPosition.js +41 -0
- package/dist/shared/getUniqueModifications.d.ts +14 -0
- package/dist/shared/getUniqueModifications.js +16 -0
- package/dist/shared/getUniqueTags.d.ts +15 -0
- package/dist/shared/getUniqueTags.js +18 -0
- package/dist/shared/{renderSvg.js → renderSvgUtil.js} +0 -2
- package/dist/shared/types.d.ts +94 -0
- package/dist/shared/types.js +2 -0
- package/dist/shared/util.d.ts +19 -1
- package/dist/shared/util.js +52 -0
- package/dist/util.d.ts +10 -7
- package/dist/util.js +26 -37
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +6 -13
- package/esm/AlignmentsFeatureDetail/BreakendMultiLevelOptionDialog.js +0 -1
- package/esm/AlignmentsFeatureDetail/BreakendSingleLevelOptionDialog.js +0 -1
- package/esm/AlignmentsFeatureDetail/Flags.js +2 -2
- package/esm/AlignmentsFeatureDetail/Formatter.js +0 -3
- package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.d.ts +3 -5
- package/esm/AlignmentsFeatureDetail/LaunchPairedEndBreakpointSplitViewPanel.js +5 -10
- package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.d.ts +3 -5
- package/esm/AlignmentsFeatureDetail/LaunchSupplementaryAlignmentBreakpointSplitViewPanel.js +37 -36
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.d.ts +2 -2
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +3 -4
- package/esm/AlignmentsFeatureDetail/PairLink.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/PairLink.js +0 -1
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.d.ts +2 -2
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +5 -6
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignmentsLocStrings.js +2 -6
- package/esm/AlignmentsFeatureDetail/getSAFeatures.d.ts +2 -2
- package/esm/AlignmentsFeatureDetail/getSAFeatures.js +2 -6
- package/esm/AlignmentsFeatureDetail/index.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.d.ts +2 -2
- package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +3 -3
- package/esm/AlignmentsFeatureDetail/stateModelFactory.js +1 -1
- package/esm/AlignmentsFeatureDetail/tagInfo.js +1 -1
- package/esm/AlignmentsFeatureDetail/util.d.ts +1 -1
- package/esm/AlignmentsTrack/configSchemaF.d.ts +1 -1
- package/esm/AlignmentsTrack/configSchemaF.js +1 -8
- package/esm/AlignmentsTrack/index.d.ts +1 -1
- package/esm/AlignmentsTrack/index.js +0 -3
- package/esm/BamAdapter/BamAdapter.d.ts +8 -6
- package/esm/BamAdapter/BamAdapter.js +36 -31
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +6 -20
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +43 -76
- package/esm/BamAdapter/configSchema.d.ts +0 -17
- package/esm/BamAdapter/configSchema.js +1 -22
- package/esm/BamAdapter/index.d.ts +1 -1
- package/esm/CramAdapter/CramAdapter.d.ts +8 -10
- package/esm/CramAdapter/CramAdapter.js +28 -34
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +23 -29
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +59 -75
- package/esm/CramAdapter/CramTestAdapters.d.ts +3 -3
- package/esm/CramAdapter/CramTestAdapters.js +4 -5
- package/esm/CramAdapter/configSchema.d.ts +0 -14
- package/esm/CramAdapter/configSchema.js +1 -19
- package/esm/CramAdapter/index.d.ts +1 -1
- package/esm/CramAdapter/index.js +0 -1
- package/esm/CramAdapter/util.d.ts +2 -11
- package/esm/CramAdapter/util.js +1 -24
- package/esm/GuessAlignmentsTypes/index.d.ts +1 -1
- package/esm/GuessAlignmentsTypes/index.js +1 -1
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +2 -2
- package/esm/HtsgetBamAdapter/configSchema.d.ts +0 -9
- package/esm/HtsgetBamAdapter/configSchema.js +1 -14
- package/esm/HtsgetBamAdapter/index.d.ts +1 -1
- package/esm/HtsgetBamAdapter/index.js +1 -1
- package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +2 -5
- package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +1 -31
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +2 -2
- package/esm/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +2 -16
- package/esm/LinearAlignmentsDisplay/configSchema.js +16 -0
- package/esm/LinearAlignmentsDisplay/index.d.ts +1 -1
- package/esm/LinearAlignmentsDisplay/index.js +2 -3
- package/esm/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +7 -73
- package/esm/LinearAlignmentsDisplay/{models/model.js → model.js} +14 -83
- package/esm/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +1 -1
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +34 -181
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +74 -151
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +5 -3
- package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +2 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +111 -56
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +2 -6
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -1
- package/esm/LinearPileupDisplay/components/SetFeatureHeightDialog.js +2 -2
- package/esm/LinearPileupDisplay/components/SetMaxHeightDialog.js +2 -2
- package/esm/LinearPileupDisplay/components/SortByTagDialog.js +8 -6
- package/esm/LinearPileupDisplay/configSchema.d.ts +13 -16
- package/esm/LinearPileupDisplay/configSchema.js +12 -30
- package/esm/LinearPileupDisplay/index.d.ts +1 -1
- package/esm/LinearPileupDisplay/index.js +2 -2
- package/esm/LinearPileupDisplay/model.d.ts +121 -123
- package/esm/LinearPileupDisplay/model.js +111 -125
- package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +1 -1
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +3 -7
- package/esm/LinearReadArcsDisplay/configSchema.d.ts +12 -20
- package/esm/LinearReadArcsDisplay/configSchema.js +8 -31
- package/esm/LinearReadArcsDisplay/drawFeats.d.ts +1 -1
- package/esm/LinearReadArcsDisplay/drawFeats.js +1 -9
- package/esm/LinearReadArcsDisplay/index.d.ts +1 -1
- package/esm/LinearReadArcsDisplay/index.js +1 -2
- package/esm/LinearReadArcsDisplay/model.d.ts +13 -90
- package/esm/LinearReadArcsDisplay/model.js +25 -113
- package/esm/LinearReadArcsDisplay/util.d.ts +1 -1
- package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +1 -1
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +3 -7
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +5 -17
- package/esm/LinearReadCloudDisplay/configSchema.js +3 -28
- package/esm/LinearReadCloudDisplay/drawFeats.d.ts +1 -1
- package/esm/LinearReadCloudDisplay/drawFeats.js +2 -2
- package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +4 -4
- package/esm/LinearReadCloudDisplay/drawLongReadChains.js +1 -4
- package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +4 -4
- package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -3
- package/esm/LinearReadCloudDisplay/index.d.ts +1 -1
- package/esm/LinearReadCloudDisplay/index.js +1 -2
- package/esm/LinearReadCloudDisplay/model.d.ts +14 -64
- package/esm/LinearReadCloudDisplay/model.js +24 -76
- package/esm/LinearReadCloudDisplay/util.js +0 -1
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +50 -20
- package/esm/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +17 -22
- package/esm/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +16 -32
- package/esm/LinearSNPCoverageDisplay/index.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/index.js +3 -3
- package/{dist/LinearSNPCoverageDisplay/models → esm/LinearSNPCoverageDisplay}/model.d.ts +9 -60
- package/esm/LinearSNPCoverageDisplay/{models/model.js → model.js} +69 -147
- package/esm/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/esm/MismatchParser/cigarToMismatches.js +88 -0
- package/esm/MismatchParser/getNextRefPos.d.ts +4 -0
- package/esm/MismatchParser/getNextRefPos.js +35 -0
- package/esm/MismatchParser/index.d.ts +5 -30
- package/esm/MismatchParser/index.js +5 -325
- package/esm/MismatchParser/mdToMismatches.d.ts +3 -0
- package/esm/MismatchParser/mdToMismatches.js +71 -0
- package/esm/ModificationParser/index.d.ts +19 -0
- package/esm/ModificationParser/index.js +121 -0
- package/esm/PileupRPC/base.d.ts +2 -2
- package/esm/PileupRPC/base.js +0 -1
- package/esm/PileupRPC/index.d.ts +1 -1
- package/esm/PileupRPC/index.js +1 -1
- package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +2 -3
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js +2 -4
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +3 -4
- package/esm/PileupRPC/methods/GetReducedFeatures.js +21 -20
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +4 -4
- package/esm/PileupRPC/methods/GetVisibleModifications.js +10 -7
- package/esm/PileupRPC/util.d.ts +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +12 -11
- package/esm/PileupRenderer/PileupLayoutSession.js +2 -5
- package/esm/PileupRenderer/PileupRenderer.d.ts +11 -29
- package/esm/PileupRenderer/PileupRenderer.js +19 -22
- package/esm/PileupRenderer/colorBy.d.ts +2 -2
- package/esm/PileupRenderer/colorBy.js +1 -7
- package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/esm/PileupRenderer/components/PileupRendering.js +1 -4
- package/esm/PileupRenderer/configSchema.d.ts +0 -31
- package/esm/PileupRenderer/configSchema.js +1 -35
- package/esm/PileupRenderer/getAlignmentShapeColor.d.ts +2 -2
- package/esm/PileupRenderer/getAlignmentShapeColor.js +2 -7
- package/esm/PileupRenderer/index.d.ts +1 -1
- package/esm/PileupRenderer/index.js +1 -1
- package/esm/PileupRenderer/layoutFeature.d.ts +2 -2
- package/esm/PileupRenderer/layoutFeature.js +0 -1
- package/esm/PileupRenderer/layoutFeatures.d.ts +5 -2
- package/esm/PileupRenderer/layoutFeatures.js +7 -5
- package/esm/PileupRenderer/makeImageData.d.ts +3 -4
- package/esm/PileupRenderer/makeImageData.js +8 -2
- package/esm/PileupRenderer/renderAlignment.d.ts +3 -3
- package/esm/PileupRenderer/renderAlignment.js +19 -8
- package/esm/PileupRenderer/renderAlignmentShape.d.ts +3 -3
- package/esm/PileupRenderer/renderAlignmentShape.js +102 -21
- package/esm/PileupRenderer/renderMethylation.d.ts +6 -5
- package/esm/PileupRenderer/renderMethylation.js +13 -9
- package/esm/PileupRenderer/renderMismatches.d.ts +3 -3
- package/esm/PileupRenderer/renderMismatches.js +17 -28
- package/esm/PileupRenderer/renderModifications.d.ts +6 -5
- package/esm/PileupRenderer/renderModifications.js +29 -34
- package/esm/PileupRenderer/renderPerBaseLettering.d.ts +4 -3
- package/esm/PileupRenderer/renderPerBaseLettering.js +1 -4
- package/esm/PileupRenderer/renderPerBaseQuality.d.ts +4 -3
- package/esm/PileupRenderer/renderPerBaseQuality.js +3 -5
- package/esm/PileupRenderer/renderSoftClipping.d.ts +5 -5
- package/esm/PileupRenderer/renderSoftClipping.js +7 -11
- package/esm/PileupRenderer/sortUtil.d.ts +3 -8
- package/esm/PileupRenderer/sortUtil.js +13 -16
- package/esm/PileupRenderer/types.d.ts +26 -0
- package/esm/PileupRenderer/types.js +1 -0
- package/esm/PileupRenderer/util.d.ts +2 -2
- package/esm/PileupRenderer/util.js +1 -3
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +4 -3
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +15 -12
- package/esm/SNPCoverageAdapter/configSchema.d.ts +0 -4
- package/esm/SNPCoverageAdapter/configSchema.js +1 -8
- package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +11 -11
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +73 -192
- package/esm/SNPCoverageAdapter/index.d.ts +1 -1
- package/esm/SNPCoverageAdapter/processDepth.d.ts +8 -0
- package/esm/SNPCoverageAdapter/processDepth.js +35 -0
- package/esm/SNPCoverageAdapter/processMismatches.d.ts +9 -0
- package/esm/SNPCoverageAdapter/processMismatches.js +55 -0
- package/esm/SNPCoverageAdapter/processModifications.d.ts +10 -0
- package/esm/SNPCoverageAdapter/processModifications.js +46 -0
- package/esm/SNPCoverageAdapter/processReferenceCpGs.d.ts +9 -0
- package/esm/SNPCoverageAdapter/processReferenceCpGs.js +60 -0
- package/esm/SNPCoverageAdapter/util.d.ts +9 -24
- package/esm/SNPCoverageAdapter/util.js +35 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +6 -4
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +167 -74
- package/esm/SNPCoverageRenderer/configSchema.d.ts +0 -15
- package/esm/SNPCoverageRenderer/configSchema.js +1 -19
- package/esm/SNPCoverageRenderer/index.d.ts +1 -1
- package/esm/SNPCoverageRenderer/index.js +2 -2
- package/esm/index.d.ts +2 -2
- package/esm/index.js +10 -10
- package/esm/shared/afterAttach.d.ts +1 -1
- package/esm/shared/afterAttach.js +0 -2
- package/esm/shared/color.d.ts +1 -11
- package/esm/shared/color.js +0 -14
- package/{dist/shared → esm/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/esm/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +12 -11
- package/{dist/shared → esm/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/esm/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +7 -3
- package/esm/shared/fetchChains.d.ts +2 -2
- package/esm/shared/fetchChains.js +2 -4
- package/esm/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/esm/shared/getMaximumModificationAtEachPosition.js +38 -0
- package/esm/shared/getUniqueModifications.d.ts +14 -0
- package/esm/shared/getUniqueModifications.js +13 -0
- package/esm/shared/getUniqueTags.d.ts +15 -0
- package/esm/shared/getUniqueTags.js +15 -0
- package/esm/shared/{renderSvg.js → renderSvgUtil.js} +0 -2
- package/esm/shared/types.d.ts +94 -0
- package/esm/shared/types.js +1 -0
- package/esm/shared/util.d.ts +19 -1
- package/esm/shared/util.js +47 -0
- package/esm/util.d.ts +10 -7
- package/esm/util.js +24 -34
- package/package.json +4 -5
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -41
- package/dist/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/dist/LinearPileupDisplay/components/ModificationsTable.js +0 -28
- package/dist/shared/index.d.ts +0 -49
- package/dist/shared/index.js +0 -41
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +0 -33
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -36
- package/esm/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/esm/LinearPileupDisplay/components/ModificationsTable.js +0 -22
- package/esm/shared/index.d.ts +0 -49
- package/esm/shared/index.js +0 -36
- /package/dist/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/dist/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/esm/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function layoutFeats(props:
|
|
1
|
+
import type { PreProcessedRenderArgs } from './types';
|
|
2
|
+
export declare function layoutFeats(props: PreProcessedRenderArgs): {
|
|
3
|
+
layoutRecords: import("./layoutFeature").LayoutRecord[];
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
-
import { iterMap } from '@jbrowse/core/util';
|
|
3
|
-
// locals
|
|
2
|
+
import { iterMap, notEmpty } from '@jbrowse/core/util';
|
|
4
3
|
import { layoutFeature } from './layoutFeature';
|
|
5
4
|
import { sortFeature } from './sortUtil';
|
|
6
|
-
// layout determines the height of the canvas that we use to render
|
|
7
5
|
export function layoutFeats(props) {
|
|
8
6
|
const { layout, features, sortedBy, config, bpPerPx, showSoftClip, regions } = props;
|
|
9
7
|
const region = regions[0];
|
|
@@ -12,7 +10,7 @@ export function layoutFeats(props) {
|
|
|
12
10
|
: features;
|
|
13
11
|
const heightPx = readConfObject(config, 'height');
|
|
14
12
|
const displayMode = readConfObject(config, 'displayMode');
|
|
15
|
-
|
|
13
|
+
const layoutRecords = iterMap(featureMap.values(), feature => layoutFeature({
|
|
16
14
|
feature,
|
|
17
15
|
layout,
|
|
18
16
|
bpPerPx,
|
|
@@ -20,5 +18,9 @@ export function layoutFeats(props) {
|
|
|
20
18
|
showSoftClip,
|
|
21
19
|
heightPx,
|
|
22
20
|
displayMode,
|
|
23
|
-
}), featureMap.size);
|
|
21
|
+
}), featureMap.size).filter(notEmpty);
|
|
22
|
+
return {
|
|
23
|
+
layoutRecords,
|
|
24
|
+
height: Math.max(layout.getTotalHeight(), 1),
|
|
25
|
+
};
|
|
24
26
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type RenderArgsWithColor = RenderArgsDeserializedWithFeaturesAndLayout;
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
3
|
interface LayoutFeature {
|
|
5
4
|
heightPx: number;
|
|
6
5
|
topPx: number;
|
|
@@ -10,6 +9,6 @@ export declare function makeImageData({ ctx, layoutRecords, canvasWidth, renderA
|
|
|
10
9
|
ctx: CanvasRenderingContext2D;
|
|
11
10
|
canvasWidth: number;
|
|
12
11
|
layoutRecords: LayoutFeature[];
|
|
13
|
-
renderArgs:
|
|
12
|
+
renderArgs: ProcessedRenderArgs;
|
|
14
13
|
}): undefined;
|
|
15
14
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
2
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
4
4
|
import { renderAlignment } from './renderAlignment';
|
|
5
5
|
import { renderMismatches } from './renderMismatches';
|
|
6
6
|
import { renderSoftClipping } from './renderSoftClipping';
|
|
7
|
+
import { getCharWidthHeight, getColorBaseMap, getContrastBaseMap, shouldDrawIndels, shouldDrawSNPsMuted, } from './util';
|
|
7
8
|
export function makeImageData({ ctx, layoutRecords, canvasWidth, renderArgs, }) {
|
|
8
|
-
const { config, showSoftClip, colorBy, theme: configTheme } = renderArgs;
|
|
9
|
+
const { stopToken, config, showSoftClip, colorBy, theme: configTheme, } = renderArgs;
|
|
9
10
|
const mismatchAlpha = readConfObject(config, 'mismatchAlpha');
|
|
10
11
|
const minSubfeatureWidth = readConfObject(config, 'minSubfeatureWidth');
|
|
11
12
|
const largeInsertionIndicatorScale = readConfObject(config, 'largeInsertionIndicatorScale');
|
|
@@ -17,7 +18,12 @@ export function makeImageData({ ctx, layoutRecords, canvasWidth, renderArgs, })
|
|
|
17
18
|
const { charWidth, charHeight } = getCharWidthHeight();
|
|
18
19
|
const drawSNPsMuted = shouldDrawSNPsMuted(colorBy === null || colorBy === void 0 ? void 0 : colorBy.type);
|
|
19
20
|
const drawIndels = shouldDrawIndels();
|
|
21
|
+
let start = performance.now();
|
|
20
22
|
for (const feat of layoutRecords) {
|
|
23
|
+
if (performance.now() - start > 400) {
|
|
24
|
+
checkStopToken(stopToken);
|
|
25
|
+
start = performance.now();
|
|
26
|
+
}
|
|
21
27
|
renderAlignment({
|
|
22
28
|
ctx,
|
|
23
29
|
feat,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { LayoutFeature } from './util';
|
|
3
3
|
export declare function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastForBase, charWidth, charHeight, defaultColor, canvasWidth, }: {
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
5
5
|
feat: LayoutFeature;
|
|
6
|
-
renderArgs:
|
|
6
|
+
renderArgs: ProcessedRenderArgs;
|
|
7
7
|
colorForBase: Record<string, string>;
|
|
8
8
|
contrastForBase: Record<string, string>;
|
|
9
9
|
charWidth: number;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getAlignmentShapeColor } from './getAlignmentShapeColor';
|
|
2
2
|
import { renderAlignmentShape } from './renderAlignmentShape';
|
|
3
|
-
import { renderPerBaseQuality } from './renderPerBaseQuality';
|
|
4
|
-
import { renderPerBaseLettering } from './renderPerBaseLettering';
|
|
5
3
|
import { renderModifications } from './renderModifications';
|
|
4
|
+
import { renderPerBaseLettering } from './renderPerBaseLettering';
|
|
5
|
+
import { renderPerBaseQuality } from './renderPerBaseQuality';
|
|
6
|
+
import { parseCigar } from '../MismatchParser';
|
|
6
7
|
import { renderMethylation } from './renderMethylation';
|
|
7
8
|
export function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastForBase, charWidth, charHeight, defaultColor, canvasWidth, }) {
|
|
8
9
|
const { config, bpPerPx, regions, colorBy, colorTagMap = {} } = renderArgs;
|
|
@@ -18,19 +19,21 @@ export function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastF
|
|
|
18
19
|
colorTagMap,
|
|
19
20
|
});
|
|
20
21
|
renderAlignmentShape({ ctx, feat, renderArgs });
|
|
21
|
-
// second pass for color types that render per-base things that go over the
|
|
22
|
-
// existing drawing
|
|
23
22
|
switch (colorType) {
|
|
24
|
-
case 'perBaseQuality':
|
|
23
|
+
case 'perBaseQuality': {
|
|
24
|
+
const cigarOps = parseCigar(feature.get('CIGAR'));
|
|
25
25
|
renderPerBaseQuality({
|
|
26
26
|
ctx,
|
|
27
27
|
feat,
|
|
28
28
|
region,
|
|
29
29
|
bpPerPx,
|
|
30
30
|
canvasWidth,
|
|
31
|
+
cigarOps,
|
|
31
32
|
});
|
|
32
33
|
break;
|
|
33
|
-
|
|
34
|
+
}
|
|
35
|
+
case 'perBaseLettering': {
|
|
36
|
+
const cigarOps = parseCigar(feature.get('CIGAR'));
|
|
34
37
|
renderPerBaseLettering({
|
|
35
38
|
ctx,
|
|
36
39
|
feat,
|
|
@@ -41,9 +44,12 @@ export function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastF
|
|
|
41
44
|
charWidth,
|
|
42
45
|
charHeight,
|
|
43
46
|
canvasWidth,
|
|
47
|
+
cigarOps,
|
|
44
48
|
});
|
|
45
49
|
break;
|
|
46
|
-
|
|
50
|
+
}
|
|
51
|
+
case 'modifications': {
|
|
52
|
+
const cigarOps = parseCigar(feature.get('CIGAR'));
|
|
47
53
|
renderModifications({
|
|
48
54
|
ctx,
|
|
49
55
|
feat,
|
|
@@ -51,9 +57,12 @@ export function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastF
|
|
|
51
57
|
bpPerPx,
|
|
52
58
|
renderArgs,
|
|
53
59
|
canvasWidth,
|
|
60
|
+
cigarOps,
|
|
54
61
|
});
|
|
55
62
|
break;
|
|
56
|
-
|
|
63
|
+
}
|
|
64
|
+
case 'methylation': {
|
|
65
|
+
const cigarOps = parseCigar(feature.get('CIGAR'));
|
|
57
66
|
renderMethylation({
|
|
58
67
|
ctx,
|
|
59
68
|
feat,
|
|
@@ -61,7 +70,9 @@ export function renderAlignment({ ctx, feat, renderArgs, colorForBase, contrastF
|
|
|
61
70
|
bpPerPx,
|
|
62
71
|
renderArgs,
|
|
63
72
|
canvasWidth,
|
|
73
|
+
cigarOps,
|
|
64
74
|
});
|
|
65
75
|
break;
|
|
76
|
+
}
|
|
66
77
|
}
|
|
67
78
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LayoutFeature } from './util';
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { LayoutFeature } from './util';
|
|
3
3
|
export declare function renderAlignmentShape({ ctx, feat, renderArgs, }: {
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
5
5
|
feat: LayoutFeature;
|
|
6
|
-
renderArgs:
|
|
6
|
+
renderArgs: ProcessedRenderArgs;
|
|
7
7
|
}): void;
|
|
@@ -1,36 +1,117 @@
|
|
|
1
1
|
import { bpSpanPx } from '@jbrowse/core/util';
|
|
2
|
+
import { parseCigar } from '../MismatchParser';
|
|
2
3
|
export function renderAlignmentShape({ ctx, feat, renderArgs, }) {
|
|
3
4
|
const { regions, bpPerPx } = renderArgs;
|
|
4
5
|
const { heightPx, topPx, feature } = feat;
|
|
5
6
|
const region = regions[0];
|
|
6
7
|
const s = feature.get('start');
|
|
7
8
|
const e = feature.get('end');
|
|
8
|
-
const
|
|
9
|
+
const CIGAR = feature.get('CIGAR');
|
|
9
10
|
const flip = region.reversed ? -1 : 1;
|
|
10
11
|
const strand = feature.get('strand') * flip;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const renderChevrons = bpPerPx < 10 && heightPx > 5;
|
|
13
|
+
if (CIGAR === null || CIGAR === void 0 ? void 0 : CIGAR.includes('N')) {
|
|
14
|
+
const cigarOps = parseCigar(CIGAR);
|
|
15
|
+
if (strand === 1) {
|
|
16
|
+
let drawLen = 0;
|
|
17
|
+
let drawStart = s;
|
|
18
|
+
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
19
|
+
const opLen = +cigarOps[i];
|
|
20
|
+
const op = cigarOps[i + 1];
|
|
21
|
+
if (op === 'M' || op === 'X' || op === '=' || op === 'D') {
|
|
22
|
+
drawLen += opLen;
|
|
23
|
+
}
|
|
24
|
+
else if (op === 'N') {
|
|
25
|
+
if (drawStart !== drawLen) {
|
|
26
|
+
const [leftPx, rightPx] = bpSpanPx(drawStart, drawStart + drawLen, region, bpPerPx);
|
|
27
|
+
const w = rightPx - leftPx;
|
|
28
|
+
ctx.fillRect(leftPx, topPx, w, heightPx);
|
|
29
|
+
}
|
|
30
|
+
drawStart += drawLen + opLen;
|
|
31
|
+
drawLen = 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (drawStart !== drawLen) {
|
|
35
|
+
const [leftPx, rightPx] = bpSpanPx(drawStart, drawStart + drawLen, region, bpPerPx);
|
|
36
|
+
const w = rightPx - leftPx;
|
|
37
|
+
if (renderChevrons) {
|
|
38
|
+
ctx.beginPath();
|
|
39
|
+
ctx.moveTo(leftPx, topPx);
|
|
40
|
+
ctx.lineTo(leftPx, topPx + heightPx);
|
|
41
|
+
ctx.lineTo(rightPx, topPx + heightPx);
|
|
42
|
+
ctx.lineTo(rightPx + 5, topPx + heightPx / 2);
|
|
43
|
+
ctx.lineTo(rightPx, topPx);
|
|
44
|
+
ctx.closePath();
|
|
45
|
+
ctx.fill();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
ctx.fillRect(leftPx, topPx, w, heightPx);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
21
51
|
}
|
|
22
|
-
else {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
52
|
+
else if (strand === -1) {
|
|
53
|
+
let drawLen = 0;
|
|
54
|
+
let drawStart = e;
|
|
55
|
+
for (let i = cigarOps.length - 2; i >= 0; i -= 2) {
|
|
56
|
+
const opLen = +cigarOps[i];
|
|
57
|
+
const op = cigarOps[i + 1];
|
|
58
|
+
if (op === 'M' || op === 'X' || op === '=' || op === 'D') {
|
|
59
|
+
drawLen += opLen;
|
|
60
|
+
}
|
|
61
|
+
else if (op === 'N') {
|
|
62
|
+
if (drawLen !== 0) {
|
|
63
|
+
const [leftPx, rightPx] = bpSpanPx(drawStart - drawLen, drawStart, region, bpPerPx);
|
|
64
|
+
ctx.fillRect(leftPx, topPx, rightPx - leftPx, heightPx);
|
|
65
|
+
}
|
|
66
|
+
drawStart -= drawLen + opLen;
|
|
67
|
+
drawLen = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (drawLen !== 0) {
|
|
71
|
+
const [leftPx, rightPx] = bpSpanPx(drawStart - drawLen, drawStart, region, bpPerPx);
|
|
72
|
+
const w = rightPx - leftPx;
|
|
73
|
+
if (renderChevrons) {
|
|
74
|
+
ctx.beginPath();
|
|
75
|
+
ctx.moveTo(leftPx - 5, topPx + heightPx / 2);
|
|
76
|
+
ctx.lineTo(leftPx, topPx + heightPx);
|
|
77
|
+
ctx.lineTo(rightPx, topPx + heightPx);
|
|
78
|
+
ctx.lineTo(rightPx, topPx);
|
|
79
|
+
ctx.lineTo(leftPx, topPx);
|
|
80
|
+
ctx.closePath();
|
|
81
|
+
ctx.fill();
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
ctx.fillRect(leftPx, topPx, w, heightPx);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
31
87
|
}
|
|
32
88
|
}
|
|
33
89
|
else {
|
|
34
|
-
|
|
90
|
+
const [leftPx, rightPx] = bpSpanPx(s, e, region, bpPerPx);
|
|
91
|
+
if (bpPerPx < 10 && heightPx > 5) {
|
|
92
|
+
if (strand === -1) {
|
|
93
|
+
ctx.beginPath();
|
|
94
|
+
ctx.moveTo(leftPx - 5, topPx + heightPx / 2);
|
|
95
|
+
ctx.lineTo(leftPx, topPx + heightPx);
|
|
96
|
+
ctx.lineTo(rightPx, topPx + heightPx);
|
|
97
|
+
ctx.lineTo(rightPx, topPx);
|
|
98
|
+
ctx.lineTo(leftPx, topPx);
|
|
99
|
+
ctx.closePath();
|
|
100
|
+
ctx.fill();
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
ctx.beginPath();
|
|
104
|
+
ctx.moveTo(leftPx, topPx);
|
|
105
|
+
ctx.lineTo(leftPx, topPx + heightPx);
|
|
106
|
+
ctx.lineTo(rightPx, topPx + heightPx);
|
|
107
|
+
ctx.lineTo(rightPx + 5, topPx + heightPx / 2);
|
|
108
|
+
ctx.lineTo(rightPx, topPx);
|
|
109
|
+
ctx.closePath();
|
|
110
|
+
ctx.fill();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
ctx.fillRect(leftPx, topPx, rightPx - leftPx, heightPx);
|
|
115
|
+
}
|
|
35
116
|
}
|
|
36
117
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LayoutFeature } from './util';
|
|
3
|
-
import {
|
|
4
|
-
export declare function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, }: {
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { LayoutFeature } from './util';
|
|
3
|
+
import type { Region } from '@jbrowse/core/util';
|
|
4
|
+
export declare function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, cigarOps, }: {
|
|
5
5
|
ctx: CanvasRenderingContext2D;
|
|
6
6
|
feat: LayoutFeature;
|
|
7
7
|
region: Region;
|
|
8
8
|
bpPerPx: number;
|
|
9
|
-
renderArgs:
|
|
9
|
+
renderArgs: ProcessedRenderArgs;
|
|
10
10
|
canvasWidth: number;
|
|
11
|
+
cigarOps: string[];
|
|
11
12
|
}): void;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { bpSpanPx } from '@jbrowse/core/util';
|
|
2
|
-
import { getMethBins } from '../MismatchParser';
|
|
3
|
-
import { fillRect } from './util';
|
|
4
2
|
import { colord } from '@jbrowse/core/util/colord';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, }) {
|
|
8
|
-
var _a, _b;
|
|
3
|
+
import { fillRect } from './util';
|
|
4
|
+
import { getMethBins } from '../ModificationParser';
|
|
5
|
+
export function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, cigarOps, }) {
|
|
9
6
|
const { regionSequence } = renderArgs;
|
|
10
7
|
const { feature, topPx, heightPx } = feat;
|
|
11
8
|
if (!regionSequence) {
|
|
@@ -17,7 +14,7 @@ export function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canv
|
|
|
17
14
|
}
|
|
18
15
|
const fstart = feature.get('start');
|
|
19
16
|
const fend = feature.get('end');
|
|
20
|
-
const { methBins, methProbs } = getMethBins(feature);
|
|
17
|
+
const { methBins, methProbs, hydroxyMethBins, hydroxyMethProbs } = getMethBins(feature, cigarOps);
|
|
21
18
|
function getCol(k) {
|
|
22
19
|
if (methBins[k]) {
|
|
23
20
|
const p = methProbs[k] || 0;
|
|
@@ -25,12 +22,19 @@ export function renderMethylation({ ctx, feat, region, bpPerPx, renderArgs, canv
|
|
|
25
22
|
? colord('red').alpha((p - 0.5) * 2)
|
|
26
23
|
: colord('blue').alpha(1 - p * 2)).toHslString();
|
|
27
24
|
}
|
|
25
|
+
if (hydroxyMethBins[k]) {
|
|
26
|
+
const p = hydroxyMethProbs[k] || 0;
|
|
27
|
+
return (p > 0.5
|
|
28
|
+
? colord('pink').alpha((p - 0.5) * 2)
|
|
29
|
+
: colord('purple').alpha(1 - p * 2)).toHslString();
|
|
30
|
+
}
|
|
28
31
|
return undefined;
|
|
29
32
|
}
|
|
33
|
+
const r = regionSequence.toLowerCase();
|
|
30
34
|
for (let i = 0; i < fend - fstart; i++) {
|
|
31
35
|
const j = i + fstart;
|
|
32
|
-
const l1 =
|
|
33
|
-
const l2 =
|
|
36
|
+
const l1 = r[j - region.start + 1];
|
|
37
|
+
const l2 = r[j - region.start + 2];
|
|
34
38
|
if (l1 === 'c' && l2 === 'g') {
|
|
35
39
|
if (bpPerPx > 2) {
|
|
36
40
|
const [leftPx, rightPx] = bpSpanPx(j, j + 2, region, bpPerPx);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { LayoutFeature } from './util';
|
|
3
3
|
export declare function renderMismatches({ ctx, feat, renderArgs, minSubfeatureWidth, largeInsertionIndicatorScale, mismatchAlpha, charWidth, charHeight, colorForBase, contrastForBase, canvasWidth, drawSNPsMuted, drawIndels, }: {
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
5
5
|
feat: LayoutFeature;
|
|
6
|
-
renderArgs:
|
|
6
|
+
renderArgs: ProcessedRenderArgs;
|
|
7
7
|
colorForBase: Record<string, string>;
|
|
8
8
|
contrastForBase: Record<string, string>;
|
|
9
9
|
mismatchAlpha?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bpSpanPx, measureText } from '@jbrowse/core/util';
|
|
2
|
-
import { fillRect } from './util';
|
|
3
2
|
import { colord } from '@jbrowse/core/util/colord';
|
|
3
|
+
import { fillRect } from './util';
|
|
4
4
|
export function renderMismatches({ ctx, feat, renderArgs, minSubfeatureWidth, largeInsertionIndicatorScale, mismatchAlpha, charWidth, charHeight, colorForBase, contrastForBase, canvasWidth, drawSNPsMuted, drawIndels = true, }) {
|
|
5
5
|
const { bpPerPx, regions } = renderArgs;
|
|
6
6
|
const { heightPx, topPx, feature } = feat;
|
|
@@ -9,44 +9,36 @@ export function renderMismatches({ ctx, feat, renderArgs, minSubfeatureWidth, la
|
|
|
9
9
|
const pxPerBp = Math.min(1 / bpPerPx, 2);
|
|
10
10
|
const mismatches = feature.get('mismatches');
|
|
11
11
|
const heightLim = charHeight - 2;
|
|
12
|
-
// extraHorizontallyFlippedOffset is used to draw interbase items, which
|
|
13
|
-
// are located to the left when forward and right when reversed
|
|
14
12
|
const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx + 1 : -1;
|
|
15
13
|
if (!mismatches) {
|
|
16
14
|
return;
|
|
17
15
|
}
|
|
18
|
-
// two pass rendering: first pass, draw all the mismatches except wide
|
|
19
|
-
// insertion markers
|
|
20
16
|
for (const mismatch of mismatches) {
|
|
21
17
|
const mstart = start + mismatch.start;
|
|
22
18
|
const mlen = mismatch.length;
|
|
23
19
|
const mbase = mismatch.base;
|
|
24
20
|
const [leftPx, rightPx] = bpSpanPx(mstart, mstart + mlen, region, bpPerPx);
|
|
25
|
-
const widthPx = Math.max(minSubfeatureWidth,
|
|
21
|
+
const widthPx = Math.max(minSubfeatureWidth, rightPx - leftPx);
|
|
26
22
|
if (mismatch.type === 'mismatch') {
|
|
27
23
|
if (!drawSNPsMuted) {
|
|
28
24
|
const baseColor = colorForBase[mismatch.base] || '#888';
|
|
29
|
-
const c = mismatchAlpha
|
|
30
|
-
?
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.alpha(Math.min(1, mismatch.qual / 50))
|
|
34
|
-
.toHslString()
|
|
25
|
+
const c = mismatchAlpha && mismatch.qual !== undefined
|
|
26
|
+
? colord(baseColor)
|
|
27
|
+
.alpha(Math.min(1, mismatch.qual / 50))
|
|
28
|
+
.toHslString()
|
|
35
29
|
: baseColor;
|
|
36
30
|
fillRect(ctx, Math.round(leftPx), topPx, widthPx, heightPx, canvasWidth, c);
|
|
37
31
|
}
|
|
38
32
|
if (widthPx >= charWidth && heightPx >= heightLim) {
|
|
39
|
-
// normal SNP coloring
|
|
40
33
|
const contrastColor = drawSNPsMuted
|
|
41
34
|
? 'black'
|
|
42
35
|
: contrastForBase[mismatch.base] || 'black';
|
|
43
|
-
ctx.fillStyle =
|
|
44
|
-
|
|
45
|
-
? contrastColor
|
|
46
|
-
: colord(contrastColor)
|
|
36
|
+
ctx.fillStyle =
|
|
37
|
+
mismatchAlpha && mismatch.qual !== undefined
|
|
38
|
+
? colord(contrastColor)
|
|
47
39
|
.alpha(Math.min(1, mismatch.qual / 50))
|
|
48
40
|
.toHslString()
|
|
49
|
-
|
|
41
|
+
: contrastColor;
|
|
50
42
|
ctx.fillText(mbase, leftPx + (widthPx - charWidth) / 2 + 1, topPx + heightPx);
|
|
51
43
|
}
|
|
52
44
|
}
|
|
@@ -60,7 +52,6 @@ export function renderMismatches({ ctx, feat, renderArgs, minSubfeatureWidth, la
|
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
54
|
else if (mismatch.type === 'insertion' && drawIndels) {
|
|
63
|
-
ctx.fillStyle = 'purple';
|
|
64
55
|
const pos = leftPx + extraHorizontallyFlippedOffset;
|
|
65
56
|
const len = +mismatch.base || mismatch.length;
|
|
66
57
|
const insW = Math.max(0, Math.min(1.2, 1 / bpPerPx));
|
|
@@ -87,26 +78,24 @@ export function renderMismatches({ ctx, feat, renderArgs, minSubfeatureWidth, la
|
|
|
87
78
|
}
|
|
88
79
|
}
|
|
89
80
|
else if (mismatch.type === 'skip') {
|
|
90
|
-
// fix to avoid bad rendering note that this was also related to chrome
|
|
91
|
-
// bug https://bugs.chromium.org/p/chromium/issues/detail?id=1131528
|
|
92
|
-
// also affected firefox ref #1236 #2750
|
|
93
81
|
if (leftPx + widthPx > 0) {
|
|
94
|
-
// make small exons more visible when zoomed far out
|
|
95
82
|
const adjustPx = widthPx - (bpPerPx > 10 ? 1.5 : 0);
|
|
96
|
-
|
|
97
|
-
|
|
83
|
+
const l = Math.max(0, leftPx);
|
|
84
|
+
const t = topPx + heightPx / 2 - 1;
|
|
85
|
+
const w = adjustPx + Math.min(leftPx, 0);
|
|
86
|
+
const h = 1;
|
|
87
|
+
fillRect(ctx, l, t, w, h, canvasWidth, 'rgb(151,184,201)');
|
|
98
88
|
}
|
|
99
89
|
}
|
|
100
90
|
}
|
|
101
|
-
// second pass, draw wide insertion markers on top
|
|
102
91
|
if (drawIndels) {
|
|
103
92
|
for (const mismatch of mismatches) {
|
|
104
93
|
const mstart = start + mismatch.start;
|
|
105
94
|
const mlen = mismatch.length;
|
|
106
|
-
const [leftPx] = bpSpanPx(mstart, mstart + mlen, region, bpPerPx);
|
|
107
95
|
const len = +mismatch.base || mismatch.length;
|
|
108
|
-
const txt = `${len}`;
|
|
109
96
|
if (mismatch.type === 'insertion' && len >= 10) {
|
|
97
|
+
const [leftPx] = bpSpanPx(mstart, mstart + mlen, region, bpPerPx);
|
|
98
|
+
const txt = `${len}`;
|
|
110
99
|
if (bpPerPx > largeInsertionIndicatorScale) {
|
|
111
100
|
fillRect(ctx, leftPx - 1, topPx, 2, heightPx, canvasWidth, 'purple');
|
|
112
101
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LayoutFeature } from './util';
|
|
3
|
-
import {
|
|
4
|
-
export declare function renderModifications({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, }: {
|
|
1
|
+
import type { ProcessedRenderArgs } from './types';
|
|
2
|
+
import type { LayoutFeature } from './util';
|
|
3
|
+
import type { Region } from '@jbrowse/core/util';
|
|
4
|
+
export declare function renderModifications({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, cigarOps, }: {
|
|
5
5
|
ctx: CanvasRenderingContext2D;
|
|
6
6
|
feat: LayoutFeature;
|
|
7
7
|
region: Region;
|
|
8
8
|
bpPerPx: number;
|
|
9
|
-
renderArgs:
|
|
9
|
+
renderArgs: ProcessedRenderArgs;
|
|
10
10
|
canvasWidth: number;
|
|
11
|
+
cigarOps: string[];
|
|
11
12
|
}): void;
|
|
@@ -1,45 +1,40 @@
|
|
|
1
|
-
import { bpSpanPx } from '@jbrowse/core/util';
|
|
2
|
-
import { getModificationPositions, getModificationProbabilities, getNextRefPos, parseCigar, } from '../MismatchParser';
|
|
3
|
-
import { getTagAlt } from '../util';
|
|
1
|
+
import { bpSpanPx, max, sum } from '@jbrowse/core/util';
|
|
4
2
|
import { fillRect } from './util';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// https://github.com/samtools/hts-specs/pull/418/files#diff-e765c6479316309f56b636f88189cdde8c40b854c7bdcce9ee7fe87a4e76febcR596
|
|
10
|
-
//
|
|
11
|
-
// if we have ML or Ml, it is an 8bit probability, divide by 255
|
|
12
|
-
//
|
|
13
|
-
// if we have MP or Mp it is phred scaled ASCII, which can go up to 90 but
|
|
14
|
-
// has very high likelihood basecalls at that point, we really only care
|
|
15
|
-
// about low qual calls <20 approx
|
|
16
|
-
export function renderModifications({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, }) {
|
|
3
|
+
import { getMaxProbModAtEachPosition } from '../shared/getMaximumModificationAtEachPosition';
|
|
4
|
+
import { alphaColor } from '../shared/util';
|
|
5
|
+
export function renderModifications({ ctx, feat, region, bpPerPx, renderArgs, canvasWidth, cigarOps, }) {
|
|
6
|
+
var _a, _b, _c;
|
|
17
7
|
const { feature, topPx, heightPx } = feat;
|
|
18
|
-
const {
|
|
8
|
+
const { colorBy, visibleModifications = {} } = renderArgs;
|
|
19
9
|
const seq = feature.get('seq');
|
|
20
10
|
if (!seq) {
|
|
21
11
|
return;
|
|
22
12
|
}
|
|
23
|
-
const mm = getTagAlt(feature, 'MM', 'Mm') || '';
|
|
24
|
-
const cigar = feature.get('CIGAR');
|
|
25
13
|
const start = feature.get('start');
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
const isolatedModification = (_a = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _a === void 0 ? void 0 : _a.isolatedModification;
|
|
15
|
+
const twoColor = (_b = colorBy === null || colorBy === void 0 ? void 0 : colorBy.modifications) === null || _b === void 0 ? void 0 : _b.twoColor;
|
|
16
|
+
(_c = getMaxProbModAtEachPosition(feature, cigarOps)) === null || _c === void 0 ? void 0 : _c.forEach(({ allProbs, prob, type }, pos) => {
|
|
17
|
+
const r = start + pos;
|
|
18
|
+
const [leftPx, rightPx] = bpSpanPx(r, r + 1, region, bpPerPx);
|
|
19
|
+
const mod = visibleModifications[type];
|
|
20
|
+
if (!mod) {
|
|
21
|
+
console.warn(`${type} not known yet`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (isolatedModification && mod.type !== isolatedModification) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const col = mod.color || 'black';
|
|
28
|
+
const s = 1 - sum(allProbs);
|
|
29
|
+
if (twoColor && s > max(allProbs)) {
|
|
30
|
+
const c = alphaColor('blue', s);
|
|
40
31
|
const w = rightPx - leftPx + 0.5;
|
|
41
32
|
fillRect(ctx, leftPx, topPx, w, heightPx, canvasWidth, c);
|
|
42
|
-
probIndex++;
|
|
43
33
|
}
|
|
44
|
-
|
|
34
|
+
else {
|
|
35
|
+
const c = alphaColor(col, prob);
|
|
36
|
+
const w = rightPx - leftPx + 0.5;
|
|
37
|
+
fillRect(ctx, leftPx, topPx, w, heightPx, canvasWidth, c);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
45
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare function renderPerBaseLettering({ ctx, feat, region, bpPerPx, colorForBase, contrastForBase, charWidth, charHeight, canvasWidth, }: {
|
|
1
|
+
import type { LayoutFeature } from './util';
|
|
2
|
+
import type { Region } from '@jbrowse/core/util';
|
|
3
|
+
export declare function renderPerBaseLettering({ ctx, feat, region, bpPerPx, colorForBase, contrastForBase, charWidth, charHeight, canvasWidth, cigarOps, }: {
|
|
4
4
|
ctx: CanvasRenderingContext2D;
|
|
5
5
|
feat: LayoutFeature;
|
|
6
6
|
region: Region;
|
|
@@ -10,4 +10,5 @@ export declare function renderPerBaseLettering({ ctx, feat, region, bpPerPx, col
|
|
|
10
10
|
charWidth: number;
|
|
11
11
|
charHeight: number;
|
|
12
12
|
canvasWidth: number;
|
|
13
|
+
cigarOps: string[];
|
|
13
14
|
}): void;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { bpSpanPx } from '@jbrowse/core/util';
|
|
2
|
-
import { parseCigar } from '../MismatchParser';
|
|
3
2
|
import { fillRect } from './util';
|
|
4
|
-
export function renderPerBaseLettering({ ctx, feat, region, bpPerPx, colorForBase, contrastForBase, charWidth, charHeight, canvasWidth, }) {
|
|
3
|
+
export function renderPerBaseLettering({ ctx, feat, region, bpPerPx, colorForBase, contrastForBase, charWidth, charHeight, canvasWidth, cigarOps, }) {
|
|
5
4
|
const heightLim = charHeight - 2;
|
|
6
5
|
const { feature, topPx, heightPx } = feat;
|
|
7
6
|
const seq = feature.get('seq');
|
|
8
|
-
const cigarOps = parseCigar(feature.get('CIGAR'));
|
|
9
7
|
const w = 1 / bpPerPx;
|
|
10
8
|
const start = feature.get('start');
|
|
11
9
|
let soffset = 0;
|
|
@@ -30,7 +28,6 @@ export function renderPerBaseLettering({ ctx, feat, region, bpPerPx, colorForBas
|
|
|
30
28
|
const c = colorForBase[letter];
|
|
31
29
|
fillRect(ctx, leftPx, topPx, w + 0.5, heightPx, canvasWidth, c);
|
|
32
30
|
if (w >= charWidth && heightPx >= heightLim) {
|
|
33
|
-
// normal SNP coloring
|
|
34
31
|
ctx.fillStyle = contrastForBase[letter];
|
|
35
32
|
ctx.fillText(letter, leftPx + (w - charWidth) / 2 + 1, topPx + heightPx);
|
|
36
33
|
}
|