Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
aedac6b6
Commit
aedac6b6
authored
8 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
correct uniprot web service and add taxonomy web service
parent
4d201803
Branches
icy-3.0.0
Tags
v3.0.0-a.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/ws.py
+13
-5
13 additions, 5 deletions
ippisite/ippidb/ws.py
with
13 additions
and
5 deletions
ippisite/ippidb/ws.py
+
13
−
5
View file @
aedac6b6
...
...
@@ -36,10 +36,18 @@ def get_epo_info(patent_number):
'
authors_list
'
:
authors
}
def
get_uniprot_info
(
uniprot_id
):
uniprot_client
=
Uni
p
rot
()
uniprot_client
=
Uni
P
rot
()
resp
=
uniprot_client
.
retrieve
(
uniprot_id
)
recommended_name
=
res
.
root
.
findall
(
'
{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}protein/{http://uniprot.org/uniprot}recommendedName/{http://uniprot.org/uniprot}fullName
'
)[
0
].
text
organism
=
res
.
root
.
findall
(
'
{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}organism/{http://uniprot.org/uniprot}dbReference[@type=
"
NCBI Taxonomy
"
]/@id
'
)
recommended_name
=
resp
.
root
.
findall
(
'
{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}protein/{http://uniprot.org/uniprot}recommendedName/{http://uniprot.org/uniprot}fullName
'
)[
0
].
text
organism
=
resp
.
root
.
findall
(
'
{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}organism/{http://uniprot.org/uniprot}dbReference[@type=
"
NCBI Taxonomy
"
]
'
)[
0
].
attrib
[
'
id
'
]
gene
=
resp
.
root
.
findall
(
'
{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}gene/{http://uniprot.org/uniprot}name[@type=
"
primary
"
]
'
)[
0
].
text
return
{
'
recommended_name
'
:
recommended_name
,
'
organism
'
:
organism
}
'
organism
'
:
int
(
organism
),
'
gene
'
:
gene
}
def
get_taxonomy_info
(
taxonomy_id
):
eu
=
EUtils
()
r
=
eu
.
EFetch
(
'
taxonomy
'
,
taxonomy_id
,
retmode
=
'
dict
'
)
scientific_name
=
r
[
'
TaxaSet
'
][
'
Taxon
'
][
'
ScientificName
'
]
return
{
'
scientific_name
'
:
scientific_name
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment