@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,5 +1,5 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
-
declare const
|
|
2
|
+
declare const MultiVariantColorLegend: ({ model, labelWidth, }: {
|
|
3
3
|
model: {
|
|
4
4
|
canDisplayLabels: boolean;
|
|
5
5
|
rowHeight: number;
|
|
@@ -7,4 +7,4 @@ declare const ColorLegend: ({ model, labelWidth, }: {
|
|
|
7
7
|
};
|
|
8
8
|
labelWidth: number;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export default
|
|
10
|
+
export default MultiVariantColorLegend;
|
|
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
9
10
|
const mobx_react_1 = require("mobx-react");
|
|
10
11
|
const RectBg_1 = __importDefault(require("./RectBg"));
|
|
11
|
-
const
|
|
12
|
+
const MultiVariantColorLegend = (0, mobx_react_1.observer)(function ({ model, labelWidth, }) {
|
|
12
13
|
const { canDisplayLabels, rowHeight, sources } = model;
|
|
13
14
|
const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
|
|
14
15
|
const colorBoxWidth = 15;
|
|
15
16
|
const hasColors = sources === null || sources === void 0 ? void 0 : sources.some(s => s.color);
|
|
16
17
|
const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
|
|
18
|
+
const theme = (0, material_1.useTheme)();
|
|
17
19
|
return sources ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [canDisplayLabels ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => {
|
|
18
20
|
const { color, name, label } = source;
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [color ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? ((0, jsx_runtime_1.jsx)("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, children: label || name })) : null] }, `${label}-${idx}`));
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [color ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? ((0, jsx_runtime_1.jsx)("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, ...(0, util_1.getFillProps)(theme.palette.text.primary), children: label || name })) : null] }, `${label}-${idx}`));
|
|
20
22
|
})] })) : null;
|
|
21
23
|
});
|
|
22
|
-
exports.default =
|
|
24
|
+
exports.default = MultiVariantColorLegend;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
|
|
2
|
+
declare const MultiVariantCrosshairs: ({ mouseX, mouseY, model, }: {
|
|
3
|
+
mouseX: number;
|
|
4
|
+
mouseY: number;
|
|
5
|
+
model: MultiVariantBaseModel;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default MultiVariantCrosshairs;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
9
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
|
+
const mui_1 = require("tss-react/mui");
|
|
11
|
+
const MultiVariantTooltip_1 = __importDefault(require("./MultiVariantTooltip"));
|
|
12
|
+
const useStyles = (0, mui_1.makeStyles)()({
|
|
13
|
+
rel: {
|
|
14
|
+
position: 'relative',
|
|
15
|
+
},
|
|
16
|
+
cursor: {
|
|
17
|
+
pointerEvents: 'none',
|
|
18
|
+
zIndex: 800,
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
width: 10,
|
|
23
|
+
height: 10,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const MultiVariantCrosshairs = (0, mobx_react_1.observer)(function ({ mouseX, mouseY, model, }) {
|
|
27
|
+
const { classes } = useStyles();
|
|
28
|
+
const theme = (0, material_1.useTheme)();
|
|
29
|
+
const { hoveredGenotype, height, scrollTop, sourceMap } = model;
|
|
30
|
+
const { width } = (0, util_1.getContainingView)(model);
|
|
31
|
+
const source = hoveredGenotype ? sourceMap === null || sourceMap === void 0 ? void 0 : sourceMap[hoveredGenotype.name] : undefined;
|
|
32
|
+
const y = mouseY - scrollTop;
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.rel, children: [(0, jsx_runtime_1.jsxs)("svg", { className: classes.cursor, width: width, height: height, style: {
|
|
34
|
+
top: scrollTop,
|
|
35
|
+
}, children: [(0, jsx_runtime_1.jsx)("line", { x1: 0, x2: width, y1: y, y2: y, stroke: theme.palette.text.primary }), (0, jsx_runtime_1.jsx)("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: theme.palette.text.primary })] }), source ? ((0, jsx_runtime_1.jsx)(MultiVariantTooltip_1.default, { source: {
|
|
36
|
+
...source,
|
|
37
|
+
...hoveredGenotype,
|
|
38
|
+
} })) : null] }));
|
|
39
|
+
});
|
|
40
|
+
exports.default = MultiVariantCrosshairs;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
|
|
2
|
+
export declare const LegendBar: (props: {
|
|
3
|
+
model: MultiVariantBaseModel;
|
|
4
|
+
orientation?: string;
|
|
5
|
+
exportSVG?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default LegendBar;
|
|
@@ -7,7 +7,7 @@ exports.LegendBar = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
const mobx_react_1 = require("mobx-react");
|
|
10
|
-
const
|
|
10
|
+
const MultiVariantColorLegend_1 = __importDefault(require("./MultiVariantColorLegend"));
|
|
11
11
|
const Wrapper = (0, mobx_react_1.observer)(function ({ children, model, exportSVG, }) {
|
|
12
12
|
const { id, scrollTop, height } = model;
|
|
13
13
|
const clipid = `legend-${id}`;
|
|
@@ -25,7 +25,7 @@ exports.LegendBar = (0, mobx_react_1.observer)(function (props) {
|
|
|
25
25
|
const { model } = props;
|
|
26
26
|
const { canDisplayLabels, rowHeight, sources } = model;
|
|
27
27
|
const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
|
|
28
|
-
return sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: (0, jsx_runtime_1.jsx)(
|
|
28
|
+
return sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: (0, jsx_runtime_1.jsx)(MultiVariantColorLegend_1.default, { model: model, labelWidth: (0, util_1.max)(sources
|
|
29
29
|
.map(s => (0, util_1.measureText)(s.label, svgFontSize) + 10)
|
|
30
30
|
.map(width => (canDisplayLabels ? width : 20)), 0) }) })) : null;
|
|
31
31
|
});
|
|
@@ -7,6 +7,7 @@ exports.default = MultiVariantTooltip;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const ui_1 = require("@jbrowse/core/ui");
|
|
9
9
|
const BaseTooltip_1 = __importDefault(require("@jbrowse/core/ui/BaseTooltip"));
|
|
10
|
+
const escape_html_1 = __importDefault(require("escape-html"));
|
|
10
11
|
function MultiVariantTooltip({ source, }) {
|
|
11
12
|
return ((0, jsx_runtime_1.jsxs)(BaseTooltip_1.default, { children: [source.color ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
12
13
|
width: 10,
|
|
@@ -14,10 +15,10 @@ function MultiVariantTooltip({ source, }) {
|
|
|
14
15
|
backgroundColor: source.color,
|
|
15
16
|
} })) : null, (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: Object.entries(source)
|
|
16
17
|
.filter(([key, val]) => key !== 'color' &&
|
|
17
|
-
key !== 'name' &&
|
|
18
18
|
key !== 'HP' &&
|
|
19
|
+
key !== 'name' &&
|
|
19
20
|
key !== 'id' &&
|
|
20
21
|
val !== undefined)
|
|
21
|
-
.map(([key, value]) => `${key}:${value}`)
|
|
22
|
+
.map(([key, value]) => `${key}:${(0, escape_html_1.default)(`${value}`)}`)
|
|
22
23
|
.join('<br/>') })] }));
|
|
23
24
|
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const util_1 = require("@jbrowse/core/util");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const RectBg = ({ x, y, width, height, color, }) => {
|
|
7
|
+
const theme = (0, material_1.useTheme)();
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("rect", { pointerEvents: "auto", x: x, y: y, width: width, height: height, ...(0, util_1.getFillProps)(color || (0, material_1.alpha)(theme.palette.background.paper, 0.3)) }));
|
|
7
9
|
};
|
|
8
10
|
exports.default = RectBg;
|
|
@@ -33,7 +33,7 @@ function SetColorDialog({ model, handleClose, }) {
|
|
|
33
33
|
const [showBulkEditor, setShowBulkEditor] = (0, react_1.useState)(false);
|
|
34
34
|
const [currLayout, setCurrLayout] = (0, react_1.useState)(sources || []);
|
|
35
35
|
const [showTips, setShowTips] = (0, util_1.useLocalStorage)('multivariant-showTips', false);
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(DraggableDialog_1.default, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-variant
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(DraggableDialog_1.default, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-sample variant display - Color/arrangement editor", children: showBulkEditor ? ((0, jsx_runtime_1.jsx)(BulkEditPanel_1.default, { currLayout: currLayout, onClose: arg => {
|
|
37
37
|
if (arg) {
|
|
38
38
|
setCurrLayout(arg);
|
|
39
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
2
3
|
export default function SourcesDataGrid({ rows, onChange, setSelected, }: {
|
|
3
4
|
rows: Source[];
|
|
4
5
|
onChange: (arg: Source[]) => void;
|
|
5
|
-
setSelected: (arg:
|
|
6
|
+
setSelected: (arg: GridRowId[]) => void;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,8 +25,8 @@ function SourcesDataGrid({ rows, onChange, setSelected, }) {
|
|
|
25
25
|
idx: 0,
|
|
26
26
|
field: null,
|
|
27
27
|
});
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { height: 400, width: '100%' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { checkboxSelection: true,
|
|
29
|
-
setSelected(arg);
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { height: 400, width: '100%' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { checkboxSelection: true, onRowSelectionModelChange: arg => {
|
|
29
|
+
setSelected([...arg.ids]);
|
|
30
30
|
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
31
31
|
{
|
|
32
32
|
field: 'color',
|
|
@@ -9,6 +9,6 @@ const SourcesDataGrid_1 = __importDefault(require("./SourcesDataGrid"));
|
|
|
9
9
|
const SourcesGridHeader_1 = __importDefault(require("./SourcesGridHeader"));
|
|
10
10
|
function SourcesGrid({ rows, onChange, showTips, }) {
|
|
11
11
|
const [selected, setSelected] = (0, react_1.useState)([]);
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SourcesGridHeader_1.default, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }), (0, jsx_runtime_1.jsx)(SourcesDataGrid_1.default, { rows: rows, onChange: onChange, setSelected: setSelected })] }));
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SourcesGridHeader_1.default, { selected: selected, rows: rows, showTips: showTips, onChange: onChange }), rows.length ? ((0, jsx_runtime_1.jsx)(SourcesDataGrid_1.default, { rows: rows, onChange: onChange, setSelected: setSelected })) : ((0, jsx_runtime_1.jsx)("div", { children: "No rows" }))] }));
|
|
13
13
|
}
|
|
14
14
|
exports.default = SourcesGrid;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
2
3
|
export default function SourcesGridHeader({ selected, onChange, rows, showTips, }: {
|
|
3
4
|
onChange: (arg: Source[]) => void;
|
|
4
5
|
rows: Source[];
|
|
5
|
-
selected:
|
|
6
|
+
selected: GridRowId[];
|
|
6
7
|
showTips: boolean;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,12 +28,12 @@ function SourcesGridHeader({ selected, onChange, rows, showTips, }) {
|
|
|
28
28
|
onChange((0, sourcesGridUtils_1.moveDown)([...rows], selected, rows.length));
|
|
29
29
|
}, disabled: !selected.length, children: [(0, jsx_runtime_1.jsx)(KeyboardDoubleArrowDown_1.default, {}), showTips ? 'Move selected items to bottom' : null] }), (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPopover, { anchorEl: anchorEl, color: widgetColor, onChange: c => {
|
|
30
30
|
setWidgetColor(c);
|
|
31
|
-
|
|
31
|
+
for (const id of selected) {
|
|
32
32
|
const elt = rows.find(f => f.name === id);
|
|
33
33
|
if (elt) {
|
|
34
34
|
elt.color = c;
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
onChange([...rows]);
|
|
38
38
|
}, onClose: () => {
|
|
39
39
|
setAnchorEl(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function drawColorAlleleCount(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, mostFrequentAlt: string):
|
|
1
|
+
export declare function drawColorAlleleCount(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, mostFrequentAlt: string, drawReference?: boolean, featureType?: string, featureStrand?: number, alpha?: number): any;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.drawColorAlleleCount = drawColorAlleleCount;
|
|
4
4
|
const colord_1 = require("@jbrowse/core/util/colord");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
|
-
function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
6
|
+
function getColorAlleleCount(alleles, mostFrequentAlt, drawReference = true) {
|
|
7
7
|
const total = alleles.length;
|
|
8
8
|
let alt = 0;
|
|
9
9
|
let uncalled = 0;
|
|
@@ -24,7 +24,7 @@ function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
if (ref === total) {
|
|
27
|
-
return
|
|
27
|
+
return drawReference ? '#ccc' : undefined;
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
let a1;
|
|
@@ -42,7 +42,31 @@ function getColorAlleleCount(alleles, mostFrequentAlt) {
|
|
|
42
42
|
return (a1 === null || a1 === void 0 ? void 0 : a1.toHex()) || 'black';
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function drawColorAlleleCount(alleles, ctx, x, y, w, h, mostFrequentAlt) {
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
function drawColorAlleleCount(alleles, ctx, x, y, w, h, mostFrequentAlt, drawReference = true, featureType = '', featureStrand, alpha = 1) {
|
|
46
|
+
const c = getColorAlleleCount(alleles, mostFrequentAlt, drawReference);
|
|
47
|
+
if (c) {
|
|
48
|
+
ctx.fillStyle = alpha !== 1 ? (0, colord_1.colord)(c).alpha(alpha).toHex() : c;
|
|
49
|
+
if (featureType === 'inversion') {
|
|
50
|
+
if (featureStrand === 1) {
|
|
51
|
+
ctx.beginPath();
|
|
52
|
+
ctx.moveTo(x - constants_1.f2, y - constants_1.f2);
|
|
53
|
+
ctx.lineTo(x - constants_1.f2, y + h + constants_1.f2);
|
|
54
|
+
ctx.lineTo(x + w + constants_1.f2, y + h / 2);
|
|
55
|
+
ctx.closePath();
|
|
56
|
+
ctx.fill();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
ctx.beginPath();
|
|
60
|
+
ctx.moveTo(x + w + constants_1.f2, y - constants_1.f2);
|
|
61
|
+
ctx.lineTo(x + w + constants_1.f2, y + h + constants_1.f2);
|
|
62
|
+
ctx.lineTo(x - constants_1.f2, y + h / 2);
|
|
63
|
+
ctx.closePath();
|
|
64
|
+
ctx.fill();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
ctx.fillRect(x - constants_1.f2, y - constants_1.f2, w + constants_1.f2, h + constants_1.f2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return c;
|
|
48
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function drawPhased(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, HP: number, PS?: string):
|
|
1
|
+
export declare function drawPhased(alleles: string[], ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, HP: number, PS?: string, drawReference?: boolean, alpha?: number): string | undefined;
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.drawPhased = drawPhased;
|
|
4
4
|
const colors_1 = require("@jbrowse/core/ui/colors");
|
|
5
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
5
6
|
const constants_1 = require("./constants");
|
|
6
7
|
const util_1 = require("./util");
|
|
7
|
-
function getColorPhased(alleles, HP) {
|
|
8
|
+
function getColorPhased(alleles, HP, drawReference = true) {
|
|
8
9
|
const c = +alleles[HP];
|
|
9
|
-
return c ? colors_1.set1[c - 1] || 'black' : '#ccc';
|
|
10
|
+
return c ? colors_1.set1[c - 1] || 'black' : drawReference ? '#ccc' : undefined;
|
|
10
11
|
}
|
|
11
|
-
function getColorPhasedWithPhaseSet(alleles, HP, PS) {
|
|
12
|
+
function getColorPhasedWithPhaseSet(alleles, HP, PS, drawReference = true) {
|
|
12
13
|
const c = +alleles[HP];
|
|
13
|
-
return c ? (0, util_1.colorify)(+PS) || 'black' : '#ccc';
|
|
14
|
+
return c ? (0, util_1.colorify)(+PS) || 'black' : drawReference ? '#ccc' : undefined;
|
|
14
15
|
}
|
|
15
|
-
function drawPhased(alleles, ctx, x, y, w, h, HP, PS) {
|
|
16
|
-
|
|
17
|
-
PS
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
function drawPhased(alleles, ctx, x, y, w, h, HP, PS, drawReference = true, alpha = 1) {
|
|
17
|
+
const c = PS !== undefined
|
|
18
|
+
? getColorPhasedWithPhaseSet(alleles, HP, PS, drawReference)
|
|
19
|
+
: getColorPhased(alleles, HP, drawReference);
|
|
20
|
+
if (c) {
|
|
21
|
+
ctx.fillStyle = alpha !== 1 ? (0, colord_1.colord)(c).alpha(alpha).toHex() : c;
|
|
22
|
+
ctx.fillRect(x - constants_1.f2, y - constants_1.f2, w + constants_1.f2, h + constants_1.f2);
|
|
23
|
+
}
|
|
24
|
+
return c;
|
|
21
25
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SampleInfo, Source } from './types';
|
|
2
|
+
export declare function getSources({ sources, layout, renderingMode, sampleInfo, }: {
|
|
3
|
+
sources: Source[];
|
|
4
|
+
layout?: Source[];
|
|
5
|
+
renderingMode: string;
|
|
6
|
+
sampleInfo?: Record<string, SampleInfo>;
|
|
7
|
+
}): {
|
|
8
|
+
label: string;
|
|
9
|
+
id: string;
|
|
10
|
+
baseUri?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
group?: string;
|
|
14
|
+
HP?: number;
|
|
15
|
+
}[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSources = getSources;
|
|
4
|
+
function getSources({ sources, layout = sources, renderingMode, sampleInfo, }) {
|
|
5
|
+
const rows = [];
|
|
6
|
+
const sourceMap = Object.fromEntries(sources.map(s => [s.name, s]));
|
|
7
|
+
for (const row of layout) {
|
|
8
|
+
if (renderingMode === 'phased') {
|
|
9
|
+
const info = sampleInfo === null || sampleInfo === void 0 ? void 0 : sampleInfo[row.name];
|
|
10
|
+
if (info === null || info === void 0 ? void 0 : info.isPhased) {
|
|
11
|
+
const ploidy = info.maxPloidy;
|
|
12
|
+
for (let i = 0; i < ploidy; i++) {
|
|
13
|
+
const id = `${row.name} HP${i}`;
|
|
14
|
+
rows.push({
|
|
15
|
+
...sourceMap[row.name],
|
|
16
|
+
...row,
|
|
17
|
+
label: id,
|
|
18
|
+
HP: i,
|
|
19
|
+
id: id,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
rows.push({
|
|
26
|
+
...sourceMap[row.name],
|
|
27
|
+
...row,
|
|
28
|
+
label: row.name,
|
|
29
|
+
id: row.name,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return rows;
|
|
34
|
+
}
|
|
@@ -2,7 +2,12 @@ import type { Feature } from '@jbrowse/core/util';
|
|
|
2
2
|
export declare function findSecondLargestNumber(arr: Iterable<number>): number;
|
|
3
3
|
export declare function calculateAlleleCounts(feat: Feature): Map<any, any>;
|
|
4
4
|
export declare function calculateMinorAlleleFrequency(alleleCounts: Map<string, number>): number;
|
|
5
|
-
export declare function getFeaturesThatPassMinorAlleleFrequencyFilter(
|
|
5
|
+
export declare function getFeaturesThatPassMinorAlleleFrequencyFilter({ features, minorAlleleFrequencyFilter, lengthCutoffFilter, stopToken, }: {
|
|
6
|
+
features: Iterable<Feature>;
|
|
7
|
+
minorAlleleFrequencyFilter: number;
|
|
8
|
+
lengthCutoffFilter: number;
|
|
9
|
+
stopToken?: string;
|
|
10
|
+
}): {
|
|
6
11
|
feature: Feature;
|
|
7
12
|
mostFrequentAlt: string;
|
|
8
13
|
alleleCounts: Map<string, number>;
|
|
@@ -47,21 +47,20 @@ function getMostFrequentAlt(alleleCounts) {
|
|
|
47
47
|
}
|
|
48
48
|
return mostFrequentAlt;
|
|
49
49
|
}
|
|
50
|
-
function getFeaturesThatPassMinorAlleleFrequencyFilter(
|
|
50
|
+
function getFeaturesThatPassMinorAlleleFrequencyFilter({ features, minorAlleleFrequencyFilter, lengthCutoffFilter, stopToken, }) {
|
|
51
51
|
const results = [];
|
|
52
|
-
|
|
52
|
+
(0, util_1.forEachWithStopTokenCheck)(features, stopToken, feature => {
|
|
53
53
|
if (feature.get('end') - feature.get('start') <= lengthCutoffFilter) {
|
|
54
54
|
const alleleCounts = calculateAlleleCounts(feature);
|
|
55
55
|
if (calculateMinorAlleleFrequency(alleleCounts) >=
|
|
56
56
|
minorAlleleFrequencyFilter) {
|
|
57
|
-
const mostFrequentAlt = getMostFrequentAlt(alleleCounts);
|
|
58
57
|
results.push({
|
|
59
58
|
feature,
|
|
60
|
-
mostFrequentAlt,
|
|
59
|
+
mostFrequentAlt: getMostFrequentAlt(alleleCounts),
|
|
61
60
|
alleleCounts,
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
}
|
|
64
|
+
});
|
|
66
65
|
return results;
|
|
67
66
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
1
2
|
export declare function moveUp(arr: {
|
|
2
3
|
name: string;
|
|
3
|
-
}[], sel:
|
|
4
|
+
}[], sel: GridRowId[], by?: number): {
|
|
4
5
|
name: string;
|
|
5
6
|
}[];
|
|
6
7
|
export declare function moveDown(arr: {
|
|
7
8
|
name: string;
|
|
8
|
-
}[], sel:
|
|
9
|
+
}[], sel: GridRowId[], by?: number): {
|
|
9
10
|
name: string;
|
|
10
11
|
}[];
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import Crosshair from '
|
|
6
|
-
import LegendBar from '../../shared/components/
|
|
5
|
+
import Crosshair from '../../shared/components/MultiVariantCrosshairs';
|
|
6
|
+
import LegendBar from '../../shared/components/MultiVariantLegendBar';
|
|
7
7
|
const MultiLinearVariantDisplayComponent = observer(function (props) {
|
|
8
8
|
const { model } = props;
|
|
9
9
|
const ref = useRef(null);
|
|
@@ -7,7 +7,7 @@ export default function MultiLinearVariantDisplayF(pluginManager) {
|
|
|
7
7
|
const configSchema = configSchemaFactory(pluginManager);
|
|
8
8
|
return new DisplayType({
|
|
9
9
|
name: 'MultiLinearVariantDisplay',
|
|
10
|
-
displayName: 'Multi-variant display (regular)',
|
|
10
|
+
displayName: 'Multi-sample variant display (regular)',
|
|
11
11
|
configSchema,
|
|
12
12
|
stateModel: modelFactory(configSchema),
|
|
13
13
|
trackType: 'VariantTrack',
|
|
@@ -89,11 +89,13 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
89
89
|
renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
90
90
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
91
91
|
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
92
|
+
lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
93
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
94
|
+
referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
92
95
|
} & {
|
|
93
96
|
type: import("mobx-state-tree").ISimpleType<"MultiLinearVariantDisplay">;
|
|
94
97
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
95
98
|
minorAlleleFrequencyFilter: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
96
|
-
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
97
99
|
}, {
|
|
98
100
|
rendererTypeName: string;
|
|
99
101
|
error: unknown;
|
|
@@ -237,19 +239,28 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
237
239
|
renderProps(): any;
|
|
238
240
|
} & {
|
|
239
241
|
sourcesLoadingStopToken: string | undefined;
|
|
242
|
+
simplifiedFeaturesStopToken: string | undefined;
|
|
240
243
|
featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
|
|
241
244
|
sourcesVolatile: import("../shared/types").Source[] | undefined;
|
|
242
245
|
featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
|
|
243
246
|
hasPhased: boolean;
|
|
244
247
|
sampleInfo: undefined | Record<string, import("../shared/types").SampleInfo>;
|
|
245
|
-
hoveredGenotype:
|
|
248
|
+
hoveredGenotype: {
|
|
249
|
+
genotype: string;
|
|
250
|
+
name: string;
|
|
251
|
+
} | undefined;
|
|
246
252
|
} & {
|
|
253
|
+
setJexlFilters(f?: string[]): void;
|
|
247
254
|
setRowHeight(arg: number): void;
|
|
248
|
-
setHoveredGenotype(arg
|
|
255
|
+
setHoveredGenotype(arg?: {
|
|
256
|
+
genotype: string;
|
|
257
|
+
name: string;
|
|
258
|
+
}): void;
|
|
249
259
|
setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
|
|
250
260
|
setLayout(layout: import("../shared/types").Source[]): void;
|
|
251
261
|
clearLayout(): void;
|
|
252
262
|
setSourcesLoading(str: string): void;
|
|
263
|
+
setSimplifiedFeaturesLoading(str: string): void;
|
|
253
264
|
setSources(sources: import("../shared/types").Source[]): void;
|
|
254
265
|
setMafFilter(arg: number): void;
|
|
255
266
|
setShowSidebarLabels(arg: boolean): void;
|
|
@@ -257,8 +268,19 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
257
268
|
setAutoHeight(arg: boolean): void;
|
|
258
269
|
setHasPhased(arg: boolean): void;
|
|
259
270
|
setSampleInfo(arg: Record<string, import("../shared/types").SampleInfo>): void;
|
|
271
|
+
setReferenceDrawingMode(arg: string): void;
|
|
260
272
|
} & {
|
|
273
|
+
readonly activeFilters: any;
|
|
261
274
|
readonly preSources: import("../shared/types").Source[] | undefined;
|
|
275
|
+
readonly sourcesWithoutLayout: {
|
|
276
|
+
label: string;
|
|
277
|
+
id: string;
|
|
278
|
+
baseUri?: string;
|
|
279
|
+
name: string;
|
|
280
|
+
color?: string;
|
|
281
|
+
group?: string;
|
|
282
|
+
HP?: number;
|
|
283
|
+
}[] | undefined;
|
|
262
284
|
readonly sources: {
|
|
263
285
|
label: string;
|
|
264
286
|
id: string;
|
|
@@ -269,6 +291,17 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
269
291
|
HP?: number;
|
|
270
292
|
}[] | undefined;
|
|
271
293
|
} & {
|
|
294
|
+
readonly sourceMap: {
|
|
295
|
+
[k: string]: {
|
|
296
|
+
label: string;
|
|
297
|
+
id: string;
|
|
298
|
+
baseUri?: string;
|
|
299
|
+
name: string;
|
|
300
|
+
color?: string;
|
|
301
|
+
group?: string;
|
|
302
|
+
HP?: number;
|
|
303
|
+
};
|
|
304
|
+
} | undefined;
|
|
272
305
|
readonly rowHeight: number;
|
|
273
306
|
adapterProps(): any;
|
|
274
307
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
@@ -322,6 +355,18 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
322
355
|
type?: undefined;
|
|
323
356
|
checked?: undefined;
|
|
324
357
|
onClick?: undefined;
|
|
358
|
+
} | {
|
|
359
|
+
label: string;
|
|
360
|
+
type: string;
|
|
361
|
+
subMenu: {
|
|
362
|
+
label: string;
|
|
363
|
+
type: string;
|
|
364
|
+
checked: boolean;
|
|
365
|
+
onClick: () => void;
|
|
366
|
+
}[];
|
|
367
|
+
icon?: undefined;
|
|
368
|
+
checked?: undefined;
|
|
369
|
+
onClick?: undefined;
|
|
325
370
|
} | {
|
|
326
371
|
label: string;
|
|
327
372
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
@@ -334,10 +379,20 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
334
379
|
type?: undefined;
|
|
335
380
|
checked?: undefined;
|
|
336
381
|
onClick?: undefined;
|
|
382
|
+
} | {
|
|
383
|
+
label: string;
|
|
384
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
385
|
+
muiName: string;
|
|
386
|
+
};
|
|
387
|
+
onClick: () => void;
|
|
388
|
+
type?: undefined;
|
|
389
|
+
checked?: undefined;
|
|
390
|
+
subMenu?: undefined;
|
|
337
391
|
})[];
|
|
338
392
|
} & {
|
|
339
393
|
readonly canDisplayLabels: boolean;
|
|
340
394
|
readonly totalHeight: number;
|
|
395
|
+
readonly featuresReady: boolean;
|
|
341
396
|
} & {
|
|
342
397
|
renderProps(): any;
|
|
343
398
|
} & {
|
|
@@ -7,7 +7,6 @@ export function stateModelFactory(configSchema) {
|
|
|
7
7
|
type: types.literal('MultiLinearVariantDisplay'),
|
|
8
8
|
rowHeightSetting: types.optional(types.number, 11),
|
|
9
9
|
minorAlleleFrequencyFilter: types.optional(types.number, 0),
|
|
10
|
-
autoHeight: false,
|
|
11
10
|
}))
|
|
12
11
|
.views(() => ({
|
|
13
12
|
get rendererTypeName() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getContainingView } from '@jbrowse/core/util';
|
|
3
3
|
import { when } from 'mobx';
|
|
4
|
-
import LegendBar from '../shared/components/
|
|
4
|
+
import LegendBar from '../shared/components/MultiVariantLegendBar';
|
|
5
5
|
export async function renderSvg(self, opts, superRenderSvg) {
|
|
6
6
|
await when(() => !!self.regionCannotBeRenderedText);
|
|
7
7
|
const { offsetPx } = getContainingView(self);
|