@jbrowse/plugin-variants 3.1.0 → 3.3.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/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +58 -3
- package/dist/MultiLinearVariantDisplay/model.js +0 -1
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +59 -2
- package/dist/MultiLinearVariantMatrixDisplay/model.js +5 -1
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +15 -8
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
- package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
- package/dist/MultiLinearVariantRenderer/index.js +2 -2
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +63 -23
- package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
- package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
- package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/dist/VariantFeatureWidget/Formatter.js +23 -0
- package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.js +2 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +30 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
- package/dist/VariantRPC/getGenotypeMatrix.d.ts +6 -0
- package/dist/VariantRPC/getGenotypeMatrix.js +60 -0
- package/dist/VariantRPC/types.d.ts +36 -0
- package/dist/VariantRPC/types.js +2 -0
- package/dist/VcfAdapter/VcfAdapter.js +6 -3
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +125 -27
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +17 -7
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/index.js +2 -0
- package/dist/shared/MultiVariantBaseModel.d.ts +59 -3
- package/dist/shared/MultiVariantBaseModel.js +95 -37
- package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
- package/dist/shared/components/AddFiltersDialog.js +61 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.js +29 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +74 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +145 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.d.ts +10 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
- package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
- package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
- package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
- package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/dist/shared/components/MultiVariantTooltip.js +3 -2
- package/dist/shared/components/RectBg.js +4 -2
- package/dist/shared/components/SetColorDialog.js +1 -1
- package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
- package/dist/shared/components/SourcesDataGrid.js +2 -2
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/components/SourcesGridHeader.js +2 -2
- package/dist/shared/drawAlleleCount.d.ts +1 -1
- package/dist/shared/drawAlleleCount.js +29 -5
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/getSources.d.ts +15 -0
- package/dist/shared/getSources.js +34 -0
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +58 -3
- package/esm/MultiLinearVariantDisplay/model.js +0 -1
- package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +59 -2
- package/esm/MultiLinearVariantMatrixDisplay/model.js +5 -1
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +16 -9
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
- package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
- package/esm/MultiLinearVariantRenderer/index.js +1 -1
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +64 -24
- package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
- package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
- package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/esm/VariantFeatureWidget/Formatter.js +17 -0
- package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.js +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +23 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
- package/esm/VariantRPC/getGenotypeMatrix.d.ts +6 -0
- package/esm/VariantRPC/getGenotypeMatrix.js +57 -0
- package/esm/VariantRPC/types.d.ts +36 -0
- package/esm/VariantRPC/types.js +1 -0
- package/esm/VcfAdapter/VcfAdapter.js +7 -4
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +123 -27
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +18 -8
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/index.js +2 -0
- package/esm/shared/MultiVariantBaseModel.d.ts +59 -3
- package/esm/shared/MultiVariantBaseModel.js +97 -39
- package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
- package/esm/shared/components/AddFiltersDialog.js +59 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.js +24 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +72 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +140 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.d.ts +10 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
- package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
- package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
- package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
- package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/esm/shared/components/MultiVariantTooltip.js +3 -2
- package/esm/shared/components/RectBg.js +4 -2
- package/esm/shared/components/SetColorDialog.js +1 -1
- package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
- package/esm/shared/components/SourcesDataGrid.js +2 -2
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/components/SourcesGridHeader.js +2 -2
- package/esm/shared/drawAlleleCount.d.ts +1 -1
- package/esm/shared/drawAlleleCount.js +29 -5
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/getSources.d.ts +15 -0
- package/esm/shared/getSources.js +31 -0
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +10 -9
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
- package/dist/shared/components/ClusterDialog.d.ts +0 -11
- package/dist/shared/components/ClusterDialog.js +0 -113
- package/dist/shared/components/LegendBar.d.ts +0 -18
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
- package/esm/shared/components/ClusterDialog.d.ts +0 -11
- package/esm/shared/components/ClusterDialog.js +0 -107
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const util_1 = require("@jbrowse/core/util");
|
|
8
|
-
const mobx_react_1 = require("mobx-react");
|
|
9
|
-
const mui_1 = require("tss-react/mui");
|
|
10
|
-
const MultiVariantTooltip_1 = __importDefault(require("../../shared/components/MultiVariantTooltip"));
|
|
11
|
-
const useStyles = (0, mui_1.makeStyles)()({
|
|
12
|
-
rel: {
|
|
13
|
-
position: 'relative',
|
|
14
|
-
},
|
|
15
|
-
cursor: {
|
|
16
|
-
pointerEvents: 'none',
|
|
17
|
-
zIndex: 800,
|
|
18
|
-
position: 'absolute',
|
|
19
|
-
},
|
|
20
|
-
color: {
|
|
21
|
-
width: 10,
|
|
22
|
-
height: 10,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
const Crosshair = (0, mobx_react_1.observer)(function ({ mouseX, mouseY, model, }) {
|
|
26
|
-
const { classes } = useStyles();
|
|
27
|
-
const { hoveredGenotype, height, scrollTop, rowHeight, sources } = model;
|
|
28
|
-
const { width } = (0, util_1.getContainingView)(model);
|
|
29
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor(mouseY / rowHeight)];
|
|
30
|
-
const y = mouseY - scrollTop;
|
|
31
|
-
return source ? ((0, jsx_runtime_1.jsxs)("div", { className: classes.rel, children: [(0, jsx_runtime_1.jsxs)("svg", { className: classes.cursor, width: width, height: height, style: {
|
|
32
|
-
top: scrollTop,
|
|
33
|
-
}, children: [(0, jsx_runtime_1.jsx)("line", { x1: 0, x2: width, y1: y, y2: y, stroke: "black" }), (0, jsx_runtime_1.jsx)("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: "black" })] }), (0, jsx_runtime_1.jsx)(MultiVariantTooltip_1.default, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
34
|
-
});
|
|
35
|
-
exports.default = Crosshair;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MultiLinearVariantMatrixDisplayModel } from '../model';
|
|
2
|
-
declare const Crosshair: ({ mouseX, mouseY, model, }: {
|
|
3
|
-
mouseX: number;
|
|
4
|
-
mouseY: number;
|
|
5
|
-
model: MultiLinearVariantMatrixDisplayModel;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default Crosshair;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const util_1 = require("@jbrowse/core/util");
|
|
8
|
-
const mobx_react_1 = require("mobx-react");
|
|
9
|
-
const mui_1 = require("tss-react/mui");
|
|
10
|
-
const MultiVariantTooltip_1 = __importDefault(require("../../shared/components/MultiVariantTooltip"));
|
|
11
|
-
const useStyles = (0, mui_1.makeStyles)()({
|
|
12
|
-
cursor: {
|
|
13
|
-
pointerEvents: 'none',
|
|
14
|
-
zIndex: 800,
|
|
15
|
-
position: 'relative',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
const Crosshair = (0, mobx_react_1.observer)(function ({ mouseX, mouseY, model, }) {
|
|
19
|
-
const { classes } = useStyles();
|
|
20
|
-
const { hoveredGenotype, lineZoneHeight, totalHeight, rowHeight, sources } = model;
|
|
21
|
-
const { width } = (0, util_1.getContainingView)(model);
|
|
22
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor((mouseY - lineZoneHeight) / rowHeight)];
|
|
23
|
-
const yoff = mouseY - lineZoneHeight;
|
|
24
|
-
return source ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("svg", { className: classes.cursor, width: width, height: totalHeight, style: {
|
|
25
|
-
top: lineZoneHeight,
|
|
26
|
-
}, children: [(0, jsx_runtime_1.jsx)("line", { x1: 0, x2: width, y1: yoff, y2: yoff, stroke: "black" }), (0, jsx_runtime_1.jsx)("line", { x1: mouseX, x2: mouseX, y1: 0, y2: totalHeight, stroke: "black" })] }), (0, jsx_runtime_1.jsx)(MultiVariantTooltip_1.default, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
27
|
-
});
|
|
28
|
-
exports.default = Crosshair;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
6
|
-
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const LinearVariantMatrixRendering = (0, mobx_react_1.observer)(function (props) {
|
|
8
|
-
const { arr, width, height, displayModel } = props;
|
|
9
|
-
const ref = (0, react_1.useRef)(null);
|
|
10
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
let offsetX = 0;
|
|
13
|
-
let offsetY = 0;
|
|
14
|
-
if (ref.current) {
|
|
15
|
-
const r = ref.current.getBoundingClientRect();
|
|
16
|
-
offsetX = eventClientX - r.left;
|
|
17
|
-
offsetY = eventClientY - r.top;
|
|
18
|
-
}
|
|
19
|
-
const dimY = arr.length;
|
|
20
|
-
const dimX = ((_a = arr[0]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
21
|
-
return (_b = arr[Math.floor((offsetX / width) * dimY)]) === null || _b === void 0 ? void 0 : _b[Math.floor((offsetY / height) * dimX)];
|
|
22
|
-
}
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onMouseMove: e => {
|
|
24
|
-
var _a;
|
|
25
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
26
|
-
}, onMouseLeave: () => {
|
|
27
|
-
var _a;
|
|
28
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
29
|
-
}, onMouseOut: () => {
|
|
30
|
-
var _a;
|
|
31
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
32
|
-
}, style: {
|
|
33
|
-
overflow: 'visible',
|
|
34
|
-
position: 'relative',
|
|
35
|
-
height,
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.PrerenderedCanvas, { ...props }) }));
|
|
37
|
-
});
|
|
38
|
-
exports.default = LinearVariantMatrixRendering;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import RBush from 'rbush';
|
|
2
|
-
import type { Source } from '../shared/types';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util/types';
|
|
5
|
-
declare const MultiVariantRendering: (props: {
|
|
6
|
-
regions: Region[];
|
|
7
|
-
features: Map<string, Feature>;
|
|
8
|
-
bpPerPx: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
sources: Source[];
|
|
12
|
-
scrollTop: number;
|
|
13
|
-
totalHeight: number;
|
|
14
|
-
rbush: RBush<{
|
|
15
|
-
genotype: string;
|
|
16
|
-
}>;
|
|
17
|
-
displayModel: any;
|
|
18
|
-
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
19
|
-
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
20
|
-
onFeatureClick?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default MultiVariantRendering;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
-
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const rbush_1 = __importDefault(require("rbush"));
|
|
11
|
-
const MultiVariantRendering = (0, mobx_react_1.observer)(function (props) {
|
|
12
|
-
const { totalHeight, scrollTop } = props;
|
|
13
|
-
const { rbush, displayModel } = props;
|
|
14
|
-
const ref = (0, react_1.useRef)(null);
|
|
15
|
-
const rbush2 = (0, react_1.useMemo)(() => new rbush_1.default().fromJSON(rbush), [rbush]);
|
|
16
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
17
|
-
var _a;
|
|
18
|
-
let offsetX = 0;
|
|
19
|
-
let offsetY = 0;
|
|
20
|
-
if (ref.current) {
|
|
21
|
-
const r = ref.current.getBoundingClientRect();
|
|
22
|
-
offsetX = eventClientX - r.left;
|
|
23
|
-
offsetY = eventClientY - r.top;
|
|
24
|
-
}
|
|
25
|
-
const ret = rbush2.search({
|
|
26
|
-
minX: offsetX,
|
|
27
|
-
maxX: offsetX + 3,
|
|
28
|
-
minY: offsetY,
|
|
29
|
-
maxY: offsetY + 3,
|
|
30
|
-
});
|
|
31
|
-
return (_a = ret[0]) === null || _a === void 0 ? void 0 : _a.genotype;
|
|
32
|
-
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onMouseMove: e => {
|
|
34
|
-
var _a;
|
|
35
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
36
|
-
}, onMouseLeave: () => {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
39
|
-
}, onMouseOut: () => {
|
|
40
|
-
var _a;
|
|
41
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
42
|
-
}, style: {
|
|
43
|
-
overflow: 'visible',
|
|
44
|
-
position: 'relative',
|
|
45
|
-
height: totalHeight,
|
|
46
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.PrerenderedCanvas, { ...props, style: {
|
|
47
|
-
position: 'absolute',
|
|
48
|
-
left: 0,
|
|
49
|
-
top: scrollTop,
|
|
50
|
-
} }) }));
|
|
51
|
-
});
|
|
52
|
-
exports.default = MultiVariantRendering;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = VariantConsequencePanel;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const BaseCard_1 = __importDefault(require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard"));
|
|
9
|
-
const VariantConsequenceDataGridWrapper_1 = __importDefault(require("./VariantConsequenceDataGridWrapper"));
|
|
10
|
-
function VariantConsequencePanel({ data, fields, title, }) {
|
|
11
|
-
return data.length ? ((0, jsx_runtime_1.jsx)(BaseCard_1.default, { title: title, children: (0, jsx_runtime_1.jsx)(VariantConsequenceDataGridWrapper_1.default, { rows: data.map((elt, id) => ({
|
|
12
|
-
id,
|
|
13
|
-
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),
|
|
14
|
-
})), columns: fields.map(c => ({ field: c })) }) })) : null;
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = ClusterDialog;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
10
|
-
const util_1 = require("@jbrowse/core/util");
|
|
11
|
-
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
12
|
-
const material_1 = require("@mui/material");
|
|
13
|
-
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
14
|
-
const file_saver_1 = require("file-saver");
|
|
15
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
16
|
-
const mui_1 = require("tss-react/mui");
|
|
17
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
18
|
-
textAreaFont: {
|
|
19
|
-
fontFamily: 'Courier New',
|
|
20
|
-
},
|
|
21
|
-
mgap: {
|
|
22
|
-
display: 'flex',
|
|
23
|
-
flexDirection: 'column',
|
|
24
|
-
gap: theme.spacing(4),
|
|
25
|
-
},
|
|
26
|
-
}));
|
|
27
|
-
function ClusterDialog({ model, handleClose, }) {
|
|
28
|
-
const { classes } = useStyles();
|
|
29
|
-
const [results, setResults] = (0, react_1.useState)();
|
|
30
|
-
const [error, setError] = (0, react_1.useState)();
|
|
31
|
-
const [paste, setPaste] = (0, react_1.useState)('');
|
|
32
|
-
const [useCompleteMethod, setUseCompleteMethod] = (0, react_1.useState)(false);
|
|
33
|
-
(0, react_1.useEffect)(() => {
|
|
34
|
-
;
|
|
35
|
-
(async () => {
|
|
36
|
-
try {
|
|
37
|
-
setError(undefined);
|
|
38
|
-
const view = (0, util_1.getContainingView)(model);
|
|
39
|
-
if (!view.initialized) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const { rpcManager } = (0, util_1.getSession)(model);
|
|
43
|
-
const { sources, minorAlleleFrequencyFilter, adapterConfig } = model;
|
|
44
|
-
const sessionId = (0, tracks_1.getRpcSessionId)(model);
|
|
45
|
-
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
46
|
-
regions: view.dynamicBlocks.contentBlocks,
|
|
47
|
-
sources,
|
|
48
|
-
minorAlleleFrequencyFilter,
|
|
49
|
-
sessionId,
|
|
50
|
-
adapterConfig,
|
|
51
|
-
}));
|
|
52
|
-
const entries = Object.values(ret);
|
|
53
|
-
const keys = Object.keys(ret);
|
|
54
|
-
const clusterMethod = useCompleteMethod ? 'complete' : 'single';
|
|
55
|
-
const text = `try(library(fastcluster), silent=TRUE)
|
|
56
|
-
inputMatrix<-matrix(c(${entries.map(val => val.genotypes.join(',')).join(',\n')}
|
|
57
|
-
),nrow=${entries.length},byrow=TRUE)
|
|
58
|
-
rownames(inputMatrix)<-c(${keys.map(key => `'${key}'`).join(',')})
|
|
59
|
-
resultClusters<-hclust(dist(inputMatrix), method='${clusterMethod}')
|
|
60
|
-
cat(resultClusters$order,sep='\\n')`;
|
|
61
|
-
setResults(text);
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
if (!(0, util_1.isAbortException)(e) && (0, mobx_state_tree_1.isAlive)(model)) {
|
|
65
|
-
console.error(e);
|
|
66
|
-
setError(e);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
})();
|
|
70
|
-
}, [model, useCompleteMethod]);
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, title: "Cluster by genotype", onClose: handleClose, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)("div", { className: classes.mgap, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "This page will produce an R script that will perform hierarchical clustering on the visible genotype data using `hclust`." }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "You can then paste the results in this form to specify the row ordering." }), results ? ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { children: ["Step 1:", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
72
|
-
(0, file_saver_1.saveAs)(new Blob([results || ''], {
|
|
73
|
-
type: 'text/plain;charset=utf-8',
|
|
74
|
-
}), 'cluster.R');
|
|
75
|
-
}, children: "Download Rscript" }), ' ', "or", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
|
|
76
|
-
(0, copy_to_clipboard_1.default)(results || '');
|
|
77
|
-
}, children: "Copy Rscript to clipboard" }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: useCompleteMethod, onChange: e => {
|
|
78
|
-
setUseCompleteMethod(e.target.checked);
|
|
79
|
-
} }), label: "Use 'complete' linkage method instead of 'single'" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.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 => {
|
|
80
|
-
setPaste(event.target.value);
|
|
81
|
-
}, slotProps: {
|
|
82
|
-
input: {
|
|
83
|
-
classes: {
|
|
84
|
-
input: classes.textAreaFont,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
} }) })] }) })) : ((0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })), error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null] }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { disabled: !results, variant: "contained", onClick: () => {
|
|
88
|
-
const { sources } = model;
|
|
89
|
-
if (sources) {
|
|
90
|
-
try {
|
|
91
|
-
model.setLayout(paste
|
|
92
|
-
.split('\n')
|
|
93
|
-
.map(t => t.trim())
|
|
94
|
-
.filter(f => !!f)
|
|
95
|
-
.map(r => +r)
|
|
96
|
-
.map(idx => {
|
|
97
|
-
const ret = sources[idx - 1];
|
|
98
|
-
if (!ret) {
|
|
99
|
-
throw new Error(`out of bounds at ${idx}`);
|
|
100
|
-
}
|
|
101
|
-
return ret;
|
|
102
|
-
}));
|
|
103
|
-
}
|
|
104
|
-
catch (e) {
|
|
105
|
-
console.error(e);
|
|
106
|
-
setError(e);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
handleClose();
|
|
110
|
-
}, children: "Apply clustering" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
111
|
-
handleClose();
|
|
112
|
-
}, children: "Cancel" })] })] }));
|
|
113
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Source } from '../types';
|
|
2
|
-
interface ReducedModel {
|
|
3
|
-
scrollTop: number;
|
|
4
|
-
totalHeight: number;
|
|
5
|
-
rowHeight: number;
|
|
6
|
-
lineZoneHeight?: number;
|
|
7
|
-
sources?: Source[];
|
|
8
|
-
canDisplayLabels: boolean;
|
|
9
|
-
height: number;
|
|
10
|
-
samplePloidy?: Record<string, number>;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const LegendBar: (props: {
|
|
14
|
-
model: ReducedModel;
|
|
15
|
-
orientation?: string;
|
|
16
|
-
exportSVG?: boolean;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
-
export default LegendBar;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MultiLinearVariantDisplayModel } from '../model';
|
|
2
|
-
declare const Crosshair: ({ mouseX, mouseY, model, }: {
|
|
3
|
-
mouseX: number;
|
|
4
|
-
mouseY: number;
|
|
5
|
-
model: MultiLinearVariantDisplayModel;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default Crosshair;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import MultiVariantTooltip from '../../shared/components/MultiVariantTooltip';
|
|
6
|
-
const useStyles = makeStyles()({
|
|
7
|
-
rel: {
|
|
8
|
-
position: 'relative',
|
|
9
|
-
},
|
|
10
|
-
cursor: {
|
|
11
|
-
pointerEvents: 'none',
|
|
12
|
-
zIndex: 800,
|
|
13
|
-
position: 'absolute',
|
|
14
|
-
},
|
|
15
|
-
color: {
|
|
16
|
-
width: 10,
|
|
17
|
-
height: 10,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const Crosshair = observer(function ({ mouseX, mouseY, model, }) {
|
|
21
|
-
const { classes } = useStyles();
|
|
22
|
-
const { hoveredGenotype, height, scrollTop, rowHeight, sources } = model;
|
|
23
|
-
const { width } = getContainingView(model);
|
|
24
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor(mouseY / rowHeight)];
|
|
25
|
-
const y = mouseY - scrollTop;
|
|
26
|
-
return source ? (_jsxs("div", { className: classes.rel, children: [_jsxs("svg", { className: classes.cursor, width: width, height: height, style: {
|
|
27
|
-
top: scrollTop,
|
|
28
|
-
}, children: [_jsx("line", { x1: 0, x2: width, y1: y, y2: y, stroke: "black" }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: "black" })] }), _jsx(MultiVariantTooltip, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
29
|
-
});
|
|
30
|
-
export default Crosshair;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { MultiLinearVariantMatrixDisplayModel } from '../model';
|
|
2
|
-
declare const Crosshair: ({ mouseX, mouseY, model, }: {
|
|
3
|
-
mouseX: number;
|
|
4
|
-
mouseY: number;
|
|
5
|
-
model: MultiLinearVariantMatrixDisplayModel;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export default Crosshair;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
|
-
import MultiVariantTooltip from '../../shared/components/MultiVariantTooltip';
|
|
6
|
-
const useStyles = makeStyles()({
|
|
7
|
-
cursor: {
|
|
8
|
-
pointerEvents: 'none',
|
|
9
|
-
zIndex: 800,
|
|
10
|
-
position: 'relative',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
const Crosshair = observer(function ({ mouseX, mouseY, model, }) {
|
|
14
|
-
const { classes } = useStyles();
|
|
15
|
-
const { hoveredGenotype, lineZoneHeight, totalHeight, rowHeight, sources } = model;
|
|
16
|
-
const { width } = getContainingView(model);
|
|
17
|
-
const source = sources === null || sources === void 0 ? void 0 : sources[Math.floor((mouseY - lineZoneHeight) / rowHeight)];
|
|
18
|
-
const yoff = mouseY - lineZoneHeight;
|
|
19
|
-
return source ? (_jsxs(_Fragment, { children: [_jsxs("svg", { className: classes.cursor, width: width, height: totalHeight, style: {
|
|
20
|
-
top: lineZoneHeight,
|
|
21
|
-
}, children: [_jsx("line", { x1: 0, x2: width, y1: yoff, y2: yoff, stroke: "black" }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: totalHeight, stroke: "black" })] }), _jsx(MultiVariantTooltip, { source: { ...source, hoveredGenotype } })] })) : null;
|
|
22
|
-
});
|
|
23
|
-
export default Crosshair;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
const LinearVariantMatrixRendering = observer(function (props) {
|
|
6
|
-
const { arr, width, height, displayModel } = props;
|
|
7
|
-
const ref = useRef(null);
|
|
8
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
let offsetX = 0;
|
|
11
|
-
let offsetY = 0;
|
|
12
|
-
if (ref.current) {
|
|
13
|
-
const r = ref.current.getBoundingClientRect();
|
|
14
|
-
offsetX = eventClientX - r.left;
|
|
15
|
-
offsetY = eventClientY - r.top;
|
|
16
|
-
}
|
|
17
|
-
const dimY = arr.length;
|
|
18
|
-
const dimX = ((_a = arr[0]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
19
|
-
return (_b = arr[Math.floor((offsetX / width) * dimY)]) === null || _b === void 0 ? void 0 : _b[Math.floor((offsetY / height) * dimX)];
|
|
20
|
-
}
|
|
21
|
-
return (_jsx("div", { ref: ref, onMouseMove: e => {
|
|
22
|
-
var _a;
|
|
23
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
24
|
-
}, onMouseLeave: () => {
|
|
25
|
-
var _a;
|
|
26
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
27
|
-
}, onMouseOut: () => {
|
|
28
|
-
var _a;
|
|
29
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
30
|
-
}, style: {
|
|
31
|
-
overflow: 'visible',
|
|
32
|
-
position: 'relative',
|
|
33
|
-
height,
|
|
34
|
-
}, children: _jsx(PrerenderedCanvas, { ...props }) }));
|
|
35
|
-
});
|
|
36
|
-
export default LinearVariantMatrixRendering;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import RBush from 'rbush';
|
|
2
|
-
import type { Source } from '../shared/types';
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util/types';
|
|
5
|
-
declare const MultiVariantRendering: (props: {
|
|
6
|
-
regions: Region[];
|
|
7
|
-
features: Map<string, Feature>;
|
|
8
|
-
bpPerPx: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
sources: Source[];
|
|
12
|
-
scrollTop: number;
|
|
13
|
-
totalHeight: number;
|
|
14
|
-
rbush: RBush<{
|
|
15
|
-
genotype: string;
|
|
16
|
-
}>;
|
|
17
|
-
displayModel: any;
|
|
18
|
-
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
19
|
-
onMouseMove?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
20
|
-
onFeatureClick?: (event: React.MouseEvent, arg?: Feature) => void;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default MultiVariantRendering;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef } from 'react';
|
|
3
|
-
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
4
|
-
import { observer } from 'mobx-react';
|
|
5
|
-
import RBush from 'rbush';
|
|
6
|
-
const MultiVariantRendering = observer(function (props) {
|
|
7
|
-
const { totalHeight, scrollTop } = props;
|
|
8
|
-
const { rbush, displayModel } = props;
|
|
9
|
-
const ref = useRef(null);
|
|
10
|
-
const rbush2 = useMemo(() => new RBush().fromJSON(rbush), [rbush]);
|
|
11
|
-
function getFeatureUnderMouse(eventClientX, eventClientY) {
|
|
12
|
-
var _a;
|
|
13
|
-
let offsetX = 0;
|
|
14
|
-
let offsetY = 0;
|
|
15
|
-
if (ref.current) {
|
|
16
|
-
const r = ref.current.getBoundingClientRect();
|
|
17
|
-
offsetX = eventClientX - r.left;
|
|
18
|
-
offsetY = eventClientY - r.top;
|
|
19
|
-
}
|
|
20
|
-
const ret = rbush2.search({
|
|
21
|
-
minX: offsetX,
|
|
22
|
-
maxX: offsetX + 3,
|
|
23
|
-
minY: offsetY,
|
|
24
|
-
maxY: offsetY + 3,
|
|
25
|
-
});
|
|
26
|
-
return (_a = ret[0]) === null || _a === void 0 ? void 0 : _a.genotype;
|
|
27
|
-
}
|
|
28
|
-
return (_jsx("div", { ref: ref, onMouseMove: e => {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, getFeatureUnderMouse(e.clientX, e.clientY));
|
|
31
|
-
}, onMouseLeave: () => {
|
|
32
|
-
var _a;
|
|
33
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
34
|
-
}, onMouseOut: () => {
|
|
35
|
-
var _a;
|
|
36
|
-
(_a = displayModel.setHoveredGenotype) === null || _a === void 0 ? void 0 : _a.call(displayModel, undefined);
|
|
37
|
-
}, style: {
|
|
38
|
-
overflow: 'visible',
|
|
39
|
-
position: 'relative',
|
|
40
|
-
height: totalHeight,
|
|
41
|
-
}, children: _jsx(PrerenderedCanvas, { ...props, style: {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
left: 0,
|
|
44
|
-
top: scrollTop,
|
|
45
|
-
} }) }));
|
|
46
|
-
});
|
|
47
|
-
export default MultiVariantRendering;
|
|
@@ -1,9 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
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;
|