@jbrowse/plugin-variants 2.17.0 → 3.0.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/ChordVariantDisplay/index.d.ts +1 -1
- package/dist/ChordVariantDisplay/index.js +1 -2
- package/dist/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/dist/ChordVariantDisplay/models/configSchema.js +1 -10
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +10 -28
- package/dist/ChordVariantDisplay/models/stateModelFactory.js +2 -23
- package/dist/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/dist/LinearVariantDisplay/configSchema.js +1 -10
- package/dist/LinearVariantDisplay/index.d.ts +1 -1
- package/dist/LinearVariantDisplay/index.js +2 -2
- package/dist/LinearVariantDisplay/model.d.ts +13 -43
- package/dist/LinearVariantDisplay/model.js +1 -17
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +35 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +5 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +29 -0
- package/dist/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/dist/MultiLinearVariantDisplay/configSchema.js +30 -0
- package/dist/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantDisplay/index.js +57 -0
- package/dist/MultiLinearVariantDisplay/model.d.ts +351 -0
- package/dist/MultiLinearVariantDisplay/model.js +83 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +3 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.js +15 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +28 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +6 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +39 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +5 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +31 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +22 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.js +24 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +356 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.js +113 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +3 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +17 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +34 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +87 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +38 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +6 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +20 -0
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +100 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.js +2 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +31 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +73 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +22 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +52 -0
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +2 -0
- package/dist/MultiLinearVariantRenderer/configSchema.js +8 -0
- package/dist/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantRenderer/index.js +19 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +4 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +67 -0
- package/dist/MultiLinearVariantRenderer/types.d.ts +19 -0
- package/dist/MultiLinearVariantRenderer/types.js +2 -0
- package/dist/MultiVariantBaseRenderer.d.ts +46 -0
- package/dist/MultiVariantBaseRenderer.js +39 -0
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +4 -21
- package/dist/StructuralVariantChordRenderer/Chord.js +8 -34
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +4 -5
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +7 -30
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/dist/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/dist/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/dist/StructuralVariantChordRenderer/index.js +1 -1
- package/dist/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/dist/StructuralVariantChordRenderer/types.js +2 -0
- package/dist/Tooltip.d.ts +19 -0
- package/dist/Tooltip.js +32 -0
- package/dist/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/dist/VariantFeatureWidget/Checkbox2.js +2 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +4 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +73 -80
- package/dist/VariantFeatureWidget/LaunchBreakendWidgetArea.d.ts +4 -0
- package/dist/VariantFeatureWidget/LaunchBreakendWidgetArea.js +60 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGrid.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGrid.js +15 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGridWrapper.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequenceDataGridWrapper.js +20 -0
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +15 -0
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +2 -3
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +50 -41
- package/dist/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/dist/VariantFeatureWidget/VariantSampleFilters.js +10 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +10 -8
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +17 -51
- package/dist/VariantFeatureWidget/index.d.ts +1 -1
- package/dist/VariantFeatureWidget/index.js +18 -8
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/dist/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/dist/VariantFeatureWidget/types.d.ts +16 -0
- package/dist/VariantFeatureWidget/types.js +2 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +50 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +26 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +53 -0
- package/dist/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/dist/VariantRPC/MultiVariantGetSources.js +22 -0
- package/dist/VariantTrack/configSchema.d.ts +2 -3
- package/dist/VariantTrack/configSchema.js +6 -13
- package/dist/VariantTrack/index.d.ts +1 -1
- package/dist/VcfAdapter/VcfAdapter.d.ts +10 -2
- package/dist/VcfAdapter/VcfAdapter.js +32 -8
- package/dist/VcfAdapter/configSchema.d.ts +8 -3
- package/dist/VcfAdapter/configSchema.js +13 -8
- package/dist/VcfAdapter/index.d.ts +1 -1
- package/dist/VcfAdapter/index.js +17 -7
- package/dist/VcfFeature/index.d.ts +5 -29
- package/dist/VcfFeature/index.js +36 -26
- package/dist/VcfFeature/util.d.ts +1 -4
- package/dist/VcfFeature/util.js +3 -16
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +44 -13
- package/dist/VcfTabixAdapter/configSchema.d.ts +8 -9
- package/dist/VcfTabixAdapter/configSchema.js +10 -14
- package/dist/VcfTabixAdapter/index.d.ts +1 -1
- package/dist/VcfTabixAdapter/index.js +17 -7
- package/dist/extensionPoints.d.ts +1 -1
- package/dist/extensionPoints.js +21 -33
- package/dist/getMultiVariantFeaturesAutorun.d.ts +16 -0
- package/dist/getMultiVariantFeaturesAutorun.js +41 -0
- package/dist/getMultiVariantSourcesAutorun.d.ts +11 -0
- package/dist/getMultiVariantSourcesAutorun.js +37 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -4
- package/dist/shared/BulkEditPanel.d.ts +5 -0
- package/dist/shared/BulkEditPanel.js +84 -0
- package/dist/shared/ClusterDialog.d.ts +11 -0
- package/dist/shared/ClusterDialog.js +109 -0
- package/dist/shared/ColorLegend.d.ts +10 -0
- package/dist/shared/ColorLegend.js +22 -0
- package/dist/shared/HelpfulTips.d.ts +1 -0
- package/dist/shared/HelpfulTips.js +7 -0
- package/dist/shared/LegendBar.d.ts +18 -0
- package/dist/shared/LegendBar.js +32 -0
- package/dist/shared/MAFFilterDialog.d.ts +8 -0
- package/dist/shared/MAFFilterDialog.js +28 -0
- package/dist/shared/MultiVariantBaseModel.d.ts +341 -0
- package/dist/shared/MultiVariantBaseModel.js +316 -0
- package/dist/shared/MultiVariantTooltip.d.ts +6 -0
- package/dist/shared/MultiVariantTooltip.js +23 -0
- package/dist/shared/RectBg.d.ts +8 -0
- package/dist/shared/RectBg.js +8 -0
- package/dist/shared/RowPalettizer.d.ts +5 -0
- package/dist/shared/RowPalettizer.js +40 -0
- package/dist/shared/SetColorDialog.d.ts +11 -0
- package/dist/shared/SetColorDialog.js +55 -0
- package/dist/shared/SetMinMaxDialog.d.ts +10 -0
- package/dist/shared/SetMinMaxDialog.js +26 -0
- package/dist/shared/SetRowHeightDialog.d.ts +8 -0
- package/dist/shared/SetRowHeightDialog.js +18 -0
- package/dist/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/dist/shared/SharedVariantConfigSchema.js +56 -0
- package/dist/shared/SharedVariantMixin.d.ts +309 -0
- package/dist/shared/SharedVariantMixin.js +58 -0
- package/dist/shared/SourcesDataGrid.d.ts +6 -0
- package/dist/shared/SourcesDataGrid.js +68 -0
- package/dist/shared/SourcesGrid.d.ts +7 -0
- package/dist/shared/SourcesGrid.js +14 -0
- package/dist/shared/SourcesGridHeader.d.ts +7 -0
- package/dist/shared/SourcesGridHeader.js +41 -0
- package/dist/shared/multiVariantColor.d.ts +3 -0
- package/dist/shared/multiVariantColor.js +50 -0
- package/dist/shared/util.d.ts +10 -0
- package/dist/shared/util.js +32 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -0
- package/dist/util.d.ts +8 -0
- package/dist/util.js +86 -0
- package/esm/ChordVariantDisplay/index.d.ts +1 -1
- package/esm/ChordVariantDisplay/index.js +1 -2
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/esm/ChordVariantDisplay/models/configSchema.js +1 -10
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +10 -28
- package/esm/ChordVariantDisplay/models/stateModelFactory.js +3 -24
- package/esm/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/esm/LinearVariantDisplay/configSchema.js +1 -10
- package/esm/LinearVariantDisplay/index.d.ts +1 -1
- package/esm/LinearVariantDisplay/index.js +2 -2
- package/esm/LinearVariantDisplay/model.d.ts +13 -43
- package/esm/LinearVariantDisplay/model.js +2 -18
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +30 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +5 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +24 -0
- package/esm/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/esm/MultiLinearVariantDisplay/configSchema.js +24 -0
- package/esm/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantDisplay/index.js +18 -0
- package/esm/MultiLinearVariantDisplay/model.d.ts +351 -0
- package/esm/MultiLinearVariantDisplay/model.js +44 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +3 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.js +9 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +23 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +6 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +5 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +26 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +16 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.js +18 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +356 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.js +74 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +3 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +11 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +34 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +48 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +36 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.js +4 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +14 -0
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +97 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.js +1 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +31 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +34 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +22 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +47 -0
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +2 -0
- package/esm/MultiLinearVariantRenderer/configSchema.js +6 -0
- package/esm/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantRenderer/index.js +13 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +4 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +61 -0
- package/esm/MultiLinearVariantRenderer/types.d.ts +19 -0
- package/esm/MultiLinearVariantRenderer/types.js +1 -0
- package/esm/MultiVariantBaseRenderer.d.ts +46 -0
- package/esm/MultiVariantBaseRenderer.js +33 -0
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +4 -21
- package/esm/StructuralVariantChordRenderer/Chord.js +8 -11
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +4 -5
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +7 -7
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/esm/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/esm/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/esm/StructuralVariantChordRenderer/index.js +1 -1
- package/esm/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/esm/StructuralVariantChordRenderer/types.js +1 -0
- package/esm/Tooltip.d.ts +19 -0
- package/esm/Tooltip.js +27 -0
- package/esm/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +4 -5
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +55 -72
- package/esm/VariantFeatureWidget/LaunchBreakendWidgetArea.d.ts +4 -0
- package/esm/VariantFeatureWidget/LaunchBreakendWidgetArea.js +24 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGrid.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGrid.js +9 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGridWrapper.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequenceDataGridWrapper.js +17 -0
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +9 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +2 -3
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +33 -34
- package/esm/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/esm/VariantFeatureWidget/VariantSampleFilters.js +7 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +10 -8
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +18 -29
- package/esm/VariantFeatureWidget/index.d.ts +1 -1
- package/esm/VariantFeatureWidget/index.js +1 -1
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/esm/VariantFeatureWidget/types.d.ts +16 -0
- package/esm/VariantFeatureWidget/types.js +1 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +43 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +26 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +46 -0
- package/esm/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/esm/VariantRPC/MultiVariantGetSources.js +15 -0
- package/esm/VariantTrack/configSchema.d.ts +2 -3
- package/esm/VariantTrack/configSchema.js +5 -13
- package/esm/VariantTrack/index.d.ts +1 -1
- package/esm/VcfAdapter/VcfAdapter.d.ts +10 -2
- package/esm/VcfAdapter/VcfAdapter.js +34 -10
- package/esm/VcfAdapter/configSchema.d.ts +8 -3
- package/esm/VcfAdapter/configSchema.js +13 -8
- package/esm/VcfAdapter/index.d.ts +1 -1
- package/esm/VcfFeature/index.d.ts +5 -29
- package/esm/VcfFeature/index.js +36 -26
- package/esm/VcfFeature/util.d.ts +1 -4
- package/esm/VcfFeature/util.js +3 -16
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +45 -14
- package/esm/VcfTabixAdapter/configSchema.d.ts +8 -9
- package/esm/VcfTabixAdapter/configSchema.js +10 -14
- package/esm/VcfTabixAdapter/index.d.ts +1 -1
- package/esm/extensionPoints.d.ts +1 -1
- package/esm/extensionPoints.js +22 -34
- package/esm/getMultiVariantFeaturesAutorun.d.ts +16 -0
- package/esm/getMultiVariantFeaturesAutorun.js +38 -0
- package/esm/getMultiVariantSourcesAutorun.d.ts +11 -0
- package/esm/getMultiVariantSourcesAutorun.js +34 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +18 -4
- package/esm/shared/BulkEditPanel.d.ts +5 -0
- package/esm/shared/BulkEditPanel.js +81 -0
- package/esm/shared/ClusterDialog.d.ts +11 -0
- package/esm/shared/ClusterDialog.js +103 -0
- package/esm/shared/ColorLegend.d.ts +10 -0
- package/esm/shared/ColorLegend.js +17 -0
- package/esm/shared/HelpfulTips.d.ts +1 -0
- package/esm/shared/HelpfulTips.js +4 -0
- package/esm/shared/LegendBar.d.ts +18 -0
- package/esm/shared/LegendBar.js +26 -0
- package/esm/shared/MAFFilterDialog.d.ts +8 -0
- package/esm/shared/MAFFilterDialog.js +26 -0
- package/esm/shared/MultiVariantBaseModel.d.ts +341 -0
- package/esm/shared/MultiVariantBaseModel.js +277 -0
- package/esm/shared/MultiVariantTooltip.d.ts +6 -0
- package/esm/shared/MultiVariantTooltip.js +17 -0
- package/esm/shared/RectBg.d.ts +8 -0
- package/esm/shared/RectBg.js +6 -0
- package/esm/shared/RowPalettizer.d.ts +5 -0
- package/esm/shared/RowPalettizer.js +37 -0
- package/esm/shared/SetColorDialog.d.ts +11 -0
- package/esm/shared/SetColorDialog.js +49 -0
- package/esm/shared/SetMinMaxDialog.d.ts +10 -0
- package/esm/shared/SetMinMaxDialog.js +23 -0
- package/esm/shared/SetRowHeightDialog.d.ts +8 -0
- package/esm/shared/SetRowHeightDialog.js +15 -0
- package/esm/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/esm/shared/SharedVariantConfigSchema.js +53 -0
- package/esm/shared/SharedVariantMixin.d.ts +309 -0
- package/esm/shared/SharedVariantMixin.js +55 -0
- package/esm/shared/SourcesDataGrid.d.ts +6 -0
- package/esm/shared/SourcesDataGrid.js +62 -0
- package/esm/shared/SourcesGrid.d.ts +7 -0
- package/esm/shared/SourcesGrid.js +9 -0
- package/esm/shared/SourcesGridHeader.d.ts +7 -0
- package/esm/shared/SourcesGridHeader.js +35 -0
- package/esm/shared/multiVariantColor.d.ts +3 -0
- package/esm/shared/multiVariantColor.js +45 -0
- package/esm/shared/util.d.ts +10 -0
- package/esm/shared/util.js +28 -0
- package/esm/types.d.ts +14 -0
- package/esm/types.js +1 -0
- package/esm/util.d.ts +8 -0
- package/esm/util.js +77 -0
- package/package.json +7 -8
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +0 -6
- package/dist/VariantFeatureWidget/AnnotGrid.js +0 -39
- package/dist/VariantFeatureWidget/VariantAnnotationTable.d.ts +0 -6
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js +0 -16
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +0 -6
- package/esm/VariantFeatureWidget/AnnotGrid.js +0 -13
- package/esm/VariantFeatureWidget/VariantAnnotationTable.d.ts +0 -6
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js +0 -10
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = VariantTrackF;
|
|
3
4
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
5
|
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
11
|
-
const configSchema = (pluginManager) => (0, configuration_1.ConfigurationSchema)('VariantTrack', {}, {
|
|
12
|
-
/**
|
|
13
|
-
* #baseConfiguration
|
|
14
|
-
*/
|
|
15
|
-
baseConfiguration: (0, pluggableElementTypes_1.createBaseTrackConfig)(pluginManager),
|
|
16
|
-
});
|
|
17
|
-
exports.default = configSchema;
|
|
6
|
+
function VariantTrackF(pluginManager) {
|
|
7
|
+
return (0, configuration_1.ConfigurationSchema)('VariantTrack', {}, {
|
|
8
|
+
baseConfiguration: (0, pluggableElementTypes_1.createBaseTrackConfig)(pluginManager),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function VariantTrackF(pm: PluginManager): void;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { Region, Feature } from '@jbrowse/core/util';
|
|
3
1
|
import IntervalTree from '@flatten-js/interval-tree';
|
|
2
|
+
import VcfParser from '@gmod/vcf';
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
6
|
type StatusCallback = (arg: string) => void;
|
|
5
7
|
export default class VcfAdapter extends BaseFeatureDataAdapter {
|
|
6
8
|
calculatedIntervalTreeMap: Record<string, IntervalTree>;
|
|
7
9
|
vcfFeatures?: Promise<{
|
|
8
10
|
header: string;
|
|
11
|
+
parser: VcfParser;
|
|
9
12
|
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree>;
|
|
10
13
|
}>;
|
|
11
14
|
static capabilities: string[];
|
|
@@ -13,16 +16,21 @@ export default class VcfAdapter extends BaseFeatureDataAdapter {
|
|
|
13
16
|
getMetadata(): Promise<any>;
|
|
14
17
|
setupP(opts?: BaseOptions): Promise<{
|
|
15
18
|
header: string;
|
|
19
|
+
parser: VcfParser;
|
|
16
20
|
intervalTreeMap: {
|
|
17
21
|
[k: string]: (sc?: (arg: string) => void) => IntervalTree<any>;
|
|
18
22
|
};
|
|
19
23
|
}>;
|
|
20
24
|
setup(): Promise<{
|
|
21
25
|
header: string;
|
|
26
|
+
parser: VcfParser;
|
|
22
27
|
intervalTreeMap: Record<string, (sc?: StatusCallback) => IntervalTree>;
|
|
23
28
|
}>;
|
|
24
29
|
getRefNames(_?: BaseOptions): Promise<string[]>;
|
|
25
30
|
getFeatures(region: Region, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
31
|
+
getSources(): Promise<{
|
|
32
|
+
name: string;
|
|
33
|
+
}[]>;
|
|
26
34
|
freeResources(): void;
|
|
27
35
|
}
|
|
28
36
|
export {};
|
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const interval_tree_1 = __importDefault(require("@flatten-js/interval-tree"));
|
|
7
|
+
const vcf_1 = __importDefault(require("@gmod/vcf"));
|
|
6
8
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
7
9
|
const util_1 = require("@jbrowse/core/util");
|
|
8
10
|
const io_1 = require("@jbrowse/core/util/io");
|
|
9
11
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
10
|
-
const interval_tree_1 = __importDefault(require("@flatten-js/interval-tree"));
|
|
11
|
-
const vcf_1 = __importDefault(require("@gmod/vcf"));
|
|
12
|
-
// local
|
|
13
12
|
const VcfFeature_1 = __importDefault(require("../VcfFeature"));
|
|
14
13
|
class VcfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
15
14
|
constructor() {
|
|
@@ -21,8 +20,7 @@ class VcfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
21
20
|
return header;
|
|
22
21
|
}
|
|
23
22
|
async getMetadata() {
|
|
24
|
-
const {
|
|
25
|
-
const parser = new vcf_1.default({ header });
|
|
23
|
+
const { parser } = await this.setup();
|
|
26
24
|
return parser.getMetadata();
|
|
27
25
|
}
|
|
28
26
|
async setupP(opts) {
|
|
@@ -35,8 +33,7 @@ class VcfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
35
33
|
const decoder = new TextDecoder('utf8');
|
|
36
34
|
let i = 0;
|
|
37
35
|
while (blockStart < buffer.length) {
|
|
38
|
-
const n = buffer.indexOf(
|
|
39
|
-
// could be a non-newline ended file, so slice to end of file if n===-1
|
|
36
|
+
const n = buffer.indexOf(10, blockStart);
|
|
40
37
|
const b = n === -1 ? buffer.subarray(blockStart) : buffer.subarray(blockStart, n);
|
|
41
38
|
const line = decoder.decode(b).trim();
|
|
42
39
|
if (line) {
|
|
@@ -81,6 +78,7 @@ class VcfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
81
78
|
]));
|
|
82
79
|
return {
|
|
83
80
|
header,
|
|
81
|
+
parser,
|
|
84
82
|
intervalTreeMap,
|
|
85
83
|
};
|
|
86
84
|
}
|
|
@@ -111,7 +109,33 @@ class VcfAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
111
109
|
catch (e) {
|
|
112
110
|
observer.error(e);
|
|
113
111
|
}
|
|
114
|
-
}, opts.
|
|
112
|
+
}, opts.stopToken);
|
|
113
|
+
}
|
|
114
|
+
async getSources() {
|
|
115
|
+
const conf = this.getConf('samplesTsvLocation');
|
|
116
|
+
if (conf.uri === '' || conf.uri === '/path/to/samples.tsv') {
|
|
117
|
+
const { parser } = await this.setup();
|
|
118
|
+
return parser.samples.map(name => ({
|
|
119
|
+
name,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const txt = await (0, io_1.openLocation)(conf).readFile('utf8');
|
|
124
|
+
const lines = txt.split(/\n|\r\n|\r/);
|
|
125
|
+
const header = lines[0].split('\t');
|
|
126
|
+
const { parser } = await this.setup();
|
|
127
|
+
const s = new Set(parser.samples);
|
|
128
|
+
return lines
|
|
129
|
+
.slice(1)
|
|
130
|
+
.map(line => {
|
|
131
|
+
const cols = line.split('\t');
|
|
132
|
+
return {
|
|
133
|
+
name: cols[0],
|
|
134
|
+
...Object.fromEntries(cols.slice(1).map((c, idx) => [header[idx + 1], c])),
|
|
135
|
+
};
|
|
136
|
+
})
|
|
137
|
+
.filter(f => s.has(f.name));
|
|
138
|
+
}
|
|
115
139
|
}
|
|
116
140
|
freeResources() { }
|
|
117
141
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const VcfAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
vcfLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -9,5 +6,13 @@ declare const VcfAdapter: import("@jbrowse/core/configuration/configurationSchem
|
|
|
9
6
|
locationType: string;
|
|
10
7
|
};
|
|
11
8
|
};
|
|
9
|
+
samplesTsvLocation: {
|
|
10
|
+
type: string;
|
|
11
|
+
defaultValue: {
|
|
12
|
+
uri: string;
|
|
13
|
+
description: string;
|
|
14
|
+
locationType: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
12
17
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
13
18
|
export default VcfAdapter;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
-
|
|
5
|
-
* #config VcfAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const VcfAdapter = (0, configuration_1.ConfigurationSchema)('VcfAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
vcfLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
|
-
defaultValue: {
|
|
8
|
+
defaultValue: {
|
|
9
|
+
uri: '/path/to/my.vcf',
|
|
10
|
+
locationType: 'UriLocation',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
samplesTsvLocation: {
|
|
14
|
+
type: 'fileLocation',
|
|
15
|
+
defaultValue: {
|
|
16
|
+
uri: '/path/to/samples.tsv',
|
|
17
|
+
description: 'tsv with header like name\tpopulation\tetc. where the first column is required, and is the sample names',
|
|
18
|
+
locationType: 'UriLocation',
|
|
19
|
+
},
|
|
15
20
|
},
|
|
16
21
|
}, { explicitlyTyped: true });
|
|
17
22
|
exports.default = VcfAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function VcfAdapterF(pluginManager: PluginManager): void;
|
package/dist/VcfAdapter/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -1,43 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
type
|
|
4
|
-
values: string[] | number[] | null;
|
|
5
|
-
}>>;
|
|
6
|
-
interface FeatureData {
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
refName: string;
|
|
9
|
-
start: number;
|
|
10
|
-
end: number;
|
|
11
|
-
description?: string;
|
|
12
|
-
type?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
aliases?: string[];
|
|
15
|
-
samples?: Samples;
|
|
16
|
-
}
|
|
1
|
+
import type VCFParser from '@gmod/vcf';
|
|
2
|
+
import type { Variant } from '@gmod/vcf';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
17
4
|
export default class VCFFeature implements Feature {
|
|
18
5
|
private variant;
|
|
19
6
|
private parser;
|
|
20
7
|
private data;
|
|
21
8
|
private _id;
|
|
22
9
|
constructor(args: {
|
|
23
|
-
variant:
|
|
24
|
-
parser:
|
|
10
|
+
variant: Variant;
|
|
11
|
+
parser: VCFParser;
|
|
25
12
|
id: string;
|
|
26
13
|
});
|
|
27
14
|
get(field: string): any;
|
|
28
|
-
set(): void;
|
|
29
15
|
parent(): undefined;
|
|
30
16
|
children(): undefined;
|
|
31
|
-
tags(): string[];
|
|
32
17
|
id(): string;
|
|
33
|
-
dataFromVariant(variant: {
|
|
34
|
-
REF: string;
|
|
35
|
-
POS: number;
|
|
36
|
-
ALT?: string[];
|
|
37
|
-
CHROM: string;
|
|
38
|
-
INFO: any;
|
|
39
|
-
ID?: string[];
|
|
40
|
-
}): FeatureData;
|
|
41
18
|
toJSON(): any;
|
|
42
19
|
}
|
|
43
|
-
export {};
|
package/dist/VcfFeature/index.js
CHANGED
|
@@ -1,55 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// locals
|
|
4
3
|
const util_1 = require("./util");
|
|
4
|
+
function dataFromVariant(variant, parser) {
|
|
5
|
+
const { FORMAT, REF = '', ALT, POS, CHROM, ID } = variant;
|
|
6
|
+
const start = POS - 1;
|
|
7
|
+
const [type, description] = (0, util_1.getSOTermAndDescription)(REF, ALT, parser);
|
|
8
|
+
return {
|
|
9
|
+
refName: CHROM,
|
|
10
|
+
start,
|
|
11
|
+
end: getEnd(variant),
|
|
12
|
+
description,
|
|
13
|
+
type,
|
|
14
|
+
name: ID === null || ID === void 0 ? void 0 : ID.join(','),
|
|
15
|
+
aliases: ID && ID.length > 1 ? ID.slice(1) : undefined,
|
|
16
|
+
format: FORMAT,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function getEnd(variant) {
|
|
20
|
+
const { POS, REF = '', ALT } = variant;
|
|
21
|
+
const isTRA = ALT === null || ALT === void 0 ? void 0 : ALT.includes('<TRA>');
|
|
22
|
+
const start = POS - 1;
|
|
23
|
+
const isSymbolic = ALT === null || ALT === void 0 ? void 0 : ALT.some(f => f.includes('<'));
|
|
24
|
+
if (isSymbolic) {
|
|
25
|
+
const info = variant.INFO;
|
|
26
|
+
if (info.END && !isTRA) {
|
|
27
|
+
return +info.END[0];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return start + REF.length;
|
|
31
|
+
}
|
|
5
32
|
class VCFFeature {
|
|
6
33
|
constructor(args) {
|
|
7
34
|
this.variant = args.variant;
|
|
8
35
|
this.parser = args.parser;
|
|
9
|
-
this.data =
|
|
36
|
+
this.data = dataFromVariant(this.variant, this.parser);
|
|
10
37
|
this._id = args.id;
|
|
11
38
|
}
|
|
12
39
|
get(field) {
|
|
13
40
|
var _a;
|
|
14
41
|
return field === 'samples'
|
|
15
|
-
? this.variant.SAMPLES
|
|
16
|
-
:
|
|
42
|
+
? this.variant.SAMPLES()
|
|
43
|
+
: field === 'genotypes'
|
|
44
|
+
? this.variant.GENOTYPES()
|
|
45
|
+
: ((_a = this.data[field]) !== null && _a !== void 0 ? _a : this.variant[field]);
|
|
17
46
|
}
|
|
18
|
-
set() { }
|
|
19
47
|
parent() {
|
|
20
48
|
return undefined;
|
|
21
49
|
}
|
|
22
50
|
children() {
|
|
23
51
|
return undefined;
|
|
24
52
|
}
|
|
25
|
-
tags() {
|
|
26
|
-
return [...Object.keys(this.data), ...Object.keys(this.variant), 'samples'];
|
|
27
|
-
}
|
|
28
53
|
id() {
|
|
29
54
|
return this._id;
|
|
30
55
|
}
|
|
31
|
-
dataFromVariant(variant) {
|
|
32
|
-
const { REF, ALT, POS, CHROM, INFO, ID } = variant;
|
|
33
|
-
const start = POS - 1;
|
|
34
|
-
const [type, description] = (0, util_1.getSOTermAndDescription)(REF, ALT, this.parser);
|
|
35
|
-
const isTRA = ALT === null || ALT === void 0 ? void 0 : ALT.includes('<TRA>');
|
|
36
|
-
const isSymbolic = ALT === null || ALT === void 0 ? void 0 : ALT.some(f => f.includes('<'));
|
|
37
|
-
return {
|
|
38
|
-
refName: CHROM,
|
|
39
|
-
start,
|
|
40
|
-
end: isSymbolic && INFO.END && !isTRA ? +INFO.END[0] : start + REF.length,
|
|
41
|
-
description,
|
|
42
|
-
type,
|
|
43
|
-
name: ID === null || ID === void 0 ? void 0 : ID.join(','),
|
|
44
|
-
aliases: ID && ID.length > 1 ? ID.slice(1) : undefined,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
56
|
toJSON() {
|
|
57
|
+
const { SAMPLES, GENOTYPES, ...rest } = this.variant;
|
|
48
58
|
return {
|
|
49
59
|
uniqueId: this._id,
|
|
50
|
-
...
|
|
60
|
+
...rest,
|
|
51
61
|
...this.data,
|
|
52
|
-
samples: this.variant.SAMPLES,
|
|
62
|
+
samples: this.variant.SAMPLES(),
|
|
53
63
|
};
|
|
54
64
|
}
|
|
55
65
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import VCF from '@gmod/vcf';
|
|
2
|
-
/**
|
|
3
|
-
* Get a sequence ontology (SO) term that describes the variant type
|
|
4
|
-
*/
|
|
1
|
+
import type VCF from '@gmod/vcf';
|
|
5
2
|
export declare function getSOTermAndDescription(ref: string, alt: string[] | undefined, parser: VCF): string[];
|
|
6
3
|
export declare function getSOAndDescFromAltDefs(alt: string, parser: VCF): string[];
|
|
7
4
|
export declare function getSOAndDescByExamination(ref: string, alt: string): string[];
|
package/dist/VcfFeature/util.js
CHANGED
|
@@ -16,11 +16,7 @@ const altTypeToSO = {
|
|
|
16
16
|
NON_REF: 'sequence_variant',
|
|
17
17
|
'*': 'sequence_variant',
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
* Get a sequence ontology (SO) term that describes the variant type
|
|
21
|
-
*/
|
|
22
19
|
function getSOTermAndDescription(ref, alt, parser) {
|
|
23
|
-
// it's just a remark if there are no alternate alleles
|
|
24
20
|
if (!alt || alt.length === 0) {
|
|
25
21
|
return ['remark', 'no alternative alleles'];
|
|
26
22
|
}
|
|
@@ -37,7 +33,6 @@ function getSOTermAndDescription(ref, alt, parser) {
|
|
|
37
33
|
descriptions.add(description);
|
|
38
34
|
}
|
|
39
35
|
});
|
|
40
|
-
// Combine descriptions like ["SNV G -> A", "SNV G -> T"] to ["SNV G -> A,T"]
|
|
41
36
|
if (descriptions.size > 1) {
|
|
42
37
|
const descs = [...descriptions];
|
|
43
38
|
const prefixes = new Set(descs
|
|
@@ -56,35 +51,27 @@ function getSOTermAndDescription(ref, alt, parser) {
|
|
|
56
51
|
return suffixes.length ? `${prefix} -> ${suffixes.join(',')}` : prefix;
|
|
57
52
|
}));
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return [];
|
|
54
|
+
return soTerms.size
|
|
55
|
+
? [[...soTerms].join(','), [...descriptions].join(',')]
|
|
56
|
+
: [];
|
|
63
57
|
}
|
|
64
58
|
function getSOAndDescFromAltDefs(alt, parser) {
|
|
65
59
|
if (typeof alt === 'string' && !alt.startsWith('<')) {
|
|
66
60
|
return [];
|
|
67
61
|
}
|
|
68
|
-
// look for a definition with an SO type for this
|
|
69
62
|
let soTerm = altTypeToSO[alt];
|
|
70
|
-
// if no SO term but ALT is in metadata, assume sequence_variant
|
|
71
63
|
if (!soTerm && parser.getMetadata('ALT', alt)) {
|
|
72
64
|
soTerm = 'sequence_variant';
|
|
73
65
|
}
|
|
74
66
|
if (soTerm) {
|
|
75
67
|
return [soTerm, alt];
|
|
76
68
|
}
|
|
77
|
-
// try to look for a definition for a parent term if we can
|
|
78
69
|
const modAlt = alt.split(':');
|
|
79
70
|
if (modAlt.length > 1) {
|
|
80
71
|
return getSOAndDescFromAltDefs(`<${modAlt.slice(0, -1).join(':')}>`, parser);
|
|
81
72
|
}
|
|
82
|
-
// no parent
|
|
83
73
|
return [];
|
|
84
74
|
}
|
|
85
|
-
// note: term SNV is used instead of SNP because SO definition of SNP says
|
|
86
|
-
// abundance must be at least 1% in population, and can't be sure we meet
|
|
87
|
-
// that
|
|
88
75
|
function getSOAndDescByExamination(ref, alt) {
|
|
89
76
|
const bnd = (0, vcf_1.parseBreakend)(alt);
|
|
90
77
|
if (bnd) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
3
|
-
import { Feature } from '@jbrowse/core/util';
|
|
4
1
|
import { TabixIndexedFile } from '@gmod/tabix';
|
|
5
2
|
import VcfParser from '@gmod/vcf';
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
6
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
6
7
|
export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
7
8
|
private configured?;
|
|
8
9
|
private configurePre;
|
|
@@ -14,5 +15,8 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
14
15
|
getHeader(): Promise<string>;
|
|
15
16
|
getMetadata(): Promise<any>;
|
|
16
17
|
getFeatures(query: NoAssemblyRegion, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
18
|
+
getSources(): Promise<{
|
|
19
|
+
name: string;
|
|
20
|
+
}[]>;
|
|
17
21
|
freeResources(): void;
|
|
18
22
|
}
|
|
@@ -3,28 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tabix_1 = require("@gmod/tabix");
|
|
7
|
+
const vcf_1 = __importDefault(require("@gmod/vcf"));
|
|
6
8
|
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
9
|
+
const util_1 = require("@jbrowse/core/util");
|
|
7
10
|
const io_1 = require("@jbrowse/core/util/io");
|
|
8
11
|
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
9
|
-
const tabix_1 = require("@gmod/tabix");
|
|
10
|
-
const vcf_1 = __importDefault(require("@gmod/vcf"));
|
|
11
|
-
// local
|
|
12
12
|
const VcfFeature_1 = __importDefault(require("../VcfFeature"));
|
|
13
13
|
class VcfTabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
14
|
-
async configurePre() {
|
|
15
|
-
const
|
|
14
|
+
async configurePre(opts) {
|
|
15
|
+
const { statusCallback = () => { } } = opts || {};
|
|
16
16
|
const vcfGzLocation = this.getConf('vcfGzLocation');
|
|
17
17
|
const location = this.getConf(['index', 'location']);
|
|
18
18
|
const indexType = this.getConf(['index', 'indexType']);
|
|
19
|
-
const filehandle = (0, io_1.openLocation)(vcfGzLocation,
|
|
19
|
+
const filehandle = (0, io_1.openLocation)(vcfGzLocation, this.pluginManager);
|
|
20
20
|
const isCSI = indexType === 'CSI';
|
|
21
21
|
const vcf = new tabix_1.TabixIndexedFile({
|
|
22
22
|
filehandle,
|
|
23
|
-
csiFilehandle: isCSI
|
|
24
|
-
|
|
23
|
+
csiFilehandle: isCSI
|
|
24
|
+
? (0, io_1.openLocation)(location, this.pluginManager)
|
|
25
|
+
: undefined,
|
|
26
|
+
tbiFilehandle: !isCSI
|
|
27
|
+
? (0, io_1.openLocation)(location, this.pluginManager)
|
|
28
|
+
: undefined,
|
|
25
29
|
chunkCacheSize: 50 * 2 ** 20,
|
|
26
30
|
});
|
|
27
|
-
const header = await vcf.getHeader();
|
|
31
|
+
const header = await (0, util_1.updateStatus)('Downloading index', statusCallback, () => vcf.getHeader());
|
|
28
32
|
return {
|
|
29
33
|
vcf,
|
|
30
34
|
parser: new vcf_1.default({ header }),
|
|
@@ -54,8 +58,9 @@ class VcfTabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
54
58
|
getFeatures(query, opts = {}) {
|
|
55
59
|
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
56
60
|
const { refName, start, end } = query;
|
|
61
|
+
const { statusCallback = () => { } } = opts;
|
|
57
62
|
const { vcf, parser } = await this.configure();
|
|
58
|
-
await vcf.getLines(refName, start, end, {
|
|
63
|
+
await (0, util_1.updateStatus)('Downloading variants', statusCallback, () => vcf.getLines(refName, start, end, {
|
|
59
64
|
lineCallback: (line, fileOffset) => {
|
|
60
65
|
observer.next(new VcfFeature_1.default({
|
|
61
66
|
variant: parser.parseLine(line),
|
|
@@ -64,10 +69,36 @@ class VcfTabixAdapter extends BaseAdapter_1.BaseFeatureDataAdapter {
|
|
|
64
69
|
}));
|
|
65
70
|
},
|
|
66
71
|
...opts,
|
|
67
|
-
});
|
|
72
|
+
}));
|
|
68
73
|
observer.complete();
|
|
69
|
-
}, opts.
|
|
74
|
+
}, opts.stopToken);
|
|
75
|
+
}
|
|
76
|
+
async getSources() {
|
|
77
|
+
const conf = this.getConf('samplesTsvLocation');
|
|
78
|
+
if (conf.uri === '' || conf.uri === '/path/to/samples.tsv') {
|
|
79
|
+
const { parser } = await this.configure();
|
|
80
|
+
return parser.samples.map(name => ({
|
|
81
|
+
name,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const txt = await (0, util_1.fetchAndMaybeUnzipText)((0, io_1.openLocation)(conf, this.pluginManager));
|
|
86
|
+
const lines = txt.split(/\n|\r\n|\r/);
|
|
87
|
+
const header = lines[0].split('\t');
|
|
88
|
+
const { parser } = await this.configure();
|
|
89
|
+
const s = new Set(parser.samples);
|
|
90
|
+
return lines
|
|
91
|
+
.slice(1)
|
|
92
|
+
.map(line => {
|
|
93
|
+
const cols = line.split('\t');
|
|
94
|
+
return {
|
|
95
|
+
name: cols[0],
|
|
96
|
+
...Object.fromEntries(cols.slice(1).map((c, idx) => [header[idx + 1], c])),
|
|
97
|
+
};
|
|
98
|
+
})
|
|
99
|
+
.filter(f => s.has(f.name));
|
|
100
|
+
}
|
|
70
101
|
}
|
|
71
|
-
freeResources(
|
|
102
|
+
freeResources() { }
|
|
72
103
|
}
|
|
73
104
|
exports.default = VcfTabixAdapter;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
vcfGzLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -10,17 +7,11 @@ declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configuration
|
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
9
|
index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
-
/**
|
|
14
|
-
* #slot index.indexType
|
|
15
|
-
*/
|
|
16
10
|
indexType: {
|
|
17
11
|
model: import("mobx-state-tree").ISimpleType<string>;
|
|
18
12
|
type: string;
|
|
19
13
|
defaultValue: string;
|
|
20
14
|
};
|
|
21
|
-
/**
|
|
22
|
-
* #slot index.location
|
|
23
|
-
*/
|
|
24
15
|
location: {
|
|
25
16
|
type: string;
|
|
26
17
|
defaultValue: {
|
|
@@ -29,5 +20,13 @@ declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configuration
|
|
|
29
20
|
};
|
|
30
21
|
};
|
|
31
22
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
23
|
+
samplesTsvLocation: {
|
|
24
|
+
type: string;
|
|
25
|
+
defaultValue: {
|
|
26
|
+
uri: string;
|
|
27
|
+
description: string;
|
|
28
|
+
locationType: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
32
31
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
33
32
|
export default VcfTabixAdapter;
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
4
3
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
|
+
function x() { }
|
|
9
6
|
const VcfTabixAdapter = (0, configuration_1.ConfigurationSchema)('VcfTabixAdapter', {
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
7
|
vcfGzLocation: {
|
|
14
8
|
type: 'fileLocation',
|
|
15
9
|
defaultValue: { uri: '/path/to/my.vcf.gz', locationType: 'UriLocation' },
|
|
16
10
|
},
|
|
17
11
|
index: (0, configuration_1.ConfigurationSchema)('VcfIndex', {
|
|
18
|
-
/**
|
|
19
|
-
* #slot index.indexType
|
|
20
|
-
*/
|
|
21
12
|
indexType: {
|
|
22
13
|
model: mobx_state_tree_1.types.enumeration('IndexType', ['TBI', 'CSI']),
|
|
23
14
|
type: 'stringEnum',
|
|
24
15
|
defaultValue: 'TBI',
|
|
25
16
|
},
|
|
26
|
-
/**
|
|
27
|
-
* #slot index.location
|
|
28
|
-
*/
|
|
29
17
|
location: {
|
|
30
18
|
type: 'fileLocation',
|
|
31
19
|
defaultValue: {
|
|
@@ -34,5 +22,13 @@ const VcfTabixAdapter = (0, configuration_1.ConfigurationSchema)('VcfTabixAdapte
|
|
|
34
22
|
},
|
|
35
23
|
},
|
|
36
24
|
}),
|
|
25
|
+
samplesTsvLocation: {
|
|
26
|
+
type: 'fileLocation',
|
|
27
|
+
defaultValue: {
|
|
28
|
+
uri: '/path/to/samples.tsv',
|
|
29
|
+
description: 'tsv with header like name\tpopulation\tetc. where the first column is required, and is the sample names',
|
|
30
|
+
locationType: 'UriLocation',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
37
33
|
}, { explicitlyTyped: true });
|
|
38
34
|
exports.default = VcfTabixAdapter;
|