jbrowse-plugin-protein3d 1.31.0 → 1.33.0
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 +12 -7
- package/dist/LaunchProteinView/components/FoldseekActionMenu.js +1 -2
- package/dist/LaunchProteinView/components/GeneStructures.js +224 -0
- package/dist/LaunchProteinView/components/HelpDialog.js +9 -8
- package/dist/LaunchProteinView/components/LaunchOptionsMenu.js +4 -11
- package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +8 -27
- package/dist/LaunchProteinView/components/ProteinViewActions.js +7 -24
- package/dist/LaunchProteinView/components/StructureList.js +103 -0
- package/dist/LaunchProteinView/components/StructureListRow.js +196 -0
- package/dist/LaunchProteinView/components/TranscriptSelector.js +2 -2
- package/dist/LaunchProteinView/components/UniProtSummaryBar.js +110 -0
- package/dist/LaunchProteinView/components/UserProvidedStructure.js +3 -2
- package/dist/LaunchProteinView/hooks/useAlphaFoldData.js +5 -0
- package/dist/LaunchProteinView/hooks/useDatasetStructures.js +45 -0
- package/dist/LaunchProteinView/hooks/useGeneStructures.js +147 -0
- package/dist/LaunchProteinView/hooks/usePdbEntrySummaries.js +10 -0
- package/dist/LaunchProteinView/hooks/useStructureLaunch.js +102 -0
- package/dist/LaunchProteinView/hooks/useTranscriptIsoformSelection.js +1 -1
- package/dist/LaunchProteinView/hooks/useUniProtIdLookup.js +2 -2
- package/dist/LaunchProteinView/index.js +1 -1
- package/dist/LaunchProteinView/utils/launchHelpers.js +4 -11
- package/dist/LaunchProteinView/utils/launchViewUtils.js +7 -10
- package/dist/LaunchProteinView/utils/structureDatasets.js +179 -0
- package/dist/LaunchProteinView/utils/structureList.js +268 -0
- package/dist/LaunchProteinViewExtensionPoint/datasetLaunch.js +50 -0
- package/dist/LaunchProteinViewExtensionPoint/launchProteinView.js +2 -1
- package/dist/LaunchProteinViewExtensionPoint/resolveShortLaunch.js +1 -1
- package/dist/ProteinView/components/HeaderStructureRow.js +5 -1
- package/dist/ProteinView/crystallizationAdditives.js +6 -1
- package/dist/ProteinView/molstarExports.js +1 -0
- package/dist/ProteinView/structureModel.js +12 -0
- package/dist/ProteinView/structureReport.js +5 -0
- package/dist/ProteinView/structureSuperposer.js +67 -19
- package/dist/ProteinView/superposeStructures.js +233 -53
- package/dist/ProteinView/superpositionOutcome.js +74 -0
- package/dist/chunks/{AddStructureDialog-GZ7YSFJO.js → AddStructureDialog-RO4QWRSL.js} +2 -2
- package/dist/chunks/AlphaFoldConfidenceAdapter-6YTRHE3R.js +2 -0
- package/dist/chunks/{AlphaFoldConfidenceAdapter-VT7X2M4N.js.map → AlphaFoldConfidenceAdapter-6YTRHE3R.js.map} +1 -1
- package/dist/chunks/AlphaMissensePathogenicityAdapter-UX7VHUBB.js +2 -0
- package/dist/chunks/{AlphaMissensePathogenicityAdapter-TKOLREIQ.js.map → AlphaMissensePathogenicityAdapter-UX7VHUBB.js.map} +1 -1
- package/dist/chunks/{GenomeTrackColorDialog-VD5NKKQZ.js → GenomeTrackColorDialog-EJZ5KTKX.js} +2 -2
- package/dist/chunks/HelpDialog-ZGLXAIOU.js +2 -0
- package/dist/chunks/HelpDialog-ZGLXAIOU.js.map +7 -0
- package/dist/chunks/LaunchProteinViewDialog-OMCH6FKM.js +3 -0
- package/dist/chunks/LaunchProteinViewDialog-OMCH6FKM.js.map +7 -0
- package/dist/chunks/{ManualAlignmentDialog-UN6O2FJS.js → ManualAlignmentDialog-IWVSCVAI.js} +2 -2
- package/dist/chunks/ProteinView-IM7GNXMQ.js +3 -0
- package/dist/chunks/ProteinView-IM7GNXMQ.js.map +7 -0
- package/dist/chunks/{chunk-EX3JB7B4.js → chunk-22BDSJBC.js} +2 -2
- package/dist/chunks/{chunk-EX3JB7B4.js.map → chunk-22BDSJBC.js.map} +1 -1
- package/dist/chunks/{chunk-KEGV4ZRS.js → chunk-34K4PBXC.js} +2 -2
- package/dist/chunks/{chunk-HION7YP4.js → chunk-53Z5PTMG.js} +2 -2
- package/dist/chunks/chunk-7B4IRZLD.js +2 -0
- package/dist/chunks/chunk-7B4IRZLD.js.map +7 -0
- package/dist/chunks/{chunk-YXRW2525.js → chunk-7GELEOAH.js} +2 -2
- package/dist/chunks/{chunk-E27SMIZ5.js → chunk-A4XT2SQ7.js} +2 -2
- package/dist/chunks/{chunk-5Q2KX5AR.js → chunk-A73LEL2C.js} +2 -2
- package/dist/chunks/chunk-EKHBUHHM.js +3 -0
- package/dist/chunks/chunk-EKHBUHHM.js.map +7 -0
- package/dist/chunks/chunk-ENPYAI4H.js +2 -0
- package/dist/chunks/chunk-ENPYAI4H.js.map +7 -0
- package/dist/chunks/{chunk-H5GTPPVG.js → chunk-ENW425OE.js} +2 -2
- package/dist/chunks/{chunk-7IAHWS5M.js → chunk-G67ZYVWG.js} +2 -2
- package/dist/chunks/chunk-HNO3QZD6.js +2 -0
- package/dist/chunks/chunk-HNO3QZD6.js.map +7 -0
- package/dist/chunks/chunk-JKKI7LFR.js +39 -0
- package/dist/chunks/{chunk-QPRIEAI4.js.map → chunk-JKKI7LFR.js.map} +4 -4
- package/dist/chunks/{chunk-ZCVU73CX.js → chunk-LVAZFGE6.js} +2 -2
- package/dist/chunks/{chunk-2PBRTULS.js → chunk-MBUM32YU.js} +3 -3
- package/dist/chunks/{chunk-2PBRTULS.js.map → chunk-MBUM32YU.js.map} +3 -3
- package/dist/chunks/chunk-NCH7IJII.js +2 -0
- package/dist/chunks/{chunk-Q6MXLDYV.js → chunk-Q5QGMPYL.js} +2 -2
- package/dist/chunks/{chunk-KML7CVV2.js → chunk-SEVYWN5I.js} +2 -2
- package/dist/chunks/{chunk-KML7CVV2.js.map → chunk-SEVYWN5I.js.map} +2 -2
- package/dist/chunks/{chunk-Y2KQAAF2.js → chunk-TZ54BAT7.js} +2 -2
- package/dist/chunks/chunk-UWFZCUMZ.js +2 -0
- package/dist/chunks/{chunk-DLVAQOU6.js.map → chunk-UWFZCUMZ.js.map} +4 -4
- package/dist/chunks/chunk-Y5T7GSKP.js +2 -0
- package/dist/chunks/{chunk-CIZQGPKL.js.map → chunk-Y5T7GSKP.js.map} +2 -2
- package/dist/chunks/clinVarSource-36GTMEOG.js +2 -0
- package/dist/chunks/esm-SMVEMW7D.js +2 -0
- package/dist/chunks/isoformRanking-UO3MADA5.js +2 -0
- package/dist/chunks/{launchAnnotationView-W6TZNXJW.js → launchAnnotationView-XZ7GDC3Z.js} +2 -2
- package/dist/chunks/launchProteinView-ZCQRFJXK.js +2 -0
- package/dist/chunks/launchProteinView-ZCQRFJXK.js.map +7 -0
- package/dist/chunks/launchViewUtils-6INIP22K.js +2 -0
- package/dist/chunks/model-J5LYRYAB.js +2 -0
- package/dist/chunks/{model-RPEEIRC2.js.map → model-J5LYRYAB.js.map} +3 -3
- package/dist/chunks/{molstarExports-E5KKETWP.js → molstarExports-5EF5VYZ6.js} +20 -20
- package/dist/chunks/resolveGeneLaunch-4AG66E4N.js +2 -0
- package/dist/index.js +17 -0
- package/dist/jbrowse-plugin-protein3d.esm.js +1 -1
- package/dist/jbrowse-plugin-protein3d.esm.js.map +3 -3
- package/dist/test_data/molstarStructure.js +6 -4
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/LaunchProteinView/components/FoldseekActionMenu.tsx +1 -2
- package/src/LaunchProteinView/components/GeneStructures.tsx +374 -0
- package/src/LaunchProteinView/components/HelpDialog.tsx +22 -18
- package/src/LaunchProteinView/components/LaunchOptionsMenu.tsx +1 -20
- package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +9 -40
- package/src/LaunchProteinView/components/ProteinViewActions.tsx +29 -76
- package/src/LaunchProteinView/components/StructureList.tsx +202 -0
- package/src/LaunchProteinView/components/StructureListRow.tsx +311 -0
- package/src/LaunchProteinView/components/TranscriptSelector.tsx +3 -0
- package/src/LaunchProteinView/components/UniProtSummaryBar.tsx +170 -0
- package/src/LaunchProteinView/components/UserProvidedStructure.tsx +3 -2
- package/src/LaunchProteinView/hooks/useAlphaFoldData.ts +6 -0
- package/src/LaunchProteinView/hooks/useDatasetStructures.ts +77 -0
- package/src/LaunchProteinView/hooks/useGeneStructures.test.ts +263 -0
- package/src/LaunchProteinView/hooks/useGeneStructures.ts +206 -0
- package/src/LaunchProteinView/hooks/usePdbEntrySummaries.ts +20 -0
- package/src/LaunchProteinView/hooks/useStructureLaunch.ts +143 -0
- package/src/LaunchProteinView/hooks/useTranscriptIsoformSelection.ts +1 -1
- package/src/LaunchProteinView/hooks/useUniProtIdLookup.ts +2 -2
- package/src/LaunchProteinView/index.ts +1 -1
- package/src/LaunchProteinView/utils/launchHelpers.test.ts +8 -28
- package/src/LaunchProteinView/utils/launchHelpers.ts +5 -16
- package/src/LaunchProteinView/utils/launchViewUtils.ts +17 -13
- package/src/LaunchProteinView/utils/structureDatasets.test.ts +220 -0
- package/src/LaunchProteinView/utils/structureDatasets.ts +263 -0
- package/src/LaunchProteinView/utils/structureList.test.ts +339 -0
- package/src/LaunchProteinView/utils/structureList.ts +399 -0
- package/src/LaunchProteinViewExtensionPoint/datasetLaunch.test.ts +97 -0
- package/src/LaunchProteinViewExtensionPoint/datasetLaunch.ts +72 -0
- package/src/LaunchProteinViewExtensionPoint/launchProteinView.ts +7 -1
- package/src/LaunchProteinViewExtensionPoint/resolveShortLaunch.ts +1 -1
- package/src/ProteinView/components/HeaderStructureRow.tsx +23 -1
- package/src/ProteinView/crystallizationAdditives.ts +6 -1
- package/src/ProteinView/measurements.test.ts +4 -1
- package/src/ProteinView/molstarExports.ts +1 -0
- package/src/ProteinView/structureModel.ts +13 -0
- package/src/ProteinView/structureReport.ts +7 -0
- package/src/ProteinView/structureSuperposer.test.ts +90 -4
- package/src/ProteinView/structureSuperposer.ts +106 -23
- package/src/ProteinView/superposeStructures.test.ts +209 -3
- package/src/ProteinView/superposeStructures.ts +357 -76
- package/src/ProteinView/superpositionOutcome.test.ts +73 -0
- package/src/ProteinView/superpositionOutcome.ts +135 -0
- package/src/index.ts +22 -0
- package/src/test_data/molstarStructure.ts +9 -4
- package/src/version.ts +1 -1
- package/dist/LaunchProteinView/components/AlphaFoldComplexesTable.js +0 -101
- package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +0 -76
- package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js +0 -16
- package/dist/LaunchProteinView/components/PdbResultsTable.js +0 -74
- package/dist/LaunchProteinView/components/PdbSearch.js +0 -138
- package/dist/LaunchProteinView/hooks/useAlphaFoldDBSearch.js +0 -66
- package/dist/chunks/AlphaFoldConfidenceAdapter-VT7X2M4N.js +0 -2
- package/dist/chunks/AlphaMissensePathogenicityAdapter-TKOLREIQ.js +0 -2
- package/dist/chunks/HelpDialog-BSSZENSL.js +0 -2
- package/dist/chunks/HelpDialog-BSSZENSL.js.map +0 -7
- package/dist/chunks/LaunchProteinViewDialog-332ZRCKH.js +0 -2
- package/dist/chunks/LaunchProteinViewDialog-332ZRCKH.js.map +0 -7
- package/dist/chunks/ProteinView-7F7VEAFI.js +0 -3
- package/dist/chunks/ProteinView-7F7VEAFI.js.map +0 -7
- package/dist/chunks/chunk-2KHWAKTL.js +0 -2
- package/dist/chunks/chunk-CIZQGPKL.js +0 -2
- package/dist/chunks/chunk-DLVAQOU6.js +0 -2
- package/dist/chunks/chunk-ESCHW2TR.js +0 -2
- package/dist/chunks/chunk-ESCHW2TR.js.map +0 -7
- package/dist/chunks/chunk-HVV3ZRSL.js +0 -2
- package/dist/chunks/chunk-HVV3ZRSL.js.map +0 -7
- package/dist/chunks/chunk-QPRIEAI4.js +0 -29
- package/dist/chunks/clinVarSource-MZZ3FS3R.js +0 -2
- package/dist/chunks/esm-P5VQ7RXE.js +0 -2
- package/dist/chunks/isoformRanking-ZNEIFWWG.js +0 -2
- package/dist/chunks/launchProteinView-NMZQQBXU.js +0 -2
- package/dist/chunks/launchProteinView-NMZQQBXU.js.map +0 -7
- package/dist/chunks/launchViewUtils-4ZY4L37J.js +0 -2
- package/dist/chunks/model-RPEEIRC2.js +0 -2
- package/dist/chunks/resolveGeneLaunch-QZL3HMFN.js +0 -2
- package/src/LaunchProteinView/components/AlphaFoldComplexesTable.tsx +0 -189
- package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +0 -164
- package/src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx +0 -31
- package/src/LaunchProteinView/components/PdbResultsTable.tsx +0 -123
- package/src/LaunchProteinView/components/PdbSearch.tsx +0 -264
- package/src/LaunchProteinView/hooks/useAlphaFoldDBSearch.ts +0 -120
- /package/dist/chunks/{AddStructureDialog-GZ7YSFJO.js.map → AddStructureDialog-RO4QWRSL.js.map} +0 -0
- /package/dist/chunks/{GenomeTrackColorDialog-VD5NKKQZ.js.map → GenomeTrackColorDialog-EJZ5KTKX.js.map} +0 -0
- /package/dist/chunks/{ManualAlignmentDialog-UN6O2FJS.js.map → ManualAlignmentDialog-IWVSCVAI.js.map} +0 -0
- /package/dist/chunks/{chunk-KEGV4ZRS.js.map → chunk-34K4PBXC.js.map} +0 -0
- /package/dist/chunks/{chunk-HION7YP4.js.map → chunk-53Z5PTMG.js.map} +0 -0
- /package/dist/chunks/{chunk-YXRW2525.js.map → chunk-7GELEOAH.js.map} +0 -0
- /package/dist/chunks/{chunk-E27SMIZ5.js.map → chunk-A4XT2SQ7.js.map} +0 -0
- /package/dist/chunks/{chunk-5Q2KX5AR.js.map → chunk-A73LEL2C.js.map} +0 -0
- /package/dist/chunks/{chunk-H5GTPPVG.js.map → chunk-ENW425OE.js.map} +0 -0
- /package/dist/chunks/{chunk-7IAHWS5M.js.map → chunk-G67ZYVWG.js.map} +0 -0
- /package/dist/chunks/{chunk-ZCVU73CX.js.map → chunk-LVAZFGE6.js.map} +0 -0
- /package/dist/chunks/{chunk-2KHWAKTL.js.map → chunk-NCH7IJII.js.map} +0 -0
- /package/dist/chunks/{chunk-Q6MXLDYV.js.map → chunk-Q5QGMPYL.js.map} +0 -0
- /package/dist/chunks/{chunk-Y2KQAAF2.js.map → chunk-TZ54BAT7.js.map} +0 -0
- /package/dist/chunks/{clinVarSource-MZZ3FS3R.js.map → clinVarSource-36GTMEOG.js.map} +0 -0
- /package/dist/chunks/{esm-P5VQ7RXE.js.map → esm-SMVEMW7D.js.map} +0 -0
- /package/dist/chunks/{isoformRanking-ZNEIFWWG.js.map → isoformRanking-UO3MADA5.js.map} +0 -0
- /package/dist/chunks/{launchAnnotationView-W6TZNXJW.js.map → launchAnnotationView-XZ7GDC3Z.js.map} +0 -0
- /package/dist/chunks/{launchViewUtils-4ZY4L37J.js.map → launchViewUtils-6INIP22K.js.map} +0 -0
- /package/dist/chunks/{molstarExports-E5KKETWP.js.map → molstarExports-5EF5VYZ6.js.map} +0 -0
- /package/dist/chunks/{resolveGeneLaunch-QZL3HMFN.js.map → resolveGeneLaunch-4AG66E4N.js.map} +0 -0
package/README.md
CHANGED
|
@@ -13,9 +13,13 @@ CI re-renders the figure from `main` every hour
|
|
|
13
13
|
|
|
14
14
|
Right-click a gene and choose **Open AlphaFold structure** for its predicted
|
|
15
15
|
model in one click, or **Launch protein view** for the dialog that offers every
|
|
16
|
-
choice. The
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
choice. The dialog looks the gene up in UniProt and lists every structure found
|
|
17
|
+
for it in one list: the AlphaFold model, the experimental PDB entries RCSB maps
|
|
18
|
+
to that UniProt entry with their partner proteins and ligands, and the complexes
|
|
19
|
+
AlphaFold DB predicted, grouped by what each shows, led by any structures the
|
|
20
|
+
site lists for the gene in a dataset of its own. Check several to open them
|
|
21
|
+
superposed in one view. It can also search Foldseek for related structures, or
|
|
22
|
+
open your own file. The plugin aligns each structure to the transcript's
|
|
19
23
|
translation, so hovering a residue highlights its codon and hovering a codon
|
|
20
24
|
highlights its residue.
|
|
21
25
|
|
|
@@ -43,10 +47,11 @@ Using the plugin:
|
|
|
43
47
|
map wrong — a peptide bound to a larger partner, a protein bound to DNA, a
|
|
44
48
|
receptor with another protein fused into it, a phosphorylated residue, and a
|
|
45
49
|
mitochondrial protein.
|
|
46
|
-
- [Your own structures](docs/your-own-structures.md): opening
|
|
47
|
-
yourself (ColabFold, AlphaFold 3, Boltz…) instead of
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
- [Your own structures](docs/your-own-structures.md): opening models you folded
|
|
51
|
+
yourself (ColabFold, AlphaFold 3, Boltz…) beside or instead of AlphaFold DB's:
|
|
52
|
+
a whole genome's worth from one mapping file named in the config, offered in
|
|
53
|
+
the right-click dialog, or one from a file, a URL or a generated link per
|
|
54
|
+
gene, and which features carry over.
|
|
50
55
|
|
|
51
56
|
Linking and embedding:
|
|
52
57
|
|
|
@@ -24,8 +24,7 @@ const FoldseekActionMenu = observer(function FoldseekActionMenu({ hit, session,
|
|
|
24
24
|
: undefined;
|
|
25
25
|
return launch3DProteinView({
|
|
26
26
|
...baseParams,
|
|
27
|
-
url: hit.structureUrl,
|
|
28
|
-
data: pdbData,
|
|
27
|
+
sources: [{ url: hit.structureUrl, data: pdbData }],
|
|
29
28
|
userProvidedTranscriptSequence,
|
|
30
29
|
});
|
|
31
30
|
});
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
|
+
import { Checkbox, Chip, DialogActions, FormControlLabel, TextField, Typography, } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { isPdbId, stripStopCodon } from 'p2s_mapper';
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
7
|
+
import PartialFailureNotice from './PartialFailureNotice';
|
|
8
|
+
import ProteinViewActions from './ProteinViewActions';
|
|
9
|
+
import SequenceMismatchNotice from './SequenceMismatchNotice';
|
|
10
|
+
import StructureList from './StructureList';
|
|
11
|
+
import TranscriptSelector from './TranscriptSelector';
|
|
12
|
+
import UniProtSummaryBar from './UniProtSummaryBar';
|
|
13
|
+
import useDebouncedValue from '../hooks/useDebouncedValue';
|
|
14
|
+
import useGeneStructures from '../hooks/useGeneStructures';
|
|
15
|
+
import useStructureLaunch, { structureSource, } from '../hooks/useStructureLaunch';
|
|
16
|
+
import useUniProtIdLookup from '../hooks/useUniProtIdLookup';
|
|
17
|
+
import { getLaunchMissingReasons } from '../utils/launchHelpers';
|
|
18
|
+
import { getLaunchSideBySide, setLaunchSideBySide } from '../utils/sideBySide';
|
|
19
|
+
import { defaultChecked, matchesFilter, toggleStructure, } from '../utils/structureList';
|
|
20
|
+
import { getTranscriptDisplayName } from '../utils/util';
|
|
21
|
+
const useStyles = makeStyles()(theme => ({
|
|
22
|
+
// Bounded by the window less the dialog's title, tabs and margins, so the
|
|
23
|
+
// list and the UniProt chooser shrink to fit and Launch never scrolls away
|
|
24
|
+
root: {
|
|
25
|
+
width: '80em',
|
|
26
|
+
maxWidth: '100%',
|
|
27
|
+
maxHeight: 'calc(100vh - 180px)',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
},
|
|
31
|
+
toolbar: {
|
|
32
|
+
flex: 'none',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexWrap: 'wrap',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
gap: 10,
|
|
38
|
+
padding: '8px 24px',
|
|
39
|
+
},
|
|
40
|
+
chips: {
|
|
41
|
+
display: 'flex',
|
|
42
|
+
gap: 6,
|
|
43
|
+
},
|
|
44
|
+
footer: {
|
|
45
|
+
flex: 'none',
|
|
46
|
+
display: 'flex',
|
|
47
|
+
flexWrap: 'wrap',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
gap: 12,
|
|
51
|
+
padding: '8px 24px',
|
|
52
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
53
|
+
},
|
|
54
|
+
summary: {
|
|
55
|
+
display: 'flex',
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
gap: 6,
|
|
58
|
+
minWidth: 0,
|
|
59
|
+
flex: '1 1 400px',
|
|
60
|
+
},
|
|
61
|
+
actions: {
|
|
62
|
+
padding: 0,
|
|
63
|
+
flexWrap: 'wrap',
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
const FILTERS = [
|
|
67
|
+
{ filter: 'all', label: 'All' },
|
|
68
|
+
{ filter: 'experimental', label: 'Experimental' },
|
|
69
|
+
{ filter: 'predicted', label: 'Predicted' },
|
|
70
|
+
];
|
|
71
|
+
function launchStructure(row) {
|
|
72
|
+
return row.kind === 'alphafold'
|
|
73
|
+
? { key: row.key, kind: 'alphafold', model: row.model }
|
|
74
|
+
: row.kind === 'pdb'
|
|
75
|
+
? { key: row.key, kind: 'pdb', pdbId: row.entry.pdbId }
|
|
76
|
+
: row.kind === 'dataset'
|
|
77
|
+
? {
|
|
78
|
+
key: row.key,
|
|
79
|
+
kind: 'url',
|
|
80
|
+
url: row.match.structure.url,
|
|
81
|
+
uniprotId: row.match.structure.uniprotId,
|
|
82
|
+
}
|
|
83
|
+
: { key: row.key, kind: 'complex', entity: row.complex.entity };
|
|
84
|
+
}
|
|
85
|
+
function describeLaunch(rows, typedPdbId, finding) {
|
|
86
|
+
const [first, ...rest] = rows;
|
|
87
|
+
return typedPdbId
|
|
88
|
+
? `PDB ${typedPdbId.toUpperCase()}, typed above, in place of the checked rows`
|
|
89
|
+
: !first
|
|
90
|
+
? finding
|
|
91
|
+
? 'Finding structures…'
|
|
92
|
+
: 'Check a structure to open it'
|
|
93
|
+
: rest.length > 0
|
|
94
|
+
? `${rows.map(r => r.label).join(' + ')}, superposed onto ${first.label}`
|
|
95
|
+
: first.section === 'fragment'
|
|
96
|
+
? `${first.label}, a short fragment, on its own`
|
|
97
|
+
: `${first.label}: ${first.title}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The default tab: every structure found for the gene in one list, checked
|
|
101
|
+
* rows opening together in one view, superposed onto the first.
|
|
102
|
+
*/
|
|
103
|
+
const GeneStructures = observer(function GeneStructures({ feature, geneName, preferredTranscriptId, session, view, handleClose, }) {
|
|
104
|
+
const { classes } = useStyles();
|
|
105
|
+
const lookup = useUniProtIdLookup({ feature, view, preferredTranscriptId });
|
|
106
|
+
const { uniprotId } = lookup;
|
|
107
|
+
const structures = useGeneStructures({
|
|
108
|
+
jbrowse: session.jbrowse,
|
|
109
|
+
uniprotId,
|
|
110
|
+
uniprotPending: lookup.isLookupLoading,
|
|
111
|
+
geneName,
|
|
112
|
+
feature,
|
|
113
|
+
view,
|
|
114
|
+
preferredTranscriptId,
|
|
115
|
+
});
|
|
116
|
+
const { rows } = structures;
|
|
117
|
+
const [filter, setFilter] = useState('all');
|
|
118
|
+
// a pick belongs to the accession it was made from
|
|
119
|
+
const [picked, setPicked] = useState();
|
|
120
|
+
const userPick = picked && picked.uniprotId === uniprotId ? picked.keys : undefined;
|
|
121
|
+
// nothing is checked until the default is known, or the first structure to
|
|
122
|
+
// arrive would be ranked against and fetched for nothing
|
|
123
|
+
const defaultPending = !structures.defaultSettled;
|
|
124
|
+
const checked = userPick ?? (defaultPending ? [] : defaultChecked(rows));
|
|
125
|
+
const checkedRows = rows.filter(r => checked.includes(r.key));
|
|
126
|
+
const [sideBySide, setSideBySide] = useState(() => getLaunchSideBySide());
|
|
127
|
+
// A typed id reaches entries the accession's listing never offers: a
|
|
128
|
+
// structure of a complex filed under a partner, anything a paper names.
|
|
129
|
+
// Debounced, so the three characters on the way to four are not three
|
|
130
|
+
// fetches.
|
|
131
|
+
const [typedPdbId, setTypedPdbId] = useState('');
|
|
132
|
+
const trimmedTypedPdbId = typedPdbId.trim();
|
|
133
|
+
const debouncedTypedPdbId = useDebouncedValue(trimmedTypedPdbId, 400);
|
|
134
|
+
const typedPdbIdInvalid = trimmedTypedPdbId !== '' && !isPdbId(trimmedTypedPdbId);
|
|
135
|
+
const typedId = isPdbId(debouncedTypedPdbId)
|
|
136
|
+
? debouncedTypedPdbId.toLowerCase()
|
|
137
|
+
: undefined;
|
|
138
|
+
const launchStructures = typedId
|
|
139
|
+
? [{ key: `typed:${typedId}`, kind: 'pdb', pdbId: typedId }]
|
|
140
|
+
: checkedRows.map(launchStructure);
|
|
141
|
+
// a site's structure is mapped through the transcript it is listed under
|
|
142
|
+
const pivotRow = typedId ? undefined : checkedRows[0];
|
|
143
|
+
const launch = useStructureLaunch({
|
|
144
|
+
structures: launchStructures,
|
|
145
|
+
uniprotId,
|
|
146
|
+
feature,
|
|
147
|
+
view,
|
|
148
|
+
preferredTranscriptId: (pivotRow?.kind === 'dataset'
|
|
149
|
+
? pivotRow.match.transcript?.id()
|
|
150
|
+
: undefined) ?? preferredTranscriptId,
|
|
151
|
+
});
|
|
152
|
+
// RCSB answering that it has no such entry, as opposed to failing to
|
|
153
|
+
// answer, means the launch would open a view on a 404
|
|
154
|
+
const typedIdUnknown = !!typedId &&
|
|
155
|
+
launch.pdbEntryError instanceof Error &&
|
|
156
|
+
'status' in launch.pdbEntryError &&
|
|
157
|
+
launch.pdbEntryError.status === 404;
|
|
158
|
+
const typedPending = trimmedTypedPdbId !== debouncedTypedPdbId;
|
|
159
|
+
const isLoading = launch.isLoading ||
|
|
160
|
+
typedPending ||
|
|
161
|
+
(!typedId && !userPick && defaultPending);
|
|
162
|
+
const error = launch.error ?? (typedIdUnknown ? launch.pdbEntryError : undefined);
|
|
163
|
+
const missingReasons = getLaunchMissingReasons({
|
|
164
|
+
structureCount: launchStructures.length,
|
|
165
|
+
userSelectedProteinSequence: launch.selectedIsoform,
|
|
166
|
+
selectedTranscript: launch.selectedTranscript,
|
|
167
|
+
});
|
|
168
|
+
const ready = !isLoading && !error && !typedPdbIdInvalid && missingReasons.length === 0;
|
|
169
|
+
const alphaFoldChecked = launchStructures.find(s => s.kind === 'alphafold');
|
|
170
|
+
// Loading or failed, the lookup can still hold the previous query's
|
|
171
|
+
// accession, which would name the view and its 1D entry
|
|
172
|
+
const launchUniprotId = typedId && (lookup.isLookupLoading || lookup.lookupError)
|
|
173
|
+
? undefined
|
|
174
|
+
: launchStructures[0]?.kind === 'alphafold'
|
|
175
|
+
? launchStructures[0].model.accession
|
|
176
|
+
: launchStructures[0]?.kind === 'url'
|
|
177
|
+
? (launchStructures[0].uniprotId ?? uniprotId)
|
|
178
|
+
: uniprotId;
|
|
179
|
+
const toggle = (row) => {
|
|
180
|
+
setPicked({ uniprotId, keys: toggleStructure(checked, row, rows) });
|
|
181
|
+
};
|
|
182
|
+
return (React.createElement("div", { className: classes.root },
|
|
183
|
+
React.createElement(UniProtSummaryBar, { lookup: lookup }),
|
|
184
|
+
React.createElement("div", { className: classes.toolbar },
|
|
185
|
+
React.createElement("div", { className: classes.chips, role: "group", "aria-label": "Source" }, FILTERS.map(f => (React.createElement(Chip, { key: f.filter, "data-testid": `structure-filter-${f.filter}`, label: `${f.label} ${rows.filter(r => matchesFilter(r, f.filter)).length}`, color: filter === f.filter ? 'primary' : 'default', variant: filter === f.filter ? 'filled' : 'outlined', "aria-pressed": filter === f.filter, onClick: () => {
|
|
186
|
+
setFilter(f.filter);
|
|
187
|
+
} })))),
|
|
188
|
+
React.createElement(TextField, { size: "small", label: "Open by PDB ID", placeholder: "e.g. 1TUP", "data-testid": "pdb-id-input", error: typedPdbIdInvalid || typedIdUnknown, helperText: typedPdbIdInvalid
|
|
189
|
+
? 'Four characters beginning with a digit'
|
|
190
|
+
: typedIdUnknown
|
|
191
|
+
? `RCSB has no entry ${debouncedTypedPdbId.toUpperCase()}`
|
|
192
|
+
: undefined, value: typedPdbId, onChange: event => {
|
|
193
|
+
setTypedPdbId(event.target.value);
|
|
194
|
+
}, slotProps: { inputLabel: { shrink: true } }, sx: { width: 200 } })),
|
|
195
|
+
React.createElement(StructureList, { rows: rows.filter(r => matchesFilter(r, filter)), sections: structures.sections, geneName: geneName, checked: typedId ? [] : checked, uniprotLength: structures.uniprotLength, onToggle: row => {
|
|
196
|
+
setTypedPdbId('');
|
|
197
|
+
toggle(row);
|
|
198
|
+
} }),
|
|
199
|
+
React.createElement("div", { className: classes.footer },
|
|
200
|
+
React.createElement("div", { className: classes.summary },
|
|
201
|
+
React.createElement(Typography, { variant: "body2", "data-testid": "launch-summary" },
|
|
202
|
+
React.createElement("strong", null, describeLaunch(checkedRows, typedId, !userPick && defaultPending))),
|
|
203
|
+
error ? React.createElement(ErrorMessage, { error: error }) : null,
|
|
204
|
+
launch.loadingStatuses.map(status => (React.createElement(LoadingEllipses, { key: status, variant: "caption", message: status }))),
|
|
205
|
+
React.createElement(PartialFailureNotice, { message: launch.partialFailure }),
|
|
206
|
+
launch.ranking && launch.selectedTranscript ? (React.createElement(TranscriptSelector, { val: launch.selectedTranscriptId, setVal: launch.setSelectedTranscriptId, structureSequence: launch.structureSequence, feature: feature, isoforms: launch.transcripts, ranking: launch.ranking, size: "small" })) : launch.selectedTranscript && launch.selectedIsoform ? (React.createElement(Typography, { variant: "caption", color: "textSecondary" },
|
|
207
|
+
"Mapped through transcript",
|
|
208
|
+
' ',
|
|
209
|
+
getTranscriptDisplayName(launch.selectedTranscript),
|
|
210
|
+
" (",
|
|
211
|
+
stripStopCodon(launch.selectedIsoform.seq).length,
|
|
212
|
+
" aa)")) : null,
|
|
213
|
+
launch.sequencesMatch === false ? React.createElement(SequenceMismatchNotice, null) : null,
|
|
214
|
+
!isLoading && !error && missingReasons.length > 0 ? (React.createElement(Typography, { variant: "body2", color: "error" }, missingReasons.join('; '))) : null),
|
|
215
|
+
React.createElement(DialogActions, { className: classes.actions },
|
|
216
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { size: "small", checked: sideBySide, "data-testid": "protein-launch-side-by-side", onChange: (_, value) => {
|
|
217
|
+
setSideBySide(value);
|
|
218
|
+
setLaunchSideBySide(value);
|
|
219
|
+
} }), label: React.createElement(Typography, { variant: "body2" }, "Open beside the genome view") }),
|
|
220
|
+
React.createElement(ProteinViewActions, { handleClose: handleClose, ready: ready, uniprotId: launchUniprotId, userSelectedProteinSequence: launch.selectedIsoform, selectedTranscript: launch.selectedTranscript, sources: launchStructures.map(structureSource), confidenceUrl: alphaFoldChecked?.kind === 'alphafold'
|
|
221
|
+
? alphaFoldChecked.model.confidenceUrl
|
|
222
|
+
: undefined, feature: feature, view: view, session: session, sideBySide: sideBySide })))));
|
|
223
|
+
});
|
|
224
|
+
export default GeneStructures;
|
|
@@ -11,18 +11,19 @@ const HelpDialog = observer(function HelpDialog({ handleClose, }) {
|
|
|
11
11
|
React.createElement(Typography, { component: "div" },
|
|
12
12
|
React.createElement("ul", null,
|
|
13
13
|
React.createElement("li", null,
|
|
14
|
-
React.createElement("b", null, "
|
|
15
|
-
" resolves the feature to a UniProt
|
|
14
|
+
React.createElement("b", null, "Structures for the gene"),
|
|
15
|
+
" resolves the feature to a UniProt entry, shown in the bar at the top (",
|
|
16
|
+
React.createElement("i", null, "Change"),
|
|
17
|
+
" picks another), and lists every structure found for it: AlphaFold's model, the experimental PDB entries RCSB aligns to the entry, and the complexes AlphaFold DB predicted with other proteins. The list is grouped by what each structure shows: the protein on its own, the protein with another protein, and short fragments. Check several rows to open them in one view, superposed onto the first; a short fragment opens on its own. ",
|
|
18
|
+
React.createElement("i", null, "Open by PDB ID"),
|
|
19
|
+
" opens any entry instead. When this site lists its own structures for the gene, in a dataset its configuration names, they lead the list under the dataset's name and the first is checked, mapped through the transcript it was folded from."),
|
|
16
20
|
React.createElement("li", null,
|
|
17
|
-
React.createElement("b", null, "
|
|
18
|
-
" lists the experimental structures RCSB aligns to that accession, ranked on coverage and resolution. A crystal is usually one domain, often with binding partners, so the view picks the chain the transcript belongs to once the structure loads."),
|
|
19
|
-
React.createElement("li", null,
|
|
20
|
-
React.createElement("b", null, "Foldseek search"),
|
|
21
|
+
React.createElement("b", null, "Similar structures (Foldseek)"),
|
|
21
22
|
" sends the protein sequence to the foldseek.com servers and lists structures similar in shape, including ones with little sequence similarity."),
|
|
22
23
|
React.createElement("li", null,
|
|
23
|
-
React.createElement("b", null, "
|
|
24
|
+
React.createElement("b", null, "Your file or URL"),
|
|
24
25
|
" opens a structure you already have \u2014 the output of ColabFold or another modelling tool, or any PDB/mmCIF file reachable by URL."))),
|
|
25
|
-
React.createElement(Typography, { sx: { mb: 2 } }, "The
|
|
26
|
+
React.createElement(Typography, { sx: { mb: 2 } }, "The transcript list ranks the isoforms against the first checked structure, marking which match its residues exactly and counting identical residues for the rest. You do not need an exact match; the alignment absorbs the differences between the two representations."),
|
|
26
27
|
React.createElement(Typography, null,
|
|
27
28
|
"If a gene will not resolve, or something looks wrong, please open an issue at",
|
|
28
29
|
' ',
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ListItemText, Menu, MenuItem } from '@mui/material';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
const LaunchOptionsMenu = observer(function LaunchOptionsMenu({ anchorEl, onClose, options,
|
|
5
|
-
return (React.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: onClose, "data-testid": "protein-launch-options-menu" },
|
|
6
|
-
|
|
7
|
-
React.createElement(ListItemText, { primary: opt.title, secondary: opt.description })))),
|
|
8
|
-
React.createElement(Divider, null),
|
|
9
|
-
React.createElement(MenuItem, { "data-testid": "protein-launch-side-by-side", onClick: () => {
|
|
10
|
-
onSideBySideChange(!sideBySide);
|
|
11
|
-
} },
|
|
12
|
-
React.createElement(Checkbox, { checked: sideBySide, size: "small" }),
|
|
13
|
-
React.createElement(ListItemText, { primary: "Open side by side", secondary: "Place the protein view right of the genome view instead of below it" }))));
|
|
4
|
+
const LaunchOptionsMenu = observer(function LaunchOptionsMenu({ anchorEl, onClose, options, }) {
|
|
5
|
+
return (React.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: onClose, "data-testid": "protein-launch-options-menu" }, options.map(opt => (React.createElement(MenuItem, { key: opt.key, "data-testid": `protein-launch-option-${opt.key}`, onClick: opt.onClick },
|
|
6
|
+
React.createElement(ListItemText, { primary: opt.title, secondary: opt.description }))))));
|
|
14
7
|
});
|
|
15
8
|
export default LaunchOptionsMenu;
|
|
@@ -3,49 +3,30 @@ import { Dialog } from '@jbrowse/core/ui';
|
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
4
|
import { Tab, Tabs } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
import AlphaFoldDBSearch from './AlphaFoldDBSearch';
|
|
7
6
|
import FoldseekSearch from './FoldseekSearch';
|
|
7
|
+
import GeneStructures from './GeneStructures';
|
|
8
8
|
import HelpButton from './HelpButton';
|
|
9
|
-
import PdbSearch from './PdbSearch';
|
|
10
9
|
import TabPanel from './TabPanel';
|
|
11
10
|
import UserProvidedStructure from './UserProvidedStructure';
|
|
12
|
-
import
|
|
13
|
-
import { getLaunchSideBySide, setLaunchSideBySide } from '../utils/sideBySide';
|
|
11
|
+
import { getGeneDisplayName } from '../utils/util';
|
|
14
12
|
const LaunchProteinViewDialog = observer(function LaunchProteinViewDialog({ handleClose, feature, preferredTranscriptId, model, view, }) {
|
|
15
13
|
const [choice, setChoice] = useState(0);
|
|
16
14
|
const session = getSession(model);
|
|
17
|
-
|
|
18
|
-
// lookup per tab meant the same UniProt search ran twice and a row picked on
|
|
19
|
-
// one tab left the other pointing at a different gene.
|
|
20
|
-
const lookup = useUniProtIdLookup({
|
|
21
|
-
feature,
|
|
22
|
-
view,
|
|
23
|
-
preferredTranscriptId,
|
|
24
|
-
});
|
|
25
|
-
// Also the dialog's, for the same reason: a tab that has been mounted since
|
|
26
|
-
// before the user changed this would otherwise launch with its own stale copy.
|
|
27
|
-
const [sideBySide, setSideBySide] = useState(() => getLaunchSideBySide());
|
|
28
|
-
const changeSideBySide = (value) => {
|
|
29
|
-
setSideBySide(value);
|
|
30
|
-
setLaunchSideBySide(value);
|
|
31
|
-
};
|
|
15
|
+
const geneName = getGeneDisplayName(feature) || 'this gene';
|
|
32
16
|
return (React.createElement(Dialog, { "data-testid": "launch-protein-view-dialog", maxWidth: "xl", title: "Launch protein view", titleNode: React.createElement(React.Fragment, null,
|
|
33
17
|
"Launch protein view ",
|
|
34
18
|
React.createElement(HelpButton, null)), open: true, onClose: handleClose },
|
|
35
19
|
React.createElement(Tabs, { value: choice, onChange: (_, val) => {
|
|
36
20
|
setChoice(val);
|
|
37
21
|
} },
|
|
38
|
-
React.createElement(Tab, { value: 0, label:
|
|
39
|
-
React.createElement(Tab, { value: 1, label: "
|
|
40
|
-
React.createElement(Tab, { value: 2, label: "
|
|
41
|
-
React.createElement(Tab, { value: 3, label: "File or URL" })),
|
|
22
|
+
React.createElement(Tab, { value: 0, label: `Structures for ${geneName}` }),
|
|
23
|
+
React.createElement(Tab, { value: 1, label: "Similar structures (Foldseek)" }),
|
|
24
|
+
React.createElement(Tab, { value: 2, label: "Your file or URL" })),
|
|
42
25
|
React.createElement(TabPanel, { value: choice, index: 0 },
|
|
43
|
-
React.createElement(
|
|
26
|
+
React.createElement(GeneStructures, { session: session, view: view, feature: feature, geneName: geneName, preferredTranscriptId: preferredTranscriptId, handleClose: handleClose })),
|
|
44
27
|
React.createElement(TabPanel, { value: choice, index: 1 },
|
|
45
|
-
React.createElement(PdbSearch, { session: session, view: view, feature: feature, preferredTranscriptId: preferredTranscriptId, handleClose: handleClose, lookup: lookup, sideBySide: sideBySide, onSideBySideChange: changeSideBySide })),
|
|
46
|
-
React.createElement(TabPanel, { value: choice, index: 2 },
|
|
47
28
|
React.createElement(FoldseekSearch, { session: session, view: view, feature: feature, preferredTranscriptId: preferredTranscriptId, handleClose: handleClose })),
|
|
48
|
-
React.createElement(TabPanel, { value: choice, index:
|
|
29
|
+
React.createElement(TabPanel, { value: choice, index: 2 },
|
|
49
30
|
React.createElement(UserProvidedStructure, { session: session, view: view, feature: feature, preferredTranscriptId: preferredTranscriptId, handleClose: handleClose }))));
|
|
50
31
|
});
|
|
51
32
|
export default LaunchProteinViewDialog;
|
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
3
3
|
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
4
|
-
import { Button, ButtonGroup
|
|
4
|
+
import { Button, ButtonGroup } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
6
|
import LaunchOptionsMenu from './LaunchOptionsMenu';
|
|
7
|
-
import SequenceMismatchNotice from './SequenceMismatchNotice';
|
|
8
7
|
import { useSafeLaunch } from '../hooks/useSafeLaunch';
|
|
9
|
-
import { getLaunchMissingReasons } from '../utils/launchHelpers';
|
|
10
8
|
import { PROTEIN_LAUNCH_LABELS, getConditionalProteinLaunches, launch3DProteinView, } from '../utils/launchViewUtils';
|
|
11
|
-
const ProteinViewActions = observer(function ProteinViewActions({ handleClose, uniprotId, userSelectedProteinSequence, selectedTranscript,
|
|
9
|
+
const ProteinViewActions = observer(function ProteinViewActions({ handleClose, ready, uniprotId, userSelectedProteinSequence, selectedTranscript, sources, confidenceUrl, feature, view, session, sideBySide, }) {
|
|
12
10
|
const [menuAnchor, setMenuAnchor] = useState(null);
|
|
13
11
|
const closeMenu = () => {
|
|
14
12
|
setMenuAnchor(null);
|
|
15
13
|
};
|
|
16
14
|
const { runLaunch, launchError, launching } = useSafeLaunch(handleClose, closeMenu);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
userSelectedProteinSequence,
|
|
20
|
-
selectedTranscript,
|
|
21
|
-
url,
|
|
22
|
-
pdbId,
|
|
23
|
-
});
|
|
24
|
-
// Loading or errored, SWR's keepPreviousData can still hold the previous
|
|
25
|
-
// accession's structure, which Launch would open under the new name.
|
|
26
|
-
const canLaunch = !isLoading && !error && !launching && missingReasons.length === 0;
|
|
27
|
-
// Suppress the derived reasons while loading or while a real upstream error
|
|
28
|
-
// is displayed above via <ErrorMessage> — a duplicate hint would mislead.
|
|
29
|
-
const showMissingReasons = !isLoading && !error && missingReasons.length > 0;
|
|
30
|
-
const launch3DParams = {
|
|
15
|
+
const canLaunch = ready && !launching;
|
|
16
|
+
const handleLaunch3DView = runLaunch(() => launch3DProteinView({
|
|
31
17
|
session,
|
|
32
18
|
view,
|
|
33
19
|
feature,
|
|
34
20
|
selectedTranscript,
|
|
35
21
|
uniprotId,
|
|
36
|
-
|
|
22
|
+
sources,
|
|
37
23
|
userProvidedTranscriptSequence: userSelectedProteinSequence?.seq,
|
|
38
24
|
sideBySide,
|
|
39
|
-
};
|
|
40
|
-
const handleLaunch3DView = runLaunch(() => launch3DProteinView(launch3DParams));
|
|
25
|
+
}));
|
|
41
26
|
const { launch1D } = getConditionalProteinLaunches({
|
|
42
27
|
session,
|
|
43
28
|
view,
|
|
@@ -66,17 +51,15 @@ const ProteinViewActions = observer(function ProteinViewActions({ handleClose, u
|
|
|
66
51
|
];
|
|
67
52
|
return (React.createElement(React.Fragment, null,
|
|
68
53
|
launchError ? React.createElement(ErrorMessage, { error: launchError }) : null,
|
|
69
|
-
sequencesMatch === false ? React.createElement(SequenceMismatchNotice, null) : null,
|
|
70
54
|
React.createElement(Button, { variant: "contained", color: "secondary", size: "small", onClick: () => {
|
|
71
55
|
handleClose();
|
|
72
56
|
} }, "Cancel"),
|
|
73
|
-
showMissingReasons ? (React.createElement("div", { style: { marginRight: 16 } }, missingReasons.map(reason => (React.createElement(Typography, { key: reason, variant: "body2", color: "error" }, reason))))) : null,
|
|
74
57
|
React.createElement(ButtonGroup, { variant: "contained", color: "primary", size: "small" },
|
|
75
58
|
React.createElement(Button, { "data-testid": "protein-launch-button", disabled: !canLaunch, onClick: handleLaunch3DView }, "Launch"),
|
|
76
59
|
React.createElement(Button, { "data-testid": "protein-launch-options-button", disabled: !canLaunch, onClick: event => {
|
|
77
60
|
setMenuAnchor(event.currentTarget);
|
|
78
61
|
}, "aria-label": "More launch options" },
|
|
79
62
|
React.createElement(ArrowDropDownIcon, null))),
|
|
80
|
-
React.createElement(LaunchOptionsMenu, { anchorEl: menuAnchor, onClose: closeMenu, options: launchOptions
|
|
63
|
+
React.createElement(LaunchOptionsMenu, { anchorEl: menuAnchor, onClose: closeMenu, options: launchOptions })));
|
|
81
64
|
});
|
|
82
65
|
export default ProteinViewActions;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
|
+
import { Link, Typography } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
import StructureListRow from './StructureListRow';
|
|
7
|
+
import { SECTIONS } from '../utils/structureList';
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
|
+
list: {
|
|
10
|
+
flex: '1 1 auto',
|
|
11
|
+
minHeight: 160,
|
|
12
|
+
overflowY: 'auto',
|
|
13
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
14
|
+
},
|
|
15
|
+
header: {
|
|
16
|
+
position: 'sticky',
|
|
17
|
+
top: 0,
|
|
18
|
+
zIndex: 1,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
justifyContent: 'space-between',
|
|
21
|
+
alignItems: 'baseline',
|
|
22
|
+
gap: 12,
|
|
23
|
+
padding: '8px 24px 4px',
|
|
24
|
+
background: theme.palette.background.paper,
|
|
25
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
26
|
+
},
|
|
27
|
+
heading: {
|
|
28
|
+
fontSize: '0.8rem',
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
letterSpacing: '0.06em',
|
|
31
|
+
textTransform: 'uppercase',
|
|
32
|
+
color: theme.palette.text.secondary,
|
|
33
|
+
},
|
|
34
|
+
line: {
|
|
35
|
+
padding: '6px 24px',
|
|
36
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
// the protein on its own is mostly the same crystal again, so the section
|
|
40
|
+
// shows its best few and the partners start above the fold
|
|
41
|
+
const ALONE_SHOWN = 5;
|
|
42
|
+
function sectionText(section, geneName) {
|
|
43
|
+
return section === 'alone'
|
|
44
|
+
? {
|
|
45
|
+
title: `${geneName} on its own`,
|
|
46
|
+
note: 'whole protein or most of it, with any bound nucleotide or drug',
|
|
47
|
+
}
|
|
48
|
+
: section === 'partner'
|
|
49
|
+
? {
|
|
50
|
+
title: `${geneName} with another protein`,
|
|
51
|
+
note: 'experimental complexes first, then AlphaFold DB predictions',
|
|
52
|
+
}
|
|
53
|
+
: {
|
|
54
|
+
title: 'Short fragments',
|
|
55
|
+
note: 'under half the protein, so each opens on its own',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const Section = observer(function Section({ section, geneName, rows, status, checked, uniprotLength, onToggle, }) {
|
|
59
|
+
const { classes } = useStyles();
|
|
60
|
+
const [expanded, setExpanded] = useState(false);
|
|
61
|
+
const { title, note } = sectionText(section, geneName);
|
|
62
|
+
const collapsed = section === 'fragment' &&
|
|
63
|
+
!expanded &&
|
|
64
|
+
!rows.some(r => checked.includes(r.key));
|
|
65
|
+
const shown = section === 'alone' && !expanded ? rows.slice(0, ALONE_SHOWN) : rows;
|
|
66
|
+
const hidden = rows.length - shown.length;
|
|
67
|
+
const loading = status?.loading ?? [];
|
|
68
|
+
const notices = status?.notices ?? [];
|
|
69
|
+
return rows.length + loading.length + notices.length === 0 ? null : (React.createElement("div", { "data-testid": `structure-section-${section}` },
|
|
70
|
+
React.createElement("div", { className: classes.header },
|
|
71
|
+
React.createElement("span", { className: classes.heading },
|
|
72
|
+
title,
|
|
73
|
+
" \u00B7 ",
|
|
74
|
+
rows.length),
|
|
75
|
+
React.createElement(Typography, { variant: "caption", color: "textSecondary" }, note)),
|
|
76
|
+
collapsed ? (rows.length > 0 ? (React.createElement("div", { className: classes.line },
|
|
77
|
+
React.createElement(Link, { component: "button", variant: "body2", onClick: () => {
|
|
78
|
+
setExpanded(true);
|
|
79
|
+
} },
|
|
80
|
+
"Show ",
|
|
81
|
+
rows.length,
|
|
82
|
+
" short fragment",
|
|
83
|
+
rows.length === 1 ? '' : 's'))) : null) : (React.createElement(React.Fragment, null,
|
|
84
|
+
shown.map(row => (React.createElement(StructureListRow, { key: row.key, row: row, checked: checked.includes(row.key), uniprotLength: uniprotLength, onToggle: () => {
|
|
85
|
+
onToggle(row);
|
|
86
|
+
} }))),
|
|
87
|
+
hidden > 0 ? (React.createElement("div", { className: classes.line },
|
|
88
|
+
React.createElement(Link, { component: "button", variant: "body2", onClick: () => {
|
|
89
|
+
setExpanded(true);
|
|
90
|
+
} },
|
|
91
|
+
"Show ",
|
|
92
|
+
hidden,
|
|
93
|
+
" more"))) : null)),
|
|
94
|
+
loading.map(message => (React.createElement("div", { className: classes.line, key: message },
|
|
95
|
+
React.createElement(LoadingEllipses, { variant: "body2", message: message })))),
|
|
96
|
+
notices.map(message => (React.createElement(Typography, { key: message, className: classes.line, variant: "body2", color: "textSecondary" }, message)))));
|
|
97
|
+
});
|
|
98
|
+
/** Every structure for the gene, grouped by what it shows of the protein */
|
|
99
|
+
const StructureList = observer(function StructureList({ rows, sections, geneName, checked, uniprotLength, onToggle, }) {
|
|
100
|
+
const { classes } = useStyles();
|
|
101
|
+
return (React.createElement("div", { className: classes.list, "data-testid": "structure-list" }, SECTIONS.map(section => (React.createElement(Section, { key: section, section: section, geneName: geneName, rows: rows.filter(r => r.section === section), status: sections?.[section], checked: checked, uniprotLength: uniprotLength, onToggle: onToggle })))));
|
|
102
|
+
});
|
|
103
|
+
export default StructureList;
|