jbrowse-plugin-protein3d 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +5 -1
- package/dist/LaunchProteinView/components/FoldseekDatabaseSelector.js +1 -1
- package/dist/LaunchProteinView/components/FoldseekSearch.js +2 -3
- package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +2 -3
- package/dist/LaunchProteinView/components/clinVarTrackSource.js +4 -3
- package/dist/LaunchProteinView/components/launchProteinAnnotationView.js +5 -9
- package/dist/LaunchProteinView/components/proteinTrackSetup.js +3 -5
- package/dist/LaunchProteinView/hooks/useAlphaFoldDBSearch.js +3 -2
- package/dist/LaunchProteinView/hooks/useAlphaFoldData.js +10 -5
- package/dist/LaunchProteinView/hooks/useFoldseekSearch.js +5 -11
- package/dist/LaunchProteinView/index.js +47 -32
- package/dist/LaunchProteinView/resolveGeneLaunch.js +15 -12
- package/dist/LaunchProteinView/utils/genomeView.js +7 -0
- package/dist/LaunchProteinViewExtensionPoint/launchAnnotationView.js +33 -46
- package/dist/LaunchProteinViewExtensionPoint/launchProteinView.js +46 -59
- package/dist/LaunchProteinViewExtensionPoint/normalizeLaunch.js +54 -9
- package/dist/LaunchProteinViewExtensionPoint/transcriptLinkage.js +21 -11
- package/dist/ProteinView/alignmentDecision.js +40 -0
- package/dist/ProteinView/alignmentDomains.js +15 -12
- package/dist/ProteinView/clinVar.js +1 -21
- package/dist/ProteinView/hooks/useUniProtFeatures.js +13 -3
- package/dist/ProteinView/hoverReadout.js +44 -0
- package/dist/ProteinView/model.js +9 -24
- package/dist/ProteinView/proteinColor.js +40 -5
- package/dist/ProteinView/proteinToGenomeMapping.js +1 -1
- package/dist/ProteinView/reportPluginFailure.js +13 -0
- package/dist/ProteinView/structureLoader.js +22 -12
- package/dist/ProteinView/structureModel.js +176 -221
- package/dist/ProteinView/structurePipeline.js +5 -2
- package/dist/ProteinView/structureSuperposer.js +2 -6
- package/dist/ProteinView/util.js +0 -4
- package/dist/ProteinView/viewInteractions.js +12 -10
- package/dist/chunks/{AddStructureDialog-XJLVGA3J.js → AddStructureDialog-C4AV64MD.js} +2 -2
- package/dist/chunks/{AlphaMissensePathogenicityAdapter-MEDROHJG.js → AlphaMissensePathogenicityAdapter-IPPLGSAW.js} +2 -2
- package/dist/chunks/LaunchProteinViewDialog-E5HWUFF7.js +2 -0
- package/dist/chunks/LaunchProteinViewDialog-E5HWUFF7.js.map +7 -0
- package/dist/chunks/{ManualAlignmentDialog-A5WPMFVH.js → ManualAlignmentDialog-A6M3SJGN.js} +2 -2
- package/dist/chunks/ProteinView-JRTWVFRV.js +3 -0
- package/dist/chunks/{ProteinView-DDO4X5OQ.js.map → ProteinView-JRTWVFRV.js.map} +3 -3
- package/dist/chunks/{chunk-CAYS7ALN.js → chunk-2RFFBSIA.js} +2 -2
- package/dist/chunks/chunk-2RFFBSIA.js.map +7 -0
- package/dist/chunks/chunk-3LIMY6Z5.js +2 -0
- package/dist/chunks/chunk-3LIMY6Z5.js.map +7 -0
- package/dist/chunks/chunk-5K2DARPA.js +2 -0
- package/dist/chunks/chunk-5K2DARPA.js.map +7 -0
- package/dist/chunks/chunk-5NBLSM7W.js +2 -0
- package/dist/chunks/chunk-5NBLSM7W.js.map +7 -0
- package/dist/chunks/chunk-7SEZTF5X.js +2 -0
- package/dist/chunks/chunk-7SEZTF5X.js.map +7 -0
- package/dist/chunks/chunk-DIM277D5.js +3 -0
- package/dist/chunks/chunk-DIM277D5.js.map +7 -0
- package/dist/chunks/chunk-KXSOSKHQ.js +2 -0
- package/dist/chunks/{chunk-3YUQKRME.js.map → chunk-KXSOSKHQ.js.map} +3 -3
- package/dist/chunks/{chunk-MHQZMBO5.js → chunk-LZTO76OW.js} +1 -1
- package/dist/chunks/{chunk-MHQZMBO5.js.map → chunk-LZTO76OW.js.map} +1 -1
- package/dist/chunks/{chunk-OZJGL4WP.js → chunk-OI77P32P.js} +2 -2
- package/dist/chunks/chunk-R64WXKZQ.js +2 -0
- package/dist/chunks/chunk-R64WXKZQ.js.map +7 -0
- package/dist/chunks/chunk-TILXEKR4.js +2 -0
- package/dist/chunks/{chunk-DQ2NR7LG.js.map → chunk-TILXEKR4.js.map} +3 -3
- package/dist/chunks/chunk-UTDQGJCS.js +2 -0
- package/dist/chunks/{chunk-SLV25HTF.js → chunk-Z3277B6H.js} +2 -2
- package/dist/chunks/{clinVarSource-NYPYPFNL.js → clinVarSource-YXLGXSMU.js} +2 -2
- package/dist/chunks/launchAnnotationView-VEXOWETU.js +2 -0
- package/dist/chunks/launchAnnotationView-VEXOWETU.js.map +7 -0
- package/dist/chunks/launchProteinView-MCB653LS.js +2 -0
- package/dist/chunks/launchProteinView-MCB653LS.js.map +7 -0
- package/dist/chunks/launchViewUtils-IQVRMEU6.js +2 -0
- package/dist/chunks/model-HOUBVNN6.js +2 -0
- package/dist/chunks/model-HOUBVNN6.js.map +7 -0
- package/dist/chunks/{molstarExports-4ANVSWG3.js → molstarExports-PDICWFG7.js} +2 -2
- package/dist/chunks/resolveGeneLaunch-CWU3P33O.js +2 -0
- package/dist/jbrowse-plugin-protein3d.esm.js +1 -1
- package/dist/jbrowse-plugin-protein3d.esm.js.map +4 -4
- package/dist/test_data/naming.js +4 -0
- package/dist/version.js +1 -1
- package/package.json +3 -4
- package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +10 -3
- package/src/LaunchProteinView/components/FoldseekActionMenu.tsx +3 -3
- package/src/LaunchProteinView/components/FoldseekDatabaseSelector.tsx +2 -4
- package/src/LaunchProteinView/components/FoldseekResultsTable.tsx +3 -3
- package/src/LaunchProteinView/components/FoldseekSearch.tsx +11 -9
- package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +4 -3
- package/src/LaunchProteinView/components/PdbSearch.tsx +2 -2
- package/src/LaunchProteinView/components/ProteinViewActions.tsx +2 -2
- package/src/LaunchProteinView/components/UserProvidedStructure.tsx +2 -4
- package/src/LaunchProteinView/components/clinVarTrackSource.ts +12 -7
- package/src/LaunchProteinView/components/launchProteinAnnotationView.test.ts +1 -20
- package/src/LaunchProteinView/components/launchProteinAnnotationView.ts +6 -11
- package/src/LaunchProteinView/components/proteinTrackSetup.test.ts +1 -0
- package/src/LaunchProteinView/components/proteinTrackSetup.ts +3 -5
- package/src/LaunchProteinView/hooks/useAlphaFoldDBSearch.ts +5 -4
- package/src/LaunchProteinView/hooks/useAlphaFoldData.test.ts +38 -7
- package/src/LaunchProteinView/hooks/useAlphaFoldData.ts +14 -5
- package/src/LaunchProteinView/hooks/useFoldseekSearch.ts +9 -15
- package/src/LaunchProteinView/index.ts +59 -39
- package/src/LaunchProteinView/openAlphaFoldStructure.test.ts +94 -0
- package/src/LaunchProteinView/resolveGeneLaunch.ts +26 -15
- package/src/LaunchProteinView/utils/genomeView.ts +17 -0
- package/src/LaunchProteinView/utils/launchViewUtils.ts +2 -2
- package/src/LaunchProteinViewExtensionPoint/findGeneByName.ts +1 -1
- package/src/LaunchProteinViewExtensionPoint/launchAnnotationView.ts +45 -52
- package/src/LaunchProteinViewExtensionPoint/launchProteinView.ts +65 -116
- package/src/LaunchProteinViewExtensionPoint/launchViewSnapshot.test.ts +24 -29
- package/src/LaunchProteinViewExtensionPoint/normalizeLaunch.test.ts +55 -0
- package/src/LaunchProteinViewExtensionPoint/normalizeLaunch.ts +87 -11
- package/src/LaunchProteinViewExtensionPoint/transcriptLinkage.test.ts +71 -0
- package/src/LaunchProteinViewExtensionPoint/transcriptLinkage.ts +35 -15
- package/src/ProteinView/alignmentDecision.test.ts +162 -0
- package/src/ProteinView/alignmentDecision.ts +88 -0
- package/src/ProteinView/alignmentDomains.test.ts +29 -1
- package/src/ProteinView/alignmentDomains.ts +15 -12
- package/src/ProteinView/applyLociInteractivity.ts +1 -1
- package/src/ProteinView/clinVar.test.ts +13 -36
- package/src/ProteinView/clinVar.ts +1 -30
- package/src/ProteinView/connectedHover.test.ts +1 -1
- package/src/ProteinView/geneExplorerLinkage.test.ts +40 -1
- package/src/ProteinView/hooks/useUniProtFeatures.test.ts +21 -0
- package/src/ProteinView/hooks/useUniProtFeatures.ts +13 -3
- package/src/ProteinView/hoverReadout.test.ts +103 -0
- package/src/ProteinView/hoverReadout.ts +65 -0
- package/src/ProteinView/model.test.ts +27 -0
- package/src/ProteinView/model.ts +11 -24
- package/src/ProteinView/proteinColor.test.ts +49 -0
- package/src/ProteinView/proteinColor.ts +42 -9
- package/src/ProteinView/proteinToGenomeMapping.ts +7 -2
- package/src/ProteinView/reportPluginFailure.test.ts +62 -0
- package/src/ProteinView/reportPluginFailure.ts +21 -0
- package/src/ProteinView/residueColors.ts +0 -2
- package/src/ProteinView/structureLoader.test.ts +49 -0
- package/src/ProteinView/structureLoader.ts +24 -12
- package/src/ProteinView/structureModel.test.ts +62 -1
- package/src/ProteinView/structureModel.ts +191 -258
- package/src/ProteinView/structurePipeline.test.ts +13 -1
- package/src/ProteinView/structurePipeline.ts +7 -1
- package/src/ProteinView/structureSuperposer.ts +2 -6
- package/src/ProteinView/util.test.ts +2 -5
- package/src/ProteinView/util.ts +0 -5
- package/src/ProteinView/viewInteractions.test.ts +18 -1
- package/src/ProteinView/viewInteractions.ts +17 -11
- package/src/test_data/naming.ts +6 -0
- package/src/version.ts +1 -1
- package/dist/LaunchProteinView/services/foldseekApi.js +0 -14
- package/dist/chunks/LaunchProteinViewDialog-BE6VHJBW.js +0 -2
- package/dist/chunks/LaunchProteinViewDialog-BE6VHJBW.js.map +0 -7
- package/dist/chunks/ProteinView-DDO4X5OQ.js +0 -3
- package/dist/chunks/chunk-3YUQKRME.js +0 -2
- package/dist/chunks/chunk-4VILXRKO.js +0 -2
- package/dist/chunks/chunk-4VILXRKO.js.map +0 -7
- package/dist/chunks/chunk-6I2O347B.js +0 -2
- package/dist/chunks/chunk-6I2O347B.js.map +0 -7
- package/dist/chunks/chunk-AU3D6JKD.js +0 -3
- package/dist/chunks/chunk-AU3D6JKD.js.map +0 -7
- package/dist/chunks/chunk-BOWUUDK4.js +0 -2
- package/dist/chunks/chunk-CAYS7ALN.js.map +0 -7
- package/dist/chunks/chunk-CMEPVW4G.js +0 -2
- package/dist/chunks/chunk-CMEPVW4G.js.map +0 -7
- package/dist/chunks/chunk-DQ2NR7LG.js +0 -2
- package/dist/chunks/chunk-N5N56QXJ.js +0 -2
- package/dist/chunks/chunk-N5N56QXJ.js.map +0 -7
- package/dist/chunks/chunk-NQUYSAIA.js +0 -2
- package/dist/chunks/chunk-NQUYSAIA.js.map +0 -7
- package/dist/chunks/launchAnnotationView-Z4AGLG5B.js +0 -2
- package/dist/chunks/launchAnnotationView-Z4AGLG5B.js.map +0 -7
- package/dist/chunks/launchProteinView-PCSCWBK6.js +0 -2
- package/dist/chunks/launchProteinView-PCSCWBK6.js.map +0 -7
- package/dist/chunks/launchViewUtils-JYSDBWXI.js +0 -2
- package/dist/chunks/model-KRPJ5RD7.js +0 -2
- package/dist/chunks/model-KRPJ5RD7.js.map +0 -7
- package/dist/chunks/resolveGeneLaunch-3TT7UL33.js +0 -2
- package/src/LaunchProteinView/services/foldseekApi.test.ts +0 -121
- package/src/LaunchProteinView/services/foldseekApi.ts +0 -66
- /package/dist/chunks/{AddStructureDialog-XJLVGA3J.js.map → AddStructureDialog-C4AV64MD.js.map} +0 -0
- /package/dist/chunks/{AlphaMissensePathogenicityAdapter-MEDROHJG.js.map → AlphaMissensePathogenicityAdapter-IPPLGSAW.js.map} +0 -0
- /package/dist/chunks/{ManualAlignmentDialog-A5WPMFVH.js.map → ManualAlignmentDialog-A6M3SJGN.js.map} +0 -0
- /package/dist/chunks/{chunk-OZJGL4WP.js.map → chunk-OI77P32P.js.map} +0 -0
- /package/dist/chunks/{chunk-BOWUUDK4.js.map → chunk-UTDQGJCS.js.map} +0 -0
- /package/dist/chunks/{chunk-SLV25HTF.js.map → chunk-Z3277B6H.js.map} +0 -0
- /package/dist/chunks/{clinVarSource-NYPYPFNL.js.map → clinVarSource-YXLGXSMU.js.map} +0 -0
- /package/dist/chunks/{launchViewUtils-JYSDBWXI.js.map → launchViewUtils-IQVRMEU6.js.map} +0 -0
- /package/dist/chunks/{molstarExports-4ANVSWG3.js.map → molstarExports-PDICWFG7.js.map} +0 -0
- /package/dist/chunks/{resolveGeneLaunch-3TT7UL33.js.map → resolveGeneLaunch-CWU3P33O.js.map} +0 -0
|
@@ -42,13 +42,17 @@ const AlphaFoldDBSearch = observer(function AlphaFoldDBSearch({ feature, preferr
|
|
|
42
42
|
"AlphaFold DB has no model for ",
|
|
43
43
|
state.uniprotId,
|
|
44
44
|
". The PDB and Foldseek tabs may have a structure.")) : null,
|
|
45
|
+
state.modelsUnreachable ? (React.createElement(Typography, null,
|
|
46
|
+
"AlphaFold DB's model list did not answer, so Launch opens the canonical model file for ",
|
|
47
|
+
state.uniprotId,
|
|
48
|
+
", without comparing its sequence to the isoforms.")) : null,
|
|
45
49
|
React.createElement(UniProtLookupControls, { lookup: lookup }),
|
|
46
50
|
state.loadingStatuses.map(status => (React.createElement(LoadingEllipses, { key: status, variant: "subtitle2", message: status }))),
|
|
47
51
|
React.createElement(PartialFailureNotice, { message: state.isoformPartialFailure }),
|
|
48
52
|
React.createElement(UniProtLookupResults, { lookup: lookup }),
|
|
49
53
|
state.ranking &&
|
|
50
54
|
state.selectedTranscript &&
|
|
51
|
-
state.structureSequence &&
|
|
55
|
+
(state.structureSequence || state.modelsUnreachable) &&
|
|
52
56
|
state.uniprotId ? (React.createElement(React.Fragment, null,
|
|
53
57
|
React.createElement("div", { className: classes.selectorsRow },
|
|
54
58
|
React.createElement(TranscriptSelector, { val: state.userSelection, setVal: state.setUserSelection, structureSequence: state.structureSequence, feature: feature, isoforms: state.transcriptOptions, ranking: state.ranking })),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, Checkbox, FormControlLabel, FormGroup, Typography, } from '@mui/material';
|
|
3
|
+
import { FOLDSEEK_DATABASES } from 'p2s_mapper';
|
|
3
4
|
import { makeStyles } from 'tss-react/mui';
|
|
4
|
-
import { FOLDSEEK_DATABASES, } from '../services/foldseekApi';
|
|
5
5
|
const useStyles = makeStyles()({
|
|
6
6
|
root: {
|
|
7
7
|
display: 'flex',
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
3
|
import { Button, DialogActions, DialogContent, Link, TextField, Typography, } from '@mui/material';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import { stripAllStopCodons } from 'p2s_mapper';
|
|
5
|
+
import { DEFAULT_FOLDSEEK_DATABASES, cleanFoldseekSequence, foldseekLengthProblem, stripAllStopCodons, } from 'p2s_mapper';
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
import FoldseekDatabaseSelector from './FoldseekDatabaseSelector';
|
|
8
8
|
import FoldseekResultsTable from './FoldseekResultsTable';
|
|
@@ -10,7 +10,6 @@ import PartialFailureNotice from './PartialFailureNotice';
|
|
|
10
10
|
import TranscriptSelector from './TranscriptSelector';
|
|
11
11
|
import useFoldseekSearch from '../hooks/useFoldseekSearch';
|
|
12
12
|
import useTranscriptIsoformSelection from '../hooks/useTranscriptIsoformSelection';
|
|
13
|
-
import { DEFAULT_DATABASES, cleanFoldseekSequence, foldseekLengthProblem, } from '../services/foldseekApi';
|
|
14
13
|
const useStyles = makeStyles()({
|
|
15
14
|
dialogContent: {
|
|
16
15
|
width: '80em',
|
|
@@ -31,7 +30,7 @@ const useStyles = makeStyles()({
|
|
|
31
30
|
const FoldseekSearch = observer(function FoldseekSearch({ feature, preferredTranscriptId, session, view, handleClose, }) {
|
|
32
31
|
const { classes } = useStyles();
|
|
33
32
|
const [userEditedSequence, setUserEditedSequence] = useState();
|
|
34
|
-
const [selectedDatabases, setSelectedDatabases] = useState(
|
|
33
|
+
const [selectedDatabases, setSelectedDatabases] = useState(DEFAULT_FOLDSEEK_DATABASES);
|
|
35
34
|
const [show3Di, setShow3Di] = useState(false);
|
|
36
35
|
const { results, cleanedAaSequence, di3Sequence, isLoading, isPredicting, error, statusMessage, predictStructure, search, cancel, reset, } = useFoldseekSearch();
|
|
37
36
|
const { transcripts, isoformSequences, ranking, isLoading: isLoadingIsoforms, error: isoformError, partialFailure: isoformPartialFailure, selectedTranscriptId: effectiveSelectedTranscriptId, setSelectedTranscriptId: setUserSelection, selectedTranscript, selectedIsoform: selectedIsoformData, } = useTranscriptIsoformSelection({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { getSession } from '@jbrowse/core/util';
|
|
4
4
|
import { Tab, Tabs } from '@mui/material';
|
|
5
5
|
import AlphaFoldDBSearch from './AlphaFoldDBSearch';
|
|
6
6
|
import FoldseekSearch from './FoldseekSearch';
|
|
@@ -10,10 +10,9 @@ import TabPanel from './TabPanel';
|
|
|
10
10
|
import UserProvidedStructure from './UserProvidedStructure';
|
|
11
11
|
import useUniProtIdLookup from '../hooks/useUniProtIdLookup';
|
|
12
12
|
import { getLaunchSideBySide, setLaunchSideBySide } from '../utils/sideBySide';
|
|
13
|
-
export default function LaunchProteinViewDialog({ handleClose, feature, preferredTranscriptId, model, }) {
|
|
13
|
+
export default function LaunchProteinViewDialog({ handleClose, feature, preferredTranscriptId, model, view, }) {
|
|
14
14
|
const [choice, setChoice] = useState(0);
|
|
15
15
|
const session = getSession(model);
|
|
16
|
-
const view = getContainingView(model);
|
|
17
16
|
// One lookup for the whole dialog: the tabs stay mounted once visited, so a
|
|
18
17
|
// lookup per tab meant the same UniProt search ran twice and a row picked on
|
|
19
18
|
// one tab left the other pointing at a different gene.
|
|
@@ -5,6 +5,7 @@ import { linkedGenomeAssemblyName, resolveLinkageAlignment, } from '../../Protei
|
|
|
5
5
|
import { sessionLinkageHost } from '../../Protein1DLinkage/sessionLinkageHost';
|
|
6
6
|
import { clinVarBuild, isUnnumberedMitochondrion, } from '../../ProteinView/clinVar';
|
|
7
7
|
import { placeClinVarOnTranscript } from '../../ProteinView/clinVarSource';
|
|
8
|
+
import { withTimeout } from '../../ProteinView/variantEffectSource';
|
|
8
9
|
// TP53's slice is under 1 MB; a stalled host should not hold the view open
|
|
9
10
|
// forever on one track
|
|
10
11
|
const CLINVAR_TIMEOUT_MS = 60_000;
|
|
@@ -35,13 +36,13 @@ export async function clinVarTrackConfFor({ session, linkage, idPrefix, }) {
|
|
|
35
36
|
if (!('alignment' in linked)) {
|
|
36
37
|
return undefined;
|
|
37
38
|
}
|
|
38
|
-
const { placed } = await placeClinVarOnTranscript({
|
|
39
|
+
const { placed } = await withTimeout(signal => placeClinVarOnTranscript({
|
|
39
40
|
build,
|
|
40
41
|
feature: new SimpleFeature(feature),
|
|
41
42
|
assemblyName,
|
|
42
43
|
session,
|
|
43
|
-
signal
|
|
44
|
-
});
|
|
44
|
+
signal,
|
|
45
|
+
}), CLINVAR_TIMEOUT_MS);
|
|
45
46
|
const mapper = makeCoordinateMapper(linked.alignment);
|
|
46
47
|
return clinVarTrackConf({
|
|
47
48
|
uniprotId,
|
|
@@ -18,15 +18,11 @@ export async function launchProteinAnnotationView(args) {
|
|
|
18
18
|
/** The view, once the entry's feature types are in hand. */
|
|
19
19
|
export async function openProteinAnnotationView({ session, feature, selectedTranscript, uniprotId, confidenceUrl, connectedViewId, connectedAssemblyName, featureTypes, clinVar, }) {
|
|
20
20
|
// A second view of an entry, another isoform's say, shares the first's
|
|
21
|
-
// assembly; adding it again makes the host warn. `has`,
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
const known = assemblyManager.has
|
|
27
|
-
? assemblyManager.has(uniprotId)
|
|
28
|
-
: !!assemblyManager.get(uniprotId);
|
|
29
|
-
if (!known) {
|
|
21
|
+
// assembly; adding it again makes the host warn. `has`, because `get` reports
|
|
22
|
+
// an unknown name to every plugin that resolves assemblies, and on a
|
|
23
|
+
// jbrowse.org/ucsc config the Hubs plugin then probes jbrowse.org/ucsc/P04637/
|
|
24
|
+
// and logs two 404s.
|
|
25
|
+
if (!session.assemblyManager.has(uniprotId)) {
|
|
30
26
|
setupProteinAssembly(session, uniprotId);
|
|
31
27
|
}
|
|
32
28
|
// The linkage drives the 1D<->genome hover highlight. It is a property of
|
|
@@ -2,15 +2,13 @@ import { myfetch, uniprotGffUrl } from 'p2s_mapper';
|
|
|
2
2
|
import { RESIDUE_COLORS } from '../../ProteinView/residueColors';
|
|
3
3
|
import { UNIPROT_FEATURE_COLOR } from '../../ProteinView/uniprotFeatureTypes';
|
|
4
4
|
// A quantitative display's color reads only `score`, and a linear one ramps
|
|
5
|
-
// across the plot's y domain, so it takes the ramp's stops and
|
|
6
|
-
// Hosts before 2026-09-26 refuse a wiggle color's `title` and `labels`; the
|
|
7
|
-
// threshold needs its labels, and the ramp leaves both off to load there too.
|
|
5
|
+
// across the plot's y domain, so it takes the ramp's stops, middle and title
|
|
8
6
|
function wiggleColor(color) {
|
|
9
7
|
if (color.scale === 'threshold') {
|
|
10
8
|
return { ...color, field: 'score' };
|
|
11
9
|
}
|
|
12
|
-
const { scale, range, domainMid } = color;
|
|
13
|
-
return { field: 'score', scale, range, domainMid };
|
|
10
|
+
const { scale, range, domainMid, title } = color;
|
|
11
|
+
return { field: 'score', scale, range, domainMid, title };
|
|
14
12
|
}
|
|
15
13
|
export async function fetchUniProtFeatureTypes(uniprotId) {
|
|
16
14
|
const data = await (await myfetch(uniprotGffUrl(uniprotId))).text();
|
|
@@ -4,7 +4,7 @@ import useAlphaFoldData from './useAlphaFoldData';
|
|
|
4
4
|
import useTranscriptIsoformSelection from './useTranscriptIsoformSelection';
|
|
5
5
|
export default function useAlphaFoldDBSearch({ feature, view, lookup, preferredTranscriptId, }) {
|
|
6
6
|
const { uniprotId, isLookupLoading } = lookup;
|
|
7
|
-
const { isLoading: isAlphaFoldLoading, isValidating: isAlphaFoldValidating,
|
|
7
|
+
const { isLoading: isAlphaFoldLoading, isValidating: isAlphaFoldValidating, modelsUnreachable, model, noModel, } = useAlphaFoldData({ uniprotId, feature, view });
|
|
8
8
|
// a stable array, or the isoform picker realigns on every render
|
|
9
9
|
const modelSequence = model?.sequence;
|
|
10
10
|
const structureSequences = useMemo(() => (modelSequence ? [modelSequence] : undefined), [modelSequence]);
|
|
@@ -23,7 +23,7 @@ export default function useAlphaFoldDBSearch({ feature, view, lookup, preferredT
|
|
|
23
23
|
].filter(s => typeof s === 'string');
|
|
24
24
|
const isLoading = loadingStatuses.length > 0;
|
|
25
25
|
// errors wait for loading to finish, so a lookup in flight doesn't flash one
|
|
26
|
-
const rawError = isoformError ?? lookup.lookupError
|
|
26
|
+
const rawError = isoformError ?? lookup.lookupError;
|
|
27
27
|
const error = isLoading ? undefined : rawError;
|
|
28
28
|
return {
|
|
29
29
|
...lookup,
|
|
@@ -40,6 +40,7 @@ export default function useAlphaFoldDBSearch({ feature, view, lookup, preferredT
|
|
|
40
40
|
modelAccession: model?.accession,
|
|
41
41
|
structureSequence,
|
|
42
42
|
noModel,
|
|
43
|
+
modelsUnreachable: isLoading ? undefined : modelsUnreachable,
|
|
43
44
|
error,
|
|
44
45
|
loadingStatuses,
|
|
45
46
|
// While the structure is refetched, structureSequence is still the previous
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { fetchAlphaFoldModels
|
|
2
|
+
import { fetchAlphaFoldModels } from 'p2s_mapper';
|
|
3
3
|
import useSWR from 'swr';
|
|
4
4
|
import { STATIC_SWR_OPTIONS } from './swrOptions';
|
|
5
5
|
import useIsoformProteinSequences from './useIsoformProteinSequences';
|
|
6
|
-
|
|
6
|
+
import { launchAlphaFoldModel } from '../resolveGeneLaunch';
|
|
7
|
+
/**
|
|
8
|
+
* The AlphaFold DB model a launch opens for this gene's accession, the
|
|
9
|
+
* canonical file when the API does not answer.
|
|
10
|
+
*/
|
|
7
11
|
export default function useAlphaFoldData({ uniprotId, feature, view, }) {
|
|
8
12
|
const { data, isLoading, isValidating, error } = useSWR(uniprotId ? ['alphafold-models', uniprotId] : null, ([, id]) => fetchAlphaFoldModels(id), { ...STATIC_SWR_OPTIONS, keepPreviousData: true });
|
|
9
13
|
const { isoformSequences } = useIsoformProteinSequences({ feature, view });
|
|
10
14
|
// keepPreviousData hands back the last accession's models after an error
|
|
11
15
|
// and after the accession is cleared, when the key is null
|
|
12
|
-
const model = useMemo(() => uniprotId && data
|
|
13
|
-
?
|
|
16
|
+
const model = useMemo(() => uniprotId && (data || error)
|
|
17
|
+
? launchAlphaFoldModel(uniprotId, error ? undefined : data, isoformSequences)
|
|
14
18
|
: undefined, [uniprotId, data, error, isoformSequences]);
|
|
19
|
+
const modelsUnreachable = uniprotId ? error : undefined;
|
|
15
20
|
return {
|
|
16
21
|
isLoading,
|
|
17
22
|
isValidating,
|
|
18
|
-
|
|
23
|
+
modelsUnreachable,
|
|
19
24
|
model,
|
|
20
25
|
noModel: !!uniprotId && !isLoading && !error && data?.length === 0,
|
|
21
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { predict3Di, submitFoldseekSearch, waitForFoldseekResults, } from '
|
|
2
|
+
import { predict3Di, submitFoldseekSearch, waitForFoldseekResults, } from 'p2s_mapper';
|
|
3
3
|
export default function useFoldseekSearch() {
|
|
4
4
|
const [results, setResults] = useState();
|
|
5
5
|
const [predictData, setPredictData] = useState();
|
|
@@ -28,7 +28,7 @@ export default function useFoldseekSearch() {
|
|
|
28
28
|
setError(undefined);
|
|
29
29
|
setStatusMessage('Predicting 3Di structure...');
|
|
30
30
|
try {
|
|
31
|
-
const result = await predict3Di(
|
|
31
|
+
const result = await predict3Di(aaSequence, { signal });
|
|
32
32
|
setPredictData(result);
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
@@ -52,15 +52,9 @@ export default function useFoldseekSearch() {
|
|
|
52
52
|
setError(undefined);
|
|
53
53
|
setStatusMessage('Submitting search...');
|
|
54
54
|
try {
|
|
55
|
-
const ticket = await submitFoldseekSearch({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
databases,
|
|
59
|
-
signal,
|
|
60
|
-
});
|
|
61
|
-
const result = await waitForFoldseekResults({
|
|
62
|
-
ticketId: ticket.id,
|
|
63
|
-
onStatusChange: setStatusMessage,
|
|
55
|
+
const ticket = await submitFoldseekSearch({ aaSequence: aaSeq, di3Sequence: di3Seq, databases }, { signal });
|
|
56
|
+
const result = await waitForFoldseekResults(ticket.id, {
|
|
57
|
+
onStatus: setStatusMessage,
|
|
64
58
|
signal,
|
|
65
59
|
});
|
|
66
60
|
setResults(result);
|
|
@@ -2,6 +2,7 @@ import { lazy } from 'react';
|
|
|
2
2
|
import { getContainingTrack, getContainingView, getSession, isGeneLikeType, } from '@jbrowse/core/util';
|
|
3
3
|
import AddIcon from '@mui/icons-material/Add';
|
|
4
4
|
import { isCodingFeature } from './codingFeature';
|
|
5
|
+
import { isLaunchingGenomeView } from './utils/genomeView';
|
|
5
6
|
import { getGeneDisplayName } from './utils/util';
|
|
6
7
|
// the menu items register at boot; what they open loads on the first click
|
|
7
8
|
const LaunchProteinViewDialog = lazy(() => import('./components/LaunchProteinViewDialog'));
|
|
@@ -49,11 +50,17 @@ function withCodingFeature(self, target, then) {
|
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
function openDialog(self, target, feature) {
|
|
52
|
-
const
|
|
53
|
-
|
|
53
|
+
const session = getSession(self);
|
|
54
|
+
const view = getContainingView(self);
|
|
55
|
+
if (!isLaunchingGenomeView(view)) {
|
|
56
|
+
session.notify(`A protein view launches from a genome view, not a ${view.type}`, 'warning');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
session.queueDialog(handleClose => [
|
|
54
60
|
LaunchProteinViewDialog,
|
|
55
61
|
{
|
|
56
|
-
model:
|
|
62
|
+
model: getContainingTrack(self),
|
|
63
|
+
view,
|
|
57
64
|
handleClose,
|
|
58
65
|
feature,
|
|
59
66
|
preferredTranscriptId: target.preferredTranscriptId,
|
|
@@ -65,49 +72,57 @@ function launchProteinView(self, target) {
|
|
|
65
72
|
openDialog(self, target, feature);
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
|
-
|
|
69
|
-
const names = 'assemblyNames' in view ? view.assemblyNames : undefined;
|
|
70
|
-
const first = Array.isArray(names) ? names[0] : undefined;
|
|
71
|
-
return typeof first === 'string' ? first : undefined;
|
|
72
|
-
}
|
|
75
|
+
const lookingUp = new Set();
|
|
73
76
|
// The dialog's defaults without the dialog. Where they name no single
|
|
74
77
|
// structure, a gene two UniProt entries answer to or one AlphaFold has not
|
|
75
78
|
// folded, the dialog opens for the choice only a person can make.
|
|
76
79
|
function openAlphaFoldStructure(self, target) {
|
|
77
80
|
const session = getSession(self);
|
|
78
81
|
const view = getContainingView(self);
|
|
79
|
-
const assemblyName = firstAssemblyName(view);
|
|
80
82
|
withCodingFeature(self, target, async (feature) => {
|
|
81
83
|
const name = getGeneDisplayName(feature);
|
|
82
|
-
|
|
84
|
+
const genomeView = isLaunchingGenomeView(view) ? view : undefined;
|
|
85
|
+
const assemblyName = genomeView?.assemblyNames[0];
|
|
86
|
+
if (!genomeView || !assemblyName) {
|
|
83
87
|
openDialog(self, target, feature);
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
await
|
|
99
|
-
session,
|
|
100
|
-
view,
|
|
90
|
+
const key = `${genomeView.id}:${feature.id()}:${target.preferredTranscriptId}`;
|
|
91
|
+
if (lookingUp.has(key)) {
|
|
92
|
+
session.notify(`Still looking up the AlphaFold structure of ${name}`, 'info');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
lookingUp.add(key);
|
|
96
|
+
try {
|
|
97
|
+
session.notify(`Looking up the AlphaFold structure of ${name}`, 'info');
|
|
98
|
+
const [{ describeMissingStructure, resolveGeneLaunch, sessionGeneLaunchHost }, { launch3DProteinView },] = await Promise.all([
|
|
99
|
+
import('./resolveGeneLaunch'),
|
|
100
|
+
import('./utils/launchViewUtils'),
|
|
101
|
+
]);
|
|
102
|
+
const launch = await resolveGeneLaunch({
|
|
103
|
+
host: sessionGeneLaunchHost(session, assemblyName),
|
|
101
104
|
feature,
|
|
102
|
-
|
|
103
|
-
uniprotId,
|
|
104
|
-
url,
|
|
105
|
-
userProvidedTranscriptSequence,
|
|
105
|
+
preferredTranscriptId: target.preferredTranscriptId,
|
|
106
106
|
});
|
|
107
|
+
const { transcript, userProvidedTranscriptSequence, uniprotId, url } = launch;
|
|
108
|
+
if (url) {
|
|
109
|
+
await launch3DProteinView({
|
|
110
|
+
session,
|
|
111
|
+
view: genomeView,
|
|
112
|
+
feature,
|
|
113
|
+
selectedTranscript: transcript,
|
|
114
|
+
uniprotId,
|
|
115
|
+
url,
|
|
116
|
+
userProvidedTranscriptSequence,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
session.notify(describeMissingStructure(name, launch), launch.lookupError === undefined ? 'info' : 'warning');
|
|
121
|
+
openDialog(self, target, feature);
|
|
122
|
+
}
|
|
107
123
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
openDialog(self, target, feature);
|
|
124
|
+
finally {
|
|
125
|
+
lookingUp.delete(key);
|
|
111
126
|
}
|
|
112
127
|
});
|
|
113
128
|
}
|
|
@@ -5,6 +5,17 @@ import { rankIsoforms, rankedTranscriptId, } from '../AlignTranscriptRpc/isoform
|
|
|
5
5
|
import { fetchTranscriptProteinSeqs } from './utils/translateTranscripts';
|
|
6
6
|
import { extractFeatureIdentifiers, extractTaxonId } from './utils/util';
|
|
7
7
|
import { alignOffThread } from '../ProteinView/alignOffThread';
|
|
8
|
+
/**
|
|
9
|
+
* The AlphaFold file a launch opens, `models` undefined when the API did not
|
|
10
|
+
* answer. That says nothing about the accession, so the spelled canonical
|
|
11
|
+
* filename is worth a try; an API answering with no models has said there is
|
|
12
|
+
* nothing to open. The structure loader draws the same line.
|
|
13
|
+
*/
|
|
14
|
+
export function launchAlphaFoldModel(uniprotId, models, isoformSequences) {
|
|
15
|
+
return models
|
|
16
|
+
? pickAlphaFoldModel(models, isoformSequences)
|
|
17
|
+
: { accession: uniprotId, url: getAlphaFoldStructureUrl(uniprotId) };
|
|
18
|
+
}
|
|
8
19
|
/** Why a resolved gene has no structure to open. */
|
|
9
20
|
export function describeMissingStructure(geneName, { uniprotId, lookupError }) {
|
|
10
21
|
return uniprotId
|
|
@@ -101,19 +112,11 @@ export async function resolveGeneLaunch({ host, feature, preferredTranscriptId,
|
|
|
101
112
|
id: t.transcript.id(),
|
|
102
113
|
seq: t.seq,
|
|
103
114
|
}));
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// said there is nothing to open. The structure loader draws the same line.
|
|
107
|
-
const models = uniprotId
|
|
108
|
-
? await host.fetchAlphaFoldModels(uniprotId).catch(() => undefined)
|
|
109
|
-
: [];
|
|
110
|
-
const model = models
|
|
111
|
-
? pickAlphaFoldModel(models, Object.fromEntries(isoforms.map(i => [i.id, { seq: i.seq ?? '' }])))
|
|
115
|
+
const model = uniprotId
|
|
116
|
+
? launchAlphaFoldModel(uniprotId, await host.fetchAlphaFoldModels(uniprotId).catch(() => undefined), Object.fromEntries(isoforms.map(i => [i.id, { seq: i.seq ?? '' }])))
|
|
112
117
|
: undefined;
|
|
113
|
-
const url =
|
|
114
|
-
|
|
115
|
-
: model?.url;
|
|
116
|
-
const structureSequences = model ? [model.sequence] : [];
|
|
118
|
+
const url = model?.url;
|
|
119
|
+
const structureSequences = model?.sequence ? [model.sequence] : [];
|
|
117
120
|
const preferred = translated.find(t => t.transcript.id() === preferredTranscriptId);
|
|
118
121
|
const ranking = preferred
|
|
119
122
|
? undefined
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SimpleFeature } from '@jbrowse/core/util';
|
|
2
2
|
import { fetchAlphaFoldModels } from 'p2s_mapper';
|
|
3
3
|
import { normalizeAnnotationLaunch } from './normalizeAnnotationLaunch';
|
|
4
|
-
import {
|
|
4
|
+
import { resolveTranscriptLinkage, withConnectedGenomeView, } from './transcriptLinkage';
|
|
5
5
|
import { clinVarTrackConfFor } from '../LaunchProteinView/components/clinVarTrackSource';
|
|
6
6
|
import { openProteinAnnotationView } from '../LaunchProteinView/components/launchProteinAnnotationView';
|
|
7
7
|
import { canAddTemporaryAssembly } from '../LaunchProteinView/components/proteinAssemblySetup';
|
|
@@ -20,63 +20,50 @@ async function entryConfidenceUrl(uniprotId) {
|
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
/** Fails by throwing, as `launchProteinView` does and for the same reason. */
|
|
23
24
|
export async function launchAnnotationView(args) {
|
|
24
25
|
const { session, ...given } = args;
|
|
25
|
-
const fail = (e) => {
|
|
26
|
-
console.error(e);
|
|
27
|
-
session.notify(`Could not launch protein annotation view: ${e}`, 'error');
|
|
28
|
-
return args;
|
|
29
|
-
};
|
|
30
26
|
const normalized = normalizeAnnotationLaunch(given);
|
|
31
27
|
for (const warning of normalized.warnings) {
|
|
32
28
|
console.warn(warning);
|
|
33
29
|
session.notify(`Protein annotation view launch: ${warning}`, 'warning');
|
|
34
30
|
}
|
|
35
31
|
if ('error' in normalized) {
|
|
36
|
-
|
|
32
|
+
throw new Error(normalized.error);
|
|
37
33
|
}
|
|
38
34
|
if (!canAddTemporaryAssembly(session)) {
|
|
39
|
-
|
|
35
|
+
throw new Error('this session cannot add the temporary assembly the view opens on');
|
|
40
36
|
}
|
|
41
37
|
const { launch } = normalized;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
: 'no UniProt entry to open');
|
|
51
|
-
}
|
|
52
|
-
const uniprotId = uniProtEntry(accession);
|
|
53
|
-
// fetched before anything is added, so a failure leaves no view
|
|
54
|
-
const [featureTypes, confidenceUrl] = await Promise.all([
|
|
55
|
-
fetchUniProtFeatureTypes(uniprotId),
|
|
56
|
-
entryConfidenceUrl(uniprotId),
|
|
57
|
-
]);
|
|
58
|
-
const transcript = resolved
|
|
59
|
-
? new SimpleFeature(resolved.feature)
|
|
60
|
-
: undefined;
|
|
61
|
-
const connectedViewId = transcript
|
|
62
|
-
? connectGenomeView(session, launch.connectedViewId, connectedView)
|
|
63
|
-
: undefined;
|
|
64
|
-
await openProteinAnnotationView({
|
|
65
|
-
session,
|
|
66
|
-
feature: transcript,
|
|
67
|
-
selectedTranscript: transcript,
|
|
68
|
-
uniprotId,
|
|
69
|
-
confidenceUrl,
|
|
70
|
-
connectedViewId,
|
|
71
|
-
connectedAssemblyName: (launch.connectedViewId
|
|
72
|
-
? viewAssemblyName(session, launch.connectedViewId)
|
|
73
|
-
: undefined) ?? connectedView?.assembly,
|
|
74
|
-
featureTypes,
|
|
75
|
-
clinVar: (linkage, idPrefix) => clinVarTrackConfFor({ session, linkage, idPrefix }),
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
return fail(e);
|
|
38
|
+
const { named, resolved, connectedView } = await resolveTranscriptLinkage(session, launch, {
|
|
39
|
+
findStructure: !launch.uniprotId,
|
|
40
|
+
});
|
|
41
|
+
const accession = launch.uniprotId ?? named?.uniprotId;
|
|
42
|
+
if (!accession) {
|
|
43
|
+
throw new Error(launch.gene && named
|
|
44
|
+
? `${describeMissingStructure(launch.gene, named)}; name a uniprotId`
|
|
45
|
+
: 'no UniProt entry to open');
|
|
80
46
|
}
|
|
47
|
+
const uniprotId = uniProtEntry(accession);
|
|
48
|
+
const [featureTypes, confidenceUrl] = await Promise.all([
|
|
49
|
+
fetchUniProtFeatureTypes(uniprotId),
|
|
50
|
+
entryConfidenceUrl(uniprotId),
|
|
51
|
+
]);
|
|
52
|
+
const transcript = resolved ? new SimpleFeature(resolved.feature) : undefined;
|
|
53
|
+
await withConnectedGenomeView(session, transcript
|
|
54
|
+
? { connectedViewId: launch.connectedViewId, connectedView }
|
|
55
|
+
: {}, connectedViewId => openProteinAnnotationView({
|
|
56
|
+
session,
|
|
57
|
+
feature: transcript,
|
|
58
|
+
selectedTranscript: transcript,
|
|
59
|
+
uniprotId,
|
|
60
|
+
confidenceUrl,
|
|
61
|
+
connectedViewId,
|
|
62
|
+
connectedAssemblyName: (launch.connectedViewId
|
|
63
|
+
? viewAssemblyName(session, launch.connectedViewId)
|
|
64
|
+
: undefined) ?? connectedView?.assembly,
|
|
65
|
+
featureTypes,
|
|
66
|
+
clinVar: (linkage, idPrefix) => clinVarTrackConfFor({ session, linkage, idPrefix }),
|
|
67
|
+
}));
|
|
81
68
|
return args;
|
|
82
69
|
}
|