Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
ensembl-client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ensembl-web
ensembl-client
Commits
29b8f1cd
Unverified
Commit
29b8f1cd
authored
Oct 16, 2020
by
Imran Salam
Committed by
GitHub
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace protein description placeholder with uniprot protein description (#368)
parent
49eb1485
Pipeline
#103492
passed with stages
in 8 minutes and 27 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
24 deletions
+54
-24
src/ensembl/src/content/app/entity-viewer/gene-view/GeneView.tsx
...embl/src/content/app/entity-viewer/gene-view/GeneView.tsx
+7
-0
src/ensembl/src/content/app/entity-viewer/gene-view/components/proteins-list/proteins-list-item-info/ProteinsListItemInfo.tsx
...ins-list/proteins-list-item-info/ProteinsListItemInfo.tsx
+1
-4
src/ensembl/src/content/app/entity-viewer/gene-view/components/proteins-list/proteins-list-item/ProteinsListItem.tsx
...nts/proteins-list/proteins-list-item/ProteinsListItem.tsx
+10
-1
src/ensembl/src/content/app/entity-viewer/shared/rest/rest-data-fetchers/proteinData.ts
...tity-viewer/shared/rest/rest-data-fetchers/proteinData.ts
+11
-19
src/ensembl/src/content/app/entity-viewer/types/externalReference.ts
.../src/content/app/entity-viewer/types/externalReference.ts
+23
-0
src/ensembl/src/content/app/entity-viewer/types/product.ts
src/ensembl/src/content/app/entity-viewer/types/product.ts
+2
-0
No files found.
src/ensembl/src/content/app/entity-viewer/gene-view/GeneView.tsx
View file @
29b8f1cd
...
...
@@ -125,6 +125,13 @@ const QUERY = gql`
product {
stable_id
unversioned_stable_id
external_references {
accession_id
description
source {
id
}
}
}
}
}
...
...
src/ensembl/src/content/app/entity-viewer/gene-view/components/proteins-list/proteins-list-item-info/ProteinsListItemInfo.tsx
View file @
29b8f1cd
...
...
@@ -71,10 +71,7 @@ const ProteinsListItemInfo = (props: Props) => {
Promise
.
all
([
fetchProteinDomains
(
proteinId
,
abortController
.
signal
),
fetchProteinSummary
(
transcript
.
unversioned_stable_id
,
abortController
.
signal
)
fetchProteinSummary
(
proteinId
,
abortController
.
signal
)
]).
then
(([
proteinDomains
,
proteinSummaryData
])
=>
{
if
(
!
abortController
.
signal
.
aborted
)
{
setTranscriptWithProteinDomains
(
...
...
src/ensembl/src/content/app/entity-viewer/gene-view/components/proteins-list/proteins-list-item/ProteinsListItem.tsx
View file @
29b8f1cd
...
...
@@ -31,6 +31,8 @@ import { Transcript } from 'src/content/app/entity-viewer/types/transcript';
import
transcriptsListStyles
from
'
src/content/app/entity-viewer/gene-view/components/default-transcripts-list/DefaultTranscriptsList.scss
'
;
import
styles
from
'
./ProteinsListItem.scss
'
;
const
UNIPROT_SOURCE
=
'
Uniprot
'
;
type
Props
=
{
transcript
:
Transcript
;
trackLength
:
number
;
...
...
@@ -48,13 +50,20 @@ const ProteinsListItem = (props: Props) => {
const
midStyles
=
classNames
(
transcriptsListStyles
.
middle
,
styles
.
middle
);
const
getProteinDescription
=
()
=>
{
const
uniprotReference
=
product
.
external_references
.
find
((
reference
)
=>
reference
.
source
.
id
.
includes
(
UNIPROT_SOURCE
)
);
return
uniprotReference
?.
description
;
};
return
(
<>
<
div
className
=
{
transcriptsListStyles
.
row
}
>
<
div
className
=
{
transcriptsListStyles
.
left
}
></
div
>
<
div
onClick
=
{
toggleListItemInfo
}
className
=
{
midStyles
}
>
<
div
>
{
getProductAminoAcidLength
(
transcript
)
}
aa
</
div
>
<
div
>
Protein description from UniProt
</
div
>
<
div
>
{
getProteinDescription
()
}
</
div
>
<
div
>
{
product
?.
stable_id
}
</
div
>
</
div
>
<
div
...
...
src/ensembl/src/content/app/entity-viewer/shared/rest/rest-data-fetchers/proteinData.ts
View file @
29b8f1cd
...
...
@@ -18,8 +18,6 @@ import apiService from 'src/services/api-service';
import
{
restProteinSummaryAdaptor
}
from
'
../rest-adaptors/rest-protein-adaptor
'
;
import
{
TranscriptInResponse
}
from
'
./transcriptData
'
;
export
type
Xref
=
{
display_id
:
string
;
};
...
...
@@ -33,6 +31,14 @@ export type ProteinStatsInResponse = {
annotations
:
number
;
};
export
type
ProteinAcessionInResponse
=
{
protein
:
{
recommendedName
:
{
fullName
:
string
;
};
};
};
export
type
UniProtSummaryStats
=
{
[
key
:
string
]:
ProteinStatsInResponse
;
};
...
...
@@ -50,24 +56,10 @@ export type ProteinSummary = {
};
export
const
fetchProteinSummary
=
async
(
transcript
Id
:
string
,
protein
Id
:
string
,
signal
?:
AbortSignal
):
Promise
<
ProteinSummary
|
null
>
=>
{
const
transcriptUrl
=
`
https://rest.ensembl.org/lookup/id/
${
transcriptId
}
?expand=1;content-type=application/json
`
;
// if the fetch is aborted, apiService.fetch will return undefined
const
transcript
:
TranscriptInResponse
|
undefined
=
await
apiService
.
fetch
(
transcriptUrl
,
{
signal
}
);
if
(
!
transcript
)
{
return
null
;
}
const
xrefsUrl
=
`
https://rest.ensembl.org/xrefs/id/
${
transcript
.
Translation
?.
id
}
?content-type=application/json;external_db=Uniprot/SWISSPROT
`
;
const
xrefsUrl
=
`
https://rest.ensembl.org/xrefs/id/
${
proteinId
}
?content-type=application/json;external_db=Uniprot/SWISSPROT
`
;
const
xrefsData
:
XrefsInResponse
|
undefined
=
await
apiService
.
fetch
(
xrefsUrl
,
{
...
...
@@ -81,8 +73,8 @@ export const fetchProteinSummary = async (
if
(
xrefsData
[
0
])
{
const
pdbeId
=
xrefsData
[
0
].
display_id
;
const
proteinStatsUrl
=
`
https://www.ebi.ac.uk/pdbe/graph-api/uniprot/summary_stats/
${
pdbeId
}
`
;
const
proteinStatsData
:
|
UniProtSummaryStats
|
undefined
=
await
apiService
.
fetch
(
proteinStatsUrl
,
{
...
...
src/ensembl/src/content/app/entity-viewer/types/externalReference.ts
0 → 100644
View file @
29b8f1cd
/**
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
Source
}
from
'
./source
'
;
export
type
ExternalReference
=
{
accession_id
:
string
;
description
:
string
;
source
:
Source
;
};
src/ensembl/src/content/app/entity-viewer/types/product.ts
View file @
29b8f1cd
...
...
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import
{
ExternalReference
}
from
'
./externalReference
'
;
import
{
LocationWithinRegion
}
from
'
./location
'
;
export
type
ProteinDomainsResources
=
{
...
...
@@ -51,6 +52,7 @@ export type Product = {
so_term
:
string
;
length
:
number
;
protein_domains
:
ProteinDomain
[];
external_references
:
ExternalReference
[];
};
export
type
ProteinDomain
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment