@jbrowse/plugin-variants 2.4.2 → 2.5.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/ChordVariantDisplay/models/configSchema.d.ts +13 -1
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -1
- package/dist/LinearVariantDisplay/configSchema.d.ts +25 -1
- package/dist/LinearVariantDisplay/model.d.ts +40 -11
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +0 -1
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +0 -1
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +29 -1
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +3 -3
- package/dist/VariantFeatureWidget/AnnotGrid.js +38 -13
- package/dist/VariantFeatureWidget/AnnotGrid.js.map +1 -1
- package/dist/VariantFeatureWidget/BreakendOptionDialog.d.ts +2 -4
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js +4 -5
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -1
- package/dist/VariantFeatureWidget/BreakendPanel.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantAnnPanel.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantCsqPanel.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +12 -11
- package/dist/VariantFeatureWidget/VariantSampleGrid.js.map +1 -1
- package/dist/VariantFeatureWidget/index.d.ts +4 -1
- package/dist/VariantTrack/configSchema.d.ts +73 -1
- package/dist/VcfAdapter/VcfAdapter.js +1 -1
- package/dist/VcfAdapter/VcfAdapter.js.map +1 -1
- package/dist/VcfAdapter/configSchema.d.ts +12 -1
- package/dist/VcfTabixAdapter/configSchema.d.ts +32 -1
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +13 -1
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -1
- package/esm/LinearVariantDisplay/configSchema.d.ts +25 -1
- package/esm/LinearVariantDisplay/model.d.ts +40 -11
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +0 -1
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +0 -1
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +29 -1
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +3 -3
- package/esm/VariantFeatureWidget/AnnotGrid.js +17 -12
- package/esm/VariantFeatureWidget/AnnotGrid.js.map +1 -1
- package/esm/VariantFeatureWidget/BreakendOptionDialog.d.ts +2 -4
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js +4 -5
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -1
- package/esm/VariantFeatureWidget/BreakendPanel.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantAnnPanel.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantCsqPanel.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +13 -12
- package/esm/VariantFeatureWidget/VariantSampleGrid.js.map +1 -1
- package/esm/VariantFeatureWidget/index.d.ts +4 -1
- package/esm/VariantTrack/configSchema.d.ts +73 -1
- package/esm/VcfAdapter/VcfAdapter.js +2 -1
- package/esm/VcfAdapter/VcfAdapter.js.map +1 -1
- package/esm/VcfAdapter/configSchema.d.ts +12 -1
- package/esm/VcfTabixAdapter/configSchema.d.ts +32 -1
- package/package.json +3 -3
- package/src/VariantFeatureWidget/AnnotGrid.tsx +41 -17
- package/src/VariantFeatureWidget/BreakendOptionDialog.tsx +4 -5
- package/src/VariantFeatureWidget/VariantSampleGrid.tsx +51 -46
- package/src/VariantFeatureWidget/__snapshots__/VariantFeatureWidget.test.tsx.snap +1 -2
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
declare const VcfAdapter: import("@jbrowse/core/configuration").
|
|
1
|
+
declare const VcfAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
/**
|
|
3
|
+
* #slot
|
|
4
|
+
*/
|
|
5
|
+
vcfLocation: {
|
|
6
|
+
type: string;
|
|
7
|
+
defaultValue: {
|
|
8
|
+
uri: string;
|
|
9
|
+
locationType: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
2
13
|
export default VcfAdapter;
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
declare const VcfTabixAdapter: import("@jbrowse/core/configuration").
|
|
1
|
+
declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
/**
|
|
3
|
+
* #slot
|
|
4
|
+
*/
|
|
5
|
+
vcfGzLocation: {
|
|
6
|
+
type: string;
|
|
7
|
+
defaultValue: {
|
|
8
|
+
uri: string;
|
|
9
|
+
locationType: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
+
/**
|
|
14
|
+
* #slot index.indexType
|
|
15
|
+
*/
|
|
16
|
+
indexType: {
|
|
17
|
+
model: import("mobx-state-tree").ISimpleType<string>;
|
|
18
|
+
type: string;
|
|
19
|
+
defaultValue: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* #slot index.location
|
|
23
|
+
*/
|
|
24
|
+
location: {
|
|
25
|
+
type: string;
|
|
26
|
+
defaultValue: {
|
|
27
|
+
uri: string;
|
|
28
|
+
locationType: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
32
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
2
33
|
export default VcfTabixAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-variants",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "JBrowse 2 variant adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@gmod/tabix": "^1.5.6",
|
|
43
43
|
"@gmod/vcf": "^5.0.9",
|
|
44
44
|
"@mui/icons-material": "^5.0.2",
|
|
45
|
-
"@mui/x-data-grid": "^
|
|
45
|
+
"@mui/x-data-grid": "^6.0.1",
|
|
46
46
|
"generic-filehandle": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"distModule": "esm/index.js",
|
|
65
65
|
"srcModule": "src/index.ts",
|
|
66
66
|
"module": "esm/index.js",
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "d1ca073996d008f0fe9a52f7c1a47ae649dcfdaf"
|
|
68
68
|
}
|
|
@@ -1,28 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
DataGrid,
|
|
4
|
+
GridColDef,
|
|
5
|
+
GridToolbar,
|
|
6
|
+
GridValidRowModel,
|
|
7
|
+
} from '@mui/x-data-grid'
|
|
8
|
+
import { Checkbox, FormControlLabel, Typography } from '@mui/material'
|
|
4
9
|
|
|
5
10
|
export default function VariantAnnotPanel({
|
|
6
11
|
rows,
|
|
7
12
|
columns,
|
|
8
13
|
}: {
|
|
9
|
-
rows:
|
|
10
|
-
columns:
|
|
14
|
+
rows: GridValidRowModel[]
|
|
15
|
+
columns: GridColDef[]
|
|
11
16
|
}) {
|
|
12
17
|
const rowHeight = 25
|
|
13
|
-
const
|
|
14
|
-
const
|
|
18
|
+
const headerHeight = 100
|
|
19
|
+
const footerHeight = 50
|
|
20
|
+
const [checked, setChecked] = useState(false)
|
|
21
|
+
const height =
|
|
22
|
+
Math.min(rows.length, 100) * rowHeight +
|
|
23
|
+
headerHeight +
|
|
24
|
+
(checked ? 50 : 0) +
|
|
25
|
+
footerHeight
|
|
15
26
|
return rows.length ? (
|
|
16
|
-
<div
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
<div>
|
|
28
|
+
<FormControlLabel
|
|
29
|
+
control={
|
|
30
|
+
<Checkbox
|
|
31
|
+
checked={checked}
|
|
32
|
+
onChange={event => setChecked(event.target.checked)}
|
|
33
|
+
/>
|
|
34
|
+
}
|
|
35
|
+
label={<Typography variant="body2">Show options</Typography>}
|
|
36
|
+
/>
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
height,
|
|
40
|
+
width: '100%',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<DataGrid
|
|
44
|
+
rowHeight={rowHeight}
|
|
45
|
+
rows={rows}
|
|
46
|
+
columns={columns}
|
|
47
|
+
slots={{ toolbar: checked ? GridToolbar : null }}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
26
50
|
</div>
|
|
27
51
|
) : null
|
|
28
52
|
}
|
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles()({
|
|
|
20
20
|
},
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
function BreakendOptionDialog({
|
|
23
|
+
export default observer(function BreakendOptionDialog({
|
|
24
24
|
model,
|
|
25
25
|
handleClose,
|
|
26
26
|
feature,
|
|
@@ -43,7 +43,7 @@ function BreakendOptionDialog({
|
|
|
43
43
|
control={
|
|
44
44
|
<Checkbox
|
|
45
45
|
checked={copyTracks}
|
|
46
|
-
onChange={
|
|
46
|
+
onChange={event => setCopyTracks(event.target.checked)}
|
|
47
47
|
/>
|
|
48
48
|
}
|
|
49
49
|
label="Copy tracks into the new view"
|
|
@@ -54,7 +54,7 @@ function BreakendOptionDialog({
|
|
|
54
54
|
control={
|
|
55
55
|
<Checkbox
|
|
56
56
|
checked={mirrorTracks}
|
|
57
|
-
onChange={
|
|
57
|
+
onChange={event => setMirrorTracks(event.target.checked)}
|
|
58
58
|
/>
|
|
59
59
|
}
|
|
60
60
|
label="Mirror tracks vertically in vertically stacked view"
|
|
@@ -114,5 +114,4 @@ function BreakendOptionDialog({
|
|
|
114
114
|
</DialogActions>
|
|
115
115
|
</Dialog>
|
|
116
116
|
)
|
|
117
|
-
}
|
|
118
|
-
export default observer(BreakendOptionDialog)
|
|
117
|
+
})
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Typography,
|
|
8
8
|
} from '@mui/material'
|
|
9
9
|
|
|
10
|
-
import { DataGrid } from '@mui/x-data-grid'
|
|
10
|
+
import { DataGrid, GridToolbar } from '@mui/x-data-grid'
|
|
11
11
|
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
12
12
|
import { measureGridWidth, SimpleFeatureSerialized } from '@jbrowse/core/util'
|
|
13
13
|
import ResizeBar, { useResizeBar } from '@jbrowse/core/ui/ResizeBar'
|
|
@@ -30,38 +30,24 @@ function SampleFilters({
|
|
|
30
30
|
filter: Filters
|
|
31
31
|
setFilter: (arg: Filters) => void
|
|
32
32
|
}) {
|
|
33
|
-
const [showFilters, setShowFilters] = useState(false)
|
|
34
33
|
return (
|
|
35
34
|
<>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</Typography>
|
|
53
|
-
{columns.map(({ field }) => (
|
|
54
|
-
<TextField
|
|
55
|
-
key={`filter-${field}`}
|
|
56
|
-
placeholder={`Filter ${field}`}
|
|
57
|
-
value={filter[field] || ''}
|
|
58
|
-
onChange={event =>
|
|
59
|
-
setFilter({ ...filter, [field]: event.target.value })
|
|
60
|
-
}
|
|
61
|
-
/>
|
|
62
|
-
))}
|
|
63
|
-
</>
|
|
64
|
-
) : null}
|
|
35
|
+
<Typography>
|
|
36
|
+
These filters can use a plain text search or regex style query, e.g. in
|
|
37
|
+
the genotype field, entering 1 will query for all genotypes that include
|
|
38
|
+
the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\d* will find
|
|
39
|
+
any non-zero allele e.g. 0|2 or 2/33
|
|
40
|
+
</Typography>
|
|
41
|
+
{columns.map(({ field }) => (
|
|
42
|
+
<TextField
|
|
43
|
+
key={`filter-${field}`}
|
|
44
|
+
placeholder={`Filter ${field}`}
|
|
45
|
+
value={filter[field] || ''}
|
|
46
|
+
onChange={event =>
|
|
47
|
+
setFilter({ ...filter, [field]: event.target.value })
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
65
51
|
</>
|
|
66
52
|
)
|
|
67
53
|
}
|
|
@@ -98,9 +84,10 @@ export default function VariantSamples(props: {
|
|
|
98
84
|
.filter(row =>
|
|
99
85
|
filters.length
|
|
100
86
|
? filters.every(key => {
|
|
101
|
-
const val = row[key]
|
|
102
87
|
const currFilter = filter[key]
|
|
103
|
-
return currFilter
|
|
88
|
+
return currFilter
|
|
89
|
+
? row[key].match(new RegExp(currFilter, 'i'))
|
|
90
|
+
: true
|
|
104
91
|
})
|
|
105
92
|
: true,
|
|
106
93
|
)
|
|
@@ -109,7 +96,7 @@ export default function VariantSamples(props: {
|
|
|
109
96
|
}
|
|
110
97
|
|
|
111
98
|
const keys = ['sample', ...Object.keys(preFilteredRows[0]?.[1] || {})]
|
|
112
|
-
|
|
99
|
+
const [checked, setChecked] = useState(false)
|
|
113
100
|
const [widths, setWidths] = useState(
|
|
114
101
|
keys.map(e => measureGridWidth(rows.map(r => r[e]))),
|
|
115
102
|
)
|
|
@@ -119,28 +106,46 @@ export default function VariantSamples(props: {
|
|
|
119
106
|
width: widths[index],
|
|
120
107
|
}))
|
|
121
108
|
|
|
122
|
-
//
|
|
109
|
+
// disableRowSelectionOnClick helps avoid
|
|
123
110
|
// https://github.com/mui-org/material-ui-x/issues/1197
|
|
124
111
|
return !preFilteredRows.length ? null : (
|
|
125
112
|
<BaseCard {...props} title="Samples">
|
|
126
113
|
{error ? <Typography color="error">{`${error}`}</Typography> : null}
|
|
127
|
-
<
|
|
114
|
+
<FormControlLabel
|
|
115
|
+
control={
|
|
116
|
+
<Checkbox
|
|
117
|
+
checked={checked}
|
|
118
|
+
onChange={event => setChecked(event.target.checked)}
|
|
119
|
+
/>
|
|
120
|
+
}
|
|
121
|
+
label={<Typography variant="body2">Show options</Typography>}
|
|
122
|
+
/>
|
|
123
|
+
{checked ? (
|
|
124
|
+
<SampleFilters
|
|
125
|
+
setFilter={setFilter}
|
|
126
|
+
columns={columns}
|
|
127
|
+
filter={filter}
|
|
128
|
+
/>
|
|
129
|
+
) : null}
|
|
128
130
|
<div ref={ref}>
|
|
129
131
|
<ResizeBar
|
|
130
132
|
widths={widths}
|
|
131
133
|
setWidths={setWidths}
|
|
132
134
|
scrollLeft={scrollLeft}
|
|
133
135
|
/>
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
<DataGrid
|
|
137
|
+
rows={rows}
|
|
138
|
+
hideFooter={rows.length < 100}
|
|
139
|
+
columns={columns}
|
|
140
|
+
disableRowSelectionOnClick
|
|
141
|
+
rowHeight={25}
|
|
142
|
+
columnHeaderHeight={35}
|
|
143
|
+
disableColumnMenu
|
|
144
|
+
slots={{ toolbar: checked ? GridToolbar : null }}
|
|
145
|
+
slotProps={{
|
|
146
|
+
toolbar: { printOptions: { disableToolbarButton: true } },
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
144
149
|
</div>
|
|
145
150
|
</BaseCard>
|
|
146
151
|
)
|
|
@@ -188,7 +188,7 @@ exports[`renders with just the required model elements 1`] = `
|
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
190
190
|
<div
|
|
191
|
-
class="css-
|
|
191
|
+
class="css-1lttu3w-container"
|
|
192
192
|
>
|
|
193
193
|
<button
|
|
194
194
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-sghohy-MuiButtonBase-root-MuiButton-root"
|
|
@@ -224,7 +224,6 @@ exports[`renders with just the required model elements 1`] = `
|
|
|
224
224
|
/>
|
|
225
225
|
</button>
|
|
226
226
|
</div>
|
|
227
|
-
<br />
|
|
228
227
|
</div>
|
|
229
228
|
</div>
|
|
230
229
|
</div>
|