diff --git a/ippisite/ippidb/ws.py b/ippisite/ippidb/ws.py index 8b9b3f3a9f415d0f417ac0212a5a9c5736c644a3..b8386de67533d729a6364f90f27ca1c63d74b517 100644 --- a/ippisite/ippidb/ws.py +++ b/ippisite/ippidb/ws.py @@ -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):