@jbrowse/plugin-variants 3.5.0 → 3.6.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 -0
- package/dist/MultiLinearVariantDisplay/model.d.ts +1 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +18 -52
- package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +5 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +51 -0
- package/dist/shared/MultiVariantBaseModel.d.ts +1 -0
- package/dist/shared/SharedVariantMixin.d.ts +1 -0
- package/dist/shared/components/SourcesDataGrid.js +1 -1
- package/esm/LinearVariantDisplay/model.d.ts +1 -0
- package/esm/MultiLinearVariantDisplay/model.d.ts +1 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +19 -53
- package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +5 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +48 -0
- package/esm/shared/MultiVariantBaseModel.d.ts +1 -0
- package/esm/shared/SharedVariantMixin.d.ts +1 -0
- package/esm/shared/components/SourcesDataGrid.js +1 -1
- package/package.json +6 -6
|
@@ -191,6 +191,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
191
191
|
readonly renderDelay: number;
|
|
192
192
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
193
193
|
readonly selectedFeatureId: string | undefined;
|
|
194
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
194
195
|
} & {
|
|
195
196
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
196
197
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -199,6 +199,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
199
199
|
readonly renderDelay: number;
|
|
200
200
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
201
201
|
readonly selectedFeatureId: string | undefined;
|
|
202
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
202
203
|
} & {
|
|
203
204
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
204
205
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
@@ -199,6 +199,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
199
199
|
readonly renderDelay: number;
|
|
200
200
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
201
201
|
readonly selectedFeatureId: string | undefined;
|
|
202
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
202
203
|
} & {
|
|
203
204
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
204
205
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
@@ -16,57 +16,19 @@ const x_data_grid_1 = require("@mui/x-data-grid");
|
|
|
16
16
|
const Checkbox2_1 = __importDefault(require("../Checkbox2"));
|
|
17
17
|
const VariantGenotypeFrequencyTable_1 = __importDefault(require("./VariantGenotypeFrequencyTable"));
|
|
18
18
|
const VariantSampleFilters_1 = __importDefault(require("./VariantSampleFilters"));
|
|
19
|
-
const
|
|
20
|
-
const util_3 = require("../../VcfFeature/util");
|
|
19
|
+
const getSampleGridRows_1 = require("./getSampleGridRows");
|
|
21
20
|
function VariantSampleGrid(props) {
|
|
22
|
-
var _a;
|
|
23
21
|
const { feature, descriptions = {} } = props;
|
|
24
22
|
const [filter, setFilter] = (0, react_1.useState)({});
|
|
25
|
-
const [
|
|
23
|
+
const [columnDisplayMode, setColumnDisplayMode] = (0, react_1.useState)('all');
|
|
26
24
|
const [showFilters, setShowFilters] = (0, react_1.useState)(false);
|
|
27
25
|
const samples = (feature.samples || {});
|
|
28
26
|
const ALT = feature.ALT;
|
|
29
27
|
const REF = feature.REF;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
...val,
|
|
36
|
-
GT: `${(_a = val.GT) === null || _a === void 0 ? void 0 : _a[0]}`,
|
|
37
|
-
genotype: (0, util_3.makeSimpleAltString)(`${(_b = val.GT) === null || _b === void 0 ? void 0 : _b[0]}`, REF, ALT),
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
});
|
|
41
|
-
let error;
|
|
42
|
-
let rows = [];
|
|
43
|
-
const filters = Object.keys(filter);
|
|
44
|
-
try {
|
|
45
|
-
rows = preFilteredRows
|
|
46
|
-
.map(([key, val]) => {
|
|
47
|
-
return {
|
|
48
|
-
...Object.fromEntries(Object.entries(val).map(([formatField, formatValue]) => [
|
|
49
|
-
formatField,
|
|
50
|
-
formatValue,
|
|
51
|
-
])),
|
|
52
|
-
sample: key,
|
|
53
|
-
id: key,
|
|
54
|
-
};
|
|
55
|
-
})
|
|
56
|
-
.filter(row => filters.length
|
|
57
|
-
? filters.every(key => {
|
|
58
|
-
const currFilter = filter[key];
|
|
59
|
-
return currFilter
|
|
60
|
-
? new RegExp(currFilter, 'i').exec(row[key])
|
|
61
|
-
: true;
|
|
62
|
-
})
|
|
63
|
-
: true);
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
console.error(e);
|
|
67
|
-
error = e;
|
|
68
|
-
}
|
|
69
|
-
const keys = ['sample', ...Object.keys(((_a = preFilteredRows[0]) === null || _a === void 0 ? void 0 : _a[1]) || {})];
|
|
28
|
+
const { rows, error } = (0, getSampleGridRows_1.getSampleGridRows)(samples, REF, ALT, filter);
|
|
29
|
+
const colKeySet = new Set(['sample', ...Object.keys(rows[0] || {})]);
|
|
30
|
+
colKeySet.delete('id');
|
|
31
|
+
const keys = [...colKeySet];
|
|
70
32
|
const widths = keys.map(e => (0, util_1.measureGridWidth)(rows.map(r => r[e])));
|
|
71
33
|
const columns = keys.map((field, index) => {
|
|
72
34
|
var _a, _b;
|
|
@@ -76,13 +38,17 @@ function VariantSampleGrid(props) {
|
|
|
76
38
|
width: widths[index],
|
|
77
39
|
});
|
|
78
40
|
});
|
|
79
|
-
const s1 = new Set(['sample', 'GT'
|
|
80
|
-
const s2 = new Set(
|
|
81
|
-
return !
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
41
|
+
const s1 = new Set(['sample', 'GT']);
|
|
42
|
+
const s2 = new Set(['sample', 'GT', 'genotype']);
|
|
43
|
+
return !rows.length ? null : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BaseCard_1.default, { ...props, title: "Genotype frequencies", children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { FallbackComponent: ui_1.ErrorMessage, children: (0, jsx_runtime_1.jsx)(VariantGenotypeFrequencyTable_1.default, { rows: rows }) }) }), (0, jsx_runtime_1.jsxs)(BaseCard_1.default, { ...props, title: "Samples", children: [error ? (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", children: `${error}` }) : null, (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Checkbox2_1.default, { label: "Show filters", checked: showFilters, onChange: event => {
|
|
44
|
+
setShowFilters(event.target.checked);
|
|
45
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.ToggleButtonGroup, { value: columnDisplayMode, exclusive: true, size: "small", onChange: (_, newValue) => {
|
|
46
|
+
if (newValue !== null) {
|
|
47
|
+
setColumnDisplayMode(newValue);
|
|
48
|
+
}
|
|
49
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.ToggleButton, { value: "all", children: "All" }), (0, jsx_runtime_1.jsx)(material_1.ToggleButton, { value: "gtOnly", children: "GT only" }), (0, jsx_runtime_1.jsx)(material_1.ToggleButton, { value: "genotypeOnly", children: "GT+resolved genotype" })] })] }), showFilters ? ((0, jsx_runtime_1.jsx)(VariantSampleFilters_1.default, { setFilter: setFilter, columns: columns, filter: filter })) : null, (0, jsx_runtime_1.jsx)(DataGridFlexContainer_1.default, { children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: columnDisplayMode === 'gtOnly'
|
|
86
50
|
? columns.filter(f => s1.has(f.field))
|
|
87
|
-
:
|
|
51
|
+
: columnDisplayMode === 'genotypeOnly'
|
|
52
|
+
? columns.filter(f => s2.has(f.field))
|
|
53
|
+
: columns, rowHeight: 25, columnHeaderHeight: 35, showToolbar: true }) })] })] }));
|
|
88
54
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSampleGridRows = getSampleGridRows;
|
|
4
|
+
const util_1 = require("../../VcfFeature/util");
|
|
5
|
+
function getSampleGridRows(samples, REF, ALT, filter) {
|
|
6
|
+
const preFilteredRows = Object.entries(samples).map(([key, val]) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const gt = (_a = val.GT) === null || _a === void 0 ? void 0 : _a[0];
|
|
9
|
+
return [
|
|
10
|
+
key,
|
|
11
|
+
{
|
|
12
|
+
...val,
|
|
13
|
+
...(gt
|
|
14
|
+
? {
|
|
15
|
+
GT: `${gt}`,
|
|
16
|
+
genotype: (0, util_1.makeSimpleAltString)(`${gt}`, REF, ALT),
|
|
17
|
+
}
|
|
18
|
+
: {}),
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
});
|
|
22
|
+
let error;
|
|
23
|
+
let rows = [];
|
|
24
|
+
const filters = Object.keys(filter);
|
|
25
|
+
try {
|
|
26
|
+
rows = preFilteredRows
|
|
27
|
+
.map(([key, val]) => {
|
|
28
|
+
return {
|
|
29
|
+
...Object.fromEntries(Object.entries(val).map(([formatField, formatValue]) => [
|
|
30
|
+
formatField,
|
|
31
|
+
formatValue,
|
|
32
|
+
])),
|
|
33
|
+
sample: key,
|
|
34
|
+
id: key,
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
.filter(row => filters.length
|
|
38
|
+
? filters.every(key => {
|
|
39
|
+
const currFilter = filter[key];
|
|
40
|
+
return currFilter
|
|
41
|
+
? new RegExp(currFilter, 'i').exec(row[key])
|
|
42
|
+
: true;
|
|
43
|
+
})
|
|
44
|
+
: true);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.error(e);
|
|
48
|
+
error = e;
|
|
49
|
+
}
|
|
50
|
+
return { rows, error };
|
|
51
|
+
}
|
|
@@ -196,6 +196,7 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
196
196
|
readonly renderDelay: number;
|
|
197
197
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
198
198
|
readonly selectedFeatureId: string | undefined;
|
|
199
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
199
200
|
} & {
|
|
200
201
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
201
202
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -184,6 +184,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
184
184
|
readonly renderDelay: number;
|
|
185
185
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
186
186
|
readonly selectedFeatureId: string | undefined;
|
|
187
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
187
188
|
} & {
|
|
188
189
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
189
190
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -25,7 +25,7 @@ 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, onRowSelectionModelChange: 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, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
29
29
|
setSelected([...arg.ids]);
|
|
30
30
|
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
31
31
|
{
|
|
@@ -191,6 +191,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
191
191
|
readonly renderDelay: number;
|
|
192
192
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
193
193
|
readonly selectedFeatureId: string | undefined;
|
|
194
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
194
195
|
} & {
|
|
195
196
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
196
197
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -199,6 +199,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
199
199
|
readonly renderDelay: number;
|
|
200
200
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
201
201
|
readonly selectedFeatureId: string | undefined;
|
|
202
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
202
203
|
} & {
|
|
203
204
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
204
205
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
@@ -199,6 +199,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
199
199
|
readonly renderDelay: number;
|
|
200
200
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
201
201
|
readonly selectedFeatureId: string | undefined;
|
|
202
|
+
copyInfoToClipboard(feature: import("@jbrowse/core/util").Feature): void;
|
|
202
203
|
} & {
|
|
203
204
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
204
205
|
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
@@ -5,62 +5,24 @@ import { ErrorMessage } from '@jbrowse/core/ui';
|
|
|
5
5
|
import DataGridFlexContainer from '@jbrowse/core/ui/DataGridFlexContainer';
|
|
6
6
|
import { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary';
|
|
7
7
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
8
|
-
import { Typography } from '@mui/material';
|
|
8
|
+
import { ToggleButton, ToggleButtonGroup, Typography } from '@mui/material';
|
|
9
9
|
import { DataGrid } from '@mui/x-data-grid';
|
|
10
10
|
import Checkbox2 from '../Checkbox2';
|
|
11
11
|
import VariantGenotypeFrequencyTable from './VariantGenotypeFrequencyTable';
|
|
12
12
|
import SampleFilters from './VariantSampleFilters';
|
|
13
|
-
import {
|
|
14
|
-
import { makeSimpleAltString } from '../../VcfFeature/util';
|
|
13
|
+
import { getSampleGridRows } from './getSampleGridRows';
|
|
15
14
|
export default function VariantSampleGrid(props) {
|
|
16
|
-
var _a;
|
|
17
15
|
const { feature, descriptions = {} } = props;
|
|
18
16
|
const [filter, setFilter] = useState({});
|
|
19
|
-
const [
|
|
17
|
+
const [columnDisplayMode, setColumnDisplayMode] = useState('all');
|
|
20
18
|
const [showFilters, setShowFilters] = useState(false);
|
|
21
19
|
const samples = (feature.samples || {});
|
|
22
20
|
const ALT = feature.ALT;
|
|
23
21
|
const REF = feature.REF;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
});
|
|
35
|
-
let error;
|
|
36
|
-
let rows = [];
|
|
37
|
-
const filters = Object.keys(filter);
|
|
38
|
-
try {
|
|
39
|
-
rows = preFilteredRows
|
|
40
|
-
.map(([key, val]) => {
|
|
41
|
-
return {
|
|
42
|
-
...Object.fromEntries(Object.entries(val).map(([formatField, formatValue]) => [
|
|
43
|
-
formatField,
|
|
44
|
-
formatValue,
|
|
45
|
-
])),
|
|
46
|
-
sample: key,
|
|
47
|
-
id: key,
|
|
48
|
-
};
|
|
49
|
-
})
|
|
50
|
-
.filter(row => filters.length
|
|
51
|
-
? filters.every(key => {
|
|
52
|
-
const currFilter = filter[key];
|
|
53
|
-
return currFilter
|
|
54
|
-
? new RegExp(currFilter, 'i').exec(row[key])
|
|
55
|
-
: true;
|
|
56
|
-
})
|
|
57
|
-
: true);
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
console.error(e);
|
|
61
|
-
error = e;
|
|
62
|
-
}
|
|
63
|
-
const keys = ['sample', ...Object.keys(((_a = preFilteredRows[0]) === null || _a === void 0 ? void 0 : _a[1]) || {})];
|
|
22
|
+
const { rows, error } = getSampleGridRows(samples, REF, ALT, filter);
|
|
23
|
+
const colKeySet = new Set(['sample', ...Object.keys(rows[0] || {})]);
|
|
24
|
+
colKeySet.delete('id');
|
|
25
|
+
const keys = [...colKeySet];
|
|
64
26
|
const widths = keys.map(e => measureGridWidth(rows.map(r => r[e])));
|
|
65
27
|
const columns = keys.map((field, index) => {
|
|
66
28
|
var _a, _b;
|
|
@@ -70,13 +32,17 @@ export default function VariantSampleGrid(props) {
|
|
|
70
32
|
width: widths[index],
|
|
71
33
|
});
|
|
72
34
|
});
|
|
73
|
-
const s1 = new Set(['sample', 'GT'
|
|
74
|
-
const s2 = new Set(
|
|
75
|
-
return !
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
35
|
+
const s1 = new Set(['sample', 'GT']);
|
|
36
|
+
const s2 = new Set(['sample', 'GT', 'genotype']);
|
|
37
|
+
return !rows.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, _jsxs("div", { children: [_jsx(Checkbox2, { label: "Show filters", checked: showFilters, onChange: event => {
|
|
38
|
+
setShowFilters(event.target.checked);
|
|
39
|
+
} }), _jsxs(ToggleButtonGroup, { value: columnDisplayMode, exclusive: true, size: "small", onChange: (_, newValue) => {
|
|
40
|
+
if (newValue !== null) {
|
|
41
|
+
setColumnDisplayMode(newValue);
|
|
42
|
+
}
|
|
43
|
+
}, children: [_jsx(ToggleButton, { value: "all", children: "All" }), _jsx(ToggleButton, { value: "gtOnly", children: "GT only" }), _jsx(ToggleButton, { value: "genotypeOnly", children: "GT+resolved genotype" })] })] }), showFilters ? (_jsx(SampleFilters, { setFilter: setFilter, columns: columns, filter: filter })) : null, _jsx(DataGridFlexContainer, { children: _jsx(DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: columnDisplayMode === 'gtOnly'
|
|
80
44
|
? columns.filter(f => s1.has(f.field))
|
|
81
|
-
:
|
|
45
|
+
: columnDisplayMode === 'genotypeOnly'
|
|
46
|
+
? columns.filter(f => s2.has(f.field))
|
|
47
|
+
: columns, rowHeight: 25, columnHeaderHeight: 35, showToolbar: true }) })] })] }));
|
|
82
48
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { makeSimpleAltString } from '../../VcfFeature/util';
|
|
2
|
+
export function getSampleGridRows(samples, REF, ALT, filter) {
|
|
3
|
+
const preFilteredRows = Object.entries(samples).map(([key, val]) => {
|
|
4
|
+
var _a;
|
|
5
|
+
const gt = (_a = val.GT) === null || _a === void 0 ? void 0 : _a[0];
|
|
6
|
+
return [
|
|
7
|
+
key,
|
|
8
|
+
{
|
|
9
|
+
...val,
|
|
10
|
+
...(gt
|
|
11
|
+
? {
|
|
12
|
+
GT: `${gt}`,
|
|
13
|
+
genotype: makeSimpleAltString(`${gt}`, REF, ALT),
|
|
14
|
+
}
|
|
15
|
+
: {}),
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
});
|
|
19
|
+
let error;
|
|
20
|
+
let rows = [];
|
|
21
|
+
const filters = Object.keys(filter);
|
|
22
|
+
try {
|
|
23
|
+
rows = preFilteredRows
|
|
24
|
+
.map(([key, val]) => {
|
|
25
|
+
return {
|
|
26
|
+
...Object.fromEntries(Object.entries(val).map(([formatField, formatValue]) => [
|
|
27
|
+
formatField,
|
|
28
|
+
formatValue,
|
|
29
|
+
])),
|
|
30
|
+
sample: key,
|
|
31
|
+
id: key,
|
|
32
|
+
};
|
|
33
|
+
})
|
|
34
|
+
.filter(row => filters.length
|
|
35
|
+
? filters.every(key => {
|
|
36
|
+
const currFilter = filter[key];
|
|
37
|
+
return currFilter
|
|
38
|
+
? new RegExp(currFilter, 'i').exec(row[key])
|
|
39
|
+
: true;
|
|
40
|
+
})
|
|
41
|
+
: true);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
console.error(e);
|
|
45
|
+
error = e;
|
|
46
|
+
}
|
|
47
|
+
return { rows, error };
|
|
48
|
+
}
|
|
@@ -196,6 +196,7 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
196
196
|
readonly renderDelay: number;
|
|
197
197
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
198
198
|
readonly selectedFeatureId: string | undefined;
|
|
199
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
199
200
|
} & {
|
|
200
201
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
201
202
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -184,6 +184,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
184
184
|
readonly renderDelay: number;
|
|
185
185
|
readonly TooltipComponent: import("@jbrowse/core/util").AnyReactComponentType;
|
|
186
186
|
readonly selectedFeatureId: string | undefined;
|
|
187
|
+
copyInfoToClipboard(feature: Feature): void;
|
|
187
188
|
} & {
|
|
188
189
|
readonly features: import("@jbrowse/core/util/compositeMap").default<string, Feature>;
|
|
189
190
|
readonly featureUnderMouse: Feature | undefined;
|
|
@@ -19,7 +19,7 @@ export default function SourcesDataGrid({ rows, onChange, setSelected, }) {
|
|
|
19
19
|
idx: 0,
|
|
20
20
|
field: null,
|
|
21
21
|
});
|
|
22
|
-
return (_jsx("div", { style: { height: 400, width: '100%' }, children: _jsx(DataGrid, { checkboxSelection: true, onRowSelectionModelChange: arg => {
|
|
22
|
+
return (_jsx("div", { style: { height: 400, width: '100%' }, children: _jsx(DataGrid, { checkboxSelection: true, disableRowSelectionOnClick: true, onRowSelectionModelChange: arg => {
|
|
23
23
|
setSelected([...arg.ids]);
|
|
24
24
|
}, rows: rows, rowHeight: 25, columnHeaderHeight: 33, columns: [
|
|
25
25
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-variants",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "JBrowse 2 variant adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@gmod/bgzf-filehandle": "^4.0.0",
|
|
41
41
|
"@gmod/tabix": "^3.0.1",
|
|
42
42
|
"@gmod/vcf": "^6.0.8",
|
|
43
|
-
"@jbrowse/core": "^3.
|
|
44
|
-
"@jbrowse/plugin-circular-view": "^3.
|
|
45
|
-
"@jbrowse/plugin-linear-genome-view": "^3.
|
|
46
|
-
"@jbrowse/sv-core": "^3.
|
|
43
|
+
"@jbrowse/core": "^3.6.0",
|
|
44
|
+
"@jbrowse/plugin-circular-view": "^3.6.0",
|
|
45
|
+
"@jbrowse/plugin-linear-genome-view": "^3.6.0",
|
|
46
|
+
"@jbrowse/sv-core": "^3.6.0",
|
|
47
47
|
"@mui/icons-material": "^7.0.0",
|
|
48
48
|
"@mui/material": "^7.0.0",
|
|
49
49
|
"@mui/x-data-grid": "^8.0.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"distModule": "esm/index.js",
|
|
64
64
|
"srcModule": "src/index.ts",
|
|
65
65
|
"module": "esm/index.js",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "133a68815ab348d156c18d83cffc997356c3cfbb"
|
|
67
67
|
}
|