@jbrowse/plugin-alignments 1.6.6 → 1.6.9
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/BamAdapter/BamSlightlyLazyFeature.d.ts +1 -10
- package/dist/BamAdapter/MismatchParser.d.ts +3 -5
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +1 -2
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +2 -2
- package/dist/PileupRenderer/PileupRenderer.d.ts +20 -6
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +3 -11
- package/dist/plugin-alignments.cjs.development.js +591 -552
- package/dist/plugin-alignments.cjs.development.js.map +1 -1
- package/dist/plugin-alignments.cjs.production.min.js +1 -1
- package/dist/plugin-alignments.cjs.production.min.js.map +1 -1
- package/dist/plugin-alignments.esm.js +594 -555
- package/dist/plugin-alignments.esm.js.map +1 -1
- package/dist/util.d.ts +4 -0
- package/package.json +3 -3
- package/src/BamAdapter/BamAdapter.ts +10 -7
- package/src/BamAdapter/BamSlightlyLazyFeature.ts +11 -79
- package/src/BamAdapter/MismatchParser.test.ts +53 -297
- package/src/BamAdapter/MismatchParser.ts +54 -116
- package/src/BamAdapter/configSchema.ts +0 -4
- package/src/CramAdapter/CramSlightlyLazyFeature.ts +3 -10
- package/src/LinearAlignmentsDisplay/models/model.tsx +4 -6
- package/src/LinearPileupDisplay/components/ColorByModifications.tsx +76 -80
- package/src/LinearPileupDisplay/components/ColorByTag.tsx +24 -23
- package/src/LinearPileupDisplay/components/FilterByTag.tsx +73 -68
- package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +28 -26
- package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +24 -13
- package/src/LinearPileupDisplay/components/SortByTag.tsx +29 -21
- package/src/LinearPileupDisplay/model.ts +6 -0
- package/src/PileupRenderer/PileupRenderer.tsx +178 -57
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +180 -229
- package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +12 -11
- package/src/util.ts +25 -0
|
@@ -3,6 +3,7 @@ import { observer } from 'mobx-react'
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
5
|
Dialog,
|
|
6
|
+
DialogActions,
|
|
6
7
|
DialogContent,
|
|
7
8
|
DialogTitle,
|
|
8
9
|
IconButton,
|
|
@@ -16,9 +17,6 @@ import {
|
|
|
16
17
|
import CloseIcon from '@material-ui/icons/Close'
|
|
17
18
|
|
|
18
19
|
const useStyles = makeStyles(theme => ({
|
|
19
|
-
root: {
|
|
20
|
-
width: 500,
|
|
21
|
-
},
|
|
22
20
|
paper: {
|
|
23
21
|
padding: theme.spacing(2),
|
|
24
22
|
margin: theme.spacing(2),
|
|
@@ -123,74 +121,74 @@ function FilterByTagDlg(props: {
|
|
|
123
121
|
Set filter bitmask options. Refer to <Link href={site}>{site}</Link>{' '}
|
|
124
122
|
for details
|
|
125
123
|
</Typography>
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
<div
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
<Bitmask flag={flagInclude} setFlag={setFlagInclude} />
|
|
132
|
-
</div>
|
|
133
|
-
<div>
|
|
134
|
-
<Typography>Read must have NONE of these flags</Typography>
|
|
135
|
-
<Bitmask flag={flagExclude} setFlag={setFlagExclude} />
|
|
136
|
-
</div>
|
|
124
|
+
<Paper className={classes.paper} variant="outlined">
|
|
125
|
+
<div style={{ display: 'flex' }}>
|
|
126
|
+
<div>
|
|
127
|
+
<Typography>Read must have ALL these flags</Typography>
|
|
128
|
+
<Bitmask flag={flagInclude} setFlag={setFlagInclude} />
|
|
137
129
|
</div>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
130
|
+
<div>
|
|
131
|
+
<Typography>Read must have NONE of these flags</Typography>
|
|
132
|
+
<Bitmask flag={flagExclude} setFlag={setFlagExclude} />
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</Paper>
|
|
136
|
+
<Paper className={classes.paper} variant="outlined">
|
|
137
|
+
<Typography>
|
|
138
|
+
Filter by tag name and value. Use * in the value field to get all
|
|
139
|
+
reads containing any value for that tag. Example: filter tag name SA
|
|
140
|
+
with value * to get all split/supplementary reads. Other examples
|
|
141
|
+
include HP for haplotype, or RG for read group
|
|
142
|
+
</Typography>
|
|
143
|
+
<TextField
|
|
144
|
+
className={classes.field}
|
|
145
|
+
value={tag}
|
|
146
|
+
onChange={event => {
|
|
147
|
+
setTag(event.target.value)
|
|
148
|
+
}}
|
|
149
|
+
placeholder="Enter tag name"
|
|
150
|
+
inputProps={{
|
|
151
|
+
maxLength: 2,
|
|
152
|
+
'data-testid': 'color-tag-name-input',
|
|
153
|
+
}}
|
|
154
|
+
error={tag.length === 2 && !validTag}
|
|
155
|
+
helperText={tag.length === 2 && !validTag ? 'Not a valid tag' : ''}
|
|
156
|
+
data-testid="color-tag-name"
|
|
157
|
+
/>
|
|
158
|
+
<TextField
|
|
159
|
+
className={classes.field}
|
|
160
|
+
value={tagValue}
|
|
161
|
+
onChange={event => {
|
|
162
|
+
setTagValue(event.target.value)
|
|
163
|
+
}}
|
|
164
|
+
placeholder="Enter tag value"
|
|
165
|
+
inputProps={{
|
|
166
|
+
'data-testid': 'color-tag-name-input',
|
|
167
|
+
}}
|
|
168
|
+
data-testid="color-tag-value"
|
|
169
|
+
/>
|
|
170
|
+
</Paper>
|
|
171
|
+
<Paper className={classes.paper} variant="outlined">
|
|
172
|
+
<Typography>Filter by read name</Typography>
|
|
173
|
+
<TextField
|
|
174
|
+
className={classes.field}
|
|
175
|
+
value={readName}
|
|
176
|
+
onChange={event => {
|
|
177
|
+
setReadName(event.target.value)
|
|
178
|
+
}}
|
|
179
|
+
placeholder="Enter read name"
|
|
180
|
+
inputProps={{
|
|
181
|
+
'data-testid': 'color-tag-readname-input',
|
|
182
|
+
}}
|
|
183
|
+
data-testid="color-tag-readname"
|
|
184
|
+
/>
|
|
185
|
+
</Paper>
|
|
186
|
+
<DialogActions>
|
|
191
187
|
<Button
|
|
192
188
|
variant="contained"
|
|
193
189
|
color="primary"
|
|
190
|
+
autoFocus
|
|
191
|
+
type="submit"
|
|
194
192
|
onClick={() => {
|
|
195
193
|
model.setFilterBy({
|
|
196
194
|
flagInclude,
|
|
@@ -209,7 +207,14 @@ function FilterByTagDlg(props: {
|
|
|
209
207
|
>
|
|
210
208
|
Submit
|
|
211
209
|
</Button>
|
|
212
|
-
|
|
210
|
+
<Button
|
|
211
|
+
variant="contained"
|
|
212
|
+
color="secondary"
|
|
213
|
+
onClick={() => handleClose()}
|
|
214
|
+
>
|
|
215
|
+
Cancel
|
|
216
|
+
</Button>
|
|
217
|
+
</DialogActions>
|
|
213
218
|
</DialogContent>
|
|
214
219
|
</Dialog>
|
|
215
220
|
)
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Typography,
|
|
7
7
|
IconButton,
|
|
8
8
|
Dialog,
|
|
9
|
+
DialogActions,
|
|
9
10
|
DialogContent,
|
|
10
11
|
DialogTitle,
|
|
11
12
|
Checkbox,
|
|
@@ -15,9 +16,6 @@ import {
|
|
|
15
16
|
import CloseIcon from '@material-ui/icons/Close'
|
|
16
17
|
|
|
17
18
|
const useStyles = makeStyles(theme => ({
|
|
18
|
-
root: {
|
|
19
|
-
margin: theme.spacing(4),
|
|
20
|
-
},
|
|
21
19
|
closeButton: {
|
|
22
20
|
position: 'absolute',
|
|
23
21
|
right: theme.spacing(1),
|
|
@@ -42,7 +40,6 @@ function SetFeatureHeightDlg(props: {
|
|
|
42
40
|
const classes = useStyles()
|
|
43
41
|
const { model, handleClose } = props
|
|
44
42
|
const { featureHeightSetting, noSpacing: noSpacingSetting } = model
|
|
45
|
-
|
|
46
43
|
const [height, setHeight] = useState(`${featureHeightSetting}`)
|
|
47
44
|
const [noSpacing, setNoSpacing] = useState(noSpacingSetting)
|
|
48
45
|
|
|
@@ -60,44 +57,49 @@ function SetFeatureHeightDlg(props: {
|
|
|
60
57
|
<Typography>
|
|
61
58
|
Adjust the feature height and whether there is any spacing between
|
|
62
59
|
features. Setting feature height to 1 and removing spacing makes the
|
|
63
|
-
display very compact
|
|
60
|
+
display very compact.
|
|
64
61
|
</Typography>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
<TextField
|
|
63
|
+
value={height}
|
|
64
|
+
helperText="Feature height"
|
|
65
|
+
onChange={event => {
|
|
66
|
+
setHeight(event.target.value)
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
<FormControlLabel
|
|
70
|
+
control={
|
|
71
|
+
<Checkbox
|
|
72
|
+
checked={!!noSpacing}
|
|
73
|
+
onChange={() => setNoSpacing(val => !val)}
|
|
74
|
+
/>
|
|
75
|
+
}
|
|
76
|
+
label="Remove spacing between features in y-direction?"
|
|
77
|
+
/>
|
|
78
|
+
<DialogActions>
|
|
83
79
|
<Button
|
|
84
80
|
variant="contained"
|
|
85
81
|
color="primary"
|
|
86
82
|
type="submit"
|
|
87
|
-
|
|
83
|
+
autoFocus
|
|
88
84
|
disabled={!ok}
|
|
89
85
|
onClick={() => {
|
|
90
86
|
model.setFeatureHeight(
|
|
91
87
|
height !== '' && !Number.isNaN(+height) ? +height : undefined,
|
|
92
88
|
)
|
|
93
89
|
model.setNoSpacing(noSpacing)
|
|
94
|
-
|
|
95
90
|
handleClose()
|
|
96
91
|
}}
|
|
97
92
|
>
|
|
98
93
|
Submit
|
|
99
94
|
</Button>
|
|
100
|
-
|
|
95
|
+
<Button
|
|
96
|
+
variant="contained"
|
|
97
|
+
color="secondary"
|
|
98
|
+
onClick={() => handleClose()}
|
|
99
|
+
>
|
|
100
|
+
Cancel
|
|
101
|
+
</Button>
|
|
102
|
+
</DialogActions>
|
|
101
103
|
</DialogContent>
|
|
102
104
|
</Dialog>
|
|
103
105
|
)
|
|
@@ -3,6 +3,7 @@ import { observer } from 'mobx-react'
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
5
|
Dialog,
|
|
6
|
+
DialogActions,
|
|
6
7
|
DialogContent,
|
|
7
8
|
DialogTitle,
|
|
8
9
|
IconButton,
|
|
@@ -41,7 +42,7 @@ function SetMaxHeightDlg(props: {
|
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<Dialog open onClose={handleClose}>
|
|
44
|
-
<DialogTitle
|
|
45
|
+
<DialogTitle>
|
|
45
46
|
Filter options
|
|
46
47
|
<IconButton
|
|
47
48
|
aria-label="close"
|
|
@@ -51,21 +52,24 @@ function SetMaxHeightDlg(props: {
|
|
|
51
52
|
<CloseIcon />
|
|
52
53
|
</IconButton>
|
|
53
54
|
</DialogTitle>
|
|
54
|
-
<DialogContent>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
<DialogContent className={classes.root}>
|
|
56
|
+
<Typography>
|
|
57
|
+
Set max height for the track. For example, you can increase this if
|
|
58
|
+
the layout says "Max height reached"
|
|
59
|
+
</Typography>
|
|
60
|
+
<TextField
|
|
61
|
+
value={max}
|
|
62
|
+
onChange={event => {
|
|
63
|
+
setMax(event.target.value)
|
|
64
|
+
}}
|
|
65
|
+
placeholder="Enter max height for layout"
|
|
66
|
+
/>
|
|
67
|
+
<DialogActions>
|
|
64
68
|
<Button
|
|
65
69
|
variant="contained"
|
|
66
70
|
color="primary"
|
|
67
71
|
type="submit"
|
|
68
|
-
|
|
72
|
+
autoFocus
|
|
69
73
|
onClick={() => {
|
|
70
74
|
model.setMaxHeight(
|
|
71
75
|
max !== '' && !Number.isNaN(+max) ? +max : undefined,
|
|
@@ -75,7 +79,14 @@ function SetMaxHeightDlg(props: {
|
|
|
75
79
|
>
|
|
76
80
|
Submit
|
|
77
81
|
</Button>
|
|
78
|
-
|
|
82
|
+
<Button
|
|
83
|
+
variant="contained"
|
|
84
|
+
color="secondary"
|
|
85
|
+
onClick={() => handleClose()}
|
|
86
|
+
>
|
|
87
|
+
Cancel
|
|
88
|
+
</Button>
|
|
89
|
+
</DialogActions>
|
|
79
90
|
</DialogContent>
|
|
80
91
|
</Dialog>
|
|
81
92
|
)
|
|
@@ -3,6 +3,7 @@ import { observer } from 'mobx-react'
|
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
5
|
Dialog,
|
|
6
|
+
DialogActions,
|
|
6
7
|
DialogContent,
|
|
7
8
|
DialogTitle,
|
|
8
9
|
IconButton,
|
|
@@ -47,29 +48,29 @@ function SortByTagDlg(props: {
|
|
|
47
48
|
</IconButton>
|
|
48
49
|
</DialogTitle>
|
|
49
50
|
<DialogContent>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
data-testid="sort-tag-name"
|
|
69
|
-
/>
|
|
51
|
+
<Typography>Set the tag to sort by</Typography>
|
|
52
|
+
<Typography color="textSecondary">
|
|
53
|
+
Examples: HP for haplotype, RG for read group, etc.
|
|
54
|
+
</Typography>
|
|
55
|
+
<TextField
|
|
56
|
+
value={tag}
|
|
57
|
+
onChange={event => setTag(event.target.value)}
|
|
58
|
+
placeholder="Enter tag name"
|
|
59
|
+
inputProps={{
|
|
60
|
+
maxLength: 2,
|
|
61
|
+
'data-testid': 'sort-tag-name-input',
|
|
62
|
+
}}
|
|
63
|
+
error={tag.length === 2 && !validTag}
|
|
64
|
+
helperText={tag.length === 2 && !validTag ? 'Not a valid tag' : ''}
|
|
65
|
+
autoComplete="off"
|
|
66
|
+
data-testid="sort-tag-name"
|
|
67
|
+
/>
|
|
68
|
+
<DialogActions>
|
|
70
69
|
<Button
|
|
71
70
|
variant="contained"
|
|
72
71
|
color="primary"
|
|
72
|
+
type="submit"
|
|
73
|
+
autoFocus
|
|
73
74
|
onClick={() => {
|
|
74
75
|
model.setSortedBy('tag', tag)
|
|
75
76
|
handleClose()
|
|
@@ -77,7 +78,14 @@ function SortByTagDlg(props: {
|
|
|
77
78
|
>
|
|
78
79
|
Submit
|
|
79
80
|
</Button>
|
|
80
|
-
|
|
81
|
+
<Button
|
|
82
|
+
variant="contained"
|
|
83
|
+
color="secondary"
|
|
84
|
+
onClick={() => handleClose()}
|
|
85
|
+
>
|
|
86
|
+
Cancel
|
|
87
|
+
</Button>
|
|
88
|
+
</DialogActions>
|
|
81
89
|
</DialogContent>
|
|
82
90
|
</Dialog>
|
|
83
91
|
)
|
|
@@ -506,6 +506,12 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
506
506
|
self.setColorScheme({ type: 'perBaseQuality' })
|
|
507
507
|
},
|
|
508
508
|
},
|
|
509
|
+
{
|
|
510
|
+
label: 'Per-base lettering',
|
|
511
|
+
onClick: () => {
|
|
512
|
+
self.setColorScheme({ type: 'perBaseLettering' })
|
|
513
|
+
},
|
|
514
|
+
},
|
|
509
515
|
{
|
|
510
516
|
label: 'Modifications or methylation',
|
|
511
517
|
onClick: () => {
|