Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
c6213854
Commit
c6213854
authored
Mar 23, 2017
by
Hervé MENAGER
Browse files
retrieve info from Uniprot for Protein class
parent
ba5be5a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/models.py
View file @
c6213854
...
...
@@ -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'
]
try
:
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'
]
taxonomy
.
save
()
self
.
organism
=
taxonomy
super
(
Protein
,
self
).
save
(
*
args
,
**
kwargs
)
class
Domain
(
models
.
Model
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment