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
552b582b
Commit
552b582b
authored
Oct 02, 2020
by
Hervé MENAGER
Browse files
correct style in `models.py`
parent
0bf2dc69
Pipeline
#38819
passed with stages
in 18 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/models.py
View file @
552b582b
...
...
@@ -1087,35 +1087,53 @@ class Compound(AutoFillableModel):
"""
Get absolute URL to the corresponding PubChem entry
"""
return
f
"https://pubchem.ncbi.nlm.nih.gov/compound/
{
self
.
pubchem_id
}
"
if
self
.
pubchem_id
else
None
return
(
f
"https://pubchem.ncbi.nlm.nih.gov/compound/
{
self
.
pubchem_id
}
"
if
self
.
pubchem_id
else
None
)
@
property
def
chembl_url
(
self
):
"""
Get absolute URL to the corresponding Chembl entry
"""
return
f
"https://www.ebi.ac.uk/chembldb/compound/inspect/
{
self
.
chembl_id
}
"
if
self
.
chembl_id
else
None
return
(
f
"https://www.ebi.ac.uk/chembldb/compound/inspect/
{
self
.
chembl_id
}
"
if
self
.
chembl_id
else
None
)
@
property
def
chemspider_url
(
self
):
"""
Get absolute URL to the corresponding ChemSpider entry
"""
return
f
"http://www.chemspider.com/Chemical-Structure.
{
self
.
chemspider_id
}
.html"
if
self
.
chemspider_id
else
None
return
(
f
"http://www.chemspider.com/Chemical-Structure.
{
self
.
chemspider_id
}
.html"
if
self
.
chemspider_id
else
None
)
@
property
def
pdbligand_url
(
self
):
"""
Get absolute URL to the corresponding PDB ligand entry
"""
return
f
"https://www.rcsb.org/ligand/
{
self
.
ligand_id
}
"
if
self
.
ligand_id
else
None
return
(
f
"https://www.rcsb.org/ligand/
{
self
.
ligand_id
}
"
if
self
.
ligand_id
else
None
)
@
property
def
drugbank_url
(
self
):
"""
Get absolute URL to the corresponding Drugbank entry
"""
return
f
"https://www.drugbank.ca/drugs/
{
self
.
drugbank_id
}
"
if
self
.
drugbank_id
else
None
return
(
f
"https://www.drugbank.ca/drugs/
{
self
.
drugbank_id
}
"
if
self
.
drugbank_id
else
None
)
def
clean
(
self
):
"""
...
...
@@ -1611,20 +1629,13 @@ def update_compound_cached_properties(compounds_queryset=None):
le
=
Subquery
(
compounds_queryset
.
filter
(
id
=
OuterRef
(
"id"
))
.
annotate
(
_le
=
Cast
(
1.37
*
F
(
"best_activity"
)
/
F
(
"nb_atom_non_h"
),
FloatField
(),
)
_le
=
Cast
(
1.37
*
F
(
"best_activity"
)
/
F
(
"nb_atom_non_h"
),
FloatField
(),)
)
.
values
(
"_le"
)[:
1
]
),
lle
=
Subquery
(
compounds_queryset
.
filter
(
id
=
OuterRef
(
"id"
))
.
annotate
(
_lle
=
Cast
(
F
(
"best_activity"
)
-
F
(
"a_log_p"
),
FloatField
()
)
)
.
annotate
(
_lle
=
Cast
(
F
(
"best_activity"
)
-
F
(
"a_log_p"
),
FloatField
()))
.
values
(
"_lle"
)[:
1
]
),
lipinsky_mw
=
Subquery
(
...
...
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