Skip to content
Snippets Groups Projects
Commit 1384f36a authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add table for "Physicochemical filters" in compound page

Former-commit-id: 7cd557d92730d0d98533ebf3c5a434ac60cf796e
parent a915c6f9
No related branches found
No related tags found
No related merge requests found
...@@ -351,6 +351,59 @@ class Compound(models.Model): ...@@ -351,6 +351,59 @@ class Compound(models.Model):
pdb_ids.add(ca.pdb_id) pdb_ids.add(ca.pdb_id)
return pdb_ids return pdb_ids
@property
def hba_hbd(self):
return self.nb_acceptor_h + self.nb_donor_h
@property
def lipinsky_mw(self):
return self.molecular_weight <= 500
@property
def lipinsky_hba(self):
return self.nb_acceptor_h <= 10
@property
def lipinsky_hbd(self):
return self.nb_donor_h <= 5
@property
def lipinsky_a_log_p(self):
return self.a_log_p <= 5
@property
def lipinsky_global(self):
return int(self.lipinsky_mw) + int(self.lipinsky_hba) + \
int(self.lipinsky_hbd) + int(self.lipinsky_a_log_p) >= 3
@property
def veber_hba_hbd(self):
return self.nb_acceptor_h + self.nb_donor_h <= 12
@property
def veber_tpsa(self):
return self.tpsa <= 140
@property
def veber_rb(self):
return self.nb_rotatable_bonds <= 10
@property
def veber_global(self):
return self.veber_rb and (self.veber_hba_hbd or self.veber_tpsa)
@property
def pfizer_a_log_p(self):
return self.a_log_p <= 3
@property
def pfizer_tpsa(self):
return self.tpsa >= 75
@property
def pfizer_global(self):
return self.pfizer_a_log_p and self.pfizer_tpsa
class MDDRActivityClass(models.Model): class MDDRActivityClass(models.Model):
name = models.CharField('Activity Class', max_length=100, unique=True) name = models.CharField('Activity Class', max_length=100, unique=True)
......
...@@ -26,18 +26,6 @@ ...@@ -26,18 +26,6 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
{% include "pubchem_img.html" %} {% include "pubchem_img.html" %}
<!--
<div id="{{ compound.id }}_smilesdisplay"
data-widget="Kekule.ChemWidget.Viewer2D" data-auto-size="true" data-padding="20"
data-toolbar-evoke-modes="[0]">
</div>
<textarea rows="10" cols="50" id="{{ compound.id }}_smilesvalue" style="display:none;">{{ compound.canonical_smile }}</textarea>
<script>
$(window).on('load', function(){
kekule_display('{{ compound.id }}_smilesvalue','{{ compound.id }}_smilesdisplay')
});
</script>
-->
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item">Common name: {{ compound.common_name }}</li> <li class="list-group-item">Common name: {{ compound.common_name }}</li>
<li class="list-group-item">Canonical SMILES: {{ compound.canonical_smile }}</li> <li class="list-group-item">Canonical SMILES: {{ compound.canonical_smile }}</li>
...@@ -90,6 +78,68 @@ ...@@ -90,6 +78,68 @@
</div> </div>
</div> </div>
<div class="tab-pane fade" id="v-pills-pharmacology" role="tabpanel" aria-labelledby="v-pills-pharmacology-tab"> <div class="tab-pane fade" id="v-pills-pharmacology" role="tabpanel" aria-labelledby="v-pills-pharmacology-tab">
<div class="row">
<table class="table table-sm col-sm-12">
<thead>
<tr>
<th class="col-sm-3" scope="col">Descriptor</th>
<th class="col-sm-3" scope="col">Lipinski's RO5</th>
<th class="col-sm-3" scope="col">Veber</th>
<th class="col-sm-3" scope="col">Pfizer's 3/75</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Global</th>
<td class="{% if compound.lipinsky_global %}bg-success{% else %}bg-danger{% endif %}"></td>
<td class="{% if compound.veber_global %}bg-success{% else %}bg-danger{% endif %}"></td>
<td class="{% if compound.pfizer_global %}bg-success{% else %}bg-danger{% endif %}"></td>
</tr>
<tr>
<th scope="row">MW</th>
<td class="{% if compound.lipinsky_mw %}bg-success{% else %}bg-danger{% endif %}" title="Molecular weight <= 500g/mol">{{ compound.molecular_weight }}g/mol</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
</tr>
<tr>
<th scope="row">HBA</th>
<td class="{% if compound.lipinsky_hba %}bg-success{% else %}bg-danger{% endif %}" title="HBA <= 10">{{ compound.nb_acceptor_h }}</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
</tr>
<tr>
<th scope="row">HBD</th>
<td class="{% if compound.lipinsky_hbd %}bg-success{% else %}bg-danger{% endif %}" title="HBD <= 5">{{ compound.nb_donor_h }}</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
</tr>
<tr>
<th scope="row">HBA + HBD</th>
<td class="bg-light"></td>
<td class="{% if compound.veber_hba_hbd %}bg-success{% else %}bg-danger{% endif %}" title="HBD + HBA <= 12">{{ compound.hba_hbd }}</td>
<td class="bg-light"></td>
</tr>
<tr>
<th scope="row">AlogP</th>
<td class="{% if compound.lipinsky_a_log_p %}bg-success{% else %}bg-danger{% endif %}" title="AlogP <= 5">{{ compound.a_log_p }}</td>
<td class="bg-light"></td>
<td class="{% if compound.pfizer_a_log_p %}bg-success{% else %}bg-danger{% endif %}" title="AlogP <= 3">{{ compound.a_log_p }}</td>
</tr>
<tr>
<th scope="row">TPSA</th>
<td class="bg-light"></td>
<td class="{% if compound.veber_tpsa %}bg-success{% else %}bg-danger{% endif %}" title="TPSA <= 140">{{ compound.tpsa }}</td>
<td class="{% if compound.pfizer_tpsa %}bg-success{% else %}bg-danger{% endif %}" title="TPSA <= 75">{{ compound.tpsa }}</td>
</tr>
<tr>
<th scope="row">RB</th>
<td class="bg-light"></td>
<td class="{% if compound.veber_rb %}bg-success{% else %}bg-danger{% endif %}" title="RB <= 10">{{ compound.nb_rotatable_bonds }}</td>
<td class="bg-light"></td>
</tr>
</tbody>
</table>
</div>
</div> </div>
<div class="tab-pane fade" id="v-pills-pharmacokinetics" role="tabpanel" aria-labelledby="v-pills-pharmacokinetics-tab"> <div class="tab-pane fade" id="v-pills-pharmacokinetics" role="tabpanel" aria-labelledby="v-pills-pharmacokinetics-tab">
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment