jbrowse-plugin-protein3d 0.0.2 → 0.0.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/dist/AddHighlightModel/GenomeMouseoverHighlight.js +3 -9
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js +4 -3
- package/dist/AddHighlightModel/ProteinToGenomeClickHighlight.js.map +1 -1
- package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.d.ts +1 -2
- package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js +4 -3
- package/dist/AddHighlightModel/ProteinToGenomeHoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/util.js +1 -1
- package/dist/AddHighlightModel/util.js.map +1 -1
- package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.d.ts +16 -0
- package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js +43 -0
- package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.js.map +1 -0
- package/dist/AlphaFoldConfidenceAdapter/configSchema.d.ts +13 -0
- package/dist/AlphaFoldConfidenceAdapter/configSchema.js +16 -0
- package/dist/AlphaFoldConfidenceAdapter/configSchema.js.map +1 -0
- package/dist/AlphaFoldConfidenceAdapter/index.d.ts +2 -0
- package/dist/AlphaFoldConfidenceAdapter/index.js +11 -0
- package/dist/AlphaFoldConfidenceAdapter/index.js.map +1 -0
- package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.d.ts +30 -0
- package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js +78 -0
- package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.js.map +1 -0
- package/dist/AlphaMissensePathogenicityAdapter/configSchema.d.ts +13 -0
- package/dist/AlphaMissensePathogenicityAdapter/configSchema.js +16 -0
- package/dist/AlphaMissensePathogenicityAdapter/configSchema.js.map +1 -0
- package/dist/AlphaMissensePathogenicityAdapter/index.d.ts +2 -0
- package/dist/AlphaMissensePathogenicityAdapter/index.js +11 -0
- package/dist/AlphaMissensePathogenicityAdapter/index.js.map +1 -0
- package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +201 -34
- package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js.map +1 -1
- package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.d.ts +7 -4
- package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js +35 -14
- package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js.map +1 -1
- package/dist/LaunchProteinView/components/HelpButton.js +6 -2
- package/dist/LaunchProteinView/components/HelpButton.js.map +1 -1
- package/dist/LaunchProteinView/components/HelpDialog.js +13 -4
- package/dist/LaunchProteinView/components/HelpDialog.js.map +1 -1
- package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +9 -9
- package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js.map +1 -1
- package/dist/LaunchProteinView/components/MSATable.d.ts +10 -0
- package/dist/LaunchProteinView/components/MSATable.js +55 -0
- package/dist/LaunchProteinView/components/MSATable.js.map +1 -0
- package/dist/LaunchProteinView/components/TranscriptSelector.d.ts +7 -3
- package/dist/LaunchProteinView/components/TranscriptSelector.js +25 -8
- package/dist/LaunchProteinView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchProteinView/components/UserProvidedStructure.js +67 -47
- package/dist/LaunchProteinView/components/UserProvidedStructure.js.map +1 -1
- package/dist/LaunchProteinView/{calculateProteinSequence.js → components/calculateProteinSequence.js} +5 -3
- package/dist/LaunchProteinView/components/calculateProteinSequence.js.map +1 -0
- package/dist/LaunchProteinView/components/useIsoformProteinSequences.d.ts +14 -0
- package/dist/LaunchProteinView/{useProteinSequences.js → components/useIsoformProteinSequences.js} +11 -6
- package/dist/LaunchProteinView/components/useIsoformProteinSequences.js.map +1 -0
- package/dist/LaunchProteinView/components/useLocalStructureFileSequence.d.ts +7 -0
- package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js +64 -0
- package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js.map +1 -0
- package/dist/LaunchProteinView/{useMyGeneInfo.d.ts → components/useMyGeneInfoUniprotIdLookup.d.ts} +2 -2
- package/dist/LaunchProteinView/{useMyGeneInfo.js → components/useMyGeneInfoUniprotIdLookup.js} +15 -10
- package/dist/LaunchProteinView/components/useMyGeneInfoUniprotIdLookup.js.map +1 -0
- package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.d.ts +7 -0
- package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js +59 -0
- package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js.map +1 -0
- package/dist/LaunchProteinView/{util.d.ts → components/util.d.ts} +0 -10
- package/dist/LaunchProteinView/{util.js → components/util.js} +4 -25
- package/dist/LaunchProteinView/components/util.js.map +1 -0
- package/dist/LaunchProteinView/index.js +6 -2
- package/dist/LaunchProteinView/index.js.map +1 -1
- package/dist/ProteinView/{loadStructureFromData.d.ts → addStructureFromData.d.ts} +2 -2
- package/dist/ProteinView/{loadStructureFromData.js → addStructureFromData.js} +3 -8
- package/dist/ProteinView/addStructureFromData.js.map +1 -0
- package/dist/ProteinView/{loadStructureFromURL.d.ts → addStructureFromURL.d.ts} +2 -2
- package/dist/ProteinView/{loadStructureFromURL.js → addStructureFromURL.js} +11 -9
- package/dist/ProteinView/addStructureFromURL.js.map +1 -0
- package/dist/ProteinView/clearSelection.js +1 -1
- package/dist/ProteinView/clearSelection.js.map +1 -1
- package/dist/ProteinView/components/ProteinAlignment.d.ts +2 -2
- package/dist/ProteinView/components/ProteinAlignment.js +37 -26
- package/dist/ProteinView/components/ProteinAlignment.js.map +1 -1
- package/dist/ProteinView/components/ProteinAlignmentHelpButton.d.ts +2 -2
- package/dist/ProteinView/components/ProteinAlignmentHelpButton.js +6 -4
- package/dist/ProteinView/components/ProteinAlignmentHelpButton.js.map +1 -1
- package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js +6 -5
- package/dist/ProteinView/components/ProteinAlignmentHelpDialog.js.map +1 -1
- package/dist/ProteinView/components/ProteinView.js +18 -60
- package/dist/ProteinView/components/ProteinView.js.map +1 -1
- package/dist/ProteinView/components/{Header.js → ProteinViewHeader.js} +29 -12
- package/dist/ProteinView/components/ProteinViewHeader.js.map +1 -0
- package/dist/ProteinView/components/SplitString.d.ts +4 -4
- package/dist/ProteinView/components/SplitString.js +4 -4
- package/dist/ProteinView/components/SplitString.js.map +1 -1
- package/dist/ProteinView/genomeToProtein.d.ts +2 -2
- package/dist/ProteinView/genomeToProtein.js +4 -5
- package/dist/ProteinView/genomeToProtein.js.map +1 -1
- package/dist/ProteinView/highlightResidue.js +2 -2
- package/dist/ProteinView/highlightResidue.js.map +1 -1
- package/dist/ProteinView/launchRemotePairwiseAlignment.d.ts +2 -5
- package/dist/ProteinView/launchRemotePairwiseAlignment.js +7 -3
- package/dist/ProteinView/launchRemotePairwiseAlignment.js.map +1 -1
- package/dist/ProteinView/model.d.ts +496 -156
- package/dist/ProteinView/model.js +66 -225
- package/dist/ProteinView/model.js.map +1 -1
- package/dist/ProteinView/proteinToGenomeMapping.d.ts +6 -6
- package/dist/ProteinView/proteinToGenomeMapping.js +29 -28
- package/dist/ProteinView/proteinToGenomeMapping.js.map +1 -1
- package/dist/ProteinView/selectResidue.js +1 -1
- package/dist/ProteinView/selectResidue.js.map +1 -1
- package/dist/ProteinView/structureModel.d.ts +183 -0
- package/dist/ProteinView/structureModel.js +407 -0
- package/dist/ProteinView/structureModel.js.map +1 -0
- package/dist/ProteinView/useProteinView.d.ts +1 -4
- package/dist/ProteinView/useProteinView.js +3 -15
- package/dist/ProteinView/useProteinView.js.map +1 -1
- package/dist/ProteinView/util.d.ts +3 -3
- package/dist/ProteinView/util.js +8 -6
- package/dist/ProteinView/util.js.map +1 -1
- package/dist/UniProtVariationAdapter/UniProtVariationAdapter.d.ts +15 -0
- package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js +55 -0
- package/dist/UniProtVariationAdapter/UniProtVariationAdapter.js.map +1 -0
- package/dist/UniProtVariationAdapter/configSchema.d.ts +17 -0
- package/dist/UniProtVariationAdapter/configSchema.js +20 -0
- package/dist/UniProtVariationAdapter/configSchema.js.map +1 -0
- package/dist/UniProtVariationAdapter/index.d.ts +2 -0
- package/dist/UniProtVariationAdapter/index.js +11 -0
- package/dist/UniProtVariationAdapter/index.js.map +1 -0
- package/dist/genomeToTranscriptMapping.d.ts +2 -2
- package/dist/genomeToTranscriptMapping.js +3 -3
- package/dist/genomeToTranscriptMapping.js.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js +1473 -1489
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +4 -4
- package/dist/mappings.d.ts +12 -10
- package/dist/mappings.js +7 -7
- package/dist/mappings.js.map +1 -1
- package/dist/mappings.test.js +7 -5
- package/dist/mappings.test.js.map +1 -1
- package/dist/test_data/gene.d.ts +577 -64
- package/dist/test_data/gene.js +1 -1
- package/dist/test_data/gene.js.map +1 -1
- package/package.json +17 -16
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -17
- package/src/AddHighlightModel/ProteinToGenomeClickHighlight.tsx +17 -14
- package/src/AddHighlightModel/ProteinToGenomeHoverHighlight.tsx +18 -17
- package/src/AddHighlightModel/util.ts +1 -1
- package/src/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.ts +63 -0
- package/src/AlphaFoldConfidenceAdapter/configSchema.ts +21 -0
- package/src/AlphaFoldConfidenceAdapter/index.ts +19 -0
- package/src/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.ts +109 -0
- package/src/AlphaMissensePathogenicityAdapter/configSchema.ts +21 -0
- package/src/AlphaMissensePathogenicityAdapter/index.ts +19 -0
- package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +266 -53
- package/src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx +71 -29
- package/src/LaunchProteinView/components/HelpButton.tsx +10 -2
- package/src/LaunchProteinView/components/HelpDialog.tsx +41 -8
- package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +10 -12
- package/src/LaunchProteinView/components/MSATable.tsx +98 -0
- package/src/LaunchProteinView/components/TranscriptSelector.tsx +39 -11
- package/src/LaunchProteinView/components/UserProvidedStructure.tsx +119 -68
- package/src/LaunchProteinView/{calculateProteinSequence.ts → components/calculateProteinSequence.ts} +6 -4
- package/src/LaunchProteinView/{useProteinSequences.ts → components/useIsoformProteinSequences.ts} +12 -7
- package/src/LaunchProteinView/components/useLocalStructureFileSequence.ts +72 -0
- package/src/LaunchProteinView/{useMyGeneInfo.ts → components/useMyGeneInfoUniprotIdLookup.ts} +16 -11
- package/src/LaunchProteinView/components/useRemoteStructureFileSequence.ts +59 -0
- package/src/LaunchProteinView/{util.ts → components/util.ts} +4 -36
- package/src/LaunchProteinView/index.ts +36 -26
- package/src/ProteinView/{loadStructureFromData.ts → addStructureFromData.ts} +2 -8
- package/src/ProteinView/{loadStructureFromURL.ts → addStructureFromURL.ts} +11 -11
- package/src/ProteinView/clearSelection.ts +1 -1
- package/src/ProteinView/components/ProteinAlignment.tsx +51 -35
- package/src/ProteinView/components/ProteinAlignmentHelpButton.tsx +4 -4
- package/src/ProteinView/components/ProteinAlignmentHelpDialog.tsx +15 -11
- package/src/ProteinView/components/ProteinView.tsx +22 -82
- package/src/ProteinView/components/{Header.tsx → ProteinViewHeader.tsx} +44 -21
- package/src/ProteinView/components/SplitString.tsx +9 -9
- package/src/ProteinView/genomeToProtein.ts +5 -9
- package/src/ProteinView/highlightResidue.ts +2 -2
- package/src/ProteinView/launchRemotePairwiseAlignment.ts +6 -3
- package/src/ProteinView/model.ts +80 -265
- package/src/ProteinView/proteinToGenomeMapping.ts +40 -38
- package/src/ProteinView/selectResidue.ts +1 -1
- package/src/ProteinView/structureModel.ts +512 -0
- package/src/ProteinView/useProteinView.ts +2 -19
- package/src/ProteinView/util.ts +20 -9
- package/src/UniProtVariationAdapter/UniProtVariationAdapter.ts +99 -0
- package/src/UniProtVariationAdapter/configSchema.ts +25 -0
- package/src/UniProtVariationAdapter/index.ts +17 -0
- package/src/__snapshots__/mappings.test.ts.snap +224 -224
- package/src/genomeToTranscriptMapping.ts +9 -9
- package/src/index.ts +7 -12
- package/src/mappings.test.ts +7 -5
- package/src/mappings.ts +25 -23
- package/src/test_data/gene.ts +3 -3
- package/dist/LaunchProteinView/calculateProteinSequence.js.map +0 -1
- package/dist/LaunchProteinView/components/PreLoadedStructureMapping.d.ts +0 -8
- package/dist/LaunchProteinView/components/PreLoadedStructureMapping.js +0 -72
- package/dist/LaunchProteinView/components/PreLoadedStructureMapping.js.map +0 -1
- package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.d.ts +0 -7
- package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.js +0 -26
- package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.js.map +0 -1
- package/dist/LaunchProteinView/useMyGeneInfo.js.map +0 -1
- package/dist/LaunchProteinView/useProteinSequences.d.ts +0 -10
- package/dist/LaunchProteinView/useProteinSequences.js.map +0 -1
- package/dist/LaunchProteinView/util.js.map +0 -1
- package/dist/ProteinModelSessionExtension.d.ts +0 -11
- package/dist/ProteinModelSessionExtension.js +0 -53
- package/dist/ProteinModelSessionExtension.js.map +0 -1
- package/dist/ProteinView/components/Header.js.map +0 -1
- package/dist/ProteinView/loadStructureFromData.js.map +0 -1
- package/dist/ProteinView/loadStructureFromURL.js.map +0 -1
- package/dist/ProteinView/useProteinViewClickBehavior.d.ts +0 -8
- package/dist/ProteinView/useProteinViewClickBehavior.js +0 -34
- package/dist/ProteinView/useProteinViewClickBehavior.js.map +0 -1
- package/dist/ProteinView/useProteinViewHoverBehavior.d.ts +0 -6
- package/dist/ProteinView/useProteinViewHoverBehavior.js +0 -31
- package/dist/ProteinView/useProteinViewHoverBehavior.js.map +0 -1
- package/src/LaunchProteinView/components/PreLoadedStructureMapping.tsx +0 -153
- package/src/LaunchProteinView/components/useCheckAlphaFoldDBExistence.ts +0 -31
- package/src/ProteinModelSessionExtension.ts +0 -71
- package/src/ProteinView/useProteinViewClickBehavior.ts +0 -48
- package/src/ProteinView/useProteinViewHoverBehavior.ts +0 -44
- /package/dist/LaunchProteinView/{calculateProteinSequence.d.ts → components/calculateProteinSequence.d.ts} +0 -0
- /package/dist/ProteinView/components/{Header.d.ts → ProteinViewHeader.d.ts} +0 -0
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useState } from 'react'
|
|
2
|
-
import { observer } from 'mobx-react'
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
DialogActions,
|
|
6
|
-
DialogContent,
|
|
7
|
-
Link,
|
|
8
|
-
MenuItem,
|
|
9
|
-
TextField,
|
|
10
|
-
Typography,
|
|
11
|
-
} from '@mui/material'
|
|
12
|
-
import { makeStyles } from 'tss-react/mui'
|
|
13
|
-
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui'
|
|
14
|
-
import { AbstractTrackModel, Feature, getSession } from '@jbrowse/core/util'
|
|
15
|
-
|
|
16
|
-
// locals
|
|
17
|
-
import {
|
|
18
|
-
createMapFromData,
|
|
19
|
-
getDisplayName,
|
|
20
|
-
getTranscriptFeatures,
|
|
21
|
-
stripTrailingVersion,
|
|
22
|
-
} from '../util'
|
|
23
|
-
import { genomeToTranscriptMapping } from '../../genomeToTranscriptMapping'
|
|
24
|
-
|
|
25
|
-
const useStyles = makeStyles()(theme => ({
|
|
26
|
-
section: {
|
|
27
|
-
marginTop: theme.spacing(6),
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
dialogContent: {
|
|
31
|
-
width: '80em',
|
|
32
|
-
},
|
|
33
|
-
}))
|
|
34
|
-
|
|
35
|
-
function foundF(f: Feature | undefined, map: Map<string, string>) {
|
|
36
|
-
return (
|
|
37
|
-
map.get(stripTrailingVersion(f?.get('name')) ?? '') ??
|
|
38
|
-
map.get(stripTrailingVersion(f?.get('id')) ?? '')
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const AutoForm = observer(function AutoForm({
|
|
43
|
-
model,
|
|
44
|
-
feature,
|
|
45
|
-
handleClose,
|
|
46
|
-
}: {
|
|
47
|
-
model: AbstractTrackModel
|
|
48
|
-
feature: Feature
|
|
49
|
-
handleClose: () => void
|
|
50
|
-
}) {
|
|
51
|
-
const { classes } = useStyles()
|
|
52
|
-
const session = getSession(model)
|
|
53
|
-
// @ts-expect-error
|
|
54
|
-
const { proteinModel } = session
|
|
55
|
-
const { data, error } = proteinModel
|
|
56
|
-
// check if we are looking at a 'two-level' or 'three-level' feature by
|
|
57
|
-
// finding exon/CDS subfeatures. we want to select from transcript names
|
|
58
|
-
const options = getTranscriptFeatures(feature)
|
|
59
|
-
const transcriptIdToStructureMap = useMemo(
|
|
60
|
-
() => createMapFromData(data),
|
|
61
|
-
[data],
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
const hasDataForFeatures = useMemo(
|
|
65
|
-
() => options.filter(f => foundF(f, transcriptIdToStructureMap)),
|
|
66
|
-
[transcriptIdToStructureMap, options],
|
|
67
|
-
)
|
|
68
|
-
const [userSelection, setUserSelection] = useState('')
|
|
69
|
-
const userSelectionFeat = options.find(f => f.id() === userSelection)
|
|
70
|
-
const foundStructureId = foundF(userSelectionFeat, transcriptIdToStructureMap)
|
|
71
|
-
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
setUserSelection(hasDataForFeatures[0]?.id())
|
|
74
|
-
}, [hasDataForFeatures])
|
|
75
|
-
|
|
76
|
-
const mapping =
|
|
77
|
-
foundStructureId && userSelectionFeat
|
|
78
|
-
? genomeToTranscriptMapping(userSelectionFeat)
|
|
79
|
-
: []
|
|
80
|
-
const url = foundStructureId
|
|
81
|
-
? `https://files.rcsb.org/view/${foundStructureId}.cif`
|
|
82
|
-
: undefined
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<>
|
|
86
|
-
<DialogContent className={classes.dialogContent}>
|
|
87
|
-
<div className={classes.section}>
|
|
88
|
-
{error ? (
|
|
89
|
-
<ErrorMessage error={error} />
|
|
90
|
-
) : data ? (
|
|
91
|
-
<div>
|
|
92
|
-
<Intro />
|
|
93
|
-
{hasDataForFeatures.length === 0 ? (
|
|
94
|
-
<Typography color="error">No data for feature</Typography>
|
|
95
|
-
) : (
|
|
96
|
-
<>
|
|
97
|
-
<div className={classes.section}>
|
|
98
|
-
<TextField
|
|
99
|
-
value={userSelection}
|
|
100
|
-
onChange={event => setUserSelection(event.target.value)}
|
|
101
|
-
label="Choose isoform"
|
|
102
|
-
select
|
|
103
|
-
>
|
|
104
|
-
{hasDataForFeatures.map(val => (
|
|
105
|
-
<MenuItem value={val.id()} key={val.id()}>
|
|
106
|
-
{getDisplayName(val)} (has data)
|
|
107
|
-
</MenuItem>
|
|
108
|
-
))}
|
|
109
|
-
</TextField>
|
|
110
|
-
</div>
|
|
111
|
-
</>
|
|
112
|
-
)}
|
|
113
|
-
</div>
|
|
114
|
-
) : (
|
|
115
|
-
<LoadingEllipses />
|
|
116
|
-
)}
|
|
117
|
-
</div>
|
|
118
|
-
</DialogContent>
|
|
119
|
-
<DialogActions>
|
|
120
|
-
<Button variant="contained" color="secondary" onClick={handleClose}>
|
|
121
|
-
Cancel
|
|
122
|
-
</Button>
|
|
123
|
-
<Button
|
|
124
|
-
variant="contained"
|
|
125
|
-
color="primary"
|
|
126
|
-
onClick={() => {
|
|
127
|
-
session.addView('ProteinView', {
|
|
128
|
-
type: 'ProteinView',
|
|
129
|
-
url,
|
|
130
|
-
mapping,
|
|
131
|
-
})
|
|
132
|
-
handleClose()
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
Submit
|
|
136
|
-
</Button>
|
|
137
|
-
</DialogActions>
|
|
138
|
-
</>
|
|
139
|
-
)
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
function Intro() {
|
|
143
|
-
return (
|
|
144
|
-
<div>
|
|
145
|
-
Find structure associated with gene ID:{' '}
|
|
146
|
-
<Link href="http://useast.ensembl.org/biomart/martview/4b20effd49654183333b81e98757976f?VIRTUALSCHEMANAME=default&ATTRIBUTES=hsapiens_gene_ensembl.default.feature_page.ensembl_gene_id|hsapiens_gene_ensembl.default.feature_page.ensembl_gene_id_version|hsapiens_gene_ensembl.default.feature_page.ensembl_transcript_id|hsapiens_gene_ensembl.default.feature_page.ensembl_transcript_id_version|hsapiens_gene_ensembl.default.feature_page.pdb|hsapiens_gene_ensembl.default.feature_page.refseq_mrna|hsapiens_gene_ensembl.default.feature_page.refseq_mrna_predicted&FILTERS=&VISIBLEPANEL=attributepanel">
|
|
147
|
-
Human mappings generated from BioMart (April 13, 2023)
|
|
148
|
-
</Link>
|
|
149
|
-
</div>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export default AutoForm
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
export function useCheckAlphaFoldDBExistence({
|
|
4
|
-
foundStructureId,
|
|
5
|
-
}: {
|
|
6
|
-
foundStructureId?: string
|
|
7
|
-
}) {
|
|
8
|
-
const [error, setError] = useState<unknown>()
|
|
9
|
-
const [loading, setLoading] = useState(false)
|
|
10
|
-
const [success, setSuccess] = useState(false)
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
13
|
-
;(async () => {
|
|
14
|
-
try {
|
|
15
|
-
if (foundStructureId) {
|
|
16
|
-
setLoading(true)
|
|
17
|
-
await fetch(
|
|
18
|
-
`https://alphafold.ebi.ac.uk/files/AF-${foundStructureId}-F1-model_v4.cif`,
|
|
19
|
-
{ method: 'HEAD' },
|
|
20
|
-
)
|
|
21
|
-
setLoading(false)
|
|
22
|
-
setSuccess(true)
|
|
23
|
-
}
|
|
24
|
-
} catch (e) {
|
|
25
|
-
console.error(e)
|
|
26
|
-
setError(e)
|
|
27
|
-
}
|
|
28
|
-
})()
|
|
29
|
-
}, [foundStructureId])
|
|
30
|
-
return { error, loading, success }
|
|
31
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { addDisposer, types } from 'mobx-state-tree'
|
|
2
|
-
import { autorun } from 'mobx'
|
|
3
|
-
import { ungzip } from 'pako'
|
|
4
|
-
|
|
5
|
-
// locals
|
|
6
|
-
import { Row } from './LaunchProteinView/util'
|
|
7
|
-
import { abfetch } from './fetchUtils'
|
|
8
|
-
|
|
9
|
-
const ProteinModelSessionExtension = types
|
|
10
|
-
.model({})
|
|
11
|
-
.volatile(() => ({
|
|
12
|
-
data: undefined as Row[] | undefined,
|
|
13
|
-
error: undefined as unknown,
|
|
14
|
-
}))
|
|
15
|
-
.actions(self => ({
|
|
16
|
-
setData(a?: Row[]) {
|
|
17
|
-
self.data = a
|
|
18
|
-
},
|
|
19
|
-
setError(e: unknown) {
|
|
20
|
-
self.error = e
|
|
21
|
-
},
|
|
22
|
-
}))
|
|
23
|
-
.actions(self => {
|
|
24
|
-
return {
|
|
25
|
-
afterCreate() {
|
|
26
|
-
const url = 'https://jbrowse.org/demos/protein3d/mart_export.txt.gz'
|
|
27
|
-
addDisposer(
|
|
28
|
-
self,
|
|
29
|
-
autorun(async () => {
|
|
30
|
-
try {
|
|
31
|
-
const ret = new TextDecoder('utf8').decode(
|
|
32
|
-
ungzip(await abfetch(url)),
|
|
33
|
-
)
|
|
34
|
-
const d = ret
|
|
35
|
-
.split('\n')
|
|
36
|
-
.slice(1)
|
|
37
|
-
.filter(line => !!line)
|
|
38
|
-
.map(line => {
|
|
39
|
-
const res = line.split('\t')
|
|
40
|
-
const [
|
|
41
|
-
gene_id,
|
|
42
|
-
gene_id_version,
|
|
43
|
-
transcript_id,
|
|
44
|
-
transcript_id_version,
|
|
45
|
-
pdb_id,
|
|
46
|
-
refseq_mrna_id,
|
|
47
|
-
refseq_mrna_predicted_id,
|
|
48
|
-
] = res
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
gene_id,
|
|
52
|
-
gene_id_version,
|
|
53
|
-
transcript_id_version,
|
|
54
|
-
transcript_id,
|
|
55
|
-
pdb_id,
|
|
56
|
-
refseq_mrna_predicted_id,
|
|
57
|
-
refseq_mrna_id,
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
self.setData(d)
|
|
62
|
-
} catch (error) {
|
|
63
|
-
self.setError(error)
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
)
|
|
67
|
-
},
|
|
68
|
-
}
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
export default ProteinModelSessionExtension
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
import { getSession } from '@jbrowse/core/util'
|
|
3
|
-
import { PluginContext } from 'molstar/lib/mol-plugin/context'
|
|
4
|
-
|
|
5
|
-
// local
|
|
6
|
-
import { JBrowsePluginProteinViewModel } from './model'
|
|
7
|
-
import { clickProteinToGenome } from './proteinToGenomeMapping'
|
|
8
|
-
import {
|
|
9
|
-
StructureElement,
|
|
10
|
-
StructureProperties as Props,
|
|
11
|
-
} from 'molstar/lib/mol-model/structure'
|
|
12
|
-
|
|
13
|
-
export default function useProteinViewClickActionBehavior({
|
|
14
|
-
plugin,
|
|
15
|
-
model,
|
|
16
|
-
}: {
|
|
17
|
-
plugin?: PluginContext
|
|
18
|
-
model: JBrowsePluginProteinViewModel
|
|
19
|
-
}) {
|
|
20
|
-
const [error, setError] = useState<unknown>()
|
|
21
|
-
const session = getSession(model)
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!plugin) {
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
plugin.behaviors.interaction.click.subscribe(event => {
|
|
27
|
-
if (StructureElement.Loci.is(event.current.loci)) {
|
|
28
|
-
const loc = StructureElement.Loci.getFirstLocation(event.current.loci)
|
|
29
|
-
if (loc) {
|
|
30
|
-
const pos = Props.residue.auth_seq_id(loc)
|
|
31
|
-
const code = Props.atom.label_comp_id(loc)
|
|
32
|
-
const chain = Props.chain.auth_asym_id(loc)
|
|
33
|
-
model.setHoveredPosition({
|
|
34
|
-
structureSeqPos: pos - 1,
|
|
35
|
-
code,
|
|
36
|
-
chain,
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
clickProteinToGenome({ model, structureSeqPos: pos - 1 }).catch(e => {
|
|
40
|
-
console.error(e)
|
|
41
|
-
setError(e)
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}, [plugin, session, model])
|
|
47
|
-
return { error }
|
|
48
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { getSession } from '@jbrowse/core/util'
|
|
3
|
-
import { PluginContext } from 'molstar/lib/mol-plugin/context'
|
|
4
|
-
|
|
5
|
-
// local
|
|
6
|
-
import { JBrowsePluginProteinViewModel } from './model'
|
|
7
|
-
import {
|
|
8
|
-
StructureElement,
|
|
9
|
-
StructureProperties as Props,
|
|
10
|
-
} from 'molstar/lib/mol-model/structure'
|
|
11
|
-
import { hoverProteinToGenome } from './proteinToGenomeMapping'
|
|
12
|
-
|
|
13
|
-
export default function useProteinViewClickActionBehavior({
|
|
14
|
-
plugin,
|
|
15
|
-
model,
|
|
16
|
-
}: {
|
|
17
|
-
plugin?: PluginContext
|
|
18
|
-
model: JBrowsePluginProteinViewModel
|
|
19
|
-
}) {
|
|
20
|
-
const session = getSession(model)
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (!plugin) {
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
plugin.behaviors.interaction.hover.subscribe(event => {
|
|
26
|
-
if (StructureElement.Loci.is(event.current.loci)) {
|
|
27
|
-
const loc = StructureElement.Loci.getFirstLocation(event.current.loci)
|
|
28
|
-
if (loc) {
|
|
29
|
-
// example code for this label
|
|
30
|
-
// https://github.com/molstar/molstar/blob/60550cfea1f62a50a764d5714307d6d1049be71d/src/mol-theme/label.ts#L255-L264
|
|
31
|
-
const structureSeqPos = Props.residue.auth_seq_id(loc)
|
|
32
|
-
const code = Props.atom.label_comp_id(loc)
|
|
33
|
-
const chain = Props.chain.auth_asym_id(loc)
|
|
34
|
-
model.setHoveredPosition({
|
|
35
|
-
structureSeqPos: structureSeqPos - 1,
|
|
36
|
-
code,
|
|
37
|
-
chain,
|
|
38
|
-
})
|
|
39
|
-
hoverProteinToGenome({ model, structureSeqPos: structureSeqPos - 1 })
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
}, [plugin, session, model])
|
|
44
|
-
}
|
|
File without changes
|
|
File without changes
|