@jbrowse/plugin-variants 3.2.0 → 3.4.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/LinearVariantDisplay/model.d.ts +1 -1
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +40 -4
- 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 +40 -3
- package/dist/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +14 -11
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +3 -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 +3 -3
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +71 -17
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +34 -5
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +13 -7
- 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 +104 -41
- package/dist/MultiLinearVariantRenderer/types.d.ts +2 -0
- package/dist/MultiVariantBaseRenderer.d.ts +4 -4
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -1
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -1
- 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 +16 -6
- 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/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +9 -6
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/dist/VariantRPC/getGenotypeMatrix.js +20 -7
- package/dist/VariantRPC/types.d.ts +23 -0
- package/dist/VcfAdapter/VcfAdapter.d.ts +0 -1
- package/dist/VcfAdapter/VcfAdapter.js +0 -1
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +123 -25
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -1
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +12 -8
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/shared/MultiVariantBaseModel.d.ts +41 -4
- package/dist/shared/MultiVariantBaseModel.js +69 -3
- package/dist/shared/SharedVariantMixin.d.ts +1 -1
- 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/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +8 -3
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -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 +40 -47
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/drawAlleleCount.d.ts +2 -1
- package/dist/shared/drawAlleleCount.js +26 -24
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +9 -4
- package/dist/shared/minorAlleleFrequencyUtils.js +19 -14
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/LinearVariantDisplay/model.d.ts +1 -1
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +40 -4
- 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 +40 -3
- package/esm/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +14 -11
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +3 -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 +3 -3
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +73 -19
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +34 -5
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +13 -7
- 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 +106 -43
- package/esm/MultiLinearVariantRenderer/types.d.ts +2 -0
- package/esm/MultiVariantBaseRenderer.d.ts +4 -4
- package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -1
- package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -1
- 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 +16 -6
- 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/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +9 -6
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/esm/VariantRPC/getGenotypeMatrix.js +20 -7
- package/esm/VariantRPC/types.d.ts +23 -0
- package/esm/VcfAdapter/VcfAdapter.d.ts +0 -1
- package/esm/VcfAdapter/VcfAdapter.js +0 -1
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +121 -25
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -1
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +13 -9
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/shared/MultiVariantBaseModel.d.ts +41 -4
- package/esm/shared/MultiVariantBaseModel.js +71 -5
- package/esm/shared/SharedVariantMixin.d.ts +1 -1
- 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/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +9 -4
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -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 +40 -47
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/drawAlleleCount.d.ts +2 -1
- package/esm/shared/drawAlleleCount.js +25 -24
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +9 -4
- package/esm/shared/minorAlleleFrequencyUtils.js +20 -15
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +12 -11
- 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/VariantRPC/cluster.d.ts +0 -17
- package/dist/VariantRPC/cluster.js +0 -84
- 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/VariantRPC/cluster.d.ts +0 -17
- package/esm/VariantRPC/cluster.js +0 -79
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /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/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +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
- /package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
|
@@ -22,7 +22,7 @@ export default abstract class MultiVariantBaseRenderer extends FeatureRendererTy
|
|
|
22
22
|
height: number;
|
|
23
23
|
width: number;
|
|
24
24
|
containsNoTransferables: boolean;
|
|
25
|
-
canvasRecordedData:
|
|
25
|
+
canvasRecordedData: Record<string, unknown>;
|
|
26
26
|
reactElement?: React.ReactElement;
|
|
27
27
|
html?: string;
|
|
28
28
|
} | {
|
|
@@ -30,15 +30,15 @@ export default abstract class MultiVariantBaseRenderer extends FeatureRendererTy
|
|
|
30
30
|
height: number;
|
|
31
31
|
width: number;
|
|
32
32
|
containsNoTransferables: boolean;
|
|
33
|
-
|
|
33
|
+
imageData: any;
|
|
34
|
+
reactElement?: React.ReactElement;
|
|
34
35
|
html?: string;
|
|
35
36
|
} | {
|
|
36
37
|
features: Map<string, Feature>;
|
|
37
38
|
height: number;
|
|
38
39
|
width: number;
|
|
39
40
|
containsNoTransferables: boolean;
|
|
40
|
-
|
|
41
|
-
reactElement?: React.ReactElement;
|
|
41
|
+
reactElement: React.ReactElement;
|
|
42
42
|
html?: string;
|
|
43
43
|
}>;
|
|
44
44
|
abstract draw<T extends RenderArgsDeserializedWithFeatures>(ctx: CanvasRenderingContext2D, props: T): Promise<Record<string, unknown> | undefined>;
|
|
@@ -17,9 +17,11 @@ const SplitVcfTabixAdapter = ConfigurationSchema('SplitVcfTabixAdapter', {
|
|
|
17
17
|
type: 'fileLocation',
|
|
18
18
|
defaultValue: {
|
|
19
19
|
uri: '/path/to/samples.tsv',
|
|
20
|
-
description: 'tsv with header like name\tpopulation\tetc
|
|
20
|
+
description: 'tsv with header like "name\tpopulation\tetc" where the first column is required, and corresponds to the sample names in the VCF files',
|
|
21
21
|
locationType: 'UriLocation',
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
}, {
|
|
24
|
+
}, {
|
|
25
|
+
explicitlyTyped: true,
|
|
26
|
+
});
|
|
25
27
|
export default SplitVcfTabixAdapter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { getMinimalDesc } from '../VcfFeature/util';
|
|
4
|
+
export default function AltFormatter({ value, ref, }) {
|
|
5
|
+
const [show, setShow] = useState(false);
|
|
6
|
+
const alt = getMinimalDesc(ref, value);
|
|
7
|
+
return alt !== value ? (_jsxs("div", { children: [_jsx("button", { onClick: () => {
|
|
8
|
+
setShow(!show);
|
|
9
|
+
}, children: show ? 'Show simplified ALT' : 'Show raw ALT' }), ' ', show ? value : getMinimalDesc(ref, value)] })) : (value);
|
|
10
|
+
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Checkbox, FormControlLabel } from '@mui/material';
|
|
3
|
-
import { makeStyles } from 'tss-react/mui';
|
|
4
|
-
const useStyles = makeStyles()({
|
|
5
|
-
block: {
|
|
6
|
-
display: 'block',
|
|
7
|
-
},
|
|
8
|
-
});
|
|
2
|
+
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
9
3
|
export default function Checkbox2({ checked, disabled, label, onChange, }) {
|
|
10
|
-
|
|
11
|
-
return (_jsx(FormControlLabel, { disabled: disabled, className: classes.block, control: _jsx(Checkbox, { checked: checked, onChange: onChange }), label: label }));
|
|
4
|
+
return (_jsx(FormControlLabel, { disabled: disabled, control: _jsx(Checkbox, { checked: checked, onChange: onChange }), label: _jsx(Typography, { variant: "body2", children: label }) }));
|
|
12
5
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import copy from 'copy-to-clipboard';
|
|
4
|
+
export default function Formatter({ value }) {
|
|
5
|
+
const [show, setShow] = useState(false);
|
|
6
|
+
const [copied, setCopied] = useState(false);
|
|
7
|
+
const display = String(value);
|
|
8
|
+
return display.length > 100 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => {
|
|
9
|
+
copy(display);
|
|
10
|
+
setCopied(true);
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
setCopied(false);
|
|
13
|
+
}, 700);
|
|
14
|
+
}, children: copied ? 'Copied to clipboard' : 'Copy' }), _jsx("button", { type: "button", onClick: () => {
|
|
15
|
+
setShow(val => !val);
|
|
16
|
+
}, children: show ? 'Show less' : 'Show more' }), _jsx("div", { children: show ? display : `${display.slice(0, 100)}...` })] })) : (_jsx("div", { children: display }));
|
|
17
|
+
}
|
|
@@ -2,16 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
4
4
|
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
5
|
-
import { DataGrid
|
|
5
|
+
import { DataGrid } from '@mui/x-data-grid';
|
|
6
6
|
export default function VariantConsequenceDataGridWrapper({ rows, columns, }) {
|
|
7
7
|
const [checked, setChecked] = useState(false);
|
|
8
8
|
const widths = columns.map(e => measureGridWidth(rows.map(r => r[e.field])));
|
|
9
|
-
return rows.length ? (_jsxs("div", { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: checked, onChange: event => {
|
|
9
|
+
return rows.length ? (_jsxs("div", { children: [_jsx(FormControlLabel, { label: _jsx(Typography, { variant: "body2", children: "Show options" }), control: _jsx(Checkbox, { checked: checked, onChange: event => {
|
|
10
10
|
setChecked(event.target.checked);
|
|
11
|
-
} }),
|
|
11
|
+
} }) }), _jsx(DataGrid, { rowHeight: 25, hideFooter: rows.length < 100, rows: rows, showToolbar: checked, columns: columns.map((c, i) => ({
|
|
12
12
|
...c,
|
|
13
13
|
width: widths[i],
|
|
14
|
-
}))
|
|
15
|
-
toolbar: checked ? GridToolbar : null,
|
|
16
|
-
} })] })) : null;
|
|
14
|
+
})) })] })) : null;
|
|
17
15
|
}
|
|
@@ -4,10 +4,12 @@ import { parseBreakend } from '@gmod/vcf';
|
|
|
4
4
|
import FeatureDetails from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails';
|
|
5
5
|
import { Paper } from '@mui/material';
|
|
6
6
|
import { observer } from 'mobx-react';
|
|
7
|
+
import AltFormatter from './AltFormatter';
|
|
8
|
+
import Formatter from './Formatter';
|
|
7
9
|
import VariantSampleGrid from './VariantSampleGrid/VariantSampleGrid';
|
|
8
10
|
import { variantFieldDescriptions } from './variantFieldDescriptions';
|
|
9
11
|
const LaunchBreakendPanel = lazy(() => import('./LaunchBreakendPanel/LaunchBreakendPanel'));
|
|
10
|
-
const VariantConsequenceDataGrid = lazy(() => import('./VariantConsequenceDataGrid'));
|
|
12
|
+
const VariantConsequenceDataGrid = lazy(() => import('./VariantConsequence/VariantConsequenceDataGrid'));
|
|
11
13
|
function AnnPanel({ descriptions, feature, }) {
|
|
12
14
|
var _a, _b, _c, _d, _e;
|
|
13
15
|
const annDesc = (_b = (_a = descriptions === null || descriptions === void 0 ? void 0 : descriptions.INFO) === null || _a === void 0 ? void 0 : _a.ANN) === null || _b === void 0 ? void 0 : _b.Description;
|
|
@@ -42,14 +44,22 @@ function LaunchBreakendWidgetArea({ model, }) {
|
|
|
42
44
|
},
|
|
43
45
|
}, model: model, locStrings: [`${feat.refName}:${feat.end}`] })) : null;
|
|
44
46
|
}
|
|
45
|
-
const
|
|
46
|
-
const { model } = props;
|
|
47
|
-
const {
|
|
48
|
-
const
|
|
49
|
-
const {
|
|
47
|
+
const FeatDefined = observer(function (props) {
|
|
48
|
+
const { feat, model } = props;
|
|
49
|
+
const { descriptions } = model;
|
|
50
|
+
const { samples, ...rest } = feat;
|
|
51
|
+
const { REF } = rest;
|
|
50
52
|
return (_jsxs(Paper, { "data-testid": "variant-side-drawer", children: [_jsx(FeatureDetails, { feature: rest, descriptions: {
|
|
51
53
|
...variantFieldDescriptions,
|
|
52
54
|
...descriptions,
|
|
55
|
+
}, formatter: (value, key) => {
|
|
56
|
+
return key === 'ALT' ? (_jsx(AltFormatter, { value: `${value}`, ref: REF })) : (_jsx(Formatter, { value: value }));
|
|
53
57
|
}, ...props }), _jsxs(Suspense, { fallback: null, children: [_jsx(CsqPanel, { feature: rest, descriptions: descriptions }), _jsx(AnnPanel, { feature: rest, descriptions: descriptions }), _jsx(LaunchBreakendWidgetArea, { model: model })] }), _jsx(VariantSampleGrid, { feature: feat, ...props, descriptions: descriptions })] }));
|
|
54
58
|
});
|
|
59
|
+
const VariantFeatureWidget = observer(function (props) {
|
|
60
|
+
const { model } = props;
|
|
61
|
+
const { featureData } = model;
|
|
62
|
+
const feat = structuredClone(featureData);
|
|
63
|
+
return feat ? (_jsx(FeatDefined, { feat: feat, ...props })) : (_jsx("div", { children: "No feature loaded, may not be available after page refresh because it was too large for localStorage" }));
|
|
64
|
+
});
|
|
55
65
|
export default VariantFeatureWidget;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
|
|
4
|
+
import { measureGridWidth } from '@jbrowse/core/util';
|
|
5
|
+
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
6
|
+
import { DataGrid } from '@mui/x-data-grid';
|
|
7
|
+
function toP(n) {
|
|
8
|
+
return n.toPrecision(3);
|
|
9
|
+
}
|
|
10
|
+
export default function VariantGenotypeFrequencyTable({ rows, }) {
|
|
11
|
+
const [useCounts, setUseCounts] = useState(false);
|
|
12
|
+
const summary = {};
|
|
13
|
+
if (!useCounts) {
|
|
14
|
+
for (const row of rows) {
|
|
15
|
+
const gt = row.GT;
|
|
16
|
+
if (!summary[gt]) {
|
|
17
|
+
summary[gt] = {
|
|
18
|
+
count: 0,
|
|
19
|
+
GT: row.GT,
|
|
20
|
+
genotype: row.genotype,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
summary[gt].count++;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
for (const row of rows) {
|
|
28
|
+
const alleleCounts = {};
|
|
29
|
+
const alleles = row.GT.split(/[/|]/);
|
|
30
|
+
for (const allele of alleles) {
|
|
31
|
+
alleleCounts[allele] = (alleleCounts[allele] || 0) + 1;
|
|
32
|
+
}
|
|
33
|
+
const key = Object.entries(alleleCounts)
|
|
34
|
+
.map(([key, val]) => `${key}:${val}`)
|
|
35
|
+
.join(';');
|
|
36
|
+
if (!summary[key]) {
|
|
37
|
+
summary[key] = {
|
|
38
|
+
count: 0,
|
|
39
|
+
GT: key,
|
|
40
|
+
genotype: row.genotype,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
summary[key].count++;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const gridRows = Object.entries(summary).map(([key, val]) => ({
|
|
47
|
+
id: key,
|
|
48
|
+
...val,
|
|
49
|
+
count: `${val.count} / ${rows.length}`,
|
|
50
|
+
frequency: `${toP((val.count / rows.length) * 100)}%`,
|
|
51
|
+
}));
|
|
52
|
+
const keys = gridRows[0] ? Object.keys(gridRows[0]) : [];
|
|
53
|
+
const widths = keys.map(e => measureGridWidth(gridRows.map(r => `${r[e]}`)));
|
|
54
|
+
return (_jsxs("div", { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: useCounts }), label: _jsx(Typography, { variant: "body2", children: "Use allele counts instead of exact GT" }), onChange: (_, checked) => {
|
|
55
|
+
setUseCounts(checked);
|
|
56
|
+
} }), _jsx(DataGridFlexContainer, { children: _jsx(DataGrid, { rows: gridRows, hideFooter: true, rowHeight: 25, columnHeaderHeight: 35, columns: [
|
|
57
|
+
{
|
|
58
|
+
field: 'GT',
|
|
59
|
+
width: widths[0],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
field: 'count',
|
|
63
|
+
width: widths[1],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
field: 'frequency',
|
|
67
|
+
width: widths[2],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
field: 'genotype',
|
|
71
|
+
width: widths[3],
|
|
72
|
+
},
|
|
73
|
+
] }) })] }));
|
|
74
|
+
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
+
import type { VariantFieldDescriptions } from './types';
|
|
1
2
|
import type { SimpleFeatureSerialized } from '@jbrowse/core/util';
|
|
2
|
-
|
|
3
|
-
Description?: string;
|
|
4
|
-
}
|
|
5
|
-
interface Descriptions {
|
|
6
|
-
FORMAT?: Record<string, FormatRecord>;
|
|
7
|
-
}
|
|
8
|
-
export default function VariantSamples(props: {
|
|
3
|
+
export default function VariantSampleGrid(props: {
|
|
9
4
|
feature: SimpleFeatureSerialized;
|
|
10
|
-
descriptions?:
|
|
5
|
+
descriptions?: VariantFieldDescriptions | null;
|
|
11
6
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -1,26 +1,50 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard';
|
|
4
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
5
|
+
import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
|
|
6
|
+
import { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary';
|
|
4
7
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
5
|
-
import {
|
|
6
|
-
import { DataGrid
|
|
8
|
+
import { Typography } from '@mui/material';
|
|
9
|
+
import { DataGrid } from '@mui/x-data-grid';
|
|
10
|
+
import Checkbox2 from '../Checkbox2';
|
|
11
|
+
import VariantGenotypeFrequencyTable from './VariantGenotypeFrequencyTable';
|
|
7
12
|
import SampleFilters from './VariantSampleFilters';
|
|
8
|
-
|
|
13
|
+
import { areSetsEqual } from './util';
|
|
14
|
+
import { makeSimpleAltString } from '../../VcfFeature/util';
|
|
15
|
+
export default function VariantSampleGrid(props) {
|
|
9
16
|
var _a;
|
|
10
17
|
const { feature, descriptions = {} } = props;
|
|
11
18
|
const [filter, setFilter] = useState({});
|
|
19
|
+
const [showOnlyGenotypeColumns, setShowOnlyGenotypeColumns] = useState(true);
|
|
20
|
+
const [showFilters, setShowFilters] = useState(false);
|
|
12
21
|
const samples = (feature.samples || {});
|
|
13
|
-
const
|
|
22
|
+
const ALT = feature.ALT;
|
|
23
|
+
const REF = feature.REF;
|
|
24
|
+
const preFilteredRows = Object.entries(samples).map(([key, val]) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return [
|
|
27
|
+
key,
|
|
28
|
+
{
|
|
29
|
+
...val,
|
|
30
|
+
GT: `${(_a = val.GT) === null || _a === void 0 ? void 0 : _a[0]}`,
|
|
31
|
+
genotype: makeSimpleAltString(`${(_b = val.GT) === null || _b === void 0 ? void 0 : _b[0]}`, REF, ALT),
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
});
|
|
14
35
|
let error;
|
|
15
36
|
let rows = [];
|
|
16
37
|
const filters = Object.keys(filter);
|
|
17
38
|
try {
|
|
18
39
|
rows = preFilteredRows
|
|
19
|
-
.map(
|
|
40
|
+
.map(([key, val]) => {
|
|
20
41
|
return {
|
|
21
|
-
...Object.fromEntries(Object.entries(
|
|
22
|
-
|
|
23
|
-
|
|
42
|
+
...Object.fromEntries(Object.entries(val).map(([formatField, formatValue]) => [
|
|
43
|
+
formatField,
|
|
44
|
+
formatValue,
|
|
45
|
+
])),
|
|
46
|
+
sample: key,
|
|
47
|
+
id: key,
|
|
24
48
|
};
|
|
25
49
|
})
|
|
26
50
|
.filter(row => filters.length
|
|
@@ -33,9 +57,9 @@ export default function VariantSamples(props) {
|
|
|
33
57
|
: true);
|
|
34
58
|
}
|
|
35
59
|
catch (e) {
|
|
60
|
+
console.error(e);
|
|
36
61
|
error = e;
|
|
37
62
|
}
|
|
38
|
-
const [checked, setChecked] = useState(false);
|
|
39
63
|
const keys = ['sample', ...Object.keys(((_a = preFilteredRows[0]) === null || _a === void 0 ? void 0 : _a[1]) || {})];
|
|
40
64
|
const widths = keys.map(e => measureGridWidth(rows.map(r => r[e])));
|
|
41
65
|
const columns = keys.map((field, index) => {
|
|
@@ -46,16 +70,13 @@ export default function VariantSamples(props) {
|
|
|
46
70
|
width: widths[index],
|
|
47
71
|
});
|
|
48
72
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
} }) })] }));
|
|
73
|
+
const s1 = new Set(['sample', 'GT', 'genotype']);
|
|
74
|
+
const s2 = new Set(keys);
|
|
75
|
+
return !preFilteredRows.length ? null : (_jsxs(_Fragment, { children: [_jsx(BaseCard, { ...props, title: "Genotype frequencies", children: _jsx(ErrorBoundary, { FallbackComponent: ErrorMessage, children: _jsx(VariantGenotypeFrequencyTable, { rows: rows }) }) }), _jsxs(BaseCard, { ...props, title: "Samples", children: [error ? _jsx(Typography, { color: "error", children: `${error}` }) : null, _jsx(Checkbox2, { label: "Show filters", checked: showFilters, onChange: event => {
|
|
76
|
+
setShowFilters(event.target.checked);
|
|
77
|
+
} }), areSetsEqual(s1, s2) ? null : (_jsx(Checkbox2, { label: "Show only genotype columns", checked: showOnlyGenotypeColumns, onChange: event => {
|
|
78
|
+
setShowOnlyGenotypeColumns(event.target.checked);
|
|
79
|
+
} })), showFilters ? (_jsx(SampleFilters, { setFilter: setFilter, columns: columns, filter: filter })) : null, _jsx(DataGridFlexContainer, { children: _jsx(DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: showOnlyGenotypeColumns
|
|
80
|
+
? columns.filter(f => s1.has(f.field))
|
|
81
|
+
: columns, rowHeight: 25, columnHeaderHeight: 35, showToolbar: true }) })] })] }));
|
|
61
82
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface FrequencyTableEntry {
|
|
2
|
+
count: number;
|
|
3
|
+
GT: string;
|
|
4
|
+
genotype: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export type FrequencyTable = Record<string, FrequencyTableEntry>;
|
|
7
|
+
export interface VariantSampleGridRow {
|
|
8
|
+
sample: string;
|
|
9
|
+
id: string;
|
|
10
|
+
GT: string;
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}
|
|
13
|
+
export type InfoFields = Record<string, unknown[]>;
|
|
14
|
+
export type Filters = Record<string, string>;
|
|
15
|
+
interface FormatRecord {
|
|
16
|
+
Description?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface VariantFieldDescriptions {
|
|
19
|
+
FORMAT?: Record<string, FormatRecord>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function areSetsEqual<T>(set1: Set<T>, set2: Set<T>): boolean;
|
|
@@ -3,9 +3,9 @@ import type { Instance } from 'mobx-state-tree';
|
|
|
3
3
|
export declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
4
4
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
5
|
type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
|
|
6
|
-
featureData: import("mobx-state-tree").IType<
|
|
6
|
+
featureData: import("mobx-state-tree").IType<import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat>;
|
|
7
7
|
formattedFields: import("mobx-state-tree").IType<any, any, any>;
|
|
8
|
-
unformattedFeatureData: import("mobx-state-tree").IType<
|
|
8
|
+
unformattedFeatureData: import("mobx-state-tree").IType<import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat>;
|
|
9
9
|
view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
10
10
|
track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
11
11
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -35,15 +35,16 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
35
35
|
} & {
|
|
36
36
|
afterAttach(): void;
|
|
37
37
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
38
|
+
descriptions: import("mobx-state-tree").IType<Record<string, unknown> | undefined, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
38
39
|
} & {
|
|
39
40
|
type: import("mobx-state-tree").ISimpleType<"VariantFeatureWidget">;
|
|
40
41
|
descriptions: import("mobx-state-tree").IType<any, any, any>;
|
|
41
42
|
}, {
|
|
42
43
|
error: unknown;
|
|
43
44
|
} & {
|
|
44
|
-
setFeatureData(featureData:
|
|
45
|
+
setFeatureData(featureData: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
45
46
|
clearFeatureData(): void;
|
|
46
|
-
setFormattedData(feat:
|
|
47
|
+
setFormattedData(feat: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
47
48
|
setExtra(type?: string, trackId?: string, maxDepth?: number): void;
|
|
48
49
|
setError(e: unknown): void;
|
|
49
50
|
} & {
|
|
@@ -53,9 +54,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
53
54
|
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
54
55
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
55
56
|
type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
|
|
56
|
-
featureData: import("mobx-state-tree").IType<
|
|
57
|
+
featureData: import("mobx-state-tree").IType<import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat>;
|
|
57
58
|
formattedFields: import("mobx-state-tree").IType<any, any, any>;
|
|
58
|
-
unformattedFeatureData: import("mobx-state-tree").IType<
|
|
59
|
+
unformattedFeatureData: import("mobx-state-tree").IType<import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat, import("@jbrowse/core/BaseFeatureWidget/types").MaybeSerializedFeat>;
|
|
59
60
|
view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
60
61
|
track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
61
62
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -85,6 +86,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
85
86
|
} & {
|
|
86
87
|
afterAttach(): void;
|
|
87
88
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
89
|
+
descriptions: import("mobx-state-tree").IType<Record<string, unknown> | undefined, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
88
90
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
|
|
89
91
|
type: "BaseFeatureWidget";
|
|
90
92
|
id: string;
|
|
@@ -95,6 +97,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
95
97
|
maxDepth: number | undefined;
|
|
96
98
|
sequenceFeatureDetails: import("mobx-state-tree").ModelSnapshotType<{}>;
|
|
97
99
|
formattedFields: any;
|
|
100
|
+
descriptions: Record<string, unknown> | undefined;
|
|
98
101
|
finalizedFeatureData: any;
|
|
99
102
|
} & import("mobx-state-tree")._NotCustomized>;
|
|
100
103
|
export type VariantFeatureWidgetStateModel = ReturnType<typeof stateModelFactory>;
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
2
|
-
import type {
|
|
3
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util';
|
|
5
|
-
interface Args {
|
|
6
|
-
adapterConfig: AnyConfigurationModel;
|
|
7
|
-
stopToken?: string;
|
|
8
|
-
statusCallback: (arg: string) => void;
|
|
9
|
-
sessionId: string;
|
|
10
|
-
headers?: Record<string, string>;
|
|
11
|
-
regions: Region[];
|
|
12
|
-
bpPerPx: number;
|
|
13
|
-
sources: Source[];
|
|
14
|
-
minorAlleleFrequencyFilter: number;
|
|
15
|
-
}
|
|
2
|
+
import type { ClusterGenotypeMatrixArgs } from './types';
|
|
16
3
|
export declare class MultiVariantClusterGenotypeMatrix extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
17
4
|
name: string;
|
|
18
|
-
execute(args:
|
|
5
|
+
execute(args: ClusterGenotypeMatrixArgs, rpcDriverClassName: string): Promise<{
|
|
19
6
|
clusters: {
|
|
20
7
|
height: number;
|
|
21
8
|
indexes: number[];
|
|
@@ -25,4 +12,3 @@ export declare class MultiVariantClusterGenotypeMatrix extends RpcMethodTypeWith
|
|
|
25
12
|
clustersGivenK: number[][][];
|
|
26
13
|
}>;
|
|
27
14
|
}
|
|
28
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
2
|
-
import { clusterData } from '
|
|
2
|
+
import { clusterData } from '@jbrowse/core/util/cluster';
|
|
3
3
|
import { getGenotypeMatrix } from './getGenotypeMatrix';
|
|
4
4
|
export class MultiVariantClusterGenotypeMatrix extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
5
5
|
constructor() {
|
|
@@ -14,13 +14,10 @@ export class MultiVariantClusterGenotypeMatrix extends RpcMethodTypeWithFiltersA
|
|
|
14
14
|
});
|
|
15
15
|
return clusterData({
|
|
16
16
|
data: Object.values(matrix),
|
|
17
|
-
onProgress: a => {
|
|
18
|
-
deserializedArgs.statusCallback(`${toP(a * 100)}%`);
|
|
19
|
-
},
|
|
20
17
|
stopToken: deserializedArgs.stopToken,
|
|
18
|
+
onProgress: progress => {
|
|
19
|
+
deserializedArgs.statusCallback(progress);
|
|
20
|
+
},
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function toP(n) {
|
|
25
|
-
return Number.parseFloat(n.toPrecision(3));
|
|
26
|
-
}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
2
|
-
import type {
|
|
3
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util';
|
|
5
|
-
interface Args {
|
|
6
|
-
adapterConfig: AnyConfigurationModel;
|
|
7
|
-
stopToken?: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
regions: Region[];
|
|
11
|
-
bpPerPx: number;
|
|
12
|
-
sources: Source[];
|
|
13
|
-
minorAlleleFrequencyFilter: number;
|
|
14
|
-
}
|
|
2
|
+
import type { GetGenotypeMatrixArgs } from './types';
|
|
15
3
|
export declare class MultiVariantGetGenotypeMatrix extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
16
4
|
name: string;
|
|
17
|
-
execute(args:
|
|
5
|
+
execute(args: GetGenotypeMatrixArgs, rpcDriverClassName: string): Promise<Record<string, number[]>>;
|
|
18
6
|
}
|
|
19
|
-
export {};
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
2
|
+
import type { GetSimplifiedFeaturesArgs } from './types';
|
|
2
3
|
import type { SampleInfo } from '../shared/types';
|
|
3
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
-
import type { Region } from '@jbrowse/core/util';
|
|
5
|
-
interface Args {
|
|
6
|
-
adapterConfig: AnyConfigurationModel;
|
|
7
|
-
stopToken?: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
regions: Region[];
|
|
11
|
-
bpPerPx: number;
|
|
12
|
-
minorAlleleFrequencyFilter: number;
|
|
13
|
-
}
|
|
14
4
|
export declare class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
15
5
|
name: string;
|
|
16
|
-
execute(args:
|
|
6
|
+
execute(args: GetSimplifiedFeaturesArgs, rpcDriverClassName: string): Promise<{
|
|
17
7
|
hasPhased: boolean;
|
|
18
8
|
sampleInfo: Record<string, SampleInfo>;
|
|
19
9
|
features: {
|
|
@@ -22,8 +12,8 @@ export declare class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWith
|
|
|
22
12
|
start: number;
|
|
23
13
|
end: number;
|
|
24
14
|
refName: string;
|
|
15
|
+
name: any;
|
|
25
16
|
};
|
|
26
17
|
}[];
|
|
27
18
|
}>;
|
|
28
19
|
}
|
|
29
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
2
2
|
import RpcMethodTypeWithFiltersAndRenameRegions from '@jbrowse/core/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions';
|
|
3
|
+
import { forEachWithStopTokenCheck } from '@jbrowse/core/util';
|
|
3
4
|
import { firstValueFrom, toArray } from 'rxjs';
|
|
4
5
|
import { getFeaturesThatPassMinorAlleleFrequencyFilter } from '../shared/minorAlleleFrequencyUtils';
|
|
5
6
|
export class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersAndRenameRegions {
|
|
@@ -8,17 +9,21 @@ export class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersA
|
|
|
8
9
|
this.name = 'MultiVariantGetSimplifiedFeatures';
|
|
9
10
|
}
|
|
10
11
|
async execute(args, rpcDriverClassName) {
|
|
11
|
-
var _a, _b;
|
|
12
12
|
const deserializedArgs = await this.deserializeArguments(args, rpcDriverClassName);
|
|
13
|
-
const { minorAlleleFrequencyFilter, regions, adapterConfig, sessionId } = deserializedArgs;
|
|
13
|
+
const { lengthCutoffFilter, minorAlleleFrequencyFilter, regions, adapterConfig, stopToken, sessionId, } = deserializedArgs;
|
|
14
14
|
const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const features = getFeaturesThatPassMinorAlleleFrequencyFilter({
|
|
16
|
+
minorAlleleFrequencyFilter,
|
|
17
|
+
lengthCutoffFilter,
|
|
18
|
+
stopToken,
|
|
19
|
+
features: await firstValueFrom(dataAdapter
|
|
20
|
+
.getFeaturesInMultipleRegions(regions, deserializedArgs)
|
|
21
|
+
.pipe(toArray())),
|
|
22
|
+
});
|
|
19
23
|
const sampleInfo = {};
|
|
20
24
|
let hasPhased = false;
|
|
21
|
-
|
|
25
|
+
forEachWithStopTokenCheck(features, stopToken, ({ feature }) => {
|
|
26
|
+
var _a, _b;
|
|
22
27
|
const samp = feature.get('genotypes');
|
|
23
28
|
for (const [key, val] of Object.entries(samp)) {
|
|
24
29
|
const isPhased = val.includes('|');
|
|
@@ -28,7 +33,7 @@ export class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersA
|
|
|
28
33
|
isPhased: ((_b = sampleInfo[key]) === null || _b === void 0 ? void 0 : _b.isPhased) || isPhased,
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
|
-
}
|
|
36
|
+
});
|
|
32
37
|
return {
|
|
33
38
|
hasPhased,
|
|
34
39
|
sampleInfo,
|
|
@@ -38,6 +43,7 @@ export class MultiVariantGetSimplifiedFeatures extends RpcMethodTypeWithFiltersA
|
|
|
38
43
|
start: feature.get('start'),
|
|
39
44
|
end: feature.get('end'),
|
|
40
45
|
refName: feature.get('refName'),
|
|
46
|
+
name: feature.get('name'),
|
|
41
47
|
},
|
|
42
48
|
})),
|
|
43
49
|
};
|