From f7c8fd21053d255f47a6cce3414b5ddec5dcc75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr> Date: Thu, 23 Mar 2017 21:35:55 +0100 Subject: [PATCH] retrieve gene name from Uniprot entry --- ippisite/ippidb/ws.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ippisite/ippidb/ws.py b/ippisite/ippidb/ws.py index de60b857..8b9b3f3a 100644 --- a/ippisite/ippidb/ws.py +++ b/ippisite/ippidb/ws.py @@ -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 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 + entry_name = resp.root.findall('{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}name')[0].text return {'recommended_name': recommended_name, 'organism': int(organism), - 'gene': gene + 'gene': gene, + 'entry_name': entry_name } def get_taxonomy_info(taxonomy_id): -- GitLab