@jbrowse/plugin-linear-genome-view 2.1.0 → 2.1.3
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/BaseLinearDisplay/components/BaseLinearDisplay.js +27 -54
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Block.js +17 -28
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +19 -21
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +27 -48
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.js +29 -58
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +242 -363
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +77 -129
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/LinearBareDisplay/configSchema.js +2 -2
- package/dist/LinearBareDisplay/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/model.js +13 -19
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +14 -31
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearBasicDisplay/configSchema.js +3 -3
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/model.js +119 -147
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.js +11 -12
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +30 -96
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +172 -0
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Gridlines.js +18 -20
- package/dist/LinearGenomeView/components/Gridlines.js.map +1 -1
- package/dist/LinearGenomeView/components/Header.js +26 -31
- package/dist/LinearGenomeView/components/Header.js.map +1 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +10 -11
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +91 -158
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +20 -21
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +87 -157
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/dist/LinearGenomeView/components/MiniControls.js +16 -32
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +44 -76
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +14 -8
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +94 -117
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +107 -169
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/RubberBand.js +51 -71
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -1
- package/dist/LinearGenomeView/components/Ruler.js +17 -18
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
- package/dist/LinearGenomeView/components/ScaleBar.js +37 -58
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +73 -133
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +38 -36
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +104 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.js +28 -30
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +37 -71
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +32 -49
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/ZoomControls.js +15 -32
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -1
- package/dist/LinearGenomeView/components/util.d.ts +1 -0
- package/dist/LinearGenomeView/components/util.js +28 -88
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +4 -4
- package/dist/LinearGenomeView/index.js +380 -430
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/LinearGenomeView/util.js +17 -36
- package/dist/LinearGenomeView/util.js.map +1 -1
- package/dist/index.js +75 -146
- package/dist/index.js.map +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
- package/esm/LinearGenomeView/components/{SequenceDialog.js → GetSequenceDialog.js} +4 -7
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.js +39 -42
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +2 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +2 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +4 -12
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +14 -8
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +0 -2
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +26 -6
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/RubberBand.js +0 -1
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +37 -33
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +76 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/util.d.ts +1 -0
- package/esm/LinearGenomeView/components/util.js +12 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +4 -4
- package/esm/LinearGenomeView/index.js +26 -19
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/package.json +2 -3
- package/src/LinearGenomeView/components/{SequenceDialog.tsx → GetSequenceDialog.tsx} +4 -17
- package/src/LinearGenomeView/components/ImportForm.tsx +40 -42
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +3 -3
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +4 -4
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +5 -15
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +0 -2
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +27 -8
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -1
- package/src/LinearGenomeView/components/SearchBox.tsx +39 -36
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -4
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +165 -0
- package/src/LinearGenomeView/components/TrackLabel.tsx +3 -1
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +16 -16
- package/src/LinearGenomeView/components/util.ts +12 -0
- package/src/LinearGenomeView/index.tsx +32 -25
- package/dist/LinearGenomeView/components/SequenceDialog.js +0 -242
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +0 -1
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Checkbox,
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogActions,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
Divider,
|
|
10
|
+
FormGroup,
|
|
11
|
+
FormControlLabel,
|
|
12
|
+
IconButton,
|
|
13
|
+
TextField,
|
|
14
|
+
Typography,
|
|
15
|
+
} from '@mui/material'
|
|
16
|
+
import { getSnapshot } from 'mobx-state-tree'
|
|
17
|
+
import { makeStyles } from 'tss-react/mui'
|
|
18
|
+
import { observer } from 'mobx-react'
|
|
19
|
+
import { getSession } from '@jbrowse/core/util'
|
|
20
|
+
|
|
21
|
+
// icons
|
|
22
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
23
|
+
|
|
24
|
+
// locals
|
|
25
|
+
import { LinearGenomeViewModel } from '..'
|
|
26
|
+
|
|
27
|
+
const useStyles = makeStyles()(theme => ({
|
|
28
|
+
closeButton: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
right: theme.spacing(1),
|
|
31
|
+
top: theme.spacing(1),
|
|
32
|
+
color: theme.palette.grey[500],
|
|
33
|
+
},
|
|
34
|
+
dialogContent: {
|
|
35
|
+
width: '40em',
|
|
36
|
+
},
|
|
37
|
+
}))
|
|
38
|
+
|
|
39
|
+
function SequenceDialog({
|
|
40
|
+
model,
|
|
41
|
+
handleClose,
|
|
42
|
+
}: {
|
|
43
|
+
model: LinearGenomeViewModel
|
|
44
|
+
handleClose: () => void
|
|
45
|
+
}) {
|
|
46
|
+
const { classes } = useStyles()
|
|
47
|
+
const [value, setValue] = useState('')
|
|
48
|
+
const [searchForward, setSearchForward] = useState(true)
|
|
49
|
+
const [searchReverse, setSearchReverse] = useState(true)
|
|
50
|
+
const [caseInsensitive, setCaseInsensitive] = useState(true)
|
|
51
|
+
|
|
52
|
+
let error
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
new RegExp(value)
|
|
56
|
+
} catch (e) {
|
|
57
|
+
error = e
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Dialog maxWidth="xl" open onClose={handleClose}>
|
|
62
|
+
<DialogTitle>
|
|
63
|
+
Sequence search
|
|
64
|
+
{handleClose ? (
|
|
65
|
+
<IconButton
|
|
66
|
+
className={classes.closeButton}
|
|
67
|
+
onClick={() => handleClose()}
|
|
68
|
+
size="large"
|
|
69
|
+
>
|
|
70
|
+
<CloseIcon />
|
|
71
|
+
</IconButton>
|
|
72
|
+
) : null}
|
|
73
|
+
</DialogTitle>
|
|
74
|
+
<Divider />
|
|
75
|
+
|
|
76
|
+
<DialogContent className={classes.dialogContent}>
|
|
77
|
+
<Typography>
|
|
78
|
+
Supply a sequence to search for. A track will be created with the
|
|
79
|
+
resulting matches once submitted. You can also supply regex style
|
|
80
|
+
expressions e.g. AACT(C|T).
|
|
81
|
+
</Typography>
|
|
82
|
+
<TextField
|
|
83
|
+
value={value}
|
|
84
|
+
onChange={e => setValue(e.target.value)}
|
|
85
|
+
helperText="Sequence search pattern"
|
|
86
|
+
/>
|
|
87
|
+
<FormGroup>
|
|
88
|
+
<FormControlLabel
|
|
89
|
+
control={
|
|
90
|
+
<Checkbox
|
|
91
|
+
checked={searchForward}
|
|
92
|
+
onChange={event => setSearchForward(event.target.checked)}
|
|
93
|
+
/>
|
|
94
|
+
}
|
|
95
|
+
label="Search forward strand"
|
|
96
|
+
/>
|
|
97
|
+
<FormControlLabel
|
|
98
|
+
control={
|
|
99
|
+
<Checkbox
|
|
100
|
+
checked={searchReverse}
|
|
101
|
+
onChange={event => setSearchReverse(event.target.checked)}
|
|
102
|
+
/>
|
|
103
|
+
}
|
|
104
|
+
label="Search reverse strand"
|
|
105
|
+
/>
|
|
106
|
+
<FormControlLabel
|
|
107
|
+
control={
|
|
108
|
+
<Checkbox
|
|
109
|
+
checked={caseInsensitive}
|
|
110
|
+
onChange={event => setCaseInsensitive(event.target.checked)}
|
|
111
|
+
/>
|
|
112
|
+
}
|
|
113
|
+
label="Case insensitive"
|
|
114
|
+
/>
|
|
115
|
+
</FormGroup>
|
|
116
|
+
{error ? <Typography color="error">{`${error}`}</Typography> : null}
|
|
117
|
+
</DialogContent>
|
|
118
|
+
<DialogActions>
|
|
119
|
+
<Button
|
|
120
|
+
onClick={() => {
|
|
121
|
+
if (value) {
|
|
122
|
+
const trackId = `sequence_search_${+Date.now()}`
|
|
123
|
+
const session = getSession(model)
|
|
124
|
+
const { assemblyManager } = session
|
|
125
|
+
const assemblyName = model.assemblyNames[0]
|
|
126
|
+
session.addTrackConf({
|
|
127
|
+
trackId,
|
|
128
|
+
name: `Sequence search ${value}`,
|
|
129
|
+
assemblyNames: [assemblyName],
|
|
130
|
+
type: 'FeatureTrack',
|
|
131
|
+
adapter: {
|
|
132
|
+
type: 'SequenceSearchAdapter',
|
|
133
|
+
search: value,
|
|
134
|
+
searchForward,
|
|
135
|
+
searchReverse,
|
|
136
|
+
caseInsensitive,
|
|
137
|
+
sequenceAdapter: getSnapshot(
|
|
138
|
+
assemblyManager.get(assemblyName)?.configuration.sequence
|
|
139
|
+
.adapter,
|
|
140
|
+
),
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
model.toggleTrack(trackId)
|
|
144
|
+
}
|
|
145
|
+
handleClose()
|
|
146
|
+
}}
|
|
147
|
+
variant="contained"
|
|
148
|
+
color="primary"
|
|
149
|
+
>
|
|
150
|
+
Submit
|
|
151
|
+
</Button>
|
|
152
|
+
|
|
153
|
+
<Button
|
|
154
|
+
onClick={() => handleClose()}
|
|
155
|
+
variant="contained"
|
|
156
|
+
color="secondary"
|
|
157
|
+
>
|
|
158
|
+
Close
|
|
159
|
+
</Button>
|
|
160
|
+
</DialogActions>
|
|
161
|
+
</Dialog>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export default observer(SequenceDialog)
|
|
@@ -72,7 +72,9 @@ function getTrackName(
|
|
|
72
72
|
return (
|
|
73
73
|
trackName ||
|
|
74
74
|
(asm
|
|
75
|
-
? `Reference Sequence (${
|
|
75
|
+
? `Reference Sequence (${
|
|
76
|
+
readConfObject(asm, 'displayName') || readConfObject(asm, 'name')
|
|
77
|
+
})`
|
|
76
78
|
: 'Reference Sequence')
|
|
77
79
|
)
|
|
78
80
|
}
|
|
@@ -90,7 +90,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
90
90
|
class="tss-ig8oez-headerBar"
|
|
91
91
|
>
|
|
92
92
|
<button
|
|
93
|
-
class="MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium
|
|
93
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
|
|
94
94
|
tabindex="0"
|
|
95
95
|
title="Open track selector"
|
|
96
96
|
type="button"
|
|
@@ -117,7 +117,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
117
117
|
class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
|
|
118
118
|
>
|
|
119
119
|
<button
|
|
120
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
120
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
121
121
|
tabindex="0"
|
|
122
122
|
type="button"
|
|
123
123
|
>
|
|
@@ -137,7 +137,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
137
137
|
/>
|
|
138
138
|
</button>
|
|
139
139
|
<button
|
|
140
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
140
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
141
141
|
tabindex="0"
|
|
142
142
|
type="button"
|
|
143
143
|
>
|
|
@@ -157,7 +157,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
157
157
|
/>
|
|
158
158
|
</button>
|
|
159
159
|
<div
|
|
160
|
-
class="MuiAutocomplete-root css-
|
|
160
|
+
class="MuiAutocomplete-root css-1qqsdnr-MuiAutocomplete-root"
|
|
161
161
|
data-testid="autocomplete"
|
|
162
162
|
style="width: 200px;"
|
|
163
163
|
>
|
|
@@ -166,7 +166,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
166
166
|
style="margin: 7px; min-width: 175px;"
|
|
167
167
|
>
|
|
168
168
|
<div
|
|
169
|
-
class="
|
|
169
|
+
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiAutocomplete-inputRoot css-154xyx0-MuiInputBase-root-MuiOutlinedInput-root"
|
|
170
170
|
style="padding: 0px; height: 32px; background: rgba(255, 255, 255, 0.8);"
|
|
171
171
|
>
|
|
172
172
|
<input
|
|
@@ -175,7 +175,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
175
175
|
aria-invalid="false"
|
|
176
176
|
autocapitalize="none"
|
|
177
177
|
autocomplete="off"
|
|
178
|
-
class="
|
|
178
|
+
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused css-nxo287-MuiInputBase-input-MuiOutlinedInput-input"
|
|
179
179
|
id="refNameAutocomplete-lgv"
|
|
180
180
|
placeholder="Search for location"
|
|
181
181
|
role="combobox"
|
|
@@ -265,7 +265,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
265
265
|
</svg>
|
|
266
266
|
</button>
|
|
267
267
|
<span
|
|
268
|
-
class="MuiSlider-
|
|
268
|
+
class="MuiSlider-root MuiSlider-colorPrimary MuiSlider-sizeSmall tss-1c03ro5-slider css-53tbrc-MuiSlider-root"
|
|
269
269
|
>
|
|
270
270
|
<span
|
|
271
271
|
class="MuiSlider-rail css-14pt78w-MuiSlider-rail"
|
|
@@ -275,7 +275,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
275
275
|
style="left: 0%; width: 0%;"
|
|
276
276
|
/>
|
|
277
277
|
<span
|
|
278
|
-
class="MuiSlider-
|
|
278
|
+
class="MuiSlider-thumb MuiSlider-thumbColorPrimary MuiSlider-thumbSizeSmall css-14gf62f-MuiSlider-thumb"
|
|
279
279
|
data-focusvisible="false"
|
|
280
280
|
data-index="0"
|
|
281
281
|
style="left: 0%;"
|
|
@@ -655,7 +655,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
655
655
|
class="tss-ig8oez-headerBar"
|
|
656
656
|
>
|
|
657
657
|
<button
|
|
658
|
-
class="MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium
|
|
658
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
|
|
659
659
|
tabindex="0"
|
|
660
660
|
title="Open track selector"
|
|
661
661
|
type="button"
|
|
@@ -682,7 +682,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
682
682
|
class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
|
|
683
683
|
>
|
|
684
684
|
<button
|
|
685
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
685
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
686
686
|
tabindex="0"
|
|
687
687
|
type="button"
|
|
688
688
|
>
|
|
@@ -702,7 +702,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
702
702
|
/>
|
|
703
703
|
</button>
|
|
704
704
|
<button
|
|
705
|
-
class="MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium
|
|
705
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
|
|
706
706
|
tabindex="0"
|
|
707
707
|
type="button"
|
|
708
708
|
>
|
|
@@ -722,7 +722,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
722
722
|
/>
|
|
723
723
|
</button>
|
|
724
724
|
<div
|
|
725
|
-
class="MuiAutocomplete-root css-
|
|
725
|
+
class="MuiAutocomplete-root css-1qqsdnr-MuiAutocomplete-root"
|
|
726
726
|
data-testid="autocomplete"
|
|
727
727
|
style="width: 255.27500000000003px;"
|
|
728
728
|
>
|
|
@@ -731,7 +731,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
731
731
|
style="margin: 7px; min-width: 175px;"
|
|
732
732
|
>
|
|
733
733
|
<div
|
|
734
|
-
class="
|
|
734
|
+
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiAutocomplete-inputRoot css-154xyx0-MuiInputBase-root-MuiOutlinedInput-root"
|
|
735
735
|
style="padding: 0px; height: 32px; background: rgba(255, 255, 255, 0.8);"
|
|
736
736
|
>
|
|
737
737
|
<input
|
|
@@ -740,7 +740,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
740
740
|
aria-invalid="false"
|
|
741
741
|
autocapitalize="none"
|
|
742
742
|
autocomplete="off"
|
|
743
|
-
class="
|
|
743
|
+
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused css-nxo287-MuiInputBase-input-MuiOutlinedInput-input"
|
|
744
744
|
id="refNameAutocomplete-lgv"
|
|
745
745
|
placeholder="Search for location"
|
|
746
746
|
role="combobox"
|
|
@@ -832,7 +832,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
832
832
|
/>
|
|
833
833
|
</button>
|
|
834
834
|
<span
|
|
835
|
-
class="MuiSlider-
|
|
835
|
+
class="MuiSlider-root MuiSlider-colorPrimary MuiSlider-sizeSmall tss-1c03ro5-slider css-53tbrc-MuiSlider-root"
|
|
836
836
|
>
|
|
837
837
|
<span
|
|
838
838
|
class="MuiSlider-rail css-14pt78w-MuiSlider-rail"
|
|
@@ -842,7 +842,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
842
842
|
style="left: 0%; width: 9.774680693120512%;"
|
|
843
843
|
/>
|
|
844
844
|
<span
|
|
845
|
-
class="MuiSlider-
|
|
845
|
+
class="MuiSlider-thumb MuiSlider-thumbColorPrimary MuiSlider-thumbSizeSmall css-14gf62f-MuiSlider-thumb"
|
|
846
846
|
data-focusvisible="false"
|
|
847
847
|
data-index="0"
|
|
848
848
|
style="left: 9.774680693120512%;"
|
|
@@ -51,3 +51,15 @@ export async function fetchResults({
|
|
|
51
51
|
elt => elt.getId(),
|
|
52
52
|
)
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
// splits on the last instance of a character
|
|
56
|
+
export function splitLast(str: string, split: string): [string, string] {
|
|
57
|
+
const lastIndex = str.lastIndexOf(split)
|
|
58
|
+
if (lastIndex === -1) {
|
|
59
|
+
return [str, '']
|
|
60
|
+
} else {
|
|
61
|
+
const before = str.slice(0, lastIndex)
|
|
62
|
+
const after = str.slice(lastIndex + 1)
|
|
63
|
+
return [before, after]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { lazy } from 'react'
|
|
1
2
|
import { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration'
|
|
2
3
|
import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
3
4
|
import { Region } from '@jbrowse/core/util/types'
|
|
@@ -53,6 +54,10 @@ import RefNameAutocomplete from './components/RefNameAutocomplete'
|
|
|
53
54
|
import SearchBox from './components/SearchBox'
|
|
54
55
|
import ExportSvgDlg from './components/ExportSvgDialog'
|
|
55
56
|
|
|
57
|
+
const SequenceSearchDialog = lazy(
|
|
58
|
+
() => import('./components/SequenceSearchDialog'),
|
|
59
|
+
)
|
|
60
|
+
|
|
56
61
|
export interface BpOffset {
|
|
57
62
|
refName?: string
|
|
58
63
|
index: number
|
|
@@ -396,21 +401,18 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
396
401
|
return newBpPerPx
|
|
397
402
|
},
|
|
398
403
|
|
|
399
|
-
setOffsets(left
|
|
404
|
+
setOffsets(left?: BpOffset, right?: BpOffset) {
|
|
400
405
|
// sets offsets used in the get sequence dialog
|
|
401
406
|
self.leftOffset = left
|
|
402
407
|
self.rightOffset = right
|
|
403
408
|
},
|
|
404
409
|
|
|
405
|
-
setSearchResults(
|
|
406
|
-
results: BaseResult[] | undefined,
|
|
407
|
-
query: string | undefined,
|
|
408
|
-
) {
|
|
410
|
+
setSearchResults(results?: BaseResult[], query?: string) {
|
|
409
411
|
self.searchResults = results
|
|
410
412
|
self.searchQuery = query
|
|
411
413
|
},
|
|
412
414
|
|
|
413
|
-
|
|
415
|
+
setGetSequenceDialogOpen(open: boolean) {
|
|
414
416
|
self.seqDialogDisplayed = open
|
|
415
417
|
},
|
|
416
418
|
|
|
@@ -561,8 +563,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
561
563
|
getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset) {
|
|
562
564
|
const snap = getSnapshot(self)
|
|
563
565
|
const simView = Base1DView.create({
|
|
564
|
-
|
|
565
|
-
...(snap as Omit<typeof self, symbol>),
|
|
566
|
+
...snap,
|
|
566
567
|
interRegionPaddingWidth: self.interRegionPaddingWidth,
|
|
567
568
|
})
|
|
568
569
|
|
|
@@ -718,6 +719,15 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
718
719
|
},
|
|
719
720
|
icon: FolderOpenIcon,
|
|
720
721
|
},
|
|
722
|
+
{
|
|
723
|
+
label: 'Sequence search',
|
|
724
|
+
onClick: () => {
|
|
725
|
+
getSession(self).queueDialog(handleClose => [
|
|
726
|
+
SequenceSearchDialog,
|
|
727
|
+
{ model: self, handleClose },
|
|
728
|
+
])
|
|
729
|
+
},
|
|
730
|
+
},
|
|
721
731
|
{
|
|
722
732
|
label: 'Export SVG',
|
|
723
733
|
icon: PhotoCameraIcon,
|
|
@@ -774,12 +784,23 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
774
784
|
onClick: self.toggleNoTracksActive,
|
|
775
785
|
},
|
|
776
786
|
{
|
|
777
|
-
label: 'Show
|
|
787
|
+
label: 'Show guidelines',
|
|
778
788
|
icon: VisibilityIcon,
|
|
779
789
|
type: 'checkbox',
|
|
780
790
|
checked: self.showGridlines,
|
|
781
791
|
onClick: self.toggleShowGridlines,
|
|
782
792
|
},
|
|
793
|
+
...(canShowCytobands
|
|
794
|
+
? [
|
|
795
|
+
{
|
|
796
|
+
label: 'Show ideogram',
|
|
797
|
+
icon: VisibilityIcon,
|
|
798
|
+
type: 'checkbox' as const,
|
|
799
|
+
checked: self.showCytobands,
|
|
800
|
+
onClick: () => self.setShowCytobands(!showCytobands),
|
|
801
|
+
},
|
|
802
|
+
]
|
|
803
|
+
: []),
|
|
783
804
|
{
|
|
784
805
|
label: 'Track labels',
|
|
785
806
|
icon: LabelIcon,
|
|
@@ -807,16 +828,6 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
807
828
|
},
|
|
808
829
|
],
|
|
809
830
|
},
|
|
810
|
-
...(canShowCytobands
|
|
811
|
-
? [
|
|
812
|
-
{
|
|
813
|
-
label: showCytobands ? 'Hide ideogram' : 'Show ideograms',
|
|
814
|
-
onClick: () => {
|
|
815
|
-
self.setShowCytobands(!showCytobands)
|
|
816
|
-
},
|
|
817
|
-
},
|
|
818
|
-
]
|
|
819
|
-
: []),
|
|
820
831
|
]
|
|
821
832
|
|
|
822
833
|
// add track's view level menu options
|
|
@@ -826,9 +837,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
826
837
|
{ type: 'divider' },
|
|
827
838
|
{ type: 'subHeader', label: key },
|
|
828
839
|
)
|
|
829
|
-
value.forEach(action =>
|
|
830
|
-
menuItems.push(action)
|
|
831
|
-
})
|
|
840
|
+
value.forEach(action => menuItems.push(action))
|
|
832
841
|
}
|
|
833
842
|
}
|
|
834
843
|
|
|
@@ -1164,9 +1173,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1164
1173
|
{
|
|
1165
1174
|
label: 'Get sequence',
|
|
1166
1175
|
icon: MenuOpenIcon,
|
|
1167
|
-
onClick: () =>
|
|
1168
|
-
self.setSequenceDialogOpen(true)
|
|
1169
|
-
},
|
|
1176
|
+
onClick: () => self.setGetSequenceDialogOpen(true),
|
|
1170
1177
|
},
|
|
1171
1178
|
]
|
|
1172
1179
|
},
|