Skip to content
Snippets Groups Projects
Commit 2ded0768 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add first draft to retrieve uniprot info

parent bbaead81
No related branches found
No related tags found
No related merge requests found
from bioservices.eutils import EUtils
from bioservices.uniprot import UniProt
from xml.etree.ElementTree import register_namespace
import requests
def get_pubmed_info(pmid):
......@@ -32,3 +34,12 @@ def get_epo_info(patent_number):
'journal_name': None,
'biblio_year': biblio_year,
'authors_list': authors}
def get_uniprot_info(uniprot_id):
uniprot_client = Uniprot()
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')
return {'recommended_name': recommended_name,
'organism': organism
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment