Commit 48621c3d authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

display correctly unvalidated compounds, WIP

parent c1b34823
Pipeline #16315 passed with stages
in 9 minutes and 29 seconds
......@@ -911,6 +911,9 @@ class Compound(AutoFillableModel):
def sorted_similar_drugbank_compounds(self):
return self.drugbankcompoundtanimoto_set.order_by('-tanimoto')
def is_validated(self):
return self.compoundaction__ppi__contribution__validated==True
def autofill(self):
# compute InChi and InChiKey
self.inchi = smi2inchi(self.canonical_smile)
......
......@@ -14,8 +14,11 @@
</div>
<div class="container-fluid">
<div class="row flex-xl-nowrap">
<div class="row flex-xl-nowrap {% if compound.is_validated is False %}bg-warning{% endif %}">
<h1 class="page-title">Compound {{ compound.id }}</h1>
{% if compound.is_validated is False %}
<h3 class="ml-2 font-italic">This compound has not been validated by a curator yet, data might be incomplete or inaccurate</h3>
{% endif %}
</div>
<div class="row flex-xl-nowrap">
<div class="col-3">
......@@ -110,11 +113,14 @@
<div class="card col-sm-12 col-md-6">
<h5 class="card-header">Radar chart</h5>
<div class="card-body">
{% if compound.molecular_weight is not None %}
<canvas id="radar"></canvas>
<script>
drawCompoundDescriptorRadarChart('radar', {{ compound.molecular_weight }}, {{ compound.a_log_p }}, {{ compound.nb_donor_h }}, {{ compound.nb_acceptor_h }}, {{ compound.tpsa }}, {{ compound.nb_rotatable_bonds }}, {{ compound.nb_benzene_like_rings }}, {{ compound.fsp3 }}, {{ compound.nb_chiral_centers }});
</script>
{% else %}
<p class="text-secondary">Compound properties unavailable</p>
{% endif %}
</div>
</div>
</div>
......
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