@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 { lazy } from 'react';
|
|
2
3
|
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
4
|
import { SimpleFeature, getEnv, getSession } from '@jbrowse/core/util';
|
|
4
5
|
import { Link, Typography } from '@mui/material';
|
|
@@ -6,70 +7,58 @@ const BreakendMultiLevelOptionDialog = lazy(() => import('./BreakendMultiLevelOp
|
|
|
6
7
|
const BreakendSingleLevelOptionDialog = lazy(() => import('./BreakendSingleLevelOptionDialog'));
|
|
7
8
|
function LocStringList({ locStrings, model, }) {
|
|
8
9
|
const session = getSession(model);
|
|
9
|
-
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.error(e);
|
|
28
|
-
session.notify(`${e}`);
|
|
29
|
-
}
|
|
30
|
-
} }, "(LGV)")))))));
|
|
10
|
+
return (_jsxs("div", { children: [_jsx(Typography, { children: "Navigate to breakend endpoint in linear view:" }), _jsx("ul", { children: locStrings.map((locString, index) => (_jsxs("li", { children: [locString, ' ', _jsx(Link, { href: "#", onClick: event => {
|
|
11
|
+
var _a;
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
const { view } = model;
|
|
14
|
+
try {
|
|
15
|
+
if (view) {
|
|
16
|
+
(_a = view.navToLocString) === null || _a === void 0 ? void 0 : _a.call(view, locString);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw new Error('No view associated with this feature detail panel anymore');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
console.error(e);
|
|
24
|
+
session.notify(`${e}`);
|
|
25
|
+
}
|
|
26
|
+
}, children: "(LGV)" })] }, `${locString}-${index}`))) })] }));
|
|
31
27
|
}
|
|
32
28
|
function LaunchBreakpointSplitViewPanel({ locStrings, model, feature, }) {
|
|
33
29
|
var _a, _b;
|
|
34
30
|
const session = getSession(model);
|
|
35
31
|
const simpleFeature = new SimpleFeature(feature);
|
|
36
32
|
const assemblyName = (_b = (_a = model.view) === null || _a === void 0 ? void 0 : _a.displayedRegions[0]) === null || _b === void 0 ? void 0 : _b.assemblyName;
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
feature: simpleFeature,
|
|
65
|
-
stableViewId: `${model.id}_${assemblyName}_breakpointsplitview_singlelevel`,
|
|
66
|
-
view: model.view,
|
|
67
|
-
assemblyName,
|
|
68
|
-
},
|
|
69
|
-
]);
|
|
70
|
-
} }, "(single row)")))))));
|
|
33
|
+
return (_jsxs("div", { children: [_jsx(Typography, { children: "Launch split view" }), _jsx("ul", { children: locStrings.map(locString => (_jsxs("li", { children: [`${feature.refName}:${feature.start} // ${locString}`, ' ', _jsx(Link, { href: "#", onClick: event => {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
session.queueDialog(handleClose => [
|
|
36
|
+
BreakendMultiLevelOptionDialog,
|
|
37
|
+
{
|
|
38
|
+
handleClose,
|
|
39
|
+
session,
|
|
40
|
+
feature: simpleFeature,
|
|
41
|
+
stableViewId: `${model.id}_${assemblyName}_breakpointsplitview_multilevel`,
|
|
42
|
+
view: model.view,
|
|
43
|
+
assemblyName,
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
}, children: "(top/bottom)" }), ' ', _jsx(Link, { href: "#", onClick: event => {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
session.queueDialog(handleClose => [
|
|
49
|
+
BreakendSingleLevelOptionDialog,
|
|
50
|
+
{
|
|
51
|
+
handleClose,
|
|
52
|
+
session,
|
|
53
|
+
feature: simpleFeature,
|
|
54
|
+
stableViewId: `${model.id}_${assemblyName}_breakpointsplitview_singlelevel`,
|
|
55
|
+
view: model.view,
|
|
56
|
+
assemblyName,
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
}, children: "(single row)" })] }, JSON.stringify(locString)))) })] }));
|
|
71
60
|
}
|
|
72
|
-
export default function
|
|
61
|
+
export default function LaunchBreakendPanel(props) {
|
|
73
62
|
const { model, locStrings, feature } = props;
|
|
74
63
|
const session = getSession(model);
|
|
75
64
|
const { pluginManager } = getEnv(session);
|
|
@@ -79,7 +68,5 @@ export default function BreakendPanel(props) {
|
|
|
79
68
|
}
|
|
80
69
|
catch (e) {
|
|
81
70
|
}
|
|
82
|
-
return (
|
|
83
|
-
React.createElement(LocStringList, { model: model, locStrings: locStrings }),
|
|
84
|
-
hasBreakpointSplitView ? (React.createElement(LaunchBreakpointSplitViewPanel, { model: model, locStrings: locStrings, feature: feature })) : null));
|
|
71
|
+
return (_jsxs(BaseCard, { ...props, title: "Breakends", children: [_jsx(LocStringList, { model: model, locStrings: locStrings }), hasBreakpointSplitView ? (_jsx(LaunchBreakpointSplitViewPanel, { model: model, locStrings: locStrings, feature: feature })) : null] }));
|
|
85
72
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy } from 'react';
|
|
3
|
+
import { parseBreakend } from '@gmod/vcf';
|
|
4
|
+
const LaunchBreakendPanel = lazy(() => import('./LaunchBreakendPanel'));
|
|
5
|
+
export default function LaunchBreakendWidgetArea({ model, }) {
|
|
6
|
+
const { featureData } = model;
|
|
7
|
+
const feat = JSON.parse(JSON.stringify(featureData));
|
|
8
|
+
const { type = '' } = feat;
|
|
9
|
+
return (_jsx(Suspense, { fallback: null, children: type === 'breakend' ? (_jsx(LaunchBreakendPanel, { feature: feat, locStrings: feat.ALT.map((alt) => { var _a; return ((_a = parseBreakend(alt)) === null || _a === void 0 ? void 0 : _a.MatePosition) || ''; }), model: model })) : type === 'translocation' ? (_jsx(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.INFO.CHR2[0]}:${feat.INFO.END}`] })) : type === 'paired_feature' ? (_jsx(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.mate.refName}:${feat.mate.start}`] })) : type.includes('inversion') ||
|
|
10
|
+
type.includes('deletion') ||
|
|
11
|
+
type.includes('duplication') ||
|
|
12
|
+
type.includes('cnv') ||
|
|
13
|
+
type.includes('sv') ? (_jsx(LaunchBreakendPanel, { feature: {
|
|
14
|
+
uniqueId: 'random',
|
|
15
|
+
refName: feat.refName,
|
|
16
|
+
start: feat.start,
|
|
17
|
+
end: feat.start + 1,
|
|
18
|
+
mate: {
|
|
19
|
+
refName: feat.refName,
|
|
20
|
+
start: feat.end,
|
|
21
|
+
end: feat.end + 1,
|
|
22
|
+
},
|
|
23
|
+
}, model: model, locStrings: [`${feat.refName}:${feat.end}`] })) : null }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
|
+
import VariantConsequenceDataGridWrapper from './VariantConsequenceDataGridWrapper';
|
|
4
|
+
export default function VariantConsequenceDataGrid({ data, fields, title, }) {
|
|
5
|
+
return data.length ? (_jsx(BaseCard, { title: title, children: _jsx(VariantConsequenceDataGridWrapper, { rows: data.map((elt, id) => ({
|
|
6
|
+
id,
|
|
7
|
+
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
8
|
+
})), columns: fields.map(c => ({ field: c })) }) })) : null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { measureGridWidth } from '@jbrowse/core/util';
|
|
4
|
+
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
5
|
+
import { DataGrid, GridToolbar } from '@mui/x-data-grid';
|
|
6
|
+
export default function VariantConsequenceDataGridWrapper({ rows, columns, }) {
|
|
7
|
+
const [checked, setChecked] = useState(false);
|
|
8
|
+
const widths = columns.map(e => measureGridWidth(rows.map(r => r[e.field])));
|
|
9
|
+
return rows.length ? (_jsxs("div", { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: checked, onChange: event => {
|
|
10
|
+
setChecked(event.target.checked);
|
|
11
|
+
} }), label: _jsx(Typography, { variant: "body2", children: "Show options" }) }), _jsx(DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({
|
|
12
|
+
...c,
|
|
13
|
+
width: widths[i],
|
|
14
|
+
})), slots: {
|
|
15
|
+
toolbar: checked ? GridToolbar : null,
|
|
16
|
+
} })] })) : null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
|
+
import VariantConsequenceDataGridWrapper from './VariantConsequenceDataGridWrapper';
|
|
4
|
+
export default function VariantConsequencePanel({ data, fields, title, }) {
|
|
5
|
+
return data.length ? (_jsx(BaseCard, { title: title, children: _jsx(VariantConsequenceDataGridWrapper, { rows: data.map((elt, id) => ({
|
|
6
|
+
id,
|
|
7
|
+
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
8
|
+
})), columns: fields.map(c => ({ field: c })) }) })) : null;
|
|
9
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { VariantFeatureWidgetModel } from './stateModelFactory';
|
|
3
2
|
declare const VariantFeatureWidget: (props: {
|
|
4
3
|
model: VariantFeatureWidgetModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default VariantFeatureWidget;
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, lazy } from 'react';
|
|
2
3
|
import { parseBreakend } from '@gmod/vcf';
|
|
3
4
|
import FeatureDetails from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails';
|
|
4
5
|
import { Paper } from '@mui/material';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
|
-
import VariantAnnotationTable from './VariantAnnotationTable';
|
|
7
7
|
import VariantSampleGrid from './VariantSampleGrid';
|
|
8
8
|
import { variantFieldDescriptions } from './variantFieldDescriptions';
|
|
9
9
|
const LaunchBreakendPanel = lazy(() => import('./LaunchBreakendPanel'));
|
|
10
|
+
const VariantConsequenceDataGrid = lazy(() => import('./VariantConsequenceDataGrid'));
|
|
10
11
|
function AnnPanel({ descriptions, feature, }) {
|
|
11
12
|
var _a, _b, _c, _d, _e;
|
|
12
13
|
const annDesc = (_b = (_a = descriptions === null || descriptions === void 0 ? void 0 : descriptions.INFO) === null || _a === void 0 ? void 0 : _a.ANN) === null || _b === void 0 ? void 0 : _b.Description;
|
|
13
14
|
const annFields = ((_d = (_c = annDesc === null || annDesc === void 0 ? void 0 : annDesc.match(/.*Functional annotations:'(.*)'$/)) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.split('|')) || [];
|
|
14
15
|
const ann = ((_e = feature.INFO) === null || _e === void 0 ? void 0 : _e.ANN) || [];
|
|
15
|
-
return (
|
|
16
|
+
return (_jsx(VariantConsequenceDataGrid, { fields: annFields, data: ann, title: "Variant ANN field" }));
|
|
16
17
|
}
|
|
17
18
|
function CsqPanel({ descriptions, feature, }) {
|
|
18
19
|
var _a, _b, _c, _d, _e;
|
|
19
20
|
const csqDescription = (_b = (_a = descriptions === null || descriptions === void 0 ? void 0 : descriptions.INFO) === null || _a === void 0 ? void 0 : _a.CSQ) === null || _b === void 0 ? void 0 : _b.Description;
|
|
20
21
|
const csqFields = ((_d = (_c = csqDescription === null || csqDescription === void 0 ? void 0 : csqDescription.match(/.*Format: (.*)/)) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.split('|')) || [];
|
|
21
22
|
const csq = ((_e = feature.INFO) === null || _e === void 0 ? void 0 : _e.CSQ) || [];
|
|
22
|
-
return (
|
|
23
|
+
return (_jsx(VariantConsequenceDataGrid, { fields: csqFields, data: csq, title: "Variant CSQ field" }));
|
|
24
|
+
}
|
|
25
|
+
function LaunchBreakendWidgetArea({ model, }) {
|
|
26
|
+
const { featureData } = model;
|
|
27
|
+
const feat = JSON.parse(JSON.stringify(featureData));
|
|
28
|
+
const { type = '' } = feat;
|
|
29
|
+
return type === 'breakend' ? (_jsx(LaunchBreakendPanel, { feature: feat, locStrings: feat.ALT.map((alt) => { var _a; return ((_a = parseBreakend(alt)) === null || _a === void 0 ? void 0 : _a.MatePosition) || ''; }), model: model })) : type === 'translocation' ? (_jsx(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.INFO.CHR2[0]}:${feat.INFO.END}`] })) : type === 'paired_feature' ? (_jsx(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.mate.refName}:${feat.mate.start}`] })) : type.includes('inversion') ||
|
|
30
|
+
type.includes('deletion') ||
|
|
31
|
+
type.includes('duplication') ||
|
|
32
|
+
type.includes('cnv') ||
|
|
33
|
+
type.includes('sv') ? (_jsx(LaunchBreakendPanel, { feature: {
|
|
34
|
+
uniqueId: 'random',
|
|
35
|
+
refName: feat.refName,
|
|
36
|
+
start: feat.start,
|
|
37
|
+
end: feat.start + 1,
|
|
38
|
+
mate: {
|
|
39
|
+
refName: feat.refName,
|
|
40
|
+
start: feat.end,
|
|
41
|
+
end: feat.end + 1,
|
|
42
|
+
},
|
|
43
|
+
}, model: model, locStrings: [`${feat.refName}:${feat.end}`] })) : null;
|
|
23
44
|
}
|
|
24
45
|
const VariantFeatureWidget = observer(function (props) {
|
|
25
46
|
const { model } = props;
|
|
26
47
|
const { featureData, descriptions } = model;
|
|
27
48
|
const feat = JSON.parse(JSON.stringify(featureData));
|
|
28
|
-
const { samples, ALT,
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
React.createElement(Suspense, { fallback: null },
|
|
34
|
-
type === 'breakend' ? (React.createElement(LaunchBreakendPanel, { feature: feat, locStrings: feat.ALT.map((alt) => { var _a; return ((_a = parseBreakend(alt)) === null || _a === void 0 ? void 0 : _a.MatePosition) || ''; }), model: model })) : null,
|
|
35
|
-
type === 'translocation' ? (React.createElement(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.INFO.CHR2[0]}:${feat.INFO.END}`] })) : null,
|
|
36
|
-
type === 'paired_feature' ? (React.createElement(LaunchBreakendPanel, { feature: feat, model: model, locStrings: [`${feat.mate.refName}:${feat.mate.start}`] })) : null,
|
|
37
|
-
type.includes('inversion') ||
|
|
38
|
-
type.includes('deletion') ||
|
|
39
|
-
type.includes('duplication') ||
|
|
40
|
-
type.includes('cnv') ||
|
|
41
|
-
type.includes('sv') ? (React.createElement(LaunchBreakendPanel, { feature: {
|
|
42
|
-
uniqueId: 'random',
|
|
43
|
-
refName: feat.refName,
|
|
44
|
-
start: feat.start,
|
|
45
|
-
end: feat.start + 1,
|
|
46
|
-
mate: {
|
|
47
|
-
refName: feat.refName,
|
|
48
|
-
start: feat.end,
|
|
49
|
-
end: feat.end + 1,
|
|
50
|
-
},
|
|
51
|
-
}, model: model, locStrings: [`${feat.refName}:${feat.end}`] })) : null),
|
|
52
|
-
React.createElement(VariantSampleGrid, { feature: feat, ...props, descriptions: descriptions })));
|
|
49
|
+
const { samples, ALT, ...rest } = feat;
|
|
50
|
+
return (_jsxs(Paper, { "data-testid": "variant-side-drawer", children: [_jsx(FeatureDetails, { feature: rest, descriptions: {
|
|
51
|
+
...variantFieldDescriptions,
|
|
52
|
+
...descriptions,
|
|
53
|
+
}, ...props }), _jsxs(Suspense, { fallback: null, children: [_jsx(CsqPanel, { feature: rest, descriptions: descriptions }), _jsx(AnnPanel, { feature: rest, descriptions: descriptions }), _jsx(LaunchBreakendWidgetArea, { model: model })] }), _jsx(VariantSampleGrid, { feature: feat, ...props, descriptions: descriptions })] }));
|
|
53
54
|
});
|
|
54
55
|
export default VariantFeatureWidget;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Filters = Record<string, string>;
|
|
2
|
+
export default function SampleFilters({ columns, filter, setFilter, }: {
|
|
3
|
+
columns: {
|
|
4
|
+
field: string;
|
|
5
|
+
}[];
|
|
6
|
+
filter: Filters;
|
|
7
|
+
setFilter: (arg: Filters) => void;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TextField, Typography } from '@mui/material';
|
|
3
|
+
export default function SampleFilters({ columns, filter, setFilter, }) {
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx(Typography, { children: "These filters can use a plain text search or regex style query, e.g. in the genotype field, entering 1 will query for all genotypes that include the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\\d* will find any non-zero allele e.g. 0|2 or 2/33" }), columns.map(({ field }) => (_jsx(TextField, { placeholder: `Filter ${field}`, value: filter[field] || '', onChange: event => {
|
|
5
|
+
setFilter({ ...filter, [field]: event.target.value });
|
|
6
|
+
} }, `filter-${field}`)))] }));
|
|
7
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
2
|
+
interface FormatRecord {
|
|
3
|
+
Description?: string;
|
|
4
|
+
}
|
|
5
|
+
interface Descriptions {
|
|
6
|
+
FORMAT?: Record<string, FormatRecord>;
|
|
7
|
+
}
|
|
3
8
|
export default function VariantSamples(props: {
|
|
4
9
|
feature: SimpleFeatureSerialized;
|
|
5
|
-
descriptions?:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>;
|
|
9
|
-
} | null;
|
|
10
|
-
}): React.JSX.Element | null;
|
|
10
|
+
descriptions?: Descriptions | null;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
3
4
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
4
|
-
import { Checkbox, FormControlLabel,
|
|
5
|
+
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
5
6
|
import { DataGrid, GridToolbar } from '@mui/x-data-grid';
|
|
6
|
-
|
|
7
|
-
return (React.createElement(React.Fragment, null,
|
|
8
|
-
React.createElement(Typography, null, "These filters can use a plain text search or regex style query, e.g. in the genotype field, entering 1 will query for all genotypes that include the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\\d* will find any non-zero allele e.g. 0|2 or 2/33"),
|
|
9
|
-
columns.map(({ field }) => (React.createElement(TextField, { key: `filter-${field}`, placeholder: `Filter ${field}`, value: filter[field] || '', onChange: event => {
|
|
10
|
-
setFilter({ ...filter, [field]: event.target.value });
|
|
11
|
-
} })))));
|
|
12
|
-
}
|
|
7
|
+
import SampleFilters from './VariantSampleFilters';
|
|
13
8
|
export default function VariantSamples(props) {
|
|
14
9
|
var _a;
|
|
15
10
|
const { feature, descriptions = {} } = props;
|
|
@@ -51,18 +46,16 @@ export default function VariantSamples(props) {
|
|
|
51
46
|
width: widths[index],
|
|
52
47
|
});
|
|
53
48
|
});
|
|
54
|
-
return !preFilteredRows.length ? null : (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
disableToolbarButton: true,
|
|
49
|
+
return !preFilteredRows.length ? null : (_jsxs(BaseCard, { ...props, title: "Samples", children: [error ? _jsx(Typography, { color: "error", children: `${error}` }) : null, _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: checked, onChange: event => {
|
|
50
|
+
setChecked(event.target.checked);
|
|
51
|
+
} }), label: _jsx(Typography, { variant: "body2", children: "Show options" }) }), checked ? (_jsx(SampleFilters, { setFilter: setFilter, columns: columns, filter: filter })) : null, _jsx("div", { style: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
}, children: _jsx(DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, columnHeaderHeight: 35, disableColumnMenu: true, slots: { toolbar: checked ? GridToolbar : null }, slotProps: {
|
|
55
|
+
toolbar: {
|
|
56
|
+
printOptions: {
|
|
57
|
+
disableToolbarButton: true,
|
|
58
|
+
},
|
|
65
59
|
},
|
|
66
|
-
}
|
|
67
|
-
} }))));
|
|
60
|
+
} }) })] }));
|
|
68
61
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
2
2
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
3
3
|
import { firstValueFrom, toArray } from 'rxjs';
|
|
4
|
+
import { getFeaturesThatPassMinorAlleleFrequencyFilter } from '../util';
|
|
4
5
|
export class MultiVariantGetGenotypeMatrix extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
5
6
|
constructor() {
|
|
6
7
|
super(...arguments);
|
|
@@ -9,39 +10,18 @@ export class MultiVariantGetGenotypeMatrix extends RpcMethodTypeWithFiltersAndRe
|
|
|
9
10
|
async execute(args, rpcDriverClassName) {
|
|
10
11
|
const pm = this.pluginManager;
|
|
11
12
|
const deserializedArgs = await this.deserializeArguments(args, rpcDriverClassName);
|
|
12
|
-
const { sources,
|
|
13
|
+
const { sources, minorAlleleFrequencyFilter, regions, adapterConfig, sessionId, } = deserializedArgs;
|
|
13
14
|
const adapter = await getAdapter(pm, sessionId, adapterConfig);
|
|
14
15
|
const dataAdapter = adapter.dataAdapter;
|
|
15
16
|
const region = regions[0];
|
|
16
17
|
const feats = await firstValueFrom(dataAdapter.getFeatures(region, deserializedArgs).pipe(toArray()));
|
|
17
18
|
const genotypeFactor = new Set();
|
|
18
|
-
const mafs =
|
|
19
|
+
const mafs = getFeaturesThatPassMinorAlleleFrequencyFilter(feats, minorAlleleFrequencyFilter);
|
|
19
20
|
for (const feat of feats) {
|
|
20
|
-
let c = 0;
|
|
21
|
-
let c2 = 0;
|
|
22
21
|
const samp = feat.get('genotypes');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
genotypeFactor.add(s);
|
|
27
|
-
if (s === '0|0' || s === './.') {
|
|
28
|
-
c2++;
|
|
29
|
-
}
|
|
30
|
-
else if (s === '1|0' || s === '0|1') {
|
|
31
|
-
c++;
|
|
32
|
-
}
|
|
33
|
-
else if (s === '1|1') {
|
|
34
|
-
c++;
|
|
35
|
-
c2++;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
c++;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (c / sources.length > mafFilter &&
|
|
42
|
-
c2 / sources.length < 1 - mafFilter) {
|
|
43
|
-
mafs.push(feat);
|
|
44
|
-
}
|
|
22
|
+
for (const { name } of sources) {
|
|
23
|
+
const s = samp[name];
|
|
24
|
+
genotypeFactor.add(s);
|
|
45
25
|
}
|
|
46
26
|
}
|
|
47
27
|
const genotypeFactorMap = Object.fromEntries([...genotypeFactor].map((type, idx) => [type, idx]));
|
|
@@ -50,7 +30,10 @@ export class MultiVariantGetGenotypeMatrix extends RpcMethodTypeWithFiltersAndRe
|
|
|
50
30
|
const samp = feat.get('genotypes');
|
|
51
31
|
for (const { name } of sources) {
|
|
52
32
|
if (!rows[name]) {
|
|
53
|
-
rows[name] = {
|
|
33
|
+
rows[name] = {
|
|
34
|
+
name,
|
|
35
|
+
genotypes: [],
|
|
36
|
+
};
|
|
54
37
|
}
|
|
55
38
|
rows[name].genotypes.push(genotypeFactorMap[samp[name]]);
|
|
56
39
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
2
|
+
import type { SampleInfo } from '../types';
|
|
2
3
|
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
4
|
import type { Region } from '@jbrowse/core/util';
|
|
4
5
|
export declare class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
@@ -11,11 +12,15 @@ export declare class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWith
|
|
|
11
12
|
regions: Region[];
|
|
12
13
|
bpPerPx: number;
|
|
13
14
|
}, rpcDriverClassName: string): Promise<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
hasPhased: boolean;
|
|
16
|
+
sampleInfo: Record<string, SampleInfo>;
|
|
17
|
+
features: {
|
|
18
|
+
id: string;
|
|
19
|
+
data: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
refName: string;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
}>;
|
|
21
26
|
}
|
|
@@ -1,56 +1,46 @@
|
|
|
1
1
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
2
2
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
3
3
|
import { firstValueFrom, toArray } from 'rxjs';
|
|
4
|
+
import { getFeaturesThatPassMinorAlleleFrequencyFilter } from '../util';
|
|
4
5
|
export class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
5
6
|
constructor() {
|
|
6
7
|
super(...arguments);
|
|
7
8
|
this.name = 'MultiVariantGetSimplifiedFeatures';
|
|
8
9
|
}
|
|
9
10
|
async execute(args, rpcDriverClassName) {
|
|
11
|
+
var _a, _b;
|
|
10
12
|
const pm = this.pluginManager;
|
|
11
13
|
const deserializedArgs = await this.deserializeArguments(args, rpcDriverClassName);
|
|
12
|
-
const {
|
|
14
|
+
const { minorAlleleFrequencyFilter, regions, adapterConfig, sessionId } = deserializedArgs;
|
|
13
15
|
const { dataAdapter } = await getAdapter(pm, sessionId, adapterConfig);
|
|
14
16
|
const feats = await firstValueFrom(dataAdapter
|
|
15
17
|
.getFeaturesInMultipleRegions(regions, deserializedArgs)
|
|
16
18
|
.pipe(toArray()));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
else if (s === '1|0' || s === '0|1') {
|
|
31
|
-
c++;
|
|
32
|
-
}
|
|
33
|
-
else if (s === '1|1') {
|
|
34
|
-
c++;
|
|
35
|
-
c2++;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
c++;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (c / sources.length > mafFilter &&
|
|
42
|
-
c2 / sources.length < 1 - mafFilter) {
|
|
43
|
-
mafs.push(feat);
|
|
44
|
-
}
|
|
19
|
+
const features = getFeaturesThatPassMinorAlleleFrequencyFilter(feats, minorAlleleFrequencyFilter);
|
|
20
|
+
const sampleInfo = {};
|
|
21
|
+
let hasPhased = false;
|
|
22
|
+
for (const f of features) {
|
|
23
|
+
const samp = f.get('genotypes');
|
|
24
|
+
for (const [key, val] of Object.entries(samp)) {
|
|
25
|
+
const isPhased = val.includes('|');
|
|
26
|
+
hasPhased || (hasPhased = isPhased);
|
|
27
|
+
sampleInfo[key] = {
|
|
28
|
+
maxPloidy: Math.max(((_a = sampleInfo[key]) === null || _a === void 0 ? void 0 : _a.maxPloidy) || 0, val.split('|').length),
|
|
29
|
+
isPhased: ((_b = sampleInfo[key]) === null || _b === void 0 ? void 0 : _b.isPhased) || isPhased,
|
|
30
|
+
};
|
|
45
31
|
}
|
|
46
32
|
}
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
return {
|
|
34
|
+
hasPhased,
|
|
35
|
+
sampleInfo,
|
|
36
|
+
features: features.map(f => ({
|
|
37
|
+
id: f.id(),
|
|
38
|
+
data: {
|
|
39
|
+
start: f.get('start'),
|
|
40
|
+
end: f.get('end'),
|
|
41
|
+
refName: f.get('refName'),
|
|
42
|
+
},
|
|
43
|
+
})),
|
|
44
|
+
};
|
|
55
45
|
}
|
|
56
46
|
}
|