@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,25 +1,29 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
1
|
import { TabixIndexedFile } from '@gmod/tabix';
|
|
5
2
|
import VcfParser from '@gmod/vcf';
|
|
6
|
-
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import { fetchAndMaybeUnzipText, updateStatus } from '@jbrowse/core/util';
|
|
5
|
+
import { openLocation } from '@jbrowse/core/util/io';
|
|
6
|
+
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
7
7
|
import VcfFeature from '../VcfFeature';
|
|
8
8
|
export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
9
|
-
async configurePre() {
|
|
10
|
-
const
|
|
9
|
+
async configurePre(opts) {
|
|
10
|
+
const { statusCallback = () => { } } = opts || {};
|
|
11
11
|
const vcfGzLocation = this.getConf('vcfGzLocation');
|
|
12
12
|
const location = this.getConf(['index', 'location']);
|
|
13
13
|
const indexType = this.getConf(['index', 'indexType']);
|
|
14
|
-
const filehandle = openLocation(vcfGzLocation,
|
|
14
|
+
const filehandle = openLocation(vcfGzLocation, this.pluginManager);
|
|
15
15
|
const isCSI = indexType === 'CSI';
|
|
16
16
|
const vcf = new TabixIndexedFile({
|
|
17
17
|
filehandle,
|
|
18
|
-
csiFilehandle: isCSI
|
|
19
|
-
|
|
18
|
+
csiFilehandle: isCSI
|
|
19
|
+
? openLocation(location, this.pluginManager)
|
|
20
|
+
: undefined,
|
|
21
|
+
tbiFilehandle: !isCSI
|
|
22
|
+
? openLocation(location, this.pluginManager)
|
|
23
|
+
: undefined,
|
|
20
24
|
chunkCacheSize: 50 * 2 ** 20,
|
|
21
25
|
});
|
|
22
|
-
const header = await vcf.getHeader();
|
|
26
|
+
const header = await updateStatus('Downloading index', statusCallback, () => vcf.getHeader());
|
|
23
27
|
return {
|
|
24
28
|
vcf,
|
|
25
29
|
parser: new VcfParser({ header }),
|
|
@@ -49,8 +53,9 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
49
53
|
getFeatures(query, opts = {}) {
|
|
50
54
|
return ObservableCreate(async (observer) => {
|
|
51
55
|
const { refName, start, end } = query;
|
|
56
|
+
const { statusCallback = () => { } } = opts;
|
|
52
57
|
const { vcf, parser } = await this.configure();
|
|
53
|
-
await vcf.getLines(refName, start, end, {
|
|
58
|
+
await updateStatus('Downloading variants', statusCallback, () => vcf.getLines(refName, start, end, {
|
|
54
59
|
lineCallback: (line, fileOffset) => {
|
|
55
60
|
observer.next(new VcfFeature({
|
|
56
61
|
variant: parser.parseLine(line),
|
|
@@ -59,9 +64,35 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
59
64
|
}));
|
|
60
65
|
},
|
|
61
66
|
...opts,
|
|
62
|
-
});
|
|
67
|
+
}));
|
|
63
68
|
observer.complete();
|
|
64
|
-
}, opts.
|
|
69
|
+
}, opts.stopToken);
|
|
70
|
+
}
|
|
71
|
+
async getSources() {
|
|
72
|
+
const conf = this.getConf('samplesTsvLocation');
|
|
73
|
+
if (conf.uri === '' || conf.uri === '/path/to/samples.tsv') {
|
|
74
|
+
const { parser } = await this.configure();
|
|
75
|
+
return parser.samples.map(name => ({
|
|
76
|
+
name,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const txt = await fetchAndMaybeUnzipText(openLocation(conf, this.pluginManager));
|
|
81
|
+
const lines = txt.split(/\n|\r\n|\r/);
|
|
82
|
+
const header = lines[0].split('\t');
|
|
83
|
+
const { parser } = await this.configure();
|
|
84
|
+
const s = new Set(parser.samples);
|
|
85
|
+
return lines
|
|
86
|
+
.slice(1)
|
|
87
|
+
.map(line => {
|
|
88
|
+
const cols = line.split('\t');
|
|
89
|
+
return {
|
|
90
|
+
name: cols[0],
|
|
91
|
+
...Object.fromEntries(cols.slice(1).map((c, idx) => [header[idx + 1], c])),
|
|
92
|
+
};
|
|
93
|
+
})
|
|
94
|
+
.filter(f => s.has(f.name));
|
|
95
|
+
}
|
|
65
96
|
}
|
|
66
|
-
freeResources(
|
|
97
|
+
freeResources() { }
|
|
67
98
|
}
|
|
@@ -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,29 +1,17 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
function x() { }
|
|
7
4
|
const VcfTabixAdapter = ConfigurationSchema('VcfTabixAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
5
|
vcfGzLocation: {
|
|
12
6
|
type: 'fileLocation',
|
|
13
7
|
defaultValue: { uri: '/path/to/my.vcf.gz', locationType: 'UriLocation' },
|
|
14
8
|
},
|
|
15
9
|
index: ConfigurationSchema('VcfIndex', {
|
|
16
|
-
/**
|
|
17
|
-
* #slot index.indexType
|
|
18
|
-
*/
|
|
19
10
|
indexType: {
|
|
20
11
|
model: types.enumeration('IndexType', ['TBI', 'CSI']),
|
|
21
12
|
type: 'stringEnum',
|
|
22
13
|
defaultValue: 'TBI',
|
|
23
14
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot index.location
|
|
26
|
-
*/
|
|
27
15
|
location: {
|
|
28
16
|
type: 'fileLocation',
|
|
29
17
|
defaultValue: {
|
|
@@ -32,5 +20,13 @@ const VcfTabixAdapter = ConfigurationSchema('VcfTabixAdapter', {
|
|
|
32
20
|
},
|
|
33
21
|
},
|
|
34
22
|
}),
|
|
23
|
+
samplesTsvLocation: {
|
|
24
|
+
type: 'fileLocation',
|
|
25
|
+
defaultValue: {
|
|
26
|
+
uri: '/path/to/samples.tsv',
|
|
27
|
+
description: 'tsv with header like name\tpopulation\tetc. where the first column is required, and is the sample names',
|
|
28
|
+
locationType: 'UriLocation',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
35
31
|
}, { explicitlyTyped: true });
|
|
36
32
|
export default VcfTabixAdapter;
|
package/esm/extensionPoints.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 ExtensionPointsF(pluginManager: PluginManager): void;
|
package/esm/extensionPoints.js
CHANGED
|
@@ -1,48 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { testAdapter } from '@jbrowse/core/util';
|
|
2
|
+
import { getFileName, makeIndex, makeIndexType, } from '@jbrowse/core/util/tracks';
|
|
2
3
|
export default function ExtensionPointsF(pluginManager) {
|
|
3
4
|
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
|
|
4
5
|
return (file, index, adapterHint) => {
|
|
5
|
-
const regexGuess = /\.vcf\.b?gz$/i;
|
|
6
|
-
const adapterName = 'VcfTabixAdapter';
|
|
7
6
|
const fileName = getFileName(file);
|
|
8
7
|
const indexName = index && getFileName(index);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
if (testAdapter(fileName, /\.vcf\.b?gz$/i, adapterHint, 'VcfTabixAdapter')) {
|
|
9
|
+
return {
|
|
10
|
+
type: 'VcfTabixAdapter',
|
|
11
|
+
vcfGzLocation: file,
|
|
12
|
+
index: {
|
|
13
|
+
location: index || makeIndex(file, '.tbi'),
|
|
14
|
+
indexType: makeIndexType(indexName, 'CSI', 'TBI'),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
else if (testAdapter(fileName, /\.vcf(\.gz)?$/i, adapterHint, 'VcfAdapter')) {
|
|
19
|
+
return {
|
|
20
|
+
type: 'VcfAdapter',
|
|
21
|
+
vcfLocation: file,
|
|
22
|
+
};
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
return
|
|
24
|
+
else {
|
|
25
|
+
return adapterGuesser(file, index, adapterHint);
|
|
22
26
|
}
|
|
23
|
-
return adapterGuesser(file, index, adapterHint);
|
|
24
27
|
};
|
|
25
28
|
});
|
|
26
29
|
pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', (trackTypeGuesser) => {
|
|
27
30
|
return (adapterName) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return trackTypeGuesser(adapterName);
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
|
|
35
|
-
return (file, index, adapterHint) => {
|
|
36
|
-
const regexGuess = /\.vcf$/i;
|
|
37
|
-
const adapterName = 'VcfAdapter';
|
|
38
|
-
const fileName = getFileName(file);
|
|
39
|
-
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
40
|
-
return {
|
|
41
|
-
type: adapterName,
|
|
42
|
-
vcfLocation: file,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return adapterGuesser(file, index, adapterHint);
|
|
31
|
+
return ['VcfTabixAdapter', 'VcfAdapter'].includes(adapterName)
|
|
32
|
+
? 'VariantTrack'
|
|
33
|
+
: trackTypeGuesser(adapterName);
|
|
46
34
|
};
|
|
47
35
|
});
|
|
48
36
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SampleInfo, Source } from './types';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
+
export declare function getMultiVariantFeaturesAutorun(self: {
|
|
5
|
+
configuration: AnyConfigurationModel;
|
|
6
|
+
adapterConfig: AnyConfigurationModel;
|
|
7
|
+
sources?: Source[];
|
|
8
|
+
minorAlleleFrequencyFilter: number;
|
|
9
|
+
statsReadyAndRegionNotTooLarge: boolean;
|
|
10
|
+
adapterProps: () => Record<string, unknown>;
|
|
11
|
+
setError: (error: unknown) => void;
|
|
12
|
+
setFeatures: (f: Feature[]) => void;
|
|
13
|
+
setMessage: (str: string) => void;
|
|
14
|
+
setHasPhased: (arg: boolean) => void;
|
|
15
|
+
setSampleInfo: (arg: Record<string, SampleInfo>) => void;
|
|
16
|
+
}): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SimpleFeature, getContainingView, getSession, } from '@jbrowse/core/util';
|
|
2
|
+
import { isAbortException } from '@jbrowse/core/util/aborting';
|
|
3
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
4
|
+
import { autorun } from 'mobx';
|
|
5
|
+
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
6
|
+
export function getMultiVariantFeaturesAutorun(self) {
|
|
7
|
+
addDisposer(self, autorun(async () => {
|
|
8
|
+
try {
|
|
9
|
+
const view = getContainingView(self);
|
|
10
|
+
if (!view.initialized || !self.statsReadyAndRegionNotTooLarge) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const { rpcManager } = getSession(self);
|
|
14
|
+
const { sources, minorAlleleFrequencyFilter, adapterConfig } = self;
|
|
15
|
+
if (sources) {
|
|
16
|
+
const sessionId = getRpcSessionId(self);
|
|
17
|
+
const { sampleInfo, hasPhased, features } = (await rpcManager.call(sessionId, 'MultiVariantGetSimplifiedFeatures', {
|
|
18
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
19
|
+
sources,
|
|
20
|
+
minorAlleleFrequencyFilter,
|
|
21
|
+
sessionId,
|
|
22
|
+
adapterConfig,
|
|
23
|
+
}));
|
|
24
|
+
if (isAlive(self)) {
|
|
25
|
+
self.setHasPhased(hasPhased);
|
|
26
|
+
self.setSampleInfo(sampleInfo);
|
|
27
|
+
self.setFeatures(features.map(f => new SimpleFeature(f)));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
console.error(e);
|
|
33
|
+
if (!isAbortException(e) && isAlive(self)) {
|
|
34
|
+
getSession(self).notifyError(`${e}`, e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, { delay: 1000 }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Source } from './types';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
export declare function getMultiVariantSourcesAutorun(self: {
|
|
4
|
+
configuration: AnyConfigurationModel;
|
|
5
|
+
adapterConfig: AnyConfigurationModel;
|
|
6
|
+
adapterProps: () => Record<string, unknown>;
|
|
7
|
+
setSourcesLoading: (aborter: string) => void;
|
|
8
|
+
setError: (error: unknown) => void;
|
|
9
|
+
setMessage: (str: string) => void;
|
|
10
|
+
setSources: (sources: Source[]) => void;
|
|
11
|
+
}): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
2
|
+
import { isAbortException } from '@jbrowse/core/util/aborting';
|
|
3
|
+
import { createStopToken } from '@jbrowse/core/util/stopToken';
|
|
4
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
5
|
+
import { autorun } from 'mobx';
|
|
6
|
+
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
7
|
+
export function getMultiVariantSourcesAutorun(self) {
|
|
8
|
+
addDisposer(self, autorun(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const view = getContainingView(self);
|
|
11
|
+
if (!view.initialized) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const { rpcManager } = getSession(self);
|
|
15
|
+
const { adapterConfig } = self;
|
|
16
|
+
const token = createStopToken();
|
|
17
|
+
self.setSourcesLoading(token);
|
|
18
|
+
const sessionId = getRpcSessionId(self);
|
|
19
|
+
const sources = (await rpcManager.call(sessionId, 'MultiVariantGetSources', {
|
|
20
|
+
sessionId,
|
|
21
|
+
adapterConfig,
|
|
22
|
+
}));
|
|
23
|
+
if (isAlive(self)) {
|
|
24
|
+
self.setSources(sources);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (!isAbortException(e) && isAlive(self)) {
|
|
29
|
+
console.error(e);
|
|
30
|
+
getSession(self).notifyError(`${e}`, e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, { delay: 1000 }));
|
|
34
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class VariantsPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/esm/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import VcfAdapterF from './VcfAdapter';
|
|
2
|
-
import VcfTabixAdapterF from './VcfTabixAdapter';
|
|
3
|
-
import ExtensionPointsF from './extensionPoints';
|
|
4
|
-
import VariantTrackF from './VariantTrack';
|
|
5
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
6
2
|
import ChordVariantDisplayF from './ChordVariantDisplay';
|
|
7
3
|
import LinearVariantDisplayF from './LinearVariantDisplay';
|
|
4
|
+
import MultiLinearVariantDisplayF from './MultiLinearVariantDisplay';
|
|
5
|
+
import LinearVariantMatrixDisplayF from './MultiLinearVariantMatrixDisplay';
|
|
6
|
+
import LinearVariantMatrixRendererF from './MultiLinearVariantMatrixRenderer';
|
|
7
|
+
import MultiVariantRendererF from './MultiLinearVariantRenderer';
|
|
8
8
|
import StructuralVariantChordRendererF from './StructuralVariantChordRenderer';
|
|
9
9
|
import VariantFeatureWidgetF from './VariantFeatureWidget';
|
|
10
|
+
import { MultiVariantGetGenotypeMatrix } from './VariantRPC/MultiVariantGetGenotypeMatrix';
|
|
11
|
+
import { MultiVariantGetSimplifiedFeatures } from './VariantRPC/MultiVariantGetSimplifiedFeatures';
|
|
12
|
+
import { MultiVariantGetSources } from './VariantRPC/MultiVariantGetSources';
|
|
13
|
+
import VariantTrackF from './VariantTrack';
|
|
14
|
+
import VcfAdapterF from './VcfAdapter';
|
|
15
|
+
import VcfTabixAdapterF from './VcfTabixAdapter';
|
|
16
|
+
import ExtensionPointsF from './extensionPoints';
|
|
10
17
|
export default class VariantsPlugin extends Plugin {
|
|
11
18
|
constructor() {
|
|
12
19
|
super(...arguments);
|
|
@@ -19,8 +26,15 @@ export default class VariantsPlugin extends Plugin {
|
|
|
19
26
|
VariantTrackF(pluginManager);
|
|
20
27
|
ExtensionPointsF(pluginManager);
|
|
21
28
|
LinearVariantDisplayF(pluginManager);
|
|
29
|
+
LinearVariantMatrixDisplayF(pluginManager);
|
|
30
|
+
MultiLinearVariantDisplayF(pluginManager);
|
|
31
|
+
MultiVariantRendererF(pluginManager);
|
|
32
|
+
LinearVariantMatrixRendererF(pluginManager);
|
|
22
33
|
StructuralVariantChordRendererF(pluginManager);
|
|
23
34
|
ChordVariantDisplayF(pluginManager);
|
|
35
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSources(pluginManager));
|
|
36
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetGenotypeMatrix(pluginManager));
|
|
37
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSimplifiedFeatures(pluginManager));
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
export { default as VcfFeature } from './VcfFeature';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
|
+
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
const useStyles = makeStyles()({
|
|
7
|
+
textAreaFont: {
|
|
8
|
+
fontFamily: 'Courier New',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
export default function BulkEditPanel({ onClose, currLayout, }) {
|
|
12
|
+
const { classes } = useStyles();
|
|
13
|
+
const [val, setVal] = useState('');
|
|
14
|
+
const [error, setError] = useState();
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [_jsx(Typography, { children: "Paste CSV or TSV. If a header column is present. First line is a header. If a column called \"name\" is present, it uses that to connect to IDs in the table, otherwise it uses the first column no." }), error ? _jsx(ErrorMessage, { error: error }) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, placeholder: 'name,population\nHG00098,GBR\nHG00101,GBR\nHG00459,CHS\n...', maxRows: 10, fullWidth: true, value: val, onChange: event => {
|
|
16
|
+
setVal(event.target.value);
|
|
17
|
+
}, slotProps: {
|
|
18
|
+
input: {
|
|
19
|
+
classes: {
|
|
20
|
+
input: classes.textAreaFont,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
} })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
24
|
+
const lines = val
|
|
25
|
+
.split('\n')
|
|
26
|
+
.map(f => f.trim())
|
|
27
|
+
.filter(f => !!f);
|
|
28
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
29
|
+
if (fields.includes('name')) {
|
|
30
|
+
setError('');
|
|
31
|
+
const oldLayout = Object.fromEntries(currLayout.map(record => [record.name, record]));
|
|
32
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
33
|
+
const cols = line.split(/[,\t]/gm);
|
|
34
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
35
|
+
return [
|
|
36
|
+
newRecord.name,
|
|
37
|
+
{
|
|
38
|
+
...newRecord,
|
|
39
|
+
...oldLayout[newRecord.name],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}));
|
|
43
|
+
onClose(currLayout.map(record => ({
|
|
44
|
+
...record,
|
|
45
|
+
...newData[record.name],
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
setError(new Error('No "name" column found on line 1'));
|
|
50
|
+
}
|
|
51
|
+
}, children: "Update rows" }), _jsx(Button, { variant: "contained", color: "primary", onClick: () => {
|
|
52
|
+
const lines = val
|
|
53
|
+
.split('\n')
|
|
54
|
+
.map(f => f.trim())
|
|
55
|
+
.filter(f => !!f);
|
|
56
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
57
|
+
if (fields.includes('name')) {
|
|
58
|
+
setError('');
|
|
59
|
+
const oldLayout = Object.fromEntries(currLayout.map(record => [record.name, record]));
|
|
60
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
61
|
+
const cols = line.split(/[,\t]/gm);
|
|
62
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
63
|
+
return [
|
|
64
|
+
newRecord.name,
|
|
65
|
+
{
|
|
66
|
+
...newRecord,
|
|
67
|
+
...oldLayout[newRecord.name],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}));
|
|
71
|
+
onClose(currLayout.map(record => ({
|
|
72
|
+
...newData[record.name],
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
setError(new Error('No "name" column found on line 1'));
|
|
77
|
+
}
|
|
78
|
+
}, children: "Replace rows" }), _jsx(Button, { variant: "contained", color: "inherit", onClick: () => {
|
|
79
|
+
onClose();
|
|
80
|
+
}, children: "Cancel" })] })] }));
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Source } from '../types';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
export default function ClusterDialog({ model, handleClose, }: {
|
|
4
|
+
model: {
|
|
5
|
+
sources?: Source[];
|
|
6
|
+
minorAlleleFrequencyFilter?: number;
|
|
7
|
+
adapterConfig: AnyConfigurationModel;
|
|
8
|
+
setLayout: (arg: Source[]) => void;
|
|
9
|
+
};
|
|
10
|
+
handleClose: () => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
4
|
+
import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
|
|
5
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
6
|
+
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
7
|
+
import copy from 'copy-to-clipboard';
|
|
8
|
+
import { saveAs } from 'file-saver';
|
|
9
|
+
import { isAlive } from 'mobx-state-tree';
|
|
10
|
+
import { makeStyles } from 'tss-react/mui';
|
|
11
|
+
const useStyles = makeStyles()(theme => ({
|
|
12
|
+
textAreaFont: {
|
|
13
|
+
fontFamily: 'Courier New',
|
|
14
|
+
},
|
|
15
|
+
mgap: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
gap: theme.spacing(4),
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
export default function ClusterDialog({ model, handleClose, }) {
|
|
22
|
+
const { classes } = useStyles();
|
|
23
|
+
const [results, setResults] = useState();
|
|
24
|
+
const [error, setError] = useState();
|
|
25
|
+
const [paste, setPaste] = useState('');
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
;
|
|
28
|
+
(async () => {
|
|
29
|
+
try {
|
|
30
|
+
setError(undefined);
|
|
31
|
+
const view = getContainingView(model);
|
|
32
|
+
if (!view.initialized) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { rpcManager } = getSession(model);
|
|
36
|
+
const { sources, minorAlleleFrequencyFilter, adapterConfig } = model;
|
|
37
|
+
const sessionId = getRpcSessionId(model);
|
|
38
|
+
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
39
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
40
|
+
sources,
|
|
41
|
+
minorAlleleFrequencyFilter,
|
|
42
|
+
sessionId,
|
|
43
|
+
adapterConfig,
|
|
44
|
+
}));
|
|
45
|
+
const entries = Object.values(ret);
|
|
46
|
+
const keys = Object.keys(ret);
|
|
47
|
+
const text = `try(library(fastcluster), silent=TRUE)
|
|
48
|
+
inputMatrix<-matrix(c(${entries.map(val => val.genotypes.join(',')).join(',\n')}
|
|
49
|
+
),nrow=${entries.length},byrow=TRUE)
|
|
50
|
+
rownames(inputMatrix)<-c(${keys.map(key => `'${key}'`).join(',')})
|
|
51
|
+
resultClusters<-hclust(dist(inputMatrix), method='single')
|
|
52
|
+
cat(resultClusters$order,sep='\\n')`;
|
|
53
|
+
setResults(text);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (!isAbortException(e) && isAlive(model)) {
|
|
57
|
+
console.error(e);
|
|
58
|
+
setError(e);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
}, [model]);
|
|
63
|
+
return (_jsxs(Dialog, { open: true, title: "Cluster by genotype", onClose: handleClose, children: [_jsx(DialogContent, { children: _jsxs("div", { className: classes.mgap, children: [_jsx(Typography, { children: "This page will produce an R script that will perform hierarchical clustering on the visible genotype data using `hclust`." }), _jsx(Typography, { children: "You can then paste the results in this form to specify the row ordering." }), results ? (_jsx("div", { children: _jsxs("div", { children: ["Step 1:", ' ', _jsx(Button, { variant: "contained", onClick: () => {
|
|
64
|
+
saveAs(new Blob([results || ''], {
|
|
65
|
+
type: 'text/plain;charset=utf-8',
|
|
66
|
+
}), 'cluster.R');
|
|
67
|
+
}, children: "Download Rscript" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: () => {
|
|
68
|
+
copy(results || '');
|
|
69
|
+
}, children: "Copy Rscript to clipboard" }), _jsx("div", { children: _jsx(TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Step 2. Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
|
|
70
|
+
setPaste(event.target.value);
|
|
71
|
+
}, slotProps: {
|
|
72
|
+
input: {
|
|
73
|
+
classes: {
|
|
74
|
+
input: classes.textAreaFont,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
} }) })] }) })) : (_jsx(LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })), error ? _jsx(ErrorMessage, { error: error }) : null] }) }), _jsxs(DialogActions, { children: [_jsx(Button, { disabled: !results, variant: "contained", onClick: () => {
|
|
78
|
+
const { sources } = model;
|
|
79
|
+
if (sources) {
|
|
80
|
+
try {
|
|
81
|
+
model.setLayout(paste
|
|
82
|
+
.split('\n')
|
|
83
|
+
.map(t => t.trim())
|
|
84
|
+
.filter(f => !!f)
|
|
85
|
+
.map(r => +r)
|
|
86
|
+
.map(idx => {
|
|
87
|
+
const ret = sources[idx - 1];
|
|
88
|
+
if (!ret) {
|
|
89
|
+
throw new Error(`out of bounds at ${idx}`);
|
|
90
|
+
}
|
|
91
|
+
return ret;
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
console.error(e);
|
|
96
|
+
setError(e);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
handleClose();
|
|
100
|
+
}, children: "Apply clustering" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
101
|
+
handleClose();
|
|
102
|
+
}, children: "Cancel" })] })] }));
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Source } from '../types';
|
|
2
|
+
declare const ColorLegend: ({ model, labelWidth, }: {
|
|
3
|
+
model: {
|
|
4
|
+
canDisplayLabels: boolean;
|
|
5
|
+
rowHeight: number;
|
|
6
|
+
sources?: Source[];
|
|
7
|
+
};
|
|
8
|
+
labelWidth: number;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export default ColorLegend;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { clamp } from '@jbrowse/core/util';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import RectBg from './RectBg';
|
|
6
|
+
const ColorLegend = observer(function ({ model, labelWidth, }) {
|
|
7
|
+
const { canDisplayLabels, rowHeight, sources } = model;
|
|
8
|
+
const svgFontSize = clamp(rowHeight, 8, 12);
|
|
9
|
+
const colorBoxWidth = 15;
|
|
10
|
+
const hasColors = sources === null || sources === void 0 ? void 0 : sources.some(s => s.color);
|
|
11
|
+
const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
|
|
12
|
+
return sources ? (_jsxs(_Fragment, { children: [canDisplayLabels ? (_jsx(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => {
|
|
13
|
+
const { color, name, label } = source;
|
|
14
|
+
return (_jsxs(Fragment, { children: [color ? (_jsx(RectBg, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? (_jsx("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, children: label || name })) : null] }, `${label}-${idx}`));
|
|
15
|
+
})] })) : null;
|
|
16
|
+
});
|
|
17
|
+
export default ColorLegend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function HelpfulTips(): import("react/jsx-runtime").JSX.Element;
|