Commit c6213854 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

retrieve info from Uniprot for Protein class

parent ba5be5a5
......@@ -75,9 +75,18 @@ class Protein(models.Model):
molecular_functions = models.ManyToManyField(MolecularFunction)
def save(self, *args, **kwargs):
info = get_epo_info(self.id_source)
info = get_uniprot_info(self.uniprot_id)
self.recommended_name_long = info['recommended_name']
self.organism = info['organism']
self.gene_name = info['gene']
self.entry_name = info['entry_name']
taxonomy = Taxonomy.objects.get(taxonomy_id=info['organism'])
except Taxonomy.DoesNotExist:
tax_info = get_taxonomy_info(info['organism'])
taxonomy = Taxonomy()
taxonomy.taxonomy_id = info['organism']
self.organism = taxonomy
super(Protein, self).save(*args, **kwargs)
class Domain(models.Model):
Supports Markdown
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