Commit ba83798f authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

first draft to show similar drugbank compounds

WIP on #96


Former-commit-id: ae2cb02a8bd669efa51c98bbf4d759cd78519434
parent cd7afec5
......@@ -496,7 +496,11 @@ class Compound(AutoFillableModel):
return the all PPI families for PPIs involved in the compound activity of the compound
"""
return list(set([ca.ppi.family for ca in self.compoundaction_set.all()]))
@property
def sorted_similar_drugbank_compounds(self):
return self.drugbankcompoundtanimoto_set.order_by('-tanimoto')
def autofill(self):
# compute InChi and InChiKey
self.inchi = smi2inchi(self.canonical_smile)
......
......@@ -201,6 +201,26 @@
</div>
<div class="tab-pane fade" id="drugsimilarity" role="tabpanel" aria-labelledby="drugsimilarity-tab">
<table class="table table-striped">
<thead>
<tr>
<th title="Tanimoto index">Ta</th>
<th>Structure</th>
<th>Name</th>
<th>Drugbank ID</th>
</tr>
</thead>
<tbody>
{% for dbct in compound.sorted_similar_drugbank_compounds %}
<tr>
<td>{{ dbct.tanimoto }}</td>
<td>{% include "compound_smiles_draw.html" with id=dbct.drugbank_compound.id smile=dbct.drugbank_compound.canonical_smiles %}</td>
<td>{{ dbct.drugbank_compound.common_name }}</td>
<td><a target="_blank" href="https://www.drugbank.ca/drugs/{{ dbct.drugbank_compound.id }}">{{ dbct.drugbank_compound.id }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</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