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

retrieve go identifiers for molecular functions from Uniprot

parent 2025f1a8
No related branches found
No related tags found
No related merge requests found
......@@ -42,10 +42,17 @@ def get_uniprot_info(uniprot_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
entry_name = resp.root.findall('{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}name')[0].text
go_els = resp.root.findall('{http://uniprot.org/uniprot}entry/{http://uniprot.org/uniprot}dbReference[@type="GO"]')
molecular_functions = []
for go_el in go_els:
term_property_value = go_el.findall('{http://uniprot.org/uniprot}property[@type="term"]')[0].attrib['value']
if term_property_value[0:2]=='F:':
molecular_functions.append('GO_'+go_el.attrib['id'][3:])
return {'recommended_name': recommended_name,
'organism': int(organism),
'gene': gene,
'entry_name': entry_name
'entry_name': entry_name,
'molecular_functions': molecular_functions
}
def get_taxonomy_info(taxonomy_id):
......
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