jbrowse-plugin-msaview 2.2.11 → 2.3.2
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/AddHighlightModel/index.d.ts +1 -1
- package/dist/AddHighlightModel/index.js.map +1 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.d.ts +2 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +1 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +1 -1
- package/dist/BgzipFastaMsaAdapter/configSchema.d.ts +1 -1
- package/dist/BgzipFastaMsaAdapter/configSchema.js.map +1 -1
- package/dist/BgzipFastaMsaAdapter/index.d.ts +1 -1
- package/dist/BgzipFastaMsaAdapter/index.js.map +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.d.ts +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.d.ts +1 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.d.ts +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.d.ts +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.d.ts +1 -2
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +21 -14
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.d.ts +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +32 -35
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.d.ts +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +2 -2
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.d.ts +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.d.ts +2 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.d.ts +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +6 -8
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.d.ts +2 -2
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.d.ts +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +3 -3
- package/dist/LaunchMsaView/components/TranscriptSelector.js +4 -4
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.d.ts +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +1 -2
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
- package/dist/LaunchMsaView/components/util.js +1 -1
- package/dist/LaunchMsaView/components/util.js.map +1 -1
- package/dist/LaunchMsaView/index.d.ts +1 -1
- package/dist/LaunchMsaView/index.js.map +1 -1
- package/dist/LaunchMsaView/util.d.ts +1 -0
- package/dist/LaunchMsaView/util.js +10 -0
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +10 -0
- package/dist/MsaViewPanel/afterCreateAutoruns.js +258 -0
- package/dist/MsaViewPanel/afterCreateAutoruns.js.map +1 -0
- package/dist/MsaViewPanel/blosum62.d.ts +2 -0
- package/dist/MsaViewPanel/blosum62.js +628 -0
- package/dist/MsaViewPanel/blosum62.js.map +1 -0
- package/dist/MsaViewPanel/components/LoadingBLAST.d.ts +1 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.d.ts +1 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
- package/dist/MsaViewPanel/doLaunchBlast.d.ts +1 -1
- package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
- package/dist/MsaViewPanel/genomeToMSA.d.ts +1 -1
- package/dist/MsaViewPanel/genomeToMSA.js.map +1 -1
- package/dist/MsaViewPanel/index.d.ts +1 -1
- package/dist/MsaViewPanel/index.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +25 -39
- package/dist/MsaViewPanel/model.js +17 -309
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/msaDataStore.d.ts +3 -4
- package/dist/MsaViewPanel/msaDataStore.js +59 -173
- package/dist/MsaViewPanel/msaDataStore.js.map +1 -1
- package/dist/MsaViewPanel/pairwiseAlignment.d.ts +0 -7
- package/dist/MsaViewPanel/pairwiseAlignment.js +1 -636
- package/dist/MsaViewPanel/pairwiseAlignment.js.map +1 -1
- package/dist/MsaViewPanel/structureConnection.js +1 -5
- package/dist/MsaViewPanel/structureConnection.js.map +1 -1
- package/dist/MsaViewPanel/util.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +30 -30
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/msa.js +35 -77
- package/dist/utils/msa.js.map +1 -1
- package/dist/utils/ncbiBlast.js +1 -10
- package/dist/utils/ncbiBlast.js.map +1 -1
- package/package.json +31 -28
- package/src/AddHighlightModel/index.tsx +1 -1
- package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +3 -4
- package/src/BgzipFastaMsaAdapter/configSchema.ts +2 -1
- package/src/BgzipFastaMsaAdapter/index.ts +2 -1
- package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +2 -6
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +2 -1
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +2 -1
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +6 -7
- package/src/LaunchMsaView/components/ManualMSALoader/launchView.ts +5 -2
- package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +22 -17
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +40 -52
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.tsx +6 -13
- package/src/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.ts +2 -1
- package/src/LaunchMsaView/components/NCBIBlastQuery/consts.ts +2 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +7 -19
- package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +2 -2
- package/src/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.ts +1 -2
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +7 -6
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +1 -6
- package/src/LaunchMsaView/components/util.ts +1 -1
- package/src/LaunchMsaView/index.ts +6 -5
- package/src/LaunchMsaView/util.ts +11 -0
- package/src/MsaViewPanel/afterCreateAutoruns.ts +299 -0
- package/src/MsaViewPanel/blosum62.ts +628 -0
- package/src/MsaViewPanel/components/LoadingBLAST.tsx +2 -1
- package/src/MsaViewPanel/components/MsaViewPanel.tsx +2 -1
- package/src/MsaViewPanel/doLaunchBlast.ts +1 -1
- package/src/MsaViewPanel/genomeToMSA.ts +2 -1
- package/src/MsaViewPanel/index.ts +2 -1
- package/src/MsaViewPanel/model.ts +30 -392
- package/src/MsaViewPanel/msaDataStore.ts +56 -196
- package/src/MsaViewPanel/pairwiseAlignment.ts +1 -637
- package/src/MsaViewPanel/structureConnection.ts +1 -5
- package/src/MsaViewPanel/util.ts +1 -1
- package/src/index.ts +4 -2
- package/src/utils/msa.ts +45 -100
- package/src/utils/ncbiBlast.ts +3 -13
- package/CHANGELOG.md +0 -101
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
-
import {
|
|
5
|
-
AbstractTrackModel,
|
|
6
|
-
Feature,
|
|
7
|
-
getContainingView,
|
|
8
|
-
} from '@jbrowse/core/util'
|
|
4
|
+
import { getContainingView } from '@jbrowse/core/util'
|
|
9
5
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
|
10
6
|
import {
|
|
11
7
|
Accordion,
|
|
@@ -22,40 +18,47 @@ import { makeStyles } from 'tss-react/mui'
|
|
|
22
18
|
|
|
23
19
|
import CachedBlastResults from './CachedBlastResults'
|
|
24
20
|
import { blastLaunchView } from './blastLaunchView'
|
|
21
|
+
import { msaAlgorithms } from './consts'
|
|
25
22
|
import TextField2 from '../../../components/TextField2'
|
|
26
23
|
import { getAllCachedResults } from '../../../utils/blastCache'
|
|
27
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
getGeneDisplayName,
|
|
26
|
+
getGeneIdentifiers,
|
|
27
|
+
getTranscriptDisplayName,
|
|
28
|
+
} from '../../util'
|
|
28
29
|
import TranscriptSelector from '../TranscriptSelector'
|
|
29
30
|
import { useTranscriptSelection } from '../useTranscriptSelection'
|
|
30
31
|
|
|
32
|
+
import type { MsaAlgorithm } from './consts'
|
|
33
|
+
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
31
34
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
32
35
|
|
|
33
|
-
function getGeneIdentifiers(feature: Feature): string[] {
|
|
34
|
-
const ids = [
|
|
35
|
-
feature.id(),
|
|
36
|
-
feature.get('id'),
|
|
37
|
-
feature.get('name'),
|
|
38
|
-
feature.get('gene_id'),
|
|
39
|
-
feature.get('gene_name'),
|
|
40
|
-
].filter((id): id is string => !!id)
|
|
41
|
-
return [...new Set(ids)]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
36
|
const useStyles = makeStyles()({
|
|
45
37
|
dialogContent: {
|
|
46
38
|
width: '80em',
|
|
47
39
|
},
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
selectField: {
|
|
41
|
+
width: 150,
|
|
42
|
+
},
|
|
43
|
+
databaseFieldContainer: {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
},
|
|
46
|
+
clusterSeqMessage: {
|
|
47
|
+
marginLeft: 4,
|
|
48
|
+
alignContent: 'center',
|
|
49
|
+
},
|
|
50
|
+
cachedResultsAccordion: {
|
|
51
|
+
marginTop: 20,
|
|
52
|
+
},
|
|
53
|
+
infoText: {
|
|
54
|
+
marginTop: 20,
|
|
50
55
|
},
|
|
51
56
|
})
|
|
52
57
|
|
|
53
58
|
const blastDatabaseOptions = ['nr', 'nr_cluster_seq'] as const
|
|
54
|
-
const msaAlgorithms = ['clustalo', 'muscle', 'kalign', 'mafft'] as const
|
|
55
59
|
const blastPrograms = ['blastp', 'quick-blastp'] as const
|
|
56
60
|
|
|
57
61
|
type blastDatabaseOptionsT = (typeof blastDatabaseOptions)[number]
|
|
58
|
-
type msaAlgorithmsT = (typeof msaAlgorithms)[number]
|
|
59
62
|
type blastProgramsT = (typeof blastPrograms)[number]
|
|
60
63
|
|
|
61
64
|
const NCBIBlastAutomaticPanel = observer(function ({
|
|
@@ -77,7 +80,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
77
80
|
const [selectedBlastDatabase, setSelectedBlastDatabase] =
|
|
78
81
|
useState<blastDatabaseOptionsT>('nr')
|
|
79
82
|
const [selectedMsaAlgorithm, setSelectedMsaAlgorithm] =
|
|
80
|
-
useState<
|
|
83
|
+
useState<MsaAlgorithm>('clustalo')
|
|
81
84
|
const [selectedBlastProgram, setSelectedBlastProgram] =
|
|
82
85
|
useState<blastProgramsT>('quick-blastp')
|
|
83
86
|
const [hasCachedResults, setHasCachedResults] = useState(false)
|
|
@@ -107,14 +110,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
107
110
|
proteinSequence,
|
|
108
111
|
error: proteinSequenceError,
|
|
109
112
|
} = useTranscriptSelection({ feature, view })
|
|
110
|
-
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (selectedBlastDatabase === 'nr_cluster_seq') {
|
|
113
|
-
setSelectedBlastProgram('blastp')
|
|
114
|
-
}
|
|
115
|
-
}, [selectedBlastDatabase])
|
|
116
113
|
const e = proteinSequenceError ?? launchViewError ?? error
|
|
117
|
-
const style = { width: 150 }
|
|
118
114
|
return (
|
|
119
115
|
<>
|
|
120
116
|
<DialogContent className={classes.dialogContent}>
|
|
@@ -123,13 +119,16 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
123
119
|
<TextField2
|
|
124
120
|
variant="outlined"
|
|
125
121
|
label="BLAST database"
|
|
126
|
-
|
|
122
|
+
className={classes.selectField}
|
|
127
123
|
select
|
|
128
124
|
value={selectedBlastDatabase}
|
|
129
125
|
onChange={event => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
)
|
|
126
|
+
const newDb = event.target
|
|
127
|
+
.value as (typeof blastDatabaseOptions)[number]
|
|
128
|
+
setSelectedBlastDatabase(newDb)
|
|
129
|
+
if (newDb === 'nr_cluster_seq') {
|
|
130
|
+
setSelectedBlastProgram('blastp')
|
|
131
|
+
}
|
|
133
132
|
}}
|
|
134
133
|
>
|
|
135
134
|
{blastDatabaseOptions.map(val => (
|
|
@@ -142,13 +141,11 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
142
141
|
<TextField2
|
|
143
142
|
variant="outlined"
|
|
144
143
|
label="MSA Algorithm"
|
|
145
|
-
|
|
144
|
+
className={classes.selectField}
|
|
146
145
|
select
|
|
147
146
|
value={selectedMsaAlgorithm}
|
|
148
147
|
onChange={event => {
|
|
149
|
-
setSelectedMsaAlgorithm(
|
|
150
|
-
event.target.value as (typeof msaAlgorithms)[number],
|
|
151
|
-
)
|
|
148
|
+
setSelectedMsaAlgorithm(event.target.value as MsaAlgorithm)
|
|
152
149
|
}}
|
|
153
150
|
>
|
|
154
151
|
{msaAlgorithms.map(val => (
|
|
@@ -158,12 +155,12 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
158
155
|
))}
|
|
159
156
|
</TextField2>
|
|
160
157
|
|
|
161
|
-
<div
|
|
158
|
+
<div className={classes.databaseFieldContainer}>
|
|
162
159
|
<TextField2
|
|
163
160
|
variant="outlined"
|
|
164
161
|
label="BLAST program"
|
|
165
162
|
disabled={selectedBlastDatabase === 'nr_cluster_seq'}
|
|
166
|
-
|
|
163
|
+
className={classes.selectField}
|
|
167
164
|
select
|
|
168
165
|
value={selectedBlastProgram}
|
|
169
166
|
onChange={event => {
|
|
@@ -181,10 +178,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
181
178
|
{selectedBlastDatabase === 'nr_cluster_seq' ? (
|
|
182
179
|
<Typography
|
|
183
180
|
variant="subtitle2"
|
|
184
|
-
|
|
185
|
-
marginLeft: 4,
|
|
186
|
-
alignContent: 'center',
|
|
187
|
-
}}
|
|
181
|
+
className={classes.clusterSeqMessage}
|
|
188
182
|
>
|
|
189
183
|
Can only use blastp on nr_cluster_seq
|
|
190
184
|
</Typography>
|
|
@@ -200,7 +194,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
200
194
|
proteinSequence={proteinSequence}
|
|
201
195
|
/>
|
|
202
196
|
|
|
203
|
-
<Typography
|
|
197
|
+
<Typography className={classes.infoText}>
|
|
204
198
|
This panel will automatically submit a query to NCBI. Using blastp can
|
|
205
199
|
take 10+ minutes to run, quick-blastp is generally a lot faster but is
|
|
206
200
|
not available for the clustered database. After completion, all the
|
|
@@ -212,7 +206,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
212
206
|
</Typography>
|
|
213
207
|
|
|
214
208
|
{hasCachedResults ? (
|
|
215
|
-
<Accordion
|
|
209
|
+
<Accordion className={classes.cachedResultsAccordion}>
|
|
216
210
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
|
217
211
|
<Typography>Previous BLAST Results</Typography>
|
|
218
212
|
</AccordionSummary>
|
|
@@ -260,13 +254,7 @@ const NCBIBlastAutomaticPanel = observer(function ({
|
|
|
260
254
|
>
|
|
261
255
|
Submit
|
|
262
256
|
</Button>
|
|
263
|
-
<Button
|
|
264
|
-
color="secondary"
|
|
265
|
-
variant="contained"
|
|
266
|
-
onClick={() => {
|
|
267
|
-
handleClose()
|
|
268
|
-
}}
|
|
269
|
-
>
|
|
257
|
+
<Button color="secondary" variant="contained" onClick={handleClose}>
|
|
270
258
|
Cancel
|
|
271
259
|
</Button>
|
|
272
260
|
</DialogActions>
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
-
import {
|
|
5
|
-
AbstractTrackModel,
|
|
6
|
-
Feature,
|
|
7
|
-
getContainingView,
|
|
8
|
-
} from '@jbrowse/core/util'
|
|
4
|
+
import { getContainingView } from '@jbrowse/core/util'
|
|
9
5
|
import {
|
|
10
6
|
Button,
|
|
11
7
|
DialogActions,
|
|
@@ -17,12 +13,15 @@ import { observer } from 'mobx-react'
|
|
|
17
13
|
import { makeStyles } from 'tss-react/mui'
|
|
18
14
|
|
|
19
15
|
import { blastLaunchView } from './blastLaunchView'
|
|
16
|
+
import { msaAlgorithms } from './consts'
|
|
20
17
|
import ExternalLink from '../../../components/ExternalLink'
|
|
21
18
|
import TextField2 from '../../../components/TextField2'
|
|
22
19
|
import { getGeneDisplayName, getTranscriptDisplayName } from '../../util'
|
|
23
20
|
import TranscriptSelector from '../TranscriptSelector'
|
|
24
21
|
import { useTranscriptSelection } from '../useTranscriptSelection'
|
|
25
22
|
|
|
23
|
+
import type { MsaAlgorithm } from './consts'
|
|
24
|
+
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
26
25
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
27
26
|
|
|
28
27
|
const useStyles = makeStyles()({
|
|
@@ -31,10 +30,6 @@ const useStyles = makeStyles()({
|
|
|
31
30
|
},
|
|
32
31
|
})
|
|
33
32
|
|
|
34
|
-
const msaAlgorithms = ['clustalo', 'muscle', 'kalign', 'mafft'] as const
|
|
35
|
-
|
|
36
|
-
type msaAlgorithmsT = (typeof msaAlgorithms)[number]
|
|
37
|
-
|
|
38
33
|
const NCBIBlastRIDPanel = observer(function ({
|
|
39
34
|
handleClose,
|
|
40
35
|
feature,
|
|
@@ -53,7 +48,7 @@ const NCBIBlastRIDPanel = observer(function ({
|
|
|
53
48
|
const [launchViewError, setLaunchViewError] = useState<unknown>()
|
|
54
49
|
const [rid, setRid] = useState('')
|
|
55
50
|
const [selectedMsaAlgorithm, setSelectedMsaAlgorithm] =
|
|
56
|
-
useState<
|
|
51
|
+
useState<MsaAlgorithm>('clustalo')
|
|
57
52
|
|
|
58
53
|
const {
|
|
59
54
|
options,
|
|
@@ -108,9 +103,7 @@ const NCBIBlastRIDPanel = observer(function ({
|
|
|
108
103
|
select
|
|
109
104
|
value={selectedMsaAlgorithm}
|
|
110
105
|
onChange={event => {
|
|
111
|
-
setSelectedMsaAlgorithm(
|
|
112
|
-
event.target.value as (typeof msaAlgorithms)[number],
|
|
113
|
-
)
|
|
106
|
+
setSelectedMsaAlgorithm(event.target.value as MsaAlgorithm)
|
|
114
107
|
}}
|
|
115
108
|
>
|
|
116
109
|
{msaAlgorithms.map(val => (
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSession } from '@jbrowse/core/util'
|
|
2
2
|
|
|
3
3
|
import type { JBrowsePluginMsaViewModel } from '../../../MsaViewPanel/model'
|
|
4
4
|
import type { CachedBlastResult } from '../../../utils/blastCache'
|
|
5
|
+
import type { Feature } from '@jbrowse/core/util'
|
|
5
6
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
6
7
|
|
|
7
8
|
export function blastLaunchView({
|
|
@@ -2,13 +2,7 @@ import React, { useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { readConfObject } from '@jbrowse/core/configuration'
|
|
4
4
|
import { ErrorMessage, LoadingEllipses, SanitizedHTML } from '@jbrowse/core/ui'
|
|
5
|
-
import {
|
|
6
|
-
AbstractTrackModel,
|
|
7
|
-
Feature,
|
|
8
|
-
getContainingView,
|
|
9
|
-
getEnv,
|
|
10
|
-
getSession,
|
|
11
|
-
} from '@jbrowse/core/util'
|
|
5
|
+
import { getContainingView, getEnv, getSession } from '@jbrowse/core/util'
|
|
12
6
|
import { Button, DialogActions, DialogContent, MenuItem } from '@mui/material'
|
|
13
7
|
import { observer } from 'mobx-react'
|
|
14
8
|
import useSWR from 'swr'
|
|
@@ -21,8 +15,9 @@ import { useTranscriptSelection } from '../useTranscriptSelection'
|
|
|
21
15
|
import { swrFlags } from './consts'
|
|
22
16
|
import { fetchMSA, fetchMSAList } from './fetchMSAData'
|
|
23
17
|
import { preCalculatedLaunchView } from './preCalculatedLaunchView'
|
|
24
|
-
import { Dataset } from './types'
|
|
25
18
|
|
|
19
|
+
import type { Dataset } from './types'
|
|
20
|
+
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
26
21
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
27
22
|
|
|
28
23
|
const useStyles = makeStyles()({
|
|
@@ -31,7 +26,7 @@ const useStyles = makeStyles()({
|
|
|
31
26
|
},
|
|
32
27
|
})
|
|
33
28
|
|
|
34
|
-
const PreLoadedMSA = observer(function
|
|
29
|
+
const PreLoadedMSA = observer(function ({
|
|
35
30
|
model,
|
|
36
31
|
feature,
|
|
37
32
|
handleClose,
|
|
@@ -78,7 +73,6 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
78
73
|
selectedTranscript,
|
|
79
74
|
proteinSequence,
|
|
80
75
|
error: proteinSequenceError,
|
|
81
|
-
validSet,
|
|
82
76
|
} = useTranscriptSelection({ feature, view, validIds: msaList })
|
|
83
77
|
|
|
84
78
|
const {
|
|
@@ -87,7 +81,7 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
87
81
|
error: msaDataFetchError,
|
|
88
82
|
} = useSWR(
|
|
89
83
|
selectedId && selectedDatasetId
|
|
90
|
-
? `${
|
|
84
|
+
? `${selectedDatasetId}-${selectedId}-${msaList?.length}-msa`
|
|
91
85
|
: 'none-msa',
|
|
92
86
|
() =>
|
|
93
87
|
selectedId && selectedDataset && msaList
|
|
@@ -150,7 +144,7 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
150
144
|
selectedTranscript={selectedTranscript}
|
|
151
145
|
onTranscriptChange={setSelectedId}
|
|
152
146
|
proteinSequence={proteinSequence}
|
|
153
|
-
|
|
147
|
+
validIds={msaList}
|
|
154
148
|
/>
|
|
155
149
|
</div>
|
|
156
150
|
) : null}
|
|
@@ -189,13 +183,7 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
189
183
|
>
|
|
190
184
|
Submit
|
|
191
185
|
</Button>
|
|
192
|
-
<Button
|
|
193
|
-
color="secondary"
|
|
194
|
-
variant="contained"
|
|
195
|
-
onClick={() => {
|
|
196
|
-
handleClose()
|
|
197
|
-
}}
|
|
198
|
-
>
|
|
186
|
+
<Button color="secondary" variant="contained" onClick={handleClose}>
|
|
199
187
|
Cancel
|
|
200
188
|
</Button>
|
|
201
189
|
</DialogActions>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration'
|
|
2
1
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
3
|
-
import { Feature } from '@jbrowse/core/util'
|
|
4
2
|
|
|
5
3
|
import type PluginManager from '@jbrowse/core/PluginManager'
|
|
4
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration'
|
|
5
|
+
import type { Feature } from '@jbrowse/core/util'
|
|
6
6
|
|
|
7
7
|
export async function fetchMSAList({
|
|
8
8
|
config,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AbstractSessionModel, Feature } from '@jbrowse/core/util'
|
|
2
|
-
|
|
1
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util'
|
|
3
2
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
4
3
|
|
|
5
4
|
export function preCalculatedLaunchView({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Feature } from '@jbrowse/core/util'
|
|
4
3
|
import { Button, MenuItem, TextField } from '@mui/material'
|
|
5
4
|
import { makeStyles } from 'tss-react/mui'
|
|
6
5
|
|
|
@@ -13,6 +12,8 @@ import {
|
|
|
13
12
|
getTranscriptLength,
|
|
14
13
|
} from '../util'
|
|
15
14
|
|
|
15
|
+
import type { Feature } from '@jbrowse/core/util'
|
|
16
|
+
|
|
16
17
|
const useStyles = makeStyles()({
|
|
17
18
|
flex: {
|
|
18
19
|
display: 'flex',
|
|
@@ -29,7 +30,7 @@ export default function TranscriptSelector({
|
|
|
29
30
|
selectedTranscript,
|
|
30
31
|
onTranscriptChange,
|
|
31
32
|
proteinSequence,
|
|
32
|
-
|
|
33
|
+
validIds,
|
|
33
34
|
}: {
|
|
34
35
|
feature: Feature
|
|
35
36
|
options: Feature[]
|
|
@@ -37,7 +38,7 @@ export default function TranscriptSelector({
|
|
|
37
38
|
selectedTranscript: Feature | undefined
|
|
38
39
|
onTranscriptChange: (transcriptId: string) => void
|
|
39
40
|
proteinSequence: string | undefined
|
|
40
|
-
|
|
41
|
+
validIds?: string[]
|
|
41
42
|
}) {
|
|
42
43
|
const { classes } = useStyles()
|
|
43
44
|
const [showSequence, setShowSequence] = useState(false)
|
|
@@ -56,15 +57,15 @@ export default function TranscriptSelector({
|
|
|
56
57
|
}}
|
|
57
58
|
>
|
|
58
59
|
{options.map(val => {
|
|
59
|
-
const inSet =
|
|
60
|
-
?
|
|
60
|
+
const inSet = validIds
|
|
61
|
+
? validIds.some(id => featureMatchesId(val, id))
|
|
61
62
|
: true
|
|
62
63
|
const { len, mod } = getTranscriptLength(val)
|
|
63
64
|
return (
|
|
64
65
|
<MenuItem value={getId(val)} key={val.id()} disabled={!inSet}>
|
|
65
66
|
{getTranscriptDisplayName(val)} ({len} aa){' '}
|
|
66
67
|
{mod ? ` (possible fragment)` : ''}
|
|
67
|
-
{
|
|
68
|
+
{validIds ? (inSet ? ' (has data)' : ' (no data)') : ''}
|
|
68
69
|
</MenuItem>
|
|
69
70
|
)
|
|
70
71
|
})}
|
|
@@ -26,11 +26,6 @@ export function useTranscriptSelection({
|
|
|
26
26
|
feature: selectedTranscript,
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
const validSet = useMemo(
|
|
30
|
-
() => (validIds ? new Set(validIds) : undefined),
|
|
31
|
-
[validIds],
|
|
32
|
-
)
|
|
33
|
-
|
|
34
29
|
useEffect(() => {
|
|
35
30
|
if (validIds && validIds.length > 0) {
|
|
36
31
|
const currentFeature = options.find(opt => getId(opt) === selectedId)
|
|
@@ -52,6 +47,6 @@ export function useTranscriptSelection({
|
|
|
52
47
|
selectedTranscript,
|
|
53
48
|
proteinSequence,
|
|
54
49
|
error,
|
|
55
|
-
|
|
50
|
+
validIds,
|
|
56
51
|
}
|
|
57
52
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PluggableElementType } from '@jbrowse/core/pluggableElementTypes'
|
|
3
|
-
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
4
|
-
import { MenuItem } from '@jbrowse/core/ui'
|
|
5
|
-
import { Feature, getContainingTrack, getSession } from '@jbrowse/core/util'
|
|
1
|
+
import { getContainingTrack, getSession } from '@jbrowse/core/util'
|
|
6
2
|
import AddIcon from '@mui/icons-material/Add'
|
|
7
3
|
|
|
8
4
|
import LaunchMsaViewDialog from './components/LaunchMsaViewDialog'
|
|
9
5
|
|
|
6
|
+
import type PluginManager from '@jbrowse/core/PluginManager'
|
|
7
|
+
import type { PluggableElementType } from '@jbrowse/core/pluggableElementTypes'
|
|
8
|
+
import type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
9
|
+
import type { MenuItem } from '@jbrowse/core/ui'
|
|
10
|
+
import type { Feature } from '@jbrowse/core/util'
|
|
10
11
|
import type { IAnyModelType } from '@jbrowse/mobx-state-tree'
|
|
11
12
|
|
|
12
13
|
function isDisplay(elt: { name: string }): elt is DisplayType {
|
|
@@ -85,3 +85,14 @@ export function getSortedTranscriptFeatures(feature: Feature) {
|
|
|
85
85
|
export function cleanProteinSequence(seq: string) {
|
|
86
86
|
return seq.replaceAll('*', '').replaceAll('&', '')
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
export function getGeneIdentifiers(feature: Feature): string[] {
|
|
90
|
+
const ids = [
|
|
91
|
+
feature.id(),
|
|
92
|
+
feature.get('id'),
|
|
93
|
+
feature.get('name'),
|
|
94
|
+
feature.get('gene_id'),
|
|
95
|
+
feature.get('gene_name'),
|
|
96
|
+
].filter((id): id is string => !!id)
|
|
97
|
+
return [...new Set(ids)]
|
|
98
|
+
}
|