jbrowse-plugin-msaview 2.3.3 → 2.3.8
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/README.md +15 -216
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +2 -11
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +19 -4
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +39 -53
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +9 -22
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +4 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js +8 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +15 -7
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js +8 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.d.ts +7 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +32 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +7 -2
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/TabPanel.js +1 -1
- package/dist/LaunchMsaView/components/TabPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/TranscriptSelector.js +7 -3
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +15 -14
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.js +17 -18
- package/dist/MsaViewPanel/afterCreateAutoruns.js.map +1 -1
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js +15 -10
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js.map +1 -1
- package/dist/MsaViewPanel/components/ErrorBoundary.d.ts +19 -0
- package/dist/MsaViewPanel/components/ErrorBoundary.js +22 -0
- package/dist/MsaViewPanel/components/ErrorBoundary.js.map +1 -0
- package/dist/MsaViewPanel/components/MsaViewPanel.js +11 -2
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +2 -14
- package/dist/MsaViewPanel/model.js +13 -10
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/pairwiseAlignment.js +15 -10
- package/dist/MsaViewPanel/pairwiseAlignment.js.map +1 -1
- package/dist/MsaViewPanel/structureConnection.d.ts +22 -0
- package/dist/MsaViewPanel/structureConnection.js +4 -0
- package/dist/MsaViewPanel/structureConnection.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +26 -26
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/blastCache.js +2 -3
- package/dist/utils/blastCache.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +33 -35
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +1 -2
- package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +2 -11
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +22 -7
- package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +40 -58
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +14 -23
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +4 -1
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.tsx +9 -1
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.tsx +15 -8
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.tsx +9 -1
- package/src/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.ts +52 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +11 -2
- package/src/LaunchMsaView/components/TabPanel.tsx +1 -1
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +7 -3
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +25 -17
- package/src/MsaViewPanel/afterCreateAutoruns.ts +17 -18
- package/src/MsaViewPanel/components/ConnectStructureDialog.tsx +23 -25
- package/src/MsaViewPanel/components/ErrorBoundary.tsx +40 -0
- package/src/MsaViewPanel/components/MsaViewPanel.tsx +22 -11
- package/src/MsaViewPanel/model.ts +49 -33
- package/src/MsaViewPanel/pairwiseAlignment.ts +15 -10
- package/src/MsaViewPanel/structureConnection.ts +23 -0
- package/src/utils/blastCache.ts +2 -3
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -39,231 +39,30 @@ https://jbrowse.org/code/jb2/main/index.html?config=https://unpkg.com/jbrowse-pl
|
|
|
39
39
|
- Clustal files (e.g. .aln file, uses clustal-js parser)
|
|
40
40
|
- Newick (tree can be loaded separately as a .nh file)
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Publication
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
automatically stored in the browser's IndexedDB to enable persistence across
|
|
46
|
-
page refreshes. This works around a limitation in react-msaview that strips
|
|
47
|
-
large data from session snapshots.
|
|
44
|
+
If you find this tool useful please cite our work
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
Diesh, C., Stevens, G., Bridge, C., Hogue, G., Buels, R., Cain, S., Stein, L., &
|
|
47
|
+
Holmes, I. (2026). Proteins in the Genome Browser: Integration of Phylogenies,
|
|
48
|
+
Alignments, and Structures With Nucleotide-level Evidence in JBrowse 2. Journal
|
|
49
|
+
of Molecular Biology, 169645. https://doi.org/10.1016/j.jmb.2026.169645
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
automatically stored in IndexedDB
|
|
53
|
-
2. A reference ID (`dataStoreId`) is saved in the session snapshot instead of
|
|
54
|
-
the raw data
|
|
55
|
-
3. On page reload, the plugin detects the `dataStoreId` and retrieves the data
|
|
56
|
-
from IndexedDB
|
|
57
|
-
4. Old IndexedDB entries are automatically cleaned up after 7 days
|
|
51
|
+
See also https://github.com/GMOD/proteinbrowser for overview
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
storage as they can be reloaded directly from the URL.
|
|
53
|
+
## Availability
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
This plugin is installed by default on https://genomes.jbrowse.org so you can
|
|
56
|
+
use it on any species there
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
- Stored data includes: MSA alignment, tree, and tree metadata
|
|
66
|
-
- Each entry is timestamped for cleanup purposes
|
|
58
|
+
## Programmatic usage
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
See [DEVELOPERS.md](DEVELOPERS.md)
|
|
69
61
|
|
|
70
|
-
##
|
|
62
|
+
## Publishing
|
|
71
63
|
|
|
72
|
-
|
|
73
|
-
programmatic launching of an MsaView. This can be used via the JBrowse 2 session
|
|
74
|
-
spec URL parameters (see https://jbrowse.org/jb2/docs/urlparams/#session-spec).
|
|
64
|
+
just push a new tag using e.g.
|
|
75
65
|
|
|
76
|
-
### Parameters
|
|
77
|
-
|
|
78
|
-
| Parameter | Required | Description |
|
|
79
|
-
| ------------------ | --------------------------- | ----------------------------------------------- |
|
|
80
|
-
| `data` | One of data/msaFileLocation | `{ msa: string, tree?: string }` |
|
|
81
|
-
| `msaFileLocation` | One of data/msaFileLocation | `{ uri: string }` for MSA file |
|
|
82
|
-
| `treeFileLocation` | No | `{ uri: string }` for tree file |
|
|
83
|
-
| `connectedViewId` | No | ID of connected LinearGenomeView |
|
|
84
|
-
| `connectedFeature` | No | Feature for cross-linking |
|
|
85
|
-
| `displayName` | No | Custom view display name |
|
|
86
|
-
| `colorSchemeName` | No | Color scheme (e.g., 'percent_identity_dynamic') |
|
|
87
|
-
| `colWidth` | No | Column width in pixels |
|
|
88
|
-
| `rowHeight` | No | Row height in pixels |
|
|
89
|
-
| `treeAreaWidth` | No | Tree area width |
|
|
90
|
-
| `treeWidth` | No | Tree width |
|
|
91
|
-
| `drawNodeBubbles` | No | Show node bubbles on tree |
|
|
92
|
-
| `labelsAlignRight` | No | Align labels to the right |
|
|
93
|
-
| `showBranchLen` | No | Show branch lengths |
|
|
94
|
-
| `querySeqName` | No | Name for query sequence |
|
|
95
|
-
|
|
96
|
-
### URL example
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
https://jbrowse.org/code/jb2/main/?config=config.json&session=spec-{"views":[{"type":"MsaView","msaFileLocation":{"uri":"https://example.com/alignment.fa"}}]}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Programmatic usage
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
pluginManager.evaluateExtensionPoint('LaunchView-MsaView', {
|
|
106
|
-
session,
|
|
107
|
-
data: { msa: clustalOutput, tree: newickTree },
|
|
108
|
-
displayName: 'My MSA',
|
|
109
|
-
colorSchemeName: 'percent_identity_dynamic',
|
|
110
|
-
})
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Inter-plugin communication
|
|
114
|
-
|
|
115
|
-
This plugin supports bidirectional communication with both the Linear Genome
|
|
116
|
-
View and jbrowse-plugin-protein3d for synchronized highlighting and navigation.
|
|
117
|
-
|
|
118
|
-
### Communication with Linear Genome View
|
|
119
|
-
|
|
120
|
-
The MSA view can be connected to a Linear Genome View to enable cross-linking
|
|
121
|
-
between MSA columns and genome coordinates.
|
|
122
|
-
|
|
123
|
-
#### Connection mechanism
|
|
124
|
-
|
|
125
|
-
When launching an MSA view from a gene feature (via right-click context menu),
|
|
126
|
-
the plugin stores:
|
|
127
|
-
|
|
128
|
-
- `connectedViewId`: The ID of the Linear Genome View
|
|
129
|
-
- `connectedFeature`: The gene/transcript feature for coordinate mapping
|
|
130
|
-
|
|
131
|
-
#### Coordinate mapping
|
|
132
|
-
|
|
133
|
-
The plugin uses the `transcriptToMsaMap` (generated by g2p_mapper) to convert
|
|
134
|
-
between MSA positions and genome coordinates:
|
|
135
|
-
|
|
136
|
-
1. MSA column (gapped) → ungapped position
|
|
137
|
-
2. Ungapped position → protein position
|
|
138
|
-
3. Protein position → genome coordinate (via p2g mapping)
|
|
139
|
-
|
|
140
|
-
Key files:
|
|
141
|
-
|
|
142
|
-
- `src/MsaViewPanel/msaCoordToGenomeCoord.ts` - MSA to genome conversion
|
|
143
|
-
- `src/MsaViewPanel/genomeToMSA.ts` - Genome to MSA conversion
|
|
144
|
-
|
|
145
|
-
#### Click navigation
|
|
146
|
-
|
|
147
|
-
Clicking on an MSA column navigates the connected Linear Genome View to the
|
|
148
|
-
corresponding genome position. The `handleMsaClick()` action in
|
|
149
|
-
`src/MsaViewPanel/model.ts:364-382` handles this.
|
|
150
|
-
|
|
151
|
-
#### Bidirectional highlighting
|
|
152
|
-
|
|
153
|
-
- **MSA → Genome**: When hovering over MSA columns, the corresponding genome
|
|
154
|
-
region is highlighted in the Linear Genome View via the
|
|
155
|
-
`LinearGenomeView-TracksContainerComponent` extension point
|
|
156
|
-
(`src/AddHighlightModel/MsaToGenomeHighlight.tsx`)
|
|
157
|
-
|
|
158
|
-
- **Genome → MSA**: When hovering over the genome view, the corresponding MSA
|
|
159
|
-
column is highlighted (`src/AddHighlightModel/GenomeMouseoverHighlight.tsx`)
|
|
160
|
-
|
|
161
|
-
### Communication with jbrowse-plugin-protein3d
|
|
162
|
-
|
|
163
|
-
The MSA view can connect to protein structures displayed in
|
|
164
|
-
jbrowse-plugin-protein3d for synchronized highlighting between sequence
|
|
165
|
-
alignment and 3D structure.
|
|
166
|
-
|
|
167
|
-
#### Auto-connection
|
|
168
|
-
|
|
169
|
-
The plugin automatically discovers and connects to compatible ProteinViews based
|
|
170
|
-
on:
|
|
171
|
-
|
|
172
|
-
1. Matching `connectedViewId` (both views connected to the same genome view)
|
|
173
|
-
2. Matching `uniprotId` between MSA row and protein structure
|
|
174
|
-
|
|
175
|
-
This logic is in `src/MsaViewPanel/model.ts:625-685`.
|
|
176
|
-
|
|
177
|
-
#### Manual connection
|
|
178
|
-
|
|
179
|
-
Users can manually connect to protein structures via the menu: **Menu → "Connect
|
|
180
|
-
to protein structure..."**
|
|
181
|
-
|
|
182
|
-
The `ConnectStructureDialog`
|
|
183
|
-
(`src/MsaViewPanel/components/ConnectStructureDialog.tsx`) allows selecting:
|
|
184
|
-
|
|
185
|
-
- Which ProteinView to connect to
|
|
186
|
-
- Which structure (if multiple)
|
|
187
|
-
- Which MSA row to align with the structure sequence
|
|
188
|
-
|
|
189
|
-
#### Pairwise alignment
|
|
190
|
-
|
|
191
|
-
When connecting to a structure, the plugin performs a Needleman-Wunsch pairwise
|
|
192
|
-
alignment between the MSA row sequence and the structure's sequence to create
|
|
193
|
-
coordinate mappings. This handles cases where sequences may differ slightly.
|
|
194
|
-
|
|
195
|
-
Key file: `src/MsaViewPanel/pairwiseAlignment.ts`
|
|
196
|
-
|
|
197
|
-
#### Connection data structure
|
|
198
|
-
|
|
199
|
-
Each structure connection stores:
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
interface StructureConnection {
|
|
203
|
-
proteinViewId: string
|
|
204
|
-
structureIdx: number
|
|
205
|
-
msaRowName: string
|
|
206
|
-
msaToStructure: Record<number, number> // MSA ungapped → structure position
|
|
207
|
-
structureToMsa: Record<number, number> // structure position → MSA ungapped
|
|
208
|
-
}
|
|
209
66
|
```
|
|
210
|
-
|
|
211
|
-
#### Bidirectional highlighting
|
|
212
|
-
|
|
213
|
-
- **MSA → Structure**: When hovering over MSA columns, the corresponding residue
|
|
214
|
-
is highlighted in the 3D structure via `structure.highlightFromExternal()`
|
|
215
|
-
|
|
216
|
-
- **Structure → MSA**: When hovering over residues in the 3D structure, the
|
|
217
|
-
corresponding MSA column is highlighted. This works via two mechanisms:
|
|
218
|
-
1. Direct mapping via `structureHoverCol` getter (requires explicit
|
|
219
|
-
connection)
|
|
220
|
-
2. Indirect via genome coordinates: the MSA view observes protein3d's
|
|
221
|
-
`hoverGenomeHighlights` and maps back to MSA columns using `g2p` mapping.
|
|
222
|
-
This works automatically when both views share the same `connectedViewId`.
|
|
223
|
-
|
|
224
|
-
### Three-way synchronization
|
|
225
|
-
|
|
226
|
-
When all three views are connected (Linear Genome View, MSA View, and Protein
|
|
227
|
-
View), hovering over any one view will highlight the corresponding positions in
|
|
228
|
-
the other two views, creating a fully synchronized visualization experience.
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
┌─────────────────────┐
|
|
232
|
-
│ Linear Genome View │◄────────────────────────────┐
|
|
233
|
-
│ (genome coords) │ │
|
|
234
|
-
└─────────┬───────────┘ │
|
|
235
|
-
│ │
|
|
236
|
-
│ connectedViewId + connectedFeature │ hoverGenomeHighlights
|
|
237
|
-
│ (uses p2g/g2p mapping) │ (genome coords)
|
|
238
|
-
▼ │
|
|
239
|
-
┌─────────────────────┐ ┌─────────┴───────────┐
|
|
240
|
-
│ MSA View │◄──────────────────│ Protein View │
|
|
241
|
-
│ (aligned seqs) │ observes genome │ (3D structure) │
|
|
242
|
-
└─────────┬───────────┘ highlights └───────────────────────┘
|
|
243
|
-
│ ▲
|
|
244
|
-
│ pairwise alignment mapping │
|
|
245
|
-
│ (msaToStructure/structureToMsa) │
|
|
246
|
-
└─────────────────────────────────────────┘
|
|
67
|
+
pnpm version minor
|
|
247
68
|
```
|
|
248
|
-
|
|
249
|
-
The MSA view can receive highlights from protein3d via two paths:
|
|
250
|
-
|
|
251
|
-
1. **Direct**: MSA observes `structure.hoverPosition` (requires explicit
|
|
252
|
-
connection with matching `uniprotId`)
|
|
253
|
-
2. **Indirect**: MSA observes `structure.hoverGenomeHighlights` and maps genome
|
|
254
|
-
coords back to MSA columns (works when both share `connectedViewId`)
|
|
255
|
-
|
|
256
|
-
### Launch mechanisms
|
|
257
|
-
|
|
258
|
-
The MSA view can be launched from the Linear Genome View via right-click context
|
|
259
|
-
menu on gene/mRNA/transcript features. This provides several data source
|
|
260
|
-
options:
|
|
261
|
-
|
|
262
|
-
1. **NCBI BLAST Query**: Submit protein sequence to NCBI BLAST and display
|
|
263
|
-
results
|
|
264
|
-
2. **Pre-loaded MSA Datasets**: Use pre-calculated alignments from configuration
|
|
265
|
-
3. **Ensembl Gene Tree**: Fetch orthologous sequences from Ensembl
|
|
266
|
-
4. **Manual MSA Loader**: Load MSA/tree files directly
|
|
267
|
-
|
|
268
|
-
Each launch method automatically sets up the genome view connection for
|
|
269
|
-
coordinate mapping and highlighting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenomeMouseoverHighlight.js","sourceRoot":"","sources":["../../src/AddHighlightModel/GenomeMouseoverHighlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAIlC,MAAM,wBAAwB,GAAG,QAAQ,CAAC,UAAU,EAClD,KAAK,GAGN;IACC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AE,GAAI,CAAA;IACtE,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAC,CAAA;AAEF,eAAe,wBAAwB,CAAA"}
|
|
@@ -33,24 +33,15 @@ export default class BgzipFastaMsaAdapter extends BaseAdapter {
|
|
|
33
33
|
}
|
|
34
34
|
async getMSAList() {
|
|
35
35
|
const refNames = await this.getMSARefs();
|
|
36
|
-
const list = new Set();
|
|
37
36
|
const val = this.getConf('msaRegex');
|
|
38
37
|
const re = new RegExp(val);
|
|
39
|
-
|
|
40
|
-
list.add(refNames[i].split(re)[0]);
|
|
41
|
-
}
|
|
38
|
+
const list = new Set(refNames.map(name => name.split(re)[0]));
|
|
42
39
|
return [...list];
|
|
43
40
|
}
|
|
44
41
|
async getMSA(id) {
|
|
45
42
|
const adapter = await this.configure();
|
|
46
43
|
const refNames = await adapter.getRefNames();
|
|
47
|
-
const rows =
|
|
48
|
-
for (let i = 0, l = refNames.length; i < l; i++) {
|
|
49
|
-
const refName = refNames[i];
|
|
50
|
-
if (refName.startsWith(id)) {
|
|
51
|
-
rows.push(refName);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
44
|
+
const rows = refNames.filter(refName => refName.startsWith(id));
|
|
54
45
|
return firstValueFrom(adapter
|
|
55
46
|
.getFeaturesInMultipleRegions(rows.map(refName => ({
|
|
56
47
|
refName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BgzipFastaMsaAdapter.js","sourceRoot":"","sources":["../../src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAI9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IAK3D,KAAK,CAAC,YAAY;QAChB,MAAM,aAAa,GA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AAM,CAAC,GAAG,CAAC,CAAA;QAC1B,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAA;QAC9D,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAA;QACtC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE,CAAA;QAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;QAC/D,OAAO,cAAc,CACnB,OAAO;aACJ,4BAA4B,CAC3B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACnB,OAAO;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,aAAa;YAClB,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC,CACJ;aACA,IAAI,CAAC,OAAO,EAAE,CAAC,CACnB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -16,6 +16,21 @@ const useStyles = makeStyles()({
|
|
|
16
16
|
textAreaFont: {
|
|
17
17
|
fontFamily: 'Courier New',
|
|
18
18
|
},
|
|
19
|
+
inputContainer: {
|
|
20
|
+
marginBottom: 30,
|
|
21
|
+
},
|
|
22
|
+
fileContainer: {
|
|
23
|
+
maxWidth: 500,
|
|
24
|
+
},
|
|
25
|
+
msaInput: {
|
|
26
|
+
marginBottom: 20,
|
|
27
|
+
},
|
|
28
|
+
queryNameInput: {
|
|
29
|
+
marginTop: 20,
|
|
30
|
+
},
|
|
31
|
+
warningAlert: {
|
|
32
|
+
marginTop: 10,
|
|
33
|
+
},
|
|
19
34
|
});
|
|
20
35
|
const ManualMSALoader = observer(function PreLoadedMSA2({ model, feature, handleClose, }) {
|
|
21
36
|
const session = getSession(model);
|
|
@@ -39,20 +54,20 @@ const ManualMSALoader = observer(function PreLoadedMSA2({ model, feature, handle
|
|
|
39
54
|
} },
|
|
40
55
|
React.createElement(FormControlLabel, { value: "file", control: React.createElement(Radio, null), label: "Open files" }),
|
|
41
56
|
React.createElement(FormControlLabel, { value: "text", control: React.createElement(Radio, null), label: "Paste text" }))),
|
|
42
|
-
React.createElement("div", {
|
|
57
|
+
React.createElement("div", { className: classes.inputContainer }, inputMethod === 'file' ? (React.createElement("div", { className: classes.fileContainer },
|
|
43
58
|
React.createElement(FileSelector, { name: "MSA File .aln (Clustal), .fa/.mfa (aligned FASTA), .stock (Stockholm), etc)", inline: true, location: msaFileLocation, setLocation: setMsaFileLocation }),
|
|
44
59
|
React.createElement(FileSelector, { name: "Tree file .nh (Newick) or .asn (NCBI COBALT ASN.1)", inline: true, location: treeFileLocation, setLocation: setTreeFileLocation }))) : (React.createElement(React.Fragment, null,
|
|
45
|
-
React.createElement(TextField2, { variant: "outlined", name: "MSA", multiline: true, minRows: 5,
|
|
60
|
+
React.createElement(TextField2, { variant: "outlined", name: "MSA", multiline: true, minRows: 5, className: classes.msaInput, maxRows: 10, fullWidth: true, placeholder: "Paste MSA here", value: msaText, onChange: event => {
|
|
46
61
|
setMsaText(event.target.value);
|
|
47
62
|
} }),
|
|
48
63
|
React.createElement(TextField2, { variant: "outlined", name: "Tree", multiline: true, minRows: 5, maxRows: 10, fullWidth: true, placeholder: "Paste newick tree (optional)", value: treeText, onChange: event => {
|
|
49
64
|
setTreeText(event.target.value);
|
|
50
65
|
} })))),
|
|
51
66
|
React.createElement(TranscriptSelector, { feature: feature, options: options, selectedId: selectedId, selectedTranscript: selectedTranscript, onTranscriptChange: setSelectedId, proteinSequence: proteinSequence }),
|
|
52
|
-
React.createElement(TextField2, { variant: "outlined", name: "MSA row name", fullWidth: true, required: true,
|
|
67
|
+
React.createElement(TextField2, { variant: "outlined", name: "MSA row name", fullWidth: true, required: true, className: classes.queryNameInput, placeholder: "Row name in MSA that corresponds to the selected transcript", helperText: "Required: Specify the name of the row in your MSA that should be aligned with the selected transcript", value: querySeqName, onChange: event => {
|
|
53
68
|
setQuerySeqName(event.target.value);
|
|
54
69
|
} }),
|
|
55
|
-
!querySeqName.trim()
|
|
70
|
+
!querySeqName.trim() ? (React.createElement(Alert, { severity: "warning", className: classes.warningAlert }, "Without specifying the MSA row name, clicking on the MSA will not navigate to the corresponding genome position, and hovering highlights will not work.")) : null),
|
|
56
71
|
React.createElement(DialogActions, null,
|
|
57
72
|
React.createElement(Button, { color: "primary", variant: "contained", disabled: !selectedTranscript ||
|
|
58
73
|
(inputMethod === 'file' && !msaFileLocation) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualMSALoader.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EACL,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,kBAAkB,MAAM,uBAAuB,CAAA;AACtD,OAAO,EA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aAAa,IAAC,SAAS,EAAE,OAAO,CAAC,aAAa;YAC5C,CAAC,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,KAAK,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI;YACtC,oBAAC,WAAW,IAAC,SAAS,EAAC,UAAU;gBAC/B,oBAAC,UAAU,IACT,GAAG,QACH,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,KAAK,CAAC,EAAE;wBAChB,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAwB,CAAC,CAAA;oBACvD,CAAC;oBAED,oBAAC,gBAAgB,IACf,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,oBAAC,KAAK,OAAG,EAClB,KAAK,EAAC,YAAY,GAClB;oBACF,oBAAC,gBAAgB,IACf,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,oBAAC,KAAK,OAAG,EAClB,KAAK,EAAC,YAAY,GAClB,CACS,CACD;YAEd,6BAAK,
|
|
1
|
+
{"version":3,"file":"ManualMSALoader.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EACL,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAA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OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE;oBACZ,WAAW,EAAE,CAAA;gBACf,CAAC,aAGM,CACK,CACf,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,eAAe,CAAA"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
4
4
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
5
5
|
import { Button, IconButton, List, ListItem, ListItemButton, ListItemText, Typography, } from '@mui/material';
|
|
6
6
|
import { observer } from 'mobx-react';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
7
8
|
import { blastLaunchViewFromCache } from './blastLaunchView';
|
|
8
|
-
import {
|
|
9
|
+
import { useCachedBlastResults } from './useCachedBlastResults';
|
|
9
10
|
import { getGeneIdentifiers } from '../../util';
|
|
11
|
+
const useStyles = makeStyles()({
|
|
12
|
+
header: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
marginBottom: 8,
|
|
17
|
+
},
|
|
18
|
+
resultList: {
|
|
19
|
+
maxHeight: 300,
|
|
20
|
+
overflow: 'auto',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
10
23
|
function getResultDisplayName(result) {
|
|
11
24
|
const parts = [];
|
|
12
25
|
if (result.geneName) {
|
|
@@ -21,44 +34,11 @@ function getResultDisplayName(result) {
|
|
|
21
34
|
return parts.join(' - ');
|
|
22
35
|
}
|
|
23
36
|
const CachedBlastResults = observer(function ({ model, handleClose, feature, }) {
|
|
24
|
-
const
|
|
25
|
-
const [loading, setLoading] = useState(true);
|
|
26
|
-
const [error, setError] = useState();
|
|
37
|
+
const { classes } = useStyles();
|
|
27
38
|
const view = getContainingView(model);
|
|
39
|
+
const [operationError, setOperationError] = useState();
|
|
28
40
|
const geneIds = useMemo(() => getGeneIdentifiers(feature), [feature]);
|
|
29
|
-
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
31
|
-
;
|
|
32
|
-
(async () => {
|
|
33
|
-
try {
|
|
34
|
-
const cached = await getAllCachedResults();
|
|
35
|
-
setResults(cached.filter(r => r.geneId && geneIds.includes(r.geneId)));
|
|
36
|
-
setLoading(false);
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
console.error(e);
|
|
40
|
-
setError(e);
|
|
41
|
-
}
|
|
42
|
-
})();
|
|
43
|
-
}, [geneIds]);
|
|
44
|
-
const handleDelete = async (id) => {
|
|
45
|
-
try {
|
|
46
|
-
await deleteCachedResult(id);
|
|
47
|
-
setResults(r => r.filter(result => result.id !== id));
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
setError(e);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const handleClearAll = async () => {
|
|
54
|
-
try {
|
|
55
|
-
await clearAllCachedResults();
|
|
56
|
-
setResults([]);
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
setError(e);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
41
|
+
const { results, error, isLoading, handleDelete, handleClearAll } = useCachedBlastResults(geneIds);
|
|
62
42
|
const handleUseCached = (cached) => {
|
|
63
43
|
blastLaunchViewFromCache({
|
|
64
44
|
view,
|
|
@@ -67,34 +47,40 @@ const CachedBlastResults = observer(function ({ model, handleClose, feature, })
|
|
|
67
47
|
});
|
|
68
48
|
handleClose();
|
|
69
49
|
};
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
const displayError = error ?? operationError;
|
|
51
|
+
if (displayError) {
|
|
52
|
+
return React.createElement(ErrorMessage, { error: displayError });
|
|
72
53
|
}
|
|
73
|
-
if (
|
|
54
|
+
if (isLoading) {
|
|
74
55
|
return React.createElement(Typography, null, "Loading cached results...");
|
|
75
56
|
}
|
|
76
57
|
if (results.length === 0) {
|
|
77
58
|
return (React.createElement(Typography, { color: "textSecondary" }, "No cached BLAST results found for this gene. Run a BLAST query to cache results."));
|
|
78
59
|
}
|
|
79
60
|
return (React.createElement("div", null,
|
|
80
|
-
React.createElement("div", {
|
|
81
|
-
display: 'flex',
|
|
82
|
-
justifyContent: 'space-between',
|
|
83
|
-
alignItems: 'center',
|
|
84
|
-
marginBottom: 8,
|
|
85
|
-
} },
|
|
61
|
+
React.createElement("div", { className: classes.header },
|
|
86
62
|
React.createElement(Typography, { variant: "subtitle1" },
|
|
87
63
|
"Cached BLAST Results (",
|
|
88
64
|
results.length,
|
|
89
65
|
")"),
|
|
90
|
-
React.createElement(Button, { size: "small", color: "error", onClick: () => {
|
|
91
|
-
|
|
92
|
-
|
|
66
|
+
React.createElement(Button, { size: "small", color: "error", onClick: async () => {
|
|
67
|
+
try {
|
|
68
|
+
setOperationError(undefined);
|
|
69
|
+
await handleClearAll();
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
setOperationError(e);
|
|
73
|
+
}
|
|
93
74
|
} }, "Clear All")),
|
|
94
|
-
React.createElement(List, { dense: true,
|
|
75
|
+
React.createElement(List, { dense: true, className: classes.resultList }, results.map(result => (React.createElement(ListItem, { key: result.id, disablePadding: true, secondaryAction: React.createElement(IconButton, { edge: "end", size: "small", onClick: async (e) => {
|
|
95
76
|
e.stopPropagation();
|
|
96
|
-
|
|
97
|
-
|
|
77
|
+
try {
|
|
78
|
+
setOperationError(undefined);
|
|
79
|
+
await handleDelete(result.id);
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
setOperationError(err);
|
|
83
|
+
}
|
|
98
84
|
} },
|
|
99
85
|
React.createElement(DeleteIcon, { fontSize: "small" })) },
|
|
100
86
|
React.createElement(ListItemButton, { onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CachedBlastResults.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"CachedBlastResults.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,UAAU,MAAM,4BAA4B,CAAA;AACnD,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAM/C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE;QACN,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,CAAC;KAChB;IACD,UAAU,EAAE;QACV,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE,MAAM;KACjB;CACF,CAAC,CAAA;AAEF,SAAS,oBAAoB,CAAC,MAAyB;IACrD,MAAM,KAAK,GAAG,EAAE,CAAA;IAChB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC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A;oBACxB,CAAC;gBACH,CAAC;gBAED,oBAAC,UAAU,IAAC,QAAQ,EAAC,OAAO,GAAG,CACpB;YAGf,oBAAC,cAAc,IACb,OAAO,EAAE,GAAG,EAAE;oBACZ,eAAe,CAAC,MAAM,CAAC,CAAA;gBACzB,CAAC;gBAED,oBAAC,YAAY,IACX,OAAO,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY,GAAG,EACpH,SAAS,EAAE,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,WAAW,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,GAC5G,CACa,CACR,CACZ,CAAC,CACG,CACH,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,kBAAkB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
4
4
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
@@ -8,8 +8,8 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
8
8
|
import CachedBlastResults from './CachedBlastResults';
|
|
9
9
|
import { blastLaunchView } from './blastLaunchView';
|
|
10
10
|
import { msaAlgorithms } from './consts';
|
|
11
|
+
import { useCachedBlastResults } from './useCachedBlastResults';
|
|
11
12
|
import TextField2 from '../../../components/TextField2';
|
|
12
|
-
import { getAllCachedResults } from '../../../utils/blastCache';
|
|
13
13
|
import { getGeneDisplayName, getGeneIdentifiers, getTranscriptDisplayName, } from '../../util';
|
|
14
14
|
import TranscriptSelector from '../TranscriptSelector';
|
|
15
15
|
import { useTranscriptSelection } from '../useTranscriptSelection';
|
|
@@ -43,25 +43,10 @@ const NCBIBlastAutomaticPanel = observer(function ({ handleClose, feature, model
|
|
|
43
43
|
const [selectedBlastDatabase, setSelectedBlastDatabase] = useState('nr');
|
|
44
44
|
const [selectedMsaAlgorithm, setSelectedMsaAlgorithm] = useState('clustalo');
|
|
45
45
|
const [selectedBlastProgram, setSelectedBlastProgram] = useState('quick-blastp');
|
|
46
|
-
const [hasCachedResults, setHasCachedResults] = useState(false);
|
|
47
|
-
const [error, setError] = useState();
|
|
48
46
|
const geneIds = useMemo(() => getGeneIdentifiers(feature), [feature]);
|
|
49
|
-
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
51
|
-
;
|
|
52
|
-
(async () => {
|
|
53
|
-
try {
|
|
54
|
-
const results = await getAllCachedResults();
|
|
55
|
-
setHasCachedResults(results.some(r => r.geneId && geneIds.includes(r.geneId)));
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
console.error(e);
|
|
59
|
-
setError(e);
|
|
60
|
-
}
|
|
61
|
-
})();
|
|
62
|
-
}, [geneIds]);
|
|
47
|
+
const { results: cachedResults, error: cachedResultsError } = useCachedBlastResults(geneIds);
|
|
63
48
|
const { options, selectedId, setSelectedId, selectedTranscript, proteinSequence, error: proteinSequenceError, } = useTranscriptSelection({ feature, view });
|
|
64
|
-
const e = proteinSequenceError ?? launchViewError ??
|
|
49
|
+
const e = proteinSequenceError ?? launchViewError ?? cachedResultsError;
|
|
65
50
|
return (React.createElement(React.Fragment, null,
|
|
66
51
|
React.createElement(DialogContent, { className: classes.dialogContent },
|
|
67
52
|
children,
|
|
@@ -84,7 +69,7 @@ const NCBIBlastAutomaticPanel = observer(function ({ handleClose, feature, model
|
|
|
84
69
|
selectedBlastDatabase === 'nr_cluster_seq' ? (React.createElement(Typography, { variant: "subtitle2", className: classes.clusterSeqMessage }, "Can only use blastp on nr_cluster_seq")) : null),
|
|
85
70
|
React.createElement(TranscriptSelector, { feature: feature, options: options, selectedId: selectedId, selectedTranscript: selectedTranscript, onTranscriptChange: setSelectedId, proteinSequence: proteinSequence }),
|
|
86
71
|
React.createElement(Typography, { className: classes.infoText }, "This panel will automatically submit a query to NCBI. Using blastp can take 10+ minutes to run, quick-blastp is generally a lot faster but is not available for the clustered database. After completion, all the hits will be run through a multiple sequence alignment. Note: we are not able to currently run NCBI COBALT automatically on the BLAST results, even though that is the method NCBI uses on their website. If you need a COBALT alignment, please use the manual approach of submitting BLAST yourself and downloading the resulting files"),
|
|
87
|
-
|
|
72
|
+
cachedResults.length > 0 ? (React.createElement(Accordion, { className: classes.cachedResultsAccordion },
|
|
88
73
|
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
89
74
|
React.createElement(Typography, null, "Previous BLAST Results")),
|
|
90
75
|
React.createElement(AccordionDetails, null,
|
|
@@ -109,14 +94,16 @@ const NCBIBlastAutomaticPanel = observer(function ({ handleClose, feature, model
|
|
|
109
94
|
proteinSequence,
|
|
110
95
|
},
|
|
111
96
|
});
|
|
97
|
+
handleClose();
|
|
112
98
|
}
|
|
113
99
|
catch (e) {
|
|
114
100
|
console.error(e);
|
|
115
101
|
setLaunchViewError(e);
|
|
116
102
|
}
|
|
117
|
-
handleClose();
|
|
118
103
|
}, disabled: !proteinSequence }, "Submit"),
|
|
119
|
-
React.createElement(Button, { color: "secondary", variant: "contained", onClick:
|
|
104
|
+
React.createElement(Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
105
|
+
handleClose();
|
|
106
|
+
} }, "Cancel"))));
|
|
120
107
|
});
|
|
121
108
|
export default NCBIBlastAutomaticPanel;
|
|
122
109
|
//# sourceMappingURL=NCBIBlastAutomaticPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NCBIBlastAutomaticPanel.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"NCBIBlastAutomaticPanel.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,cAAc,MAAM,gCAAgC,CAAA;AAC3D,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AACnB,OAAO,kBAAkB,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAMlE,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC;IAC7B,aAAa,EAAE;QACb,KAAK,EAAE,MAAM;KACd;IACD,WAAW,EAAE;QACX,KAAK,EAAE,GAAG;KACX;IACD,sBAAsB,EAAE;QACtB,OAAO,EAAE,MAAM;KAChB;IACD,iBAAiB,EAAE;QACjB,UAAU,EAAE,CAAC;QACb,YAAY,EAAE,QAAQ;KAC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