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([ for ca in self.compoundaction_set.all()]))
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 class="tab-pane fade" id="drugsimilarity" role="tabpanel" aria-labelledby="drugsimilarity-tab">
<table class="table table-striped">
<th title="Tanimoto index">Ta</th>
<th>Drugbank ID</th>
{% for dbct in compound.sorted_similar_drugbank_compounds %}
<td>{{ dbct.tanimoto }}</td>
<td>{% include "compound_smiles_draw.html" with smile=dbct.drugbank_compound.canonical_smiles %}</td>
<td>{{ dbct.drugbank_compound.common_name }}</td>
<td><a target="_blank" href="{{ }}">{{ }}</a></td>
{% endfor %}
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