jbrowse-plugin-msaview 2.4.2 → 2.4.4
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/LaunchMsaView/components/LaunchMsaViewDialog.js +3 -4
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchPanelContent.d.ts +5 -0
- package/dist/LaunchMsaView/components/LaunchPanelContent.js +16 -0
- package/dist/LaunchMsaView/components/LaunchPanelContent.js.map +1 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +22 -25
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +12 -24
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.d.ts +7 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js +10 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +23 -32
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +9 -15
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.d.ts +3 -2
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.d.ts +25 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +22 -32
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +2 -9
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +30 -29
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js +8 -6
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +1 -1
- package/dist/LaunchMsaView/components/SubmitCancelActions.d.ts +8 -0
- package/dist/LaunchMsaView/components/SubmitCancelActions.js +12 -0
- package/dist/LaunchMsaView/components/SubmitCancelActions.js.map +1 -0
- package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +3 -13
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +10 -12
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
- package/dist/LaunchMsaView/util.d.ts +4 -1
- package/dist/LaunchMsaView/util.js +29 -24
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +1 -0
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +26 -25
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/{LaunchMsaView/components/PreLoadedMSA/consts.d.ts → utils/swrConfig.d.ts} +1 -1
- package/dist/{LaunchMsaView/components/PreLoadedMSA/consts.js → utils/swrConfig.js} +2 -2
- package/dist/utils/swrConfig.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -10
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +9 -6
- package/src/LaunchMsaView/components/LaunchPanelContent.tsx +27 -0
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +28 -60
- package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +21 -33
- package/src/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.tsx +37 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +29 -75
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +10 -31
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.tsx +5 -3
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.tsx +5 -2
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.tsx +28 -78
- package/src/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.ts +2 -10
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +34 -57
- package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +17 -8
- package/src/LaunchMsaView/components/SubmitCancelActions.tsx +41 -0
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +3 -3
- package/src/LaunchMsaView/components/useSWRFeatureSequence.ts +6 -15
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +13 -15
- package/src/LaunchMsaView/util.ts +35 -25
- package/src/MsaViewPanel/util.ts +3 -3
- package/src/{LaunchMsaView/components/PreLoadedMSA/consts.ts → utils/swrConfig.ts} +1 -1
- package/src/version.ts +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/consts.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const staticSwrConfig = {
|
|
2
2
|
revalidateOnFocus: false,
|
|
3
3
|
revalidateOnReconnect: false,
|
|
4
4
|
revalidateIfStale: false,
|
|
@@ -6,4 +6,4 @@ export const swrFlags = {
|
|
|
6
6
|
refreshWhenOffline: false,
|
|
7
7
|
shouldRetryOnError: false,
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=swrConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swrConfig.js","sourceRoot":"","sources":["../../src/utils/swrConfig.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,iBAAiB,EAAE,KAAK;IACxB,qBAAqB,EAAE,KAAK;IAC5B,iBAAiB,EAAE,KAAK;IACxB,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,KAAK;CAC1B,CAAA"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.4.
|
|
1
|
+
export declare const version = "2.4.4";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.4.
|
|
1
|
+
export const version = '2.4.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.4.
|
|
2
|
+
"version": "2.4.4",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "jbrowse-plugin-msaview",
|
|
5
5
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/styled": "^11.14.1",
|
|
20
|
-
"g2p_mapper": "^2.
|
|
20
|
+
"g2p_mapper": "^2.1.5",
|
|
21
21
|
"idb": "^8.0.3",
|
|
22
22
|
"pako-esm2": "^2.0.2",
|
|
23
23
|
"react-msaview": "^5.0.16",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@mui/icons-material": "^7.3.11",
|
|
34
34
|
"@mui/material": "^7.3.11",
|
|
35
35
|
"@mui/system": "^7.3.11",
|
|
36
|
-
"@mui/x-data-grid": "^8.28.
|
|
37
|
-
"@types/node": "^25.
|
|
38
|
-
"@types/react": "^19.2.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
40
|
-
"@typescript-eslint/parser": "^8.59.
|
|
36
|
+
"@mui/x-data-grid": "^8.28.7",
|
|
37
|
+
"@types/node": "^25.9.1",
|
|
38
|
+
"@types/react": "^19.2.15",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
40
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
41
41
|
"esbuild": "^0.28.0",
|
|
42
|
-
"eslint": "^10.
|
|
42
|
+
"eslint": "^10.4.0",
|
|
43
43
|
"eslint-plugin-import-x": "^4.16.2",
|
|
44
44
|
"eslint-plugin-react": "^7.37.5",
|
|
45
45
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"serve": "^14.2.6",
|
|
57
57
|
"tss-react": "^4.9.21",
|
|
58
58
|
"typescript": "^6.0.3",
|
|
59
|
-
"typescript-eslint": "^8.59.
|
|
60
|
-
"vitest": "^4.1.
|
|
59
|
+
"typescript-eslint": "^8.59.4",
|
|
60
|
+
"vitest": "^4.1.7"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"clean": "rimraf dist",
|
|
@@ -25,15 +25,18 @@ export default function LaunchMsaViewDialog({
|
|
|
25
25
|
const datasets = readMsaDatasets(session.jbrowse)
|
|
26
26
|
const hasPreloadedDatasets = !!datasets?.length
|
|
27
27
|
|
|
28
|
-
const [value, setValue] = useState
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setValue(newValue)
|
|
32
|
-
}
|
|
28
|
+
const [value, setValue] = useState<
|
|
29
|
+
'ncbi_blast' | 'preloaded_msa' | 'manual_msa'
|
|
30
|
+
>('ncbi_blast')
|
|
33
31
|
|
|
34
32
|
return (
|
|
35
33
|
<Dialog maxWidth="xl" title="Launch MSA view" open onClose={handleClose}>
|
|
36
|
-
<Tabs
|
|
34
|
+
<Tabs
|
|
35
|
+
value={value}
|
|
36
|
+
onChange={(_event, newValue) => {
|
|
37
|
+
setValue(newValue)
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
37
40
|
<Tab label="NCBI BLAST query" value="ncbi_blast" />
|
|
38
41
|
{hasPreloadedDatasets ? (
|
|
39
42
|
<Tab label="Pre-loaded MSA datasets" value="preloaded_msa" />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
+
import { DialogContent } from '@mui/material'
|
|
5
|
+
import { makeStyles } from 'tss-react/mui'
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
dialogContent: {
|
|
9
|
+
width: '80em',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export default function LaunchPanelContent({
|
|
14
|
+
error,
|
|
15
|
+
children,
|
|
16
|
+
}: {
|
|
17
|
+
error?: unknown
|
|
18
|
+
children: React.ReactNode
|
|
19
|
+
}) {
|
|
20
|
+
const { classes } = useStyles()
|
|
21
|
+
return (
|
|
22
|
+
<DialogContent className={classes.dialogContent}>
|
|
23
|
+
{error ? <ErrorMessage error={error} /> : null}
|
|
24
|
+
{children}
|
|
25
|
+
</DialogContent>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { FileSelector } from '@jbrowse/core/ui'
|
|
4
|
+
import { getSession } from '@jbrowse/core/util'
|
|
5
5
|
import {
|
|
6
6
|
Alert,
|
|
7
|
-
Button,
|
|
8
|
-
DialogActions,
|
|
9
|
-
DialogContent,
|
|
10
7
|
FormControl,
|
|
11
8
|
FormControlLabel,
|
|
12
9
|
Radio,
|
|
@@ -17,7 +14,9 @@ import { makeStyles } from 'tss-react/mui'
|
|
|
17
14
|
|
|
18
15
|
import { launchView } from './launchView'
|
|
19
16
|
import TextField2 from '../../../components/TextField2'
|
|
20
|
-
import { getGeneDisplayName } from '../../util'
|
|
17
|
+
import { getGeneDisplayName, getLinearGenomeView } from '../../util'
|
|
18
|
+
import LaunchPanelContent from '../LaunchPanelContent'
|
|
19
|
+
import SubmitCancelActions from '../SubmitCancelActions'
|
|
21
20
|
import TranscriptSelector from '../TranscriptSelector'
|
|
22
21
|
import { useTranscriptSelection } from '../useTranscriptSelection'
|
|
23
22
|
|
|
@@ -26,12 +25,8 @@ import type {
|
|
|
26
25
|
Feature,
|
|
27
26
|
FileLocation,
|
|
28
27
|
} from '@jbrowse/core/util'
|
|
29
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
30
28
|
|
|
31
29
|
const useStyles = makeStyles()({
|
|
32
|
-
dialogContent: {
|
|
33
|
-
width: '80em',
|
|
34
|
-
},
|
|
35
30
|
textAreaFont: {
|
|
36
31
|
fontFamily: 'Courier New',
|
|
37
32
|
},
|
|
@@ -62,7 +57,7 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
62
57
|
handleClose: () => void
|
|
63
58
|
}) {
|
|
64
59
|
const session = getSession(model)
|
|
65
|
-
const view =
|
|
60
|
+
const view = getLinearGenomeView(model)
|
|
66
61
|
const { classes } = useStyles()
|
|
67
62
|
const [launchViewError, setLaunchViewError] = useState<unknown>()
|
|
68
63
|
const [inputMethod, setInputMethod] = useState<'file' | 'text'>('file')
|
|
@@ -71,20 +66,13 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
71
66
|
const [msaFileLocation, setMsaFileLocation] = useState<FileLocation>()
|
|
72
67
|
const [treeFileLocation, setTreeFileLocation] = useState<FileLocation>()
|
|
73
68
|
const [querySeqName, setQuerySeqName] = useState('')
|
|
74
|
-
const {
|
|
75
|
-
|
|
76
|
-
selectedId,
|
|
77
|
-
setSelectedId,
|
|
78
|
-
selectedTranscript,
|
|
79
|
-
proteinSequence,
|
|
80
|
-
error,
|
|
81
|
-
} = useTranscriptSelection({ feature, view })
|
|
69
|
+
const transcriptSelection = useTranscriptSelection({ feature, view })
|
|
70
|
+
const { selectedTranscript, error } = transcriptSelection
|
|
82
71
|
|
|
83
72
|
const e = launchViewError ?? error
|
|
84
73
|
return (
|
|
85
74
|
<>
|
|
86
|
-
<
|
|
87
|
-
{e ? <ErrorMessage error={e} /> : null}
|
|
75
|
+
<LaunchPanelContent error={e}>
|
|
88
76
|
<FormControl component="fieldset">
|
|
89
77
|
<RadioGroup
|
|
90
78
|
row
|
|
@@ -155,14 +143,7 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
155
143
|
)}
|
|
156
144
|
</div>
|
|
157
145
|
|
|
158
|
-
<TranscriptSelector
|
|
159
|
-
feature={feature}
|
|
160
|
-
options={options}
|
|
161
|
-
selectedId={selectedId}
|
|
162
|
-
selectedTranscript={selectedTranscript}
|
|
163
|
-
onTranscriptChange={setSelectedId}
|
|
164
|
-
proteinSequence={proteinSequence}
|
|
165
|
-
/>
|
|
146
|
+
<TranscriptSelector feature={feature} {...transcriptSelection} />
|
|
166
147
|
|
|
167
148
|
<TextField2
|
|
168
149
|
variant="outlined"
|
|
@@ -185,25 +166,23 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
185
166
|
highlights will not work.
|
|
186
167
|
</Alert>
|
|
187
168
|
) : null}
|
|
188
|
-
</
|
|
169
|
+
</LaunchPanelContent>
|
|
189
170
|
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
onClick={() => {
|
|
200
|
-
try {
|
|
171
|
+
<SubmitCancelActions
|
|
172
|
+
submitDisabled={
|
|
173
|
+
!selectedTranscript ||
|
|
174
|
+
(inputMethod === 'file' && !msaFileLocation) ||
|
|
175
|
+
(inputMethod === 'text' && !msaText.trim())
|
|
176
|
+
}
|
|
177
|
+
onSubmit={() => {
|
|
178
|
+
try {
|
|
179
|
+
if (selectedTranscript) {
|
|
201
180
|
setLaunchViewError(undefined)
|
|
202
181
|
launchView({
|
|
203
182
|
session,
|
|
204
183
|
newViewTitle: getGeneDisplayName(selectedTranscript),
|
|
205
184
|
view,
|
|
206
|
-
feature: selectedTranscript
|
|
185
|
+
feature: selectedTranscript,
|
|
207
186
|
querySeqName: querySeqName.trim(),
|
|
208
187
|
...(inputMethod === 'file'
|
|
209
188
|
? {
|
|
@@ -217,26 +196,15 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
217
196
|
},
|
|
218
197
|
}),
|
|
219
198
|
})
|
|
220
|
-
|
|
221
199
|
handleClose()
|
|
222
|
-
} catch (err) {
|
|
223
|
-
console.error(err)
|
|
224
|
-
setLaunchViewError(err)
|
|
225
200
|
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
onClick={() => {
|
|
234
|
-
handleClose()
|
|
235
|
-
}}
|
|
236
|
-
>
|
|
237
|
-
Cancel
|
|
238
|
-
</Button>
|
|
239
|
-
</DialogActions>
|
|
201
|
+
} catch (err) {
|
|
202
|
+
console.error(err)
|
|
203
|
+
setLaunchViewError(err)
|
|
204
|
+
}
|
|
205
|
+
}}
|
|
206
|
+
onCancel={handleClose}
|
|
207
|
+
/>
|
|
240
208
|
</>
|
|
241
209
|
)
|
|
242
210
|
})
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
-
import { getContainingView } from '@jbrowse/core/util'
|
|
5
4
|
import DeleteIcon from '@mui/icons-material/Delete'
|
|
6
5
|
import {
|
|
7
6
|
Button,
|
|
@@ -17,11 +16,10 @@ import { makeStyles } from 'tss-react/mui'
|
|
|
17
16
|
|
|
18
17
|
import { blastLaunchViewFromCache } from './blastLaunchView'
|
|
19
18
|
import { useCachedBlastResults } from './useCachedBlastResults'
|
|
20
|
-
import { getGeneIdentifiers } from '../../util'
|
|
19
|
+
import { getGeneIdentifiers, getLinearGenomeView } from '../../util'
|
|
21
20
|
|
|
22
21
|
import type { CachedBlastResult } from '../../../utils/blastCache'
|
|
23
22
|
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
24
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
25
23
|
|
|
26
24
|
const useStyles = makeStyles()({
|
|
27
25
|
header: {
|
|
@@ -37,17 +35,15 @@ const useStyles = makeStyles()({
|
|
|
37
35
|
})
|
|
38
36
|
|
|
39
37
|
function getResultDisplayName(result: CachedBlastResult): string {
|
|
40
|
-
const parts = [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
return parts.join(' - ')
|
|
38
|
+
const parts = [
|
|
39
|
+
result.geneName,
|
|
40
|
+
result.transcriptName !== result.geneName
|
|
41
|
+
? result.transcriptName
|
|
42
|
+
: undefined,
|
|
43
|
+
].filter((p): p is string => !!p)
|
|
44
|
+
return parts.length > 0
|
|
45
|
+
? parts.join(' - ')
|
|
46
|
+
: (result.geneId ?? result.transcriptId ?? 'Unknown')
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
const CachedBlastResults = observer(function ({
|
|
@@ -60,7 +56,7 @@ const CachedBlastResults = observer(function ({
|
|
|
60
56
|
feature: Feature
|
|
61
57
|
}) {
|
|
62
58
|
const { classes } = useStyles()
|
|
63
|
-
const view =
|
|
59
|
+
const view = getLinearGenomeView(model)
|
|
64
60
|
const [operationError, setOperationError] = useState<unknown>()
|
|
65
61
|
|
|
66
62
|
const geneIds = useMemo(() => getGeneIdentifiers(feature), [feature])
|
|
@@ -78,24 +74,16 @@ const CachedBlastResults = observer(function ({
|
|
|
78
74
|
}
|
|
79
75
|
|
|
80
76
|
const displayError = error ?? operationError
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<Typography color="textSecondary">
|
|
92
|
-
No cached BLAST results found for this gene. Run a BLAST query to cache
|
|
93
|
-
results.
|
|
94
|
-
</Typography>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return (
|
|
77
|
+
return displayError ? (
|
|
78
|
+
<ErrorMessage error={displayError} />
|
|
79
|
+
) : isLoading ? (
|
|
80
|
+
<Typography>Loading cached results...</Typography>
|
|
81
|
+
) : results.length === 0 ? (
|
|
82
|
+
<Typography color="textSecondary">
|
|
83
|
+
No cached BLAST results found for this gene. Run a BLAST query to cache
|
|
84
|
+
results.
|
|
85
|
+
</Typography>
|
|
86
|
+
) : (
|
|
99
87
|
<div>
|
|
100
88
|
<div className={classes.header}>
|
|
101
89
|
<Typography variant="subtitle1">
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { MenuItem } from '@mui/material'
|
|
4
|
+
|
|
5
|
+
import { msaAlgorithms } from './consts'
|
|
6
|
+
import TextField2 from '../../../components/TextField2'
|
|
7
|
+
|
|
8
|
+
import type { MsaAlgorithm } from './consts'
|
|
9
|
+
|
|
10
|
+
export default function MsaAlgorithmSelect({
|
|
11
|
+
value,
|
|
12
|
+
onChange,
|
|
13
|
+
className,
|
|
14
|
+
}: {
|
|
15
|
+
value: MsaAlgorithm
|
|
16
|
+
onChange: (val: MsaAlgorithm) => void
|
|
17
|
+
className?: string
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<TextField2
|
|
21
|
+
variant="outlined"
|
|
22
|
+
label="MSA Algorithm"
|
|
23
|
+
className={className}
|
|
24
|
+
select
|
|
25
|
+
value={value}
|
|
26
|
+
onChange={event => {
|
|
27
|
+
onChange(event.target.value as MsaAlgorithm)
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{msaAlgorithms.map(val => (
|
|
31
|
+
<MenuItem value={val} key={val}>
|
|
32
|
+
{val}
|
|
33
|
+
</MenuItem>
|
|
34
|
+
))}
|
|
35
|
+
</TextField2>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
-
import { getContainingView } from '@jbrowse/core/util'
|
|
5
3
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
|
6
4
|
import {
|
|
7
5
|
Accordion,
|
|
8
6
|
AccordionDetails,
|
|
9
7
|
AccordionSummary,
|
|
10
|
-
Button,
|
|
11
|
-
DialogActions,
|
|
12
|
-
DialogContent,
|
|
13
8
|
MenuItem,
|
|
14
9
|
Typography,
|
|
15
10
|
} from '@mui/material'
|
|
@@ -17,26 +12,25 @@ import { observer } from 'mobx-react'
|
|
|
17
12
|
import { makeStyles } from 'tss-react/mui'
|
|
18
13
|
|
|
19
14
|
import CachedBlastResults from './CachedBlastResults'
|
|
15
|
+
import MsaAlgorithmSelect from './MsaAlgorithmSelect'
|
|
20
16
|
import { blastLaunchView } from './blastLaunchView'
|
|
21
|
-
import { blastDatabaseOptions, blastPrograms
|
|
17
|
+
import { blastDatabaseOptions, blastPrograms } from './consts'
|
|
22
18
|
import { useCachedBlastResults } from './useCachedBlastResults'
|
|
23
19
|
import TextField2 from '../../../components/TextField2'
|
|
24
20
|
import {
|
|
25
|
-
|
|
21
|
+
getBlastViewTitle,
|
|
26
22
|
getGeneIdentifiers,
|
|
27
|
-
|
|
23
|
+
getLinearGenomeView,
|
|
28
24
|
} from '../../util'
|
|
25
|
+
import LaunchPanelContent from '../LaunchPanelContent'
|
|
26
|
+
import SubmitCancelActions from '../SubmitCancelActions'
|
|
29
27
|
import TranscriptSelector from '../TranscriptSelector'
|
|
30
28
|
import { useTranscriptSelection } from '../useTranscriptSelection'
|
|
31
29
|
|
|
32
30
|
import type { BlastDatabase, BlastProgram, MsaAlgorithm } from './consts'
|
|
33
31
|
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
34
|
-
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
35
32
|
|
|
36
33
|
const useStyles = makeStyles()({
|
|
37
|
-
dialogContent: {
|
|
38
|
-
width: '80em',
|
|
39
|
-
},
|
|
40
34
|
selectField: {
|
|
41
35
|
width: 150,
|
|
42
36
|
},
|
|
@@ -69,7 +63,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
69
63
|
children: React.ReactNode
|
|
70
64
|
}) {
|
|
71
65
|
const { classes } = useStyles()
|
|
72
|
-
const view =
|
|
66
|
+
const view = getLinearGenomeView(model)
|
|
73
67
|
const [launchViewError, setLaunchViewError] = useState<unknown>()
|
|
74
68
|
const [selectedBlastDatabase, setSelectedBlastDatabase] =
|
|
75
69
|
useState<BlastDatabase>('nr')
|
|
@@ -82,20 +76,13 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
82
76
|
const { results: cachedResults, error: cachedResultsError } =
|
|
83
77
|
useCachedBlastResults(geneIds)
|
|
84
78
|
|
|
85
|
-
const {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
setSelectedId,
|
|
89
|
-
selectedTranscript,
|
|
90
|
-
proteinSequence,
|
|
91
|
-
error: proteinSequenceError,
|
|
92
|
-
} = useTranscriptSelection({ feature, view })
|
|
93
|
-
const e = proteinSequenceError ?? launchViewError ?? cachedResultsError
|
|
79
|
+
const transcriptSelection = useTranscriptSelection({ feature, view })
|
|
80
|
+
const { selectedTranscript, proteinSequence } = transcriptSelection
|
|
81
|
+
const e = transcriptSelection.error ?? launchViewError ?? cachedResultsError
|
|
94
82
|
return (
|
|
95
83
|
<>
|
|
96
|
-
<
|
|
84
|
+
<LaunchPanelContent error={e}>
|
|
97
85
|
{children}
|
|
98
|
-
{e ? <ErrorMessage error={e} /> : null}
|
|
99
86
|
<TextField2
|
|
100
87
|
variant="outlined"
|
|
101
88
|
label="BLAST database"
|
|
@@ -117,22 +104,11 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
117
104
|
))}
|
|
118
105
|
</TextField2>
|
|
119
106
|
|
|
120
|
-
<
|
|
121
|
-
variant="outlined"
|
|
122
|
-
label="MSA Algorithm"
|
|
107
|
+
<MsaAlgorithmSelect
|
|
123
108
|
className={classes.selectField}
|
|
124
|
-
select
|
|
125
109
|
value={selectedMsaAlgorithm}
|
|
126
|
-
onChange={
|
|
127
|
-
|
|
128
|
-
}}
|
|
129
|
-
>
|
|
130
|
-
{msaAlgorithms.map(val => (
|
|
131
|
-
<MenuItem value={val} key={val}>
|
|
132
|
-
{val}
|
|
133
|
-
</MenuItem>
|
|
134
|
-
))}
|
|
135
|
-
</TextField2>
|
|
110
|
+
onChange={setSelectedMsaAlgorithm}
|
|
111
|
+
/>
|
|
136
112
|
|
|
137
113
|
<div className={classes.databaseFieldContainer}>
|
|
138
114
|
<TextField2
|
|
@@ -162,14 +138,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
162
138
|
) : null}
|
|
163
139
|
</div>
|
|
164
140
|
|
|
165
|
-
<TranscriptSelector
|
|
166
|
-
feature={feature}
|
|
167
|
-
options={options}
|
|
168
|
-
selectedId={selectedId}
|
|
169
|
-
selectedTranscript={selectedTranscript}
|
|
170
|
-
onTranscriptChange={setSelectedId}
|
|
171
|
-
proteinSequence={proteinSequence}
|
|
172
|
-
/>
|
|
141
|
+
<TranscriptSelector feature={feature} {...transcriptSelection} />
|
|
173
142
|
|
|
174
143
|
<Typography className={classes.infoText}>
|
|
175
144
|
This panel will automatically submit a query to NCBI. Using blastp can
|
|
@@ -196,21 +165,17 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
196
165
|
</AccordionDetails>
|
|
197
166
|
</Accordion>
|
|
198
167
|
) : null}
|
|
199
|
-
</
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
try {
|
|
206
|
-
if (!selectedTranscript) {
|
|
207
|
-
return
|
|
208
|
-
}
|
|
168
|
+
</LaunchPanelContent>
|
|
169
|
+
<SubmitCancelActions
|
|
170
|
+
submitDisabled={!proteinSequence}
|
|
171
|
+
onSubmit={() => {
|
|
172
|
+
try {
|
|
173
|
+
if (selectedTranscript) {
|
|
209
174
|
setLaunchViewError(undefined)
|
|
210
175
|
blastLaunchView({
|
|
211
176
|
feature: selectedTranscript,
|
|
212
177
|
view,
|
|
213
|
-
newViewTitle:
|
|
178
|
+
newViewTitle: getBlastViewTitle(feature, selectedTranscript),
|
|
214
179
|
blastParams: {
|
|
215
180
|
baseUrl,
|
|
216
181
|
blastProgram: selectedBlastProgram,
|
|
@@ -221,25 +186,14 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
221
186
|
},
|
|
222
187
|
})
|
|
223
188
|
handleClose()
|
|
224
|
-
} catch (e) {
|
|
225
|
-
console.error(e)
|
|
226
|
-
setLaunchViewError(e)
|
|
227
189
|
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
variant="contained"
|
|
236
|
-
onClick={() => {
|
|
237
|
-
handleClose()
|
|
238
|
-
}}
|
|
239
|
-
>
|
|
240
|
-
Cancel
|
|
241
|
-
</Button>
|
|
242
|
-
</DialogActions>
|
|
190
|
+
} catch (e) {
|
|
191
|
+
console.error(e)
|
|
192
|
+
setLaunchViewError(e)
|
|
193
|
+
}
|
|
194
|
+
}}
|
|
195
|
+
onCancel={handleClose}
|
|
196
|
+
/>
|
|
243
197
|
</>
|
|
244
198
|
)
|
|
245
199
|
})
|