jbrowse-plugin-msaview 2.2.2 → 2.2.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/CHANGELOG.md +1 -1
- package/README.md +229 -0
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +23 -18
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +23 -13
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +1 -1
- package/dist/AddHighlightModel/index.js +8 -1
- package/dist/AddHighlightModel/index.js.map +1 -1
- package/dist/AddHighlightModel/util.d.ts +2 -2
- package/dist/BgzipFastaMsaAdapter/configSchema.d.ts +2 -2
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +5 -11
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js +5 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +16 -16
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +38 -46
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.d.ts +4 -3
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js +4 -3
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.d.ts +9 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +76 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +35 -13
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +6 -12
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.d.ts +6 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js +15 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +12 -34
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/consts.d.ts +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/consts.js +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/consts.js.map +1 -1
- package/dist/LaunchMsaView/components/TabPanel.d.ts +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js +3 -6
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +6 -4
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.d.ts +16 -0
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +31 -0
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -0
- package/dist/LaunchMsaView/components/util.d.ts +3 -1
- package/dist/LaunchMsaView/components/util.js +12 -2
- package/dist/LaunchMsaView/components/util.js.map +1 -1
- package/dist/LaunchMsaView/util.d.ts +2 -0
- package/dist/LaunchMsaView/util.js +16 -4
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/LaunchMsaViewExtensionPoint/index.d.ts +2 -0
- package/dist/LaunchMsaViewExtensionPoint/index.js +31 -0
- package/dist/LaunchMsaViewExtensionPoint/index.js.map +1 -0
- package/dist/MsaViewPanel/components/ConnectStructureDialog.d.ts +7 -0
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js +56 -0
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js.map +1 -0
- package/dist/MsaViewPanel/components/MsaViewPanel.js +4 -2
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
- package/dist/MsaViewPanel/doLaunchBlast.d.ts +1 -0
- package/dist/MsaViewPanel/doLaunchBlast.js +65 -19
- package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
- package/dist/MsaViewPanel/genomeToMSA.d.ts +6 -0
- package/dist/MsaViewPanel/genomeToMSA.js +38 -8
- package/dist/MsaViewPanel/genomeToMSA.js.map +1 -1
- package/dist/MsaViewPanel/genomeToMSA.test.d.ts +1 -0
- package/dist/MsaViewPanel/genomeToMSA.test.js +244 -0
- package/dist/MsaViewPanel/genomeToMSA.test.js.map +1 -0
- package/dist/MsaViewPanel/model.d.ts +727 -226
- package/dist/MsaViewPanel/model.js +496 -52
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.d.ts +10 -2
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js +26 -27
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js.map +1 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.d.ts +1 -0
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js +240 -0
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js.map +1 -0
- package/dist/MsaViewPanel/msaDataStore.d.ts +14 -0
- package/dist/MsaViewPanel/msaDataStore.js +197 -0
- package/dist/MsaViewPanel/msaDataStore.js.map +1 -0
- package/dist/MsaViewPanel/pairwiseAlignment.d.ts +27 -0
- package/dist/MsaViewPanel/pairwiseAlignment.js +776 -0
- package/dist/MsaViewPanel/pairwiseAlignment.js.map +1 -0
- package/dist/MsaViewPanel/pairwiseAlignment.test.d.ts +1 -0
- package/dist/MsaViewPanel/pairwiseAlignment.test.js +112 -0
- package/dist/MsaViewPanel/pairwiseAlignment.test.js.map +1 -0
- package/dist/MsaViewPanel/structureConnection.d.ts +27 -0
- package/dist/MsaViewPanel/structureConnection.js +46 -0
- package/dist/MsaViewPanel/structureConnection.js.map +1 -0
- package/dist/MsaViewPanel/structureConnection.test.d.ts +1 -0
- package/dist/MsaViewPanel/structureConnection.test.js +122 -0
- package/dist/MsaViewPanel/structureConnection.test.js.map +1 -0
- package/dist/MsaViewPanel/types.d.ts +13 -0
- package/dist/MsaViewPanel/types.js +2 -0
- package/dist/MsaViewPanel/types.js.map +1 -0
- package/dist/MsaViewPanel/util.d.ts +7 -0
- package/dist/MsaViewPanel/util.js +10 -0
- package/dist/MsaViewPanel/util.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +39 -90
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/blastCache.d.ts +34 -0
- package/dist/utils/blastCache.js +58 -0
- package/dist/utils/blastCache.js.map +1 -0
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/fetch.js +1 -1
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/ncbiBlast.d.ts +1 -5
- package/dist/utils/taxonomyNames.d.ts +5 -0
- package/dist/utils/taxonomyNames.js +79 -0
- package/dist/utils/taxonomyNames.js.map +1 -0
- package/dist/utils/types.d.ts +8 -5
- package/package.json +50 -54
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +37 -21
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +38 -17
- package/src/AddHighlightModel/index.tsx +9 -4
- package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +13 -13
- package/src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts +6 -0
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +30 -23
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +64 -51
- package/src/LaunchMsaView/components/ManualMSALoader/launchView.ts +9 -6
- package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +146 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +53 -22
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +8 -13
- package/src/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.ts +25 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +27 -47
- package/src/LaunchMsaView/components/PreLoadedMSA/consts.ts +1 -0
- package/src/LaunchMsaView/components/TabPanel.tsx +2 -2
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +13 -20
- package/src/LaunchMsaView/components/useSWRFeatureSequence.ts +5 -5
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +48 -0
- package/src/LaunchMsaView/components/util.ts +17 -2
- package/src/LaunchMsaView/index.ts +1 -1
- package/src/LaunchMsaView/util.ts +25 -6
- package/src/LaunchMsaViewExtensionPoint/index.ts +74 -0
- package/src/MsaViewPanel/components/ConnectStructureDialog.tsx +156 -0
- package/src/MsaViewPanel/components/MsaViewPanel.tsx +6 -1
- package/src/MsaViewPanel/doLaunchBlast.ts +83 -23
- package/src/MsaViewPanel/genomeToMSA.test.ts +281 -0
- package/src/MsaViewPanel/genomeToMSA.ts +43 -10
- package/src/MsaViewPanel/model.ts +617 -58
- package/src/MsaViewPanel/msaCoordToGenomeCoord.test.ts +256 -0
- package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +42 -30
- package/src/MsaViewPanel/msaDataStore.ts +236 -0
- package/src/MsaViewPanel/pairwiseAlignment.test.ts +140 -0
- package/src/MsaViewPanel/pairwiseAlignment.ts +818 -0
- package/src/MsaViewPanel/structureConnection.test.ts +143 -0
- package/src/MsaViewPanel/structureConnection.ts +72 -0
- package/src/MsaViewPanel/types.ts +14 -0
- package/src/MsaViewPanel/util.ts +11 -0
- package/src/index.ts +3 -1
- package/src/utils/blastCache.ts +114 -0
- package/src/utils/fetch.ts +1 -1
- package/src/utils/taxonomyNames.ts +111 -0
- package/src/utils/types.ts +9 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/findValidTranscriptId.d.ts +0 -5
- package/dist/LaunchMsaView/components/PreLoadedMSA/findValidTranscriptId.js +0 -16
- package/dist/LaunchMsaView/components/PreLoadedMSA/findValidTranscriptId.js.map +0 -1
- package/dist/out.js +0 -55367
- package/src/LaunchMsaView/components/PreLoadedMSA/findValidTranscriptId.ts +0 -25
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -38,3 +38,232 @@ https://jbrowse.org/code/jb2/main/index.html?config=https://unpkg.com/jbrowse-pl
|
|
|
38
38
|
alignments embedded in a single file)
|
|
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
|
+
|
|
42
|
+
## Data persistence
|
|
43
|
+
|
|
44
|
+
MSA datasets loaded from inline data (pasted text, local file uploads) are
|
|
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.
|
|
48
|
+
|
|
49
|
+
### How it works
|
|
50
|
+
|
|
51
|
+
1. When MSA data is loaded from inline sources (not URL-based files), it is
|
|
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
|
|
58
|
+
|
|
59
|
+
Note: URL-based files (loaded via file selector with a URL) don't need IndexedDB
|
|
60
|
+
storage as they can be reloaded directly from the URL.
|
|
61
|
+
|
|
62
|
+
### Storage details
|
|
63
|
+
|
|
64
|
+
- Database name: `jbrowse-msaview-data`
|
|
65
|
+
- Stored data includes: MSA alignment, tree, and tree metadata
|
|
66
|
+
- Each entry is timestamped for cleanup purposes
|
|
67
|
+
|
|
68
|
+
This mechanism is transparent to users and requires no configuration.
|
|
69
|
+
|
|
70
|
+
## LaunchView-MsaView extension point
|
|
71
|
+
|
|
72
|
+
This plugin registers a `LaunchView-MsaView` extension point that allows
|
|
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).
|
|
75
|
+
|
|
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
|
+
```
|
|
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
|
+
└─────────────────────────────────────────┘
|
|
247
|
+
```
|
|
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.
|
|
@@ -3,26 +3,31 @@ import { getSession } from '@jbrowse/core/util';
|
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { useStyles } from './util';
|
|
5
5
|
const GenomeMouseoverHighlight = observer(function ({ model, }) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const session = getSession(model);
|
|
7
|
+
const { hovered, views } = session;
|
|
8
|
+
// Early return if no MSA view exists
|
|
9
|
+
const hasMsaView = views.some(s => s.type === 'MsaView');
|
|
10
|
+
if (!hasMsaView) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
// Early return if no hover position
|
|
14
|
+
if (!hovered ||
|
|
15
|
+
typeof hovered !== 'object' ||
|
|
16
|
+
!('hoverPosition' in hovered)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return React.createElement(GenomeMouseoverHighlightRenderer, { model: model, hovered: hovered });
|
|
10
20
|
});
|
|
11
|
-
const
|
|
21
|
+
const GenomeMouseoverHighlightRenderer = observer(function ({ model, hovered, }) {
|
|
12
22
|
const { classes } = useStyles();
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
if (s && e) {
|
|
22
|
-
const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4);
|
|
23
|
-
const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx;
|
|
24
|
-
return React.createElement("div", { className: classes.highlight, style: { left, width } });
|
|
25
|
-
}
|
|
23
|
+
const { offsetPx } = model;
|
|
24
|
+
const { coord, refName } = hovered.hoverPosition;
|
|
25
|
+
const s = model.bpToPx({ refName, coord: coord - 1 });
|
|
26
|
+
const e = model.bpToPx({ refName, coord: coord });
|
|
27
|
+
if (s && e) {
|
|
28
|
+
const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4);
|
|
29
|
+
const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx;
|
|
30
|
+
return React.createElement("div", { className: classes.highlight, style: { left, width } });
|
|
26
31
|
}
|
|
27
32
|
return null;
|
|
28
33
|
});
|
|
@@ -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,MAAM,
|
|
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,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACjC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IAElC,qCAAqC;IACrC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;IACxD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,oCAAoC;IACpC,IACE,CAAC,OAAO;QACR,OAAO,OAAO,KAA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
import { getSession } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { useStyles } from './util';
|
|
5
|
-
|
|
6
|
-
return assembly.getCanonicalRefName(s) ?? s;
|
|
7
|
-
}
|
|
5
|
+
// Outer component: only re-renders when MSA view or highlights change
|
|
8
6
|
const MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({ model, }) {
|
|
7
|
+
const { views } = getSession(model);
|
|
8
|
+
const msaView = views.find(f => f.type === 'MsaView');
|
|
9
|
+
const highlights = msaView?.connectedHighlights;
|
|
10
|
+
// Early return if no highlights - avoid all other work
|
|
11
|
+
if (!highlights || highlights.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return React.createElement(MsaToGenomeHighlightRenderer, { model: model, highlights: highlights });
|
|
15
|
+
});
|
|
16
|
+
// Inner component: handles the scroll-dependent rendering
|
|
17
|
+
const MsaToGenomeHighlightRenderer = observer(function ({ model, highlights, }) {
|
|
9
18
|
const { classes } = useStyles();
|
|
10
|
-
const { assemblyManager
|
|
11
|
-
const p = views.find(f => f.type === 'MsaView');
|
|
19
|
+
const { assemblyManager } = getSession(model);
|
|
12
20
|
const assembly = assemblyManager.get(model.assemblyNames[0]);
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
const { offsetPx } = model;
|
|
22
|
+
if (!assembly) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return (React.createElement(React.Fragment, null, highlights.map((r, idx) => {
|
|
26
|
+
const refName = assembly.getCanonicalRefName(r.refName) ?? r.refName;
|
|
15
27
|
const s = model.bpToPx({ refName, coord: r.start });
|
|
16
28
|
const e = model.bpToPx({ refName, coord: r.end });
|
|
17
29
|
if (s && e) {
|
|
18
30
|
const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4);
|
|
19
|
-
const left = Math.min(s.offsetPx, e.offsetPx) -
|
|
20
|
-
return (React.createElement("div", { key: `${
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return null;
|
|
31
|
+
const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx;
|
|
32
|
+
return (React.createElement("div", { key: `${r.refName}-${r.start}-${r.end}-${idx}`, className: classes.highlight, style: { left, width } }));
|
|
24
33
|
}
|
|
25
|
-
|
|
34
|
+
return null;
|
|
35
|
+
})));
|
|
26
36
|
});
|
|
27
37
|
export default MsaToGenomeHighlight;
|
|
28
38
|
//# sourceMappingURL=MsaToGenomeHighlight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsaToGenomeHighlight.js","sourceRoot":"","sources":["../../src/AddHighlightModel/MsaToGenomeHighlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"MsaToGenomeHighlight.js","sourceRoot":"","sources":["../../src/AddHighlightModel/MsaToGenomeHighlight.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;AAOlC,sEAAsE;AACtE,MAAM,oBAAoB,GAAG,QAAQ,CAAC,SAAS,qBAAqB,CAAC,EACnE,KAAK,GAGN;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAEvC,CAAA;IAEb,MAAM,UAAU,GAAG,OAAO,EAAE,mBAAmB,CAAA;IAE/C,uDAAuD;IACvD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,oBAAC,4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G,QAAQ,CAAA;YACxD,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,EAC9C,SAAS,EAAE,OAAO,CAAC,SAAS,EAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GACtB,CACH,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CACD,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,oBAAoB,CAAA"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
2
3
|
import HighlightComponents from './HighlightComponents';
|
|
3
4
|
export default function AddHighlightComponentsModelF(pluginManager) {
|
|
4
5
|
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent',
|
|
5
6
|
// @ts-expect-error
|
|
6
|
-
(rest
|
|
7
|
+
(rest, { model }) => {
|
|
8
|
+
// Quick check: don't add any components if no MSA view exists
|
|
9
|
+
const { views } = getSession(model);
|
|
10
|
+
const hasMsaView = views.some(v => v.type === 'MsaView');
|
|
11
|
+
if (!hasMsaView) {
|
|
12
|
+
return rest;
|
|
13
|
+
}
|
|
7
14
|
return [
|
|
8
15
|
...rest,
|
|
9
16
|
React.createElement(HighlightComponents, { key: "highlight_protein_viewer_msaview", model: model }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AddHighlightModel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AddHighlightModel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAIvD,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAClD,aAA4B;IAE5B,aAAa,CAAC,mBAAmB,CAC/B,2CAA2C;IAC3C,mBAAmB;IACnB,CAAC,IAAuB,EAAE,EAAE,KAAK,EAAoC,EAAE,EAAE;QACvE,8DAA8D;QAC9D,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO;YACL,GAAG,IAAI;YACP,oBAAC,mBAAmB,IAClB,GAAG,EAAC,kCAAkC,EACtC,KAAK,EAAE,KAAK,GACZ;SACH,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -4,6 +4,6 @@ export declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
|
4
4
|
} | undefined) => {
|
|
5
5
|
classes: Record<"highlight", string>;
|
|
6
6
|
theme: import("@mui/material").Theme;
|
|
7
|
-
css: import("tss-react
|
|
8
|
-
cx: import("tss-react
|
|
7
|
+
css: import("tss-react").Css;
|
|
8
|
+
cx: import("tss-react").Cx;
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
export default function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
export default function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/esm/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
3
|
msaRegex: {
|
|
4
4
|
type: string;
|
|
5
5
|
defaultValue: string;
|
|
6
6
|
};
|
|
7
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration").AnyConfigurationSchemaType, undefined>>;
|
|
7
|
+
}, import("@jbrowse/core/esm/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration").AnyConfigurationSchemaType, undefined>>;
|
|
@@ -6,9 +6,9 @@ import { observer } from 'mobx-react';
|
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
import { ensemblGeneTreeLaunchView } from './ensemblGeneTreeLaunchView';
|
|
8
8
|
import { useGeneTree } from './useGeneTree';
|
|
9
|
-
import { getGeneDisplayName
|
|
9
|
+
import { getGeneDisplayName } from '../../util';
|
|
10
10
|
import TranscriptSelector from '../TranscriptSelector';
|
|
11
|
-
import {
|
|
11
|
+
import { useTranscriptSelection } from '../useTranscriptSelection';
|
|
12
12
|
const useStyles = makeStyles()({
|
|
13
13
|
dialogContent: {
|
|
14
14
|
width: '80em',
|
|
@@ -22,14 +22,8 @@ const EnsemblGeneTree = observer(function ({ model, feature, handleClose, }) {
|
|
|
22
22
|
const view = getContainingView(model);
|
|
23
23
|
const { classes } = useStyles();
|
|
24
24
|
const [launchViewError, setLaunchViewError] = useState();
|
|
25
|
-
const options =
|
|
26
|
-
const
|
|
27
|
-
const { treeData, isTreeLoading, treeError } = useGeneTree(userSelection);
|
|
28
|
-
const selectedTranscript = options.find(val => getId(val) === userSelection);
|
|
29
|
-
const { proteinSequence, error: featureSequenceError } = useFeatureSequence({
|
|
30
|
-
view,
|
|
31
|
-
feature: selectedTranscript,
|
|
32
|
-
});
|
|
25
|
+
const { options, selectedId, setSelectedId, selectedTranscript, proteinSequence, error: featureSequenceError, } = useTranscriptSelection({ feature, view });
|
|
26
|
+
const { treeData, isTreeLoading, treeError } = useGeneTree(selectedId);
|
|
33
27
|
const loadingMessage = isTreeLoading
|
|
34
28
|
? 'Loading tree data from Ensembl GeneTree'
|
|
35
29
|
: undefined;
|
|
@@ -46,7 +40,7 @@ const EnsemblGeneTree = observer(function ({ model, feature, handleClose, }) {
|
|
|
46
40
|
"See ",
|
|
47
41
|
treeData.geneTreeId,
|
|
48
42
|
" at Ensembl"))) : null,
|
|
49
|
-
React.createElement(TranscriptSelector, { feature: feature, options: options,
|
|
43
|
+
React.createElement(TranscriptSelector, { feature: feature, options: options, selectedTranscript: selectedTranscript, onTranscriptChange: setSelectedId, proteinSequence: proteinSequence })),
|
|
50
44
|
React.createElement(DialogActions, null,
|
|
51
45
|
React.createElement(Button, { color: "primary", variant: "contained", onClick: () => {
|
|
52
46
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnsemblGeneTree.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAGL,iBAAiB,EACjB,UAAU,GACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"EnsemblGeneTree.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAA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AE,CAAA;oBACf,CAAC;oBAAC,OAAO,CAAC,EAAE,CAAC;wBACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;wBAChB,kBAAkB,CAAC,CAAC,CAAC,CAAA;oBACvB,CAAC;gBACH,CAAC,aAGM;YACT,oBAAC,MAAM,IACL,KAAK,EAAC,WAAW,EACjB,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,7 +1,11 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
2
|
import { geneTreeFetcher } from './ensemblGeneTreeUtils';
|
|
3
3
|
export function useGeneTree(geneId) {
|
|
4
|
-
const { data, error, isLoading } = useSWR(() => (geneId ? ['geneTree', geneId] : null), ([, geneId]) => geneTreeFetcher(geneId)
|
|
4
|
+
const { data, error, isLoading } = useSWR(() => (geneId ? ['geneTree', geneId] : null), ([, geneId]) => geneTreeFetcher(geneId), {
|
|
5
|
+
revalidateOnFocus: false,
|
|
6
|
+
revalidateOnReconnect: false,
|
|
7
|
+
revalidateIfStale: false,
|
|
8
|
+
});
|
|
5
9
|
return { treeData: data, isTreeLoading: isLoading, treeError: error };
|
|
6
10
|
}
|
|
7
11
|
//# sourceMappingURL=useGeneTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGeneTree.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"useGeneTree.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CACvC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAC5C,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EACvC;QACE,iBAAiB,EAAE,KAAK;QACxB,qBAAqB,EAAE,KAAK;QAC5B,iBAAiB,EAAE,KAAK;KACzB,CACF,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACvE,CAAC"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
3
|
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
5
|
import { Tab, Tabs } from '@mui/material';
|
|
4
6
|
import EnsemblGeneTree from './EnsemblGeneTree/EnsemblGeneTree';
|
|
5
7
|
import ManualMSALoader from './ManualMSALoader/ManualMSALoader';
|
|
6
8
|
import NCBIBlastPanel from './NCBIBlastQuery/NCBIBlastPanel';
|
|
7
9
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel';
|
|
8
10
|
import TabPanel from './TabPanel';
|
|
9
|
-
const TABS = {
|
|
10
|
-
NCBI_BLAST: 0,
|
|
11
|
-
PRELOADED_MSA: 1,
|
|
12
|
-
ENSEMBL_GENETREE: 2,
|
|
13
|
-
MANUAL_MSA: 3,
|
|
14
|
-
};
|
|
15
11
|
export default function LaunchMsaViewDialog({ handleClose, feature, model, }) {
|
|
16
|
-
const
|
|
12
|
+
const session = getSession(model);
|
|
13
|
+
const { jbrowse } = session;
|
|
14
|
+
const datasets = readConfObject(jbrowse, ['msa', 'datasets']);
|
|
15
|
+
const hasPreloadedDatasets = datasets && datasets.length > 0;
|
|
16
|
+
const [value, setValue] = useState('ncbi_blast');
|
|
17
17
|
const handleChange = (_event, newValue) => {
|
|
18
18
|
setValue(newValue);
|
|
19
19
|
};
|
|
20
20
|
return (React.createElement(Dialog, { maxWidth: "xl", title: "Launch MSA view", open: true, onClose: handleClose },
|
|
21
21
|
React.createElement(Tabs, { value: value, onChange: handleChange },
|
|
22
|
-
React.createElement(Tab, { label: "NCBI BLAST query", value:
|
|
23
|
-
React.createElement(Tab, { label: "Pre-loaded MSA datasets", value:
|
|
24
|
-
React.createElement(Tab, { label: "Ensembl GeneTree", value:
|
|
25
|
-
React.createElement(Tab, { label: "
|
|
26
|
-
React.createElement(TabPanel, { value: value, index:
|
|
22
|
+
React.createElement(Tab, { label: "NCBI BLAST query", value: "ncbi_blast" }),
|
|
23
|
+
hasPreloadedDatasets ? (React.createElement(Tab, { label: "Pre-loaded MSA datasets", value: "preloaded_msa" })) : null,
|
|
24
|
+
React.createElement(Tab, { label: "Ensembl GeneTree", value: "ensembl_genetree" }),
|
|
25
|
+
React.createElement(Tab, { label: "Manual upload", value: "manual_msa" })),
|
|
26
|
+
React.createElement(TabPanel, { value: value, index: "ncbi_blast" },
|
|
27
27
|
React.createElement(NCBIBlastPanel, { handleClose: handleClose, feature: feature, model: model })),
|
|
28
|
-
React.createElement(TabPanel, { value: value, index:
|
|
29
|
-
React.createElement(PreLoadedMSA, { model: model, feature: feature, handleClose: handleClose })),
|
|
30
|
-
React.createElement(TabPanel, { value: value, index:
|
|
28
|
+
hasPreloadedDatasets ? (React.createElement(TabPanel, { value: value, index: "preloaded_msa" },
|
|
29
|
+
React.createElement(PreLoadedMSA, { model: model, feature: feature, handleClose: handleClose }))) : null,
|
|
30
|
+
React.createElement(TabPanel, { value: value, index: "ensembl_genetree" },
|
|
31
31
|
React.createElement(EnsemblGeneTree, { model: model, feature: feature, handleClose: handleClose })),
|
|
32
|
-
React.createElement(TabPanel, { value: value, index:
|
|
32
|
+
React.createElement(TabPanel, { value: value, index: "manual_msa" },
|
|
33
33
|
React.createElement(ManualMSALoader, { model: model, feature: feature, handleClose: handleClose }))));
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=LaunchMsaViewDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchMsaViewDialog.js","sourceRoot":"","sources":["../../../src/LaunchMsaView/components/LaunchMsaViewDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"LaunchMsaViewDialog.js","sourceRoot":"","sources":["../../../src/LaunchMsaView/components/LaunchMsaViewDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAA+B,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,eAAe,MAAM,mCAAmC,CAAA;AAC/D,OAAO,eAAe,MAAM,mCAAmC,CAAA;AAC/D,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAC5D,OAAO,YAAY,MAAM,sCAAsC,CAAA;AAC/D,OAAO,QAAQ,MAAM,YAAY,CAAA;AAIjC,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,WAAW,EACX,OAAO,EACP,KAAK,GAKN;IACC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACjC,MAAM,EAAE,OAA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