@jbrowse/plugin-variants 2.18.0 → 3.0.1
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/models/stateModelFactory.d.ts +1 -1
- package/dist/LinearVariantDisplay/model.d.ts +5 -5
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +35 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +5 -49
- package/dist/MultiLinearVariantDisplay/index.js +18 -8
- package/dist/MultiLinearVariantDisplay/model.d.ts +113 -40
- package/dist/MultiLinearVariantDisplay/model.js +24 -176
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +1 -2
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +28 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +13 -16
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +6 -56
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +109 -27
- package/dist/MultiLinearVariantMatrixDisplay/model.js +31 -136
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -2
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -7
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +4 -32
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +44 -63
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +3 -2
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +31 -5
- package/dist/MultiLinearVariantMatrixRenderer/index.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +99 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/dist/MultiLinearVariantMatrixRenderer/types.js +2 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +4 -21
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +38 -25
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +7 -3
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +36 -27
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +1 -33
- package/dist/MultiLinearVariantRenderer/configSchema.js +0 -5
- 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 +4 -4
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -19
- package/dist/StructuralVariantChordRenderer/Chord.js +3 -25
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -3
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +7 -29
- package/dist/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/dist/StructuralVariantChordRenderer/types.js +2 -0
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +6 -32
- package/dist/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/dist/VariantFeatureWidget/Checkbox2.js +2 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -3
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +66 -69
- 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 +1 -2
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +47 -36
- package/dist/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/dist/VariantFeatureWidget/VariantSampleFilters.js +10 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -7
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +14 -44
- package/dist/VariantFeatureWidget/index.js +17 -7
- package/dist/VariantFeatureWidget/types.d.ts +16 -0
- package/dist/VariantFeatureWidget/types.js +2 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +10 -27
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +12 -7
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +27 -37
- package/dist/VcfAdapter/VcfAdapter.d.ts +7 -0
- package/dist/VcfAdapter/VcfAdapter.js +29 -3
- package/dist/VcfAdapter/configSchema.d.ts +8 -0
- package/dist/VcfAdapter/configSchema.js +12 -1
- package/dist/VcfAdapter/index.js +17 -7
- package/dist/VcfFeature/index.js +2 -1
- package/dist/VcfFeature/util.js +3 -4
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +38 -12
- package/dist/VcfTabixAdapter/configSchema.d.ts +8 -0
- package/dist/VcfTabixAdapter/configSchema.js +8 -0
- package/dist/VcfTabixAdapter/index.js +17 -7
- package/dist/extensionPoints.js +21 -33
- package/dist/getMultiVariantFeaturesAutorun.d.ts +4 -7
- package/dist/getMultiVariantFeaturesAutorun.js +16 -15
- package/dist/getMultiVariantSourcesAutorun.d.ts +1 -6
- package/dist/shared/BulkEditPanel.d.ts +4 -5
- package/dist/shared/BulkEditPanel.js +69 -88
- package/dist/shared/ClusterDialog.d.ts +4 -5
- package/dist/shared/ClusterDialog.js +45 -86
- package/dist/shared/ColorLegend.d.ts +2 -3
- package/dist/shared/ColorLegend.js +8 -10
- package/dist/shared/HelpfulTips.d.ts +1 -0
- package/dist/shared/HelpfulTips.js +7 -0
- package/dist/shared/LegendBar.d.ts +3 -3
- package/dist/shared/LegendBar.js +6 -12
- package/dist/shared/MAFFilterDialog.d.ts +2 -3
- package/dist/shared/MAFFilterDialog.js +14 -42
- 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 +2 -3
- package/dist/shared/RectBg.js +3 -7
- package/dist/shared/RowPalettizer.d.ts +2 -3
- package/dist/shared/RowPalettizer.js +30 -28
- package/dist/shared/SetColorDialog.d.ts +2 -3
- package/dist/shared/SetColorDialog.js +26 -65
- package/dist/shared/SetMinMaxDialog.d.ts +1 -2
- package/dist/shared/SetMinMaxDialog.js +11 -41
- package/dist/shared/SetRowHeightDialog.d.ts +8 -0
- package/dist/shared/SetRowHeightDialog.js +18 -0
- package/dist/shared/SharedVariantMixin.d.ts +7 -7
- package/dist/shared/SourcesDataGrid.d.ts +6 -0
- package/dist/shared/SourcesDataGrid.js +68 -0
- package/dist/shared/SourcesGrid.d.ts +2 -3
- package/dist/shared/SourcesGrid.js +5 -134
- 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/types.d.ts +14 -0
- package/dist/types.js +2 -0
- package/dist/util.d.ts +6 -9
- package/dist/util.js +47 -14
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +1 -1
- package/esm/LinearVariantDisplay/model.d.ts +5 -5
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +30 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +5 -26
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +113 -40
- package/esm/MultiLinearVariantDisplay/model.js +7 -169
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +1 -2
- package/esm/MultiLinearVariantDisplay/renderSvg.js +2 -5
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +23 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +13 -13
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +6 -33
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +109 -27
- package/esm/MultiLinearVariantMatrixDisplay/model.js +14 -129
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -2
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -7
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +4 -32
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +11 -63
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +3 -2
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +31 -2
- package/esm/MultiLinearVariantMatrixRenderer/index.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -0
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +96 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +15 -0
- package/esm/MultiLinearVariantMatrixRenderer/types.js +1 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +4 -21
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +6 -26
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +7 -3
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +34 -5
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +1 -33
- package/esm/MultiLinearVariantRenderer/configSchema.js +0 -2
- 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 +4 -4
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -19
- package/esm/StructuralVariantChordRenderer/Chord.js +3 -2
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +2 -3
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +7 -6
- package/esm/StructuralVariantChordRenderer/types.d.ts +17 -0
- package/esm/StructuralVariantChordRenderer/types.js +1 -0
- package/esm/Tooltip.d.ts +2 -2
- package/esm/Tooltip.js +6 -9
- package/esm/VariantFeatureWidget/Checkbox2.d.ts +1 -2
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -3
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +48 -61
- 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 +1 -2
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +30 -29
- package/esm/VariantFeatureWidget/VariantSampleFilters.d.ts +9 -0
- package/esm/VariantFeatureWidget/VariantSampleFilters.js +7 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +9 -7
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +15 -22
- package/esm/VariantFeatureWidget/types.d.ts +16 -0
- package/esm/VariantFeatureWidget/types.js +1 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +10 -27
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +12 -7
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +27 -37
- package/esm/VcfAdapter/VcfAdapter.d.ts +7 -0
- package/esm/VcfAdapter/VcfAdapter.js +31 -5
- package/esm/VcfAdapter/configSchema.d.ts +8 -0
- package/esm/VcfAdapter/configSchema.js +12 -1
- package/esm/VcfFeature/index.js +2 -1
- package/esm/VcfFeature/util.js +3 -4
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +38 -12
- package/esm/VcfTabixAdapter/configSchema.d.ts +8 -0
- package/esm/VcfTabixAdapter/configSchema.js +8 -0
- package/esm/extensionPoints.js +21 -33
- package/esm/getMultiVariantFeaturesAutorun.d.ts +4 -7
- package/esm/getMultiVariantFeaturesAutorun.js +16 -15
- package/esm/getMultiVariantSourcesAutorun.d.ts +1 -6
- package/esm/shared/BulkEditPanel.d.ts +4 -5
- package/esm/shared/BulkEditPanel.js +70 -66
- package/esm/shared/ClusterDialog.d.ts +4 -5
- package/esm/shared/ClusterDialog.js +44 -62
- package/esm/shared/ColorLegend.d.ts +2 -3
- package/esm/shared/ColorLegend.js +8 -10
- package/esm/shared/HelpfulTips.d.ts +1 -0
- package/esm/shared/HelpfulTips.js +4 -0
- package/esm/shared/LegendBar.d.ts +3 -3
- package/esm/shared/LegendBar.js +7 -13
- package/esm/shared/MAFFilterDialog.d.ts +2 -3
- package/esm/shared/MAFFilterDialog.js +14 -19
- 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 +2 -3
- package/esm/shared/RectBg.js +3 -4
- package/esm/shared/RowPalettizer.d.ts +2 -3
- package/esm/shared/RowPalettizer.js +30 -25
- package/esm/shared/SetColorDialog.d.ts +2 -3
- package/esm/shared/SetColorDialog.js +26 -42
- package/esm/shared/SetMinMaxDialog.d.ts +1 -2
- package/esm/shared/SetMinMaxDialog.js +11 -18
- package/esm/shared/SetRowHeightDialog.d.ts +8 -0
- package/esm/shared/SetRowHeightDialog.js +15 -0
- package/esm/shared/SharedVariantMixin.d.ts +7 -7
- package/esm/shared/SourcesDataGrid.d.ts +6 -0
- package/esm/shared/SourcesDataGrid.js +62 -0
- package/esm/shared/SourcesGrid.d.ts +2 -3
- package/esm/shared/SourcesGrid.js +5 -111
- 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/types.d.ts +14 -0
- package/esm/types.js +1 -0
- package/esm/util.d.ts +6 -9
- package/esm/util.js +43 -13
- package/package.json +12 -13
- 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/dist/configSchema.d.ts +0 -34
- package/dist/configSchema.js +0 -44
- package/dist/shared/DraggableDialog.d.ts +0 -6
- package/dist/shared/DraggableDialog.js +0 -62
- package/dist/shared/Tooltip.d.ts +0 -18
- package/dist/shared/Tooltip.js +0 -38
- 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
- package/esm/configSchema.d.ts +0 -34
- package/esm/configSchema.js +0 -42
- package/esm/shared/DraggableDialog.d.ts +0 -6
- package/esm/shared/DraggableDialog.js +0 -34
- package/esm/shared/Tooltip.d.ts +0 -18
- package/esm/shared/Tooltip.js +0 -33
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
4
|
import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
|
|
4
5
|
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
@@ -17,7 +18,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
17
18
|
gap: theme.spacing(4),
|
|
18
19
|
},
|
|
19
20
|
}));
|
|
20
|
-
export default function
|
|
21
|
+
export default function ClusterDialog({ model, handleClose, }) {
|
|
21
22
|
const { classes } = useStyles();
|
|
22
23
|
const [results, setResults] = useState();
|
|
23
24
|
const [error, setError] = useState();
|
|
@@ -32,12 +33,12 @@ export default function HierarchicalCluster({ model, handleClose, }) {
|
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
const { rpcManager } = getSession(model);
|
|
35
|
-
const { sources,
|
|
36
|
+
const { sources, minorAlleleFrequencyFilter, adapterConfig } = model;
|
|
36
37
|
const sessionId = getRpcSessionId(model);
|
|
37
38
|
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
38
39
|
regions: view.dynamicBlocks.contentBlocks,
|
|
39
40
|
sources,
|
|
40
|
-
|
|
41
|
+
minorAlleleFrequencyFilter,
|
|
41
42
|
sessionId,
|
|
42
43
|
adapterConfig,
|
|
43
44
|
}));
|
|
@@ -59,63 +60,44 @@ cat(resultClusters$order,sep='\\n')`;
|
|
|
59
60
|
}
|
|
60
61
|
})();
|
|
61
62
|
}, [model]);
|
|
62
|
-
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
error ? React.createElement(ErrorMessage, { error: error }) : null)),
|
|
93
|
-
React.createElement(DialogActions, null,
|
|
94
|
-
React.createElement(Button, { disabled: !results, variant: "contained", onClick: () => {
|
|
95
|
-
const { sources } = model;
|
|
96
|
-
if (sources) {
|
|
97
|
-
try {
|
|
98
|
-
model.setLayout(paste
|
|
99
|
-
.split('\n')
|
|
100
|
-
.map(t => t.trim())
|
|
101
|
-
.filter(f => !!f)
|
|
102
|
-
.map(r => +r)
|
|
103
|
-
.map(idx => {
|
|
104
|
-
const ret = sources[idx - 1];
|
|
105
|
-
if (!ret) {
|
|
106
|
-
throw new Error(`out of bounds at ${idx}`);
|
|
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
|
+
}));
|
|
107
93
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} }, "Apply clustering"),
|
|
118
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
119
|
-
handleClose();
|
|
120
|
-
} }, "Cancel"))));
|
|
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" })] })] }));
|
|
121
103
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Source } from '../util';
|
|
1
|
+
import type { Source } from '../types';
|
|
3
2
|
declare const ColorLegend: ({ model, labelWidth, }: {
|
|
4
3
|
model: {
|
|
5
4
|
canDisplayLabels: boolean;
|
|
@@ -7,5 +6,5 @@ declare const ColorLegend: ({ model, labelWidth, }: {
|
|
|
7
6
|
sources?: Source[];
|
|
8
7
|
};
|
|
9
8
|
labelWidth: number;
|
|
10
|
-
}) =>
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
export default ColorLegend;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
2
3
|
import { clamp } from '@jbrowse/core/util';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import RectBg from './RectBg';
|
|
@@ -6,14 +7,11 @@ const ColorLegend = observer(function ({ model, labelWidth, }) {
|
|
|
6
7
|
const { canDisplayLabels, rowHeight, sources } = model;
|
|
7
8
|
const svgFontSize = clamp(rowHeight, 8, 12);
|
|
8
9
|
const colorBoxWidth = 15;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
color ? (React.createElement(RectBg, { y: idx * rowHeight + 1, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null,
|
|
16
|
-
canDisplayLabels ? (React.createElement("text", { y: idx * rowHeight + svgFontSize, x: colorBoxWidth + 2, fontSize: svgFontSize }, name)) : null));
|
|
17
|
-
}))) : null;
|
|
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;
|
|
18
16
|
});
|
|
19
17
|
export default ColorLegend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function HelpfulTips(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
export default function HelpfulTips() {
|
|
3
|
+
return (_jsxs(_Fragment, { children: ["Helpful tips", _jsxs("ul", { children: [_jsx("li", { children: "You can select rows in the table with the checkboxes" }), _jsx("li", { children: "Multi-select is enabled with shift-click and control-click" }), _jsx("li", { children: "The \"Move selected items up/down\" can re-arrange subtracks" }), _jsx("li", { children: "Sorting the data grid itself can also re-arrange subtracks" }), _jsx("li", { children: "Changes are applied when you hit Submit" }), _jsx("li", { children: "You can click and drag the dialog box to move it on the screen" }), _jsx("li", { children: "Columns in the table can be hidden using a vertical '...' menu on the right side of each column" })] })] }));
|
|
4
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Source } from '../util';
|
|
1
|
+
import type { Source } from '../types';
|
|
3
2
|
interface ReducedModel {
|
|
4
3
|
scrollTop: number;
|
|
5
4
|
totalHeight: number;
|
|
@@ -8,11 +7,12 @@ interface ReducedModel {
|
|
|
8
7
|
sources?: Source[];
|
|
9
8
|
canDisplayLabels: boolean;
|
|
10
9
|
height: number;
|
|
10
|
+
samplePloidy?: Record<string, number>;
|
|
11
11
|
id: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const LegendBar: (props: {
|
|
14
14
|
model: ReducedModel;
|
|
15
15
|
orientation?: string;
|
|
16
16
|
exportSVG?: boolean;
|
|
17
|
-
}) =>
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
18
|
export default LegendBar;
|
package/esm/shared/LegendBar.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { clamp, getContainingView, measureText } from '@jbrowse/core/util';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clamp, getContainingView, max, measureText } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import ColorLegend from './ColorLegend';
|
|
5
5
|
const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
6
6
|
const { id, scrollTop, height } = model;
|
|
7
7
|
const clipid = `legend-${id}`;
|
|
8
|
-
return exportSVG ? (
|
|
9
|
-
React.createElement("defs", null,
|
|
10
|
-
React.createElement("clipPath", { id: clipid },
|
|
11
|
-
React.createElement("rect", { x: 0, y: 0, width: 1000, height: height }))),
|
|
12
|
-
React.createElement("g", { clipPath: `url(#${clipid})` },
|
|
13
|
-
React.createElement("g", { transform: `translate(0,${-scrollTop})` }, children)))) : (React.createElement("svg", { style: {
|
|
8
|
+
return exportSVG ? (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: 1000, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx("g", { transform: `translate(0,${-scrollTop})`, children: children }) })] })) : (_jsx("svg", { style: {
|
|
14
9
|
position: 'absolute',
|
|
15
10
|
top: 0,
|
|
16
11
|
left: 0,
|
|
@@ -18,15 +13,14 @@ const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
|
18
13
|
pointerEvents: 'none',
|
|
19
14
|
height: model.totalHeight,
|
|
20
15
|
width: getContainingView(model).width,
|
|
21
|
-
}
|
|
16
|
+
}, children: children }));
|
|
22
17
|
});
|
|
23
18
|
export const LegendBar = observer(function (props) {
|
|
24
19
|
const { model } = props;
|
|
25
20
|
const { canDisplayLabels, rowHeight, sources } = model;
|
|
26
21
|
const svgFontSize = clamp(rowHeight, 8, 12);
|
|
27
|
-
return sources ? (
|
|
28
|
-
|
|
29
|
-
.map(
|
|
30
|
-
.map(width => (canDisplayLabels ? width : 20))) }))) : null;
|
|
22
|
+
return sources ? (_jsx(Wrapper, { ...props, children: _jsx(ColorLegend, { model: model, labelWidth: max(sources
|
|
23
|
+
.map(s => measureText(s.label, svgFontSize) + 10)
|
|
24
|
+
.map(width => (canDisplayLabels ? width : 20)), 0) }) })) : null;
|
|
31
25
|
});
|
|
32
26
|
export default LegendBar;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const MAFFilterDialog: ({ model, handleClose, }: {
|
|
3
2
|
model: {
|
|
4
|
-
|
|
3
|
+
minorAlleleFrequencyFilter?: number;
|
|
5
4
|
setMafFilter: (arg: number) => void;
|
|
6
5
|
};
|
|
7
6
|
handleClose: () => void;
|
|
8
|
-
}) =>
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default MAFFilterDialog;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Button, Dialog, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import { makeStyles } from 'tss-react/mui';
|
|
@@ -8,24 +9,18 @@ const useStyles = makeStyles()({
|
|
|
8
9
|
},
|
|
9
10
|
});
|
|
10
11
|
const MAFFilterDialog = observer(function ({ model, handleClose, }) {
|
|
11
|
-
const {
|
|
12
|
+
const { minorAlleleFrequencyFilter = '' } = model;
|
|
12
13
|
const { classes } = useStyles();
|
|
13
|
-
const [maf, setMaf] = useState(`${
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
handleClose();
|
|
26
|
-
} }, "Submit"),
|
|
27
|
-
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
28
|
-
handleClose();
|
|
29
|
-
} }, "Cancel")))));
|
|
14
|
+
const [maf, setMaf] = useState(`${minorAlleleFrequencyFilter}`);
|
|
15
|
+
return (_jsx(Dialog, { open: true, onClose: handleClose, title: "Set minor allele frequency (MAF)", children: _jsxs(DialogContent, { className: classes.root, children: [_jsx(Typography, { children: "Set minor allele frequency cutoff track. This will filter out rare variants that might not contribute to meaningful large scale patterns" }), _jsx(TextField, { value: maf, autoFocus: true, placeholder: "Enter MAF", onChange: event => {
|
|
16
|
+
setMaf(event.target.value);
|
|
17
|
+
} }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
|
|
18
|
+
if (!Number.isNaN(+maf)) {
|
|
19
|
+
model.setMafFilter(+maf);
|
|
20
|
+
}
|
|
21
|
+
handleClose();
|
|
22
|
+
}, children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
23
|
+
handleClose();
|
|
24
|
+
}, children: "Cancel" })] })] }) }));
|
|
30
25
|
});
|
|
31
26
|
export default MAFFilterDialog;
|