Commit d89a88d7 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Following refactoring of get_uniprot_info

parent 4df0443a
......@@ -198,7 +198,16 @@ class Protein(AutoFillableModel):
"""
info = get_uniprot_info(self.uniprot_id)
self.recommended_name_long = info['recommended_name']
self.gene_name = info['gene']
gene_names = info['gene_names']
# put whatever name it find
self.gene_name = gene_names[0]['name']
# then try to find the primary, if present
for gene_name in gene_names:
if gene_name["type"] == "primary":
self.gene_name = gene_name["name"]
break
self.entry_name = info['entry_name']
self.short_name = info['short_name']
try:
......
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