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

protein short name is first part of entry name (split on '_')

as ruled by O. Sperandio...


Former-commit-id: ab8b4864ee61689d00b3d86513aca8d3ffdccd2f
parent ac5b3a73
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,9 @@ def get_uniprot_info(uniprot_id): ...@@ -49,6 +49,9 @@ def get_uniprot_info(uniprot_id):
uniprot_client = UniProt() uniprot_client = UniProt()
ns = {'u': 'http://uniprot.org/uniprot'} ns = {'u': 'http://uniprot.org/uniprot'}
resp = uniprot_client.retrieve(uniprot_id) resp = uniprot_client.retrieve(uniprot_id)
f = open('/tmp/'+uniprot_id+'.xml','w')
f.write(str(resp))
f.close()
recommended_name = resp.root.findall( recommended_name = resp.root.findall(
'u:entry/u:protein/u:recommendedName/u:fullName', ns)[0].text 'u:entry/u:protein/u:recommendedName/u:fullName', ns)[0].text
organism = resp.root.findall( organism = resp.root.findall(
...@@ -67,6 +70,7 @@ def get_uniprot_info(uniprot_id): ...@@ -67,6 +70,7 @@ def get_uniprot_info(uniprot_id):
'organism': int(organism), 'organism': int(organism),
'gene': gene, 'gene': gene,
'entry_name': entry_name, 'entry_name': entry_name,
'short_name': entry_name.split('_')[0],
'molecular_functions': molecular_functions 'molecular_functions': molecular_functions
} }
......
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