diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py index b716cc7c93d3cd9c11b5da117fc28c8ae9ed20a4..3d9c6ad1243b7cad587764b173e07964a9f2791c 100644 --- a/ippisite/ippidb/models.py +++ b/ippisite/ippidb/models.py @@ -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) diff --git a/ippisite/ippidb/templates/compound_card.html b/ippisite/ippidb/templates/compound_card.html index 4a6df77d270c03990a58e2d14dfcf5d8bf527bf1..219330c5551b38d50b822a3bfd324e1ecd456a4d 100644 --- a/ippisite/ippidb/templates/compound_card.html +++ b/ippisite/ippidb/templates/compound_card.html @@ -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>