@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,336 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const mdRegex = new RegExp(/(\d+|\^[a-z]+|[a-z])/gi);
|
|
4
|
-
const modificationRegex = new RegExp(/([A-Z])([-+])([^,.?]+)([.?])?/);
|
|
1
|
+
import { cigarToMismatches } from './cigarToMismatches';
|
|
2
|
+
import { mdToMismatches } from './mdToMismatches';
|
|
5
3
|
const cigarRegex = new RegExp(/([MIDNSHPX=])/);
|
|
6
4
|
const startClip = new RegExp(/(\d+)[SH]$/);
|
|
7
5
|
const endClip = new RegExp(/^(\d+)([SH])/);
|
|
8
6
|
export function parseCigar(cigar = '') {
|
|
9
7
|
return cigar.split(cigarRegex).slice(0, -1);
|
|
10
8
|
}
|
|
11
|
-
export function cigarToMismatches(ops, seq, ref, qual) {
|
|
12
|
-
let roffset = 0; // reference offset
|
|
13
|
-
let soffset = 0; // seq offset
|
|
14
|
-
const mismatches = [];
|
|
15
|
-
const hasRefAndSeq = ref && seq;
|
|
16
|
-
for (let i = 0; i < ops.length; i += 2) {
|
|
17
|
-
const len = +ops[i];
|
|
18
|
-
const op = ops[i + 1];
|
|
19
|
-
if (op === 'M' || op === '=' || op === 'E') {
|
|
20
|
-
if (hasRefAndSeq) {
|
|
21
|
-
for (let j = 0; j < len; j++) {
|
|
22
|
-
if (
|
|
23
|
-
// @ts-ignore in the full yarn build of the repo, this says that object is possibly undefined for some reason, ignored
|
|
24
|
-
seq[soffset + j].toUpperCase() !== ref[roffset + j].toUpperCase()) {
|
|
25
|
-
mismatches.push({
|
|
26
|
-
start: roffset + j,
|
|
27
|
-
type: 'mismatch',
|
|
28
|
-
base: seq[soffset + j],
|
|
29
|
-
altbase: ref[roffset + j],
|
|
30
|
-
length: 1,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
soffset += len;
|
|
36
|
-
}
|
|
37
|
-
if (op === 'I') {
|
|
38
|
-
mismatches.push({
|
|
39
|
-
start: roffset,
|
|
40
|
-
type: 'insertion',
|
|
41
|
-
base: `${len}`,
|
|
42
|
-
length: 0,
|
|
43
|
-
});
|
|
44
|
-
soffset += len;
|
|
45
|
-
}
|
|
46
|
-
else if (op === 'D') {
|
|
47
|
-
mismatches.push({
|
|
48
|
-
start: roffset,
|
|
49
|
-
type: 'deletion',
|
|
50
|
-
base: '*',
|
|
51
|
-
length: len,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
else if (op === 'N') {
|
|
55
|
-
mismatches.push({
|
|
56
|
-
start: roffset,
|
|
57
|
-
type: 'skip',
|
|
58
|
-
base: 'N',
|
|
59
|
-
length: len,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
else if (op === 'X') {
|
|
63
|
-
const r = (seq === null || seq === void 0 ? void 0 : seq.slice(soffset, soffset + len)) || [];
|
|
64
|
-
const q = (qual === null || qual === void 0 ? void 0 : qual.subarray(soffset, soffset + len)) || [];
|
|
65
|
-
for (let j = 0; j < len; j++) {
|
|
66
|
-
mismatches.push({
|
|
67
|
-
start: roffset + j,
|
|
68
|
-
type: 'mismatch',
|
|
69
|
-
base: r[j],
|
|
70
|
-
qual: q[j],
|
|
71
|
-
length: 1,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
soffset += len;
|
|
75
|
-
}
|
|
76
|
-
else if (op === 'H') {
|
|
77
|
-
mismatches.push({
|
|
78
|
-
start: roffset,
|
|
79
|
-
type: 'hardclip',
|
|
80
|
-
base: `H${len}`,
|
|
81
|
-
cliplen: len,
|
|
82
|
-
length: 1,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
else if (op === 'S') {
|
|
86
|
-
mismatches.push({
|
|
87
|
-
start: roffset,
|
|
88
|
-
type: 'softclip',
|
|
89
|
-
base: `S${len}`,
|
|
90
|
-
cliplen: len,
|
|
91
|
-
length: 1,
|
|
92
|
-
});
|
|
93
|
-
soffset += len;
|
|
94
|
-
}
|
|
95
|
-
if (op !== 'I' && op !== 'S' && op !== 'H') {
|
|
96
|
-
roffset += len;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return mismatches;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* parse a SAM MD tag to find mismatching bases of the template versus the
|
|
103
|
-
* reference @returns array of mismatches and their positions
|
|
104
|
-
*/
|
|
105
|
-
export function mdToMismatches(mdstring, ops, cigarMismatches, seq, qual) {
|
|
106
|
-
let curr = { start: 0, base: '', length: 0, type: 'mismatch' };
|
|
107
|
-
let lastCigar = 0;
|
|
108
|
-
let lastTemplateOffset = 0;
|
|
109
|
-
let lastRefOffset = 0;
|
|
110
|
-
let lastSkipPos = 0;
|
|
111
|
-
const mismatchRecords = [];
|
|
112
|
-
const skips = cigarMismatches.filter(cigar => cigar.type === 'skip');
|
|
113
|
-
// convert a position on the reference sequence to a position
|
|
114
|
-
// on the template sequence, taking into account hard and soft
|
|
115
|
-
// clipping of reads
|
|
116
|
-
function nextRecord() {
|
|
117
|
-
mismatchRecords.push(curr);
|
|
118
|
-
// get a new mismatch record ready
|
|
119
|
-
curr = {
|
|
120
|
-
start: curr.start + curr.length,
|
|
121
|
-
length: 0,
|
|
122
|
-
base: '',
|
|
123
|
-
type: 'mismatch',
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function getTemplateCoordLocal(refCoord) {
|
|
127
|
-
let templateOffset = lastTemplateOffset;
|
|
128
|
-
let refOffset = lastRefOffset;
|
|
129
|
-
for (let i = lastCigar; i < ops.length && refOffset <= refCoord; i += 2, lastCigar = i) {
|
|
130
|
-
const len = +ops[i];
|
|
131
|
-
const op = ops[i + 1];
|
|
132
|
-
if (op === 'S' || op === 'I') {
|
|
133
|
-
templateOffset += len;
|
|
134
|
-
}
|
|
135
|
-
else if (op === 'D' || op === 'P' || op === 'N') {
|
|
136
|
-
refOffset += len;
|
|
137
|
-
}
|
|
138
|
-
else if (op !== 'H') {
|
|
139
|
-
templateOffset += len;
|
|
140
|
-
refOffset += len;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
lastTemplateOffset = templateOffset;
|
|
144
|
-
lastRefOffset = refOffset;
|
|
145
|
-
return templateOffset - (refOffset - refCoord);
|
|
146
|
-
}
|
|
147
|
-
// now actually parse the MD string
|
|
148
|
-
const md = mdstring.match(mdRegex) || [];
|
|
149
|
-
for (const token of md) {
|
|
150
|
-
const num = +token;
|
|
151
|
-
if (!Number.isNaN(num)) {
|
|
152
|
-
curr.start += num;
|
|
153
|
-
}
|
|
154
|
-
else if (token.startsWith('^')) {
|
|
155
|
-
curr.start += token.length - 1;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
// mismatch
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
160
|
-
for (let j = 0; j < token.length; j += 1) {
|
|
161
|
-
curr.length = 1;
|
|
162
|
-
while (lastSkipPos < skips.length) {
|
|
163
|
-
const mismatch = skips[lastSkipPos];
|
|
164
|
-
if (curr.start >= mismatch.start) {
|
|
165
|
-
curr.start += mismatch.length;
|
|
166
|
-
lastSkipPos++;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const s = getTemplateCoordLocal(curr.start);
|
|
173
|
-
curr.base = seq[s] || 'X';
|
|
174
|
-
curr.qual = qual === null || qual === void 0 ? void 0 : qual[s];
|
|
175
|
-
curr.altbase = token;
|
|
176
|
-
nextRecord();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return mismatchRecords;
|
|
181
|
-
}
|
|
182
9
|
export function getMismatches(cigar, md, seq, ref, qual) {
|
|
183
10
|
let mismatches = [];
|
|
184
11
|
const ops = parseCigar(cigar);
|
|
185
|
-
// parse the CIGAR tag if it has one
|
|
186
12
|
if (cigar) {
|
|
187
13
|
mismatches = mismatches.concat(cigarToMismatches(ops, seq, ref, qual));
|
|
188
14
|
}
|
|
189
|
-
// now let's look for CRAM or MD mismatches
|
|
190
15
|
if (md && seq) {
|
|
191
16
|
mismatches = mismatches.concat(mdToMismatches(md, ops, mismatches, seq, qual));
|
|
192
17
|
}
|
|
193
18
|
return mismatches;
|
|
194
19
|
}
|
|
195
|
-
// get relative reference sequence positions for positions given relative to
|
|
196
|
-
// the read sequence
|
|
197
|
-
export function* getNextRefPos(cigarOps, positions) {
|
|
198
|
-
let readPos = 0;
|
|
199
|
-
let refPos = 0;
|
|
200
|
-
let currPos = 0;
|
|
201
|
-
for (let i = 0; i < cigarOps.length && currPos < positions.length; i += 2) {
|
|
202
|
-
const len = +cigarOps[i];
|
|
203
|
-
const op = cigarOps[i + 1];
|
|
204
|
-
if (op === 'S' || op === 'I') {
|
|
205
|
-
for (let i = 0; i < len && currPos < positions.length; i++) {
|
|
206
|
-
if (positions[currPos] === readPos + i) {
|
|
207
|
-
currPos++;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
readPos += len;
|
|
211
|
-
}
|
|
212
|
-
else if (op === 'D' || op === 'N') {
|
|
213
|
-
refPos += len;
|
|
214
|
-
}
|
|
215
|
-
else if (op === 'M' || op === 'X' || op === '=') {
|
|
216
|
-
for (let i = 0; i < len && currPos < positions.length; i++) {
|
|
217
|
-
if (positions[currPos] === readPos + i) {
|
|
218
|
-
yield refPos + i;
|
|
219
|
-
currPos++;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
readPos += len;
|
|
223
|
-
refPos += len;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
export function getModificationProbabilities(feature) {
|
|
228
|
-
var _a;
|
|
229
|
-
const m = getTagAlt(feature, 'ML', 'Ml') || [];
|
|
230
|
-
return m
|
|
231
|
-
? (typeof m === 'string' ? m.split(',').map(e => +e) : m).map(e => e / 255)
|
|
232
|
-
: (_a = getTagAlt(feature, 'MP', 'Mp')) === null || _a === void 0 ? void 0 : _a.split('').map(s => s.charCodeAt(0) - 33).map(elt => Math.min(1, elt / 50));
|
|
233
|
-
}
|
|
234
|
-
export function getMethBins(feature) {
|
|
235
|
-
const fstart = feature.get('start');
|
|
236
|
-
const fend = feature.get('end');
|
|
237
|
-
const fstrand = feature.get('strand');
|
|
238
|
-
const flen = fend - fstart;
|
|
239
|
-
const mm = getTagAlt(feature, 'MM', 'Mm') || '';
|
|
240
|
-
const methBins = new Array(flen);
|
|
241
|
-
const methProbs = new Array(flen);
|
|
242
|
-
const seq = feature.get('seq');
|
|
243
|
-
if (seq) {
|
|
244
|
-
const ops = parseCigar(feature.get('CIGAR'));
|
|
245
|
-
const probabilities = getModificationProbabilities(feature);
|
|
246
|
-
const modifications = getModificationPositions(mm, seq, fstrand);
|
|
247
|
-
let probIndex = 0;
|
|
248
|
-
for (const { type, positions } of modifications) {
|
|
249
|
-
if (type === 'm') {
|
|
250
|
-
for (const ref of getNextRefPos(ops, positions)) {
|
|
251
|
-
const prob = (probabilities === null || probabilities === void 0 ? void 0 : probabilities[probIndex]) || 0;
|
|
252
|
-
probIndex++;
|
|
253
|
-
if (ref >= 0 && ref < flen) {
|
|
254
|
-
methBins[ref] = 1;
|
|
255
|
-
methProbs[ref] = prob;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return { methBins, methProbs };
|
|
262
|
-
}
|
|
263
|
-
export function getModificationPositions(mm, fseq, fstrand) {
|
|
264
|
-
const seq = fstrand === -1 ? revcom(fseq) : fseq;
|
|
265
|
-
const mods = mm.split(';').filter(mod => !!mod);
|
|
266
|
-
const result = [];
|
|
267
|
-
for (const mod of mods) {
|
|
268
|
-
const [basemod, ...skips] = mod.split(',');
|
|
269
|
-
// regexes based on parse_mm.pl from hts-specs
|
|
270
|
-
const matches = modificationRegex.exec(basemod);
|
|
271
|
-
if (!matches) {
|
|
272
|
-
throw new Error('bad format for MM tag');
|
|
273
|
-
}
|
|
274
|
-
const [, base, strand, typestr] = matches;
|
|
275
|
-
// can be a multi e.g. C+mh for both meth (m) and hydroxymeth (h) so
|
|
276
|
-
// split, and they can also be chemical codes (ChEBI) e.g. C+16061
|
|
277
|
-
const types = typestr.split(/(\d+|.)/).filter(f => !!f);
|
|
278
|
-
if (strand === '-') {
|
|
279
|
-
console.warn('unsupported negative strand modifications');
|
|
280
|
-
// make sure to return a somewhat matching type even in this case
|
|
281
|
-
result.push({ type: 'unsupported', positions: [] });
|
|
282
|
-
}
|
|
283
|
-
// this logic also based on parse_mm.pl from hts-specs is that in the
|
|
284
|
-
// sequence of the read, if we have a modification type e.g. C+m;2 and a
|
|
285
|
-
// sequence ACGTACGTAC we skip the two instances of C and go to the last
|
|
286
|
-
// C
|
|
287
|
-
for (const type of types) {
|
|
288
|
-
let i = 0;
|
|
289
|
-
const positions = [];
|
|
290
|
-
for (const d of skips) {
|
|
291
|
-
let delta = +d;
|
|
292
|
-
do {
|
|
293
|
-
if (base === 'N' || base === seq[i]) {
|
|
294
|
-
delta--;
|
|
295
|
-
}
|
|
296
|
-
i++;
|
|
297
|
-
} while (delta >= 0 && i < seq.length);
|
|
298
|
-
if (fstrand === -1) {
|
|
299
|
-
const pos = seq.length - i;
|
|
300
|
-
if (pos >= 0) {
|
|
301
|
-
// avoid negative-number-positions in array, seen in #4629 cause
|
|
302
|
-
// unknown, could warrant some further investigation
|
|
303
|
-
positions.unshift(pos);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
positions.push(i - 1);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
result.push({
|
|
311
|
-
type,
|
|
312
|
-
positions,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
return result;
|
|
317
|
-
}
|
|
318
|
-
export function getModificationTypes(mm) {
|
|
319
|
-
return mm
|
|
320
|
-
.split(';')
|
|
321
|
-
.filter(mod => !!mod)
|
|
322
|
-
.flatMap(mod => {
|
|
323
|
-
const basemod = mod.split(',')[0];
|
|
324
|
-
const matches = modificationRegex.exec(basemod);
|
|
325
|
-
if (!matches) {
|
|
326
|
-
throw new Error(`bad format for MM tag: ${mm}`);
|
|
327
|
-
}
|
|
328
|
-
const typestr = matches[3];
|
|
329
|
-
// can be a multi e.g. C+mh for both meth (m) and hydroxymeth (h) so
|
|
330
|
-
// split, and they can also be chemical codes (ChEBI) e.g. C+16061
|
|
331
|
-
return typestr.split(/(\d+|.)/).filter(f => !!f);
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
20
|
export function getOrientedCigar(flip, cigar) {
|
|
335
21
|
if (flip) {
|
|
336
22
|
const ret = [];
|
|
@@ -394,16 +80,9 @@ export function getClip(cigar, strand) {
|
|
|
394
80
|
? +(startClip.exec(cigar) || [])[1] || 0
|
|
395
81
|
: +(endClip.exec(cigar) || [])[1] || 0;
|
|
396
82
|
}
|
|
397
|
-
export function getTag(
|
|
398
|
-
|
|
399
|
-
return tags ? tags[tag] : f.get(tag);
|
|
83
|
+
export function getTag(feature, tag) {
|
|
84
|
+
return feature.get('tags')[tag];
|
|
400
85
|
}
|
|
401
|
-
// produces a list of "feature-like" object from parsing supplementary
|
|
402
|
-
// alignments in the SA tag
|
|
403
|
-
//
|
|
404
|
-
// @param normalize - used specifically in the linear-read-vs-ref context, it
|
|
405
|
-
// flips features around relative to the original feature. other contexts of
|
|
406
|
-
// usage can keep this false
|
|
407
86
|
export function featurizeSA(SA, id, strand, readName, normalize) {
|
|
408
87
|
return ((SA === null || SA === void 0 ? void 0 : SA.split(';').filter(aln => !!aln).map((aln, index) => {
|
|
409
88
|
const ret = aln.split(',');
|
|
@@ -434,3 +113,4 @@ export function featurizeSA(SA, id, strand, readName, normalize) {
|
|
|
434
113
|
};
|
|
435
114
|
})) || []);
|
|
436
115
|
}
|
|
116
|
+
export { getNextRefPos } from './getNextRefPos';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const mdRegex = new RegExp(/(\d+|\^[a-z]+|[a-z])/gi);
|
|
2
|
+
export function mdToMismatches(mdstring, ops, cigarMismatches, seq, qual) {
|
|
3
|
+
let curr = { start: 0, base: '', length: 0, type: 'mismatch' };
|
|
4
|
+
let lastCigar = 0;
|
|
5
|
+
let lastTemplateOffset = 0;
|
|
6
|
+
let lastRefOffset = 0;
|
|
7
|
+
let lastSkipPos = 0;
|
|
8
|
+
const mismatchRecords = [];
|
|
9
|
+
const skips = cigarMismatches.filter(cigar => cigar.type === 'skip');
|
|
10
|
+
function nextRecord() {
|
|
11
|
+
mismatchRecords.push(curr);
|
|
12
|
+
curr = {
|
|
13
|
+
start: curr.start + curr.length,
|
|
14
|
+
length: 0,
|
|
15
|
+
base: '',
|
|
16
|
+
type: 'mismatch',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function getTemplateCoordLocal(refCoord) {
|
|
20
|
+
let templateOffset = lastTemplateOffset;
|
|
21
|
+
let refOffset = lastRefOffset;
|
|
22
|
+
for (let i = lastCigar; i < ops.length && refOffset <= refCoord; i += 2, lastCigar = i) {
|
|
23
|
+
const len = +ops[i];
|
|
24
|
+
const op = ops[i + 1];
|
|
25
|
+
if (op === 'S' || op === 'I') {
|
|
26
|
+
templateOffset += len;
|
|
27
|
+
}
|
|
28
|
+
else if (op === 'D' || op === 'P' || op === 'N') {
|
|
29
|
+
refOffset += len;
|
|
30
|
+
}
|
|
31
|
+
else if (op !== 'H') {
|
|
32
|
+
templateOffset += len;
|
|
33
|
+
refOffset += len;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lastTemplateOffset = templateOffset;
|
|
37
|
+
lastRefOffset = refOffset;
|
|
38
|
+
return templateOffset - (refOffset - refCoord);
|
|
39
|
+
}
|
|
40
|
+
const md = mdstring.match(mdRegex) || [];
|
|
41
|
+
for (const token of md) {
|
|
42
|
+
const num = +token;
|
|
43
|
+
if (!Number.isNaN(num)) {
|
|
44
|
+
curr.start += num;
|
|
45
|
+
}
|
|
46
|
+
else if (token.startsWith('^')) {
|
|
47
|
+
curr.start += token.length - 1;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
for (let j = 0; j < token.length; j += 1) {
|
|
51
|
+
curr.length = 1;
|
|
52
|
+
while (lastSkipPos < skips.length) {
|
|
53
|
+
const mismatch = skips[lastSkipPos];
|
|
54
|
+
if (curr.start >= mismatch.start) {
|
|
55
|
+
curr.start += mismatch.length;
|
|
56
|
+
lastSkipPos++;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const s = getTemplateCoordLocal(curr.start);
|
|
63
|
+
curr.base = seq[s] || 'X';
|
|
64
|
+
curr.qual = qual === null || qual === void 0 ? void 0 : qual[s];
|
|
65
|
+
curr.altbase = token;
|
|
66
|
+
nextRecord();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return mismatchRecords;
|
|
71
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
2
|
+
export declare function getModProbabilities(feature: Feature): number[] | undefined;
|
|
3
|
+
export declare function getModPositions(mm: string, fseq: string, fstrand: number): {
|
|
4
|
+
type: string;
|
|
5
|
+
positions: number[];
|
|
6
|
+
base: string;
|
|
7
|
+
strand: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare function getModTypes(mm: string): {
|
|
10
|
+
type: string;
|
|
11
|
+
base: string;
|
|
12
|
+
strand: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function getMethBins(feature: Feature, cigarOps: string[]): {
|
|
15
|
+
methBins: number[];
|
|
16
|
+
hydroxyMethBins: number[];
|
|
17
|
+
methProbs: number[];
|
|
18
|
+
hydroxyMethProbs: number[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { revcom } from '@jbrowse/core/util';
|
|
2
|
+
import { getNextRefPos } from '../MismatchParser';
|
|
3
|
+
import { getTagAlt } from '../util';
|
|
4
|
+
const modificationRegex = new RegExp(/([A-Z])([-+])([^,.?]+)([.?])?/);
|
|
5
|
+
export function getModProbabilities(feature) {
|
|
6
|
+
var _a;
|
|
7
|
+
const m = getTagAlt(feature, 'ML', 'Ml') || [];
|
|
8
|
+
return m
|
|
9
|
+
? (typeof m === 'string' ? m.split(',').map(e => +e) : m).map(e => e / 255)
|
|
10
|
+
: (_a = getTagAlt(feature, 'MP', 'Mp')) === null || _a === void 0 ? void 0 : _a.split('').map(s => s.charCodeAt(0) - 33).map(elt => Math.min(1, elt / 50));
|
|
11
|
+
}
|
|
12
|
+
export function getModPositions(mm, fseq, fstrand) {
|
|
13
|
+
const seq = fstrand === -1 ? revcom(fseq) : fseq;
|
|
14
|
+
const mods = mm.split(';').filter(mod => !!mod);
|
|
15
|
+
const result = [];
|
|
16
|
+
for (const mod of mods) {
|
|
17
|
+
const [basemod, ...skips] = mod.split(',');
|
|
18
|
+
const matches = modificationRegex.exec(basemod);
|
|
19
|
+
if (!matches) {
|
|
20
|
+
throw new Error('bad format for MM tag');
|
|
21
|
+
}
|
|
22
|
+
const [, base, strand, typestr] = matches;
|
|
23
|
+
const types = typestr.split(/(\d+|.)/).filter(f => !!f);
|
|
24
|
+
if (strand === '-') {
|
|
25
|
+
console.warn('unsupported negative strand modifications');
|
|
26
|
+
result.push({
|
|
27
|
+
type: 'unsupported',
|
|
28
|
+
positions: [],
|
|
29
|
+
base: base,
|
|
30
|
+
strand: strand,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
for (const type of types) {
|
|
34
|
+
let i = 0;
|
|
35
|
+
const positions = [];
|
|
36
|
+
for (const d of skips) {
|
|
37
|
+
let delta = +d;
|
|
38
|
+
do {
|
|
39
|
+
if (base === 'N' || base === seq[i]) {
|
|
40
|
+
delta--;
|
|
41
|
+
}
|
|
42
|
+
i++;
|
|
43
|
+
} while (delta >= 0 && i < seq.length);
|
|
44
|
+
if (fstrand === -1) {
|
|
45
|
+
const pos = seq.length - i;
|
|
46
|
+
if (pos >= 0) {
|
|
47
|
+
positions.unshift(pos);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
positions.push(i - 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
result.push({
|
|
55
|
+
type,
|
|
56
|
+
base: base,
|
|
57
|
+
strand: strand,
|
|
58
|
+
positions,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
export function getModTypes(mm) {
|
|
65
|
+
return mm
|
|
66
|
+
.split(';')
|
|
67
|
+
.filter(mod => !!mod)
|
|
68
|
+
.flatMap(mod => {
|
|
69
|
+
const basemod = mod.split(',')[0];
|
|
70
|
+
const matches = modificationRegex.exec(basemod);
|
|
71
|
+
if (!matches) {
|
|
72
|
+
throw new Error('bad format for MM tag');
|
|
73
|
+
}
|
|
74
|
+
const [, base, strand, typestr] = matches;
|
|
75
|
+
return typestr
|
|
76
|
+
.split(/(\d+|.)/)
|
|
77
|
+
.filter(f => !!f)
|
|
78
|
+
.map(type => ({
|
|
79
|
+
type,
|
|
80
|
+
base: base,
|
|
81
|
+
strand: strand,
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
export function getMethBins(feature, cigarOps) {
|
|
86
|
+
const fstart = feature.get('start');
|
|
87
|
+
const fend = feature.get('end');
|
|
88
|
+
const fstrand = feature.get('strand');
|
|
89
|
+
const flen = fend - fstart;
|
|
90
|
+
const mm = getTagAlt(feature, 'MM', 'Mm') || '';
|
|
91
|
+
const methBins = [];
|
|
92
|
+
const hydroxyMethBins = [];
|
|
93
|
+
const methProbs = [];
|
|
94
|
+
const hydroxyMethProbs = [];
|
|
95
|
+
const seq = feature.get('seq');
|
|
96
|
+
if (seq) {
|
|
97
|
+
const probabilities = getModProbabilities(feature);
|
|
98
|
+
const modifications = getModPositions(mm, seq, fstrand);
|
|
99
|
+
let probIndex = 0;
|
|
100
|
+
for (const { type, positions } of modifications) {
|
|
101
|
+
for (const { ref, idx } of getNextRefPos(cigarOps, positions)) {
|
|
102
|
+
const idx2 = probIndex + (fstrand === -1 ? positions.length - 1 - idx : idx);
|
|
103
|
+
const prob = (probabilities === null || probabilities === void 0 ? void 0 : probabilities[idx2]) || 0;
|
|
104
|
+
if (type === 'm') {
|
|
105
|
+
if (ref >= 0 && ref < flen) {
|
|
106
|
+
methBins[ref] = 1;
|
|
107
|
+
methProbs[ref] = prob;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (type === 'h') {
|
|
111
|
+
if (ref >= 0 && ref < flen) {
|
|
112
|
+
hydroxyMethBins[ref] = 1;
|
|
113
|
+
hydroxyMethProbs[ref] = prob;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
probIndex += positions.length;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { methBins, hydroxyMethBins, methProbs, hydroxyMethProbs };
|
|
121
|
+
}
|
package/esm/PileupRPC/base.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType';
|
|
2
|
-
import { RenderArgs } from '@jbrowse/core/rpc/coreRpcMethods';
|
|
2
|
+
import type { RenderArgs } from '@jbrowse/core/rpc/coreRpcMethods';
|
|
3
3
|
export default abstract class PileupBaseRPC extends RpcMethodType {
|
|
4
4
|
serializeArguments(args: RenderArgs & {
|
|
5
|
-
|
|
5
|
+
stopToken?: string;
|
|
6
6
|
statusCallback?: (arg: string) => void;
|
|
7
7
|
}, rpcDriver: string): Promise<Record<string, unknown>>;
|
|
8
8
|
}
|
package/esm/PileupRPC/base.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType';
|
|
2
2
|
import { renameRegionsIfNeeded } from '@jbrowse/core/util';
|
|
3
|
-
// specialized get features to return limited data about alignments
|
|
4
3
|
export default class PileupBaseRPC extends RpcMethodType {
|
|
5
4
|
async serializeArguments(args, rpcDriver) {
|
|
6
5
|
var _a;
|
package/esm/PileupRPC/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function PileupRPCMethodsF(pm: PluginManager): void;
|
package/esm/PileupRPC/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PileupGetGlobalValueForTag,
|
|
1
|
+
import { PileupGetGlobalValueForTag, PileupGetReducedFeatures, PileupGetVisibleModifications, } from './rpcMethods';
|
|
2
2
|
export default function PileupRPCMethodsF(pm) {
|
|
3
3
|
pm.addRpcMethod(() => new PileupGetGlobalValueForTag(pm));
|
|
4
4
|
pm.addRpcMethod(() => new PileupGetVisibleModifications(pm));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Region } from '@jbrowse/core/util';
|
|
2
|
-
import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals';
|
|
3
1
|
import PileupBaseRPC from '../base';
|
|
2
|
+
import type { Region } from '@jbrowse/core/util';
|
|
4
3
|
export default class PileupGetGlobalValueForTag extends PileupBaseRPC {
|
|
5
4
|
name: string;
|
|
6
5
|
execute(args: {
|
|
7
6
|
adapterConfig: Record<string, unknown>;
|
|
8
|
-
|
|
7
|
+
stopToken?: string;
|
|
9
8
|
headers?: Record<string, string>;
|
|
10
9
|
regions: Region[];
|
|
11
10
|
sessionId: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
2
|
-
import { toArray } from 'rxjs/operators';
|
|
3
2
|
import { firstValueFrom } from 'rxjs';
|
|
4
|
-
|
|
3
|
+
import { toArray } from 'rxjs/operators';
|
|
5
4
|
import PileupBaseRPC from '../base';
|
|
6
|
-
import { getTag } from '../../util';
|
|
7
5
|
export default class PileupGetGlobalValueForTag extends PileupBaseRPC {
|
|
8
6
|
constructor() {
|
|
9
7
|
super(...arguments);
|
|
@@ -16,7 +14,7 @@ export default class PileupGetGlobalValueForTag extends PileupBaseRPC {
|
|
|
16
14
|
const featuresArray = await firstValueFrom(features.pipe(toArray()));
|
|
17
15
|
return [
|
|
18
16
|
...new Set(featuresArray
|
|
19
|
-
.map(feature =>
|
|
17
|
+
.map(feature => { var _a; return (_a = feature.get('tags')) === null || _a === void 0 ? void 0 : _a[tag]; })
|
|
20
18
|
.filter(f => f !== undefined)
|
|
21
19
|
.map(f => `${f}`)),
|
|
22
20
|
];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Region } from '@jbrowse/core/util';
|
|
2
|
-
import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals';
|
|
3
1
|
import PileupBaseRPC from '../base';
|
|
2
|
+
import type { Region } from '@jbrowse/core/util';
|
|
4
3
|
export default class PileupGetReducedFeatures extends PileupBaseRPC {
|
|
5
4
|
name: string;
|
|
6
5
|
execute(args: {
|
|
7
6
|
adapterConfig: Record<string, unknown>;
|
|
8
|
-
|
|
7
|
+
stopToken?: string;
|
|
9
8
|
headers?: Record<string, string>;
|
|
10
9
|
regions: Region[];
|
|
11
10
|
sessionId: string;
|
|
@@ -23,7 +22,7 @@ export default class PileupGetReducedFeatures extends PileupBaseRPC {
|
|
|
23
22
|
pair_orientation: any;
|
|
24
23
|
next_ref: any;
|
|
25
24
|
next_pos: any;
|
|
26
|
-
clipPos:
|
|
25
|
+
clipPos: number;
|
|
27
26
|
SA: any;
|
|
28
27
|
}[][];
|
|
29
28
|
stats: {
|