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

retrieve gene name from Uniprot entry

parent 6a7f0d3e
No related branches found
No related tags found
No related merge requests found
...@@ -41,9 +41,11 @@ def get_uniprot_info(uniprot_id): ...@@ -41,9 +41,11 @@ def get_uniprot_info(uniprot_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 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'] 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 gene = resp.root.findall('{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}gene/{http://uniprot.org/uniprot}name[@type="primary"]')[0].text
entry_name = resp.root.findall('{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}name')[0].text
return {'recommended_name': recommended_name, return {'recommended_name': recommended_name,
'organism': int(organism), 'organism': int(organism),
'gene': gene 'gene': gene,
'entry_name': entry_name
} }
def get_taxonomy_info(taxonomy_id): def get_taxonomy_info(taxonomy_id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment