diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py index 2ec0acd07776509b9d7feea7f504fd3d91973671..1838e18f9abf4f4ea04783adc57a2ab59031551a 100644 --- a/ippisite/ippidb/models.py +++ b/ippisite/ippidb/models.py @@ -471,6 +471,13 @@ class Compound(models.Model): """ return self.compoundactivityresult_set.all().filter(test_activity_description__test_type='CELL').count() + @property + def families(self): + """ + 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()])) + class LeLleBiplotData(models.Model): le_lle_biplot_data = models.CharField('LE-LLE biplot JSON data', max_length=150000, blank=True, null=True) diff --git a/ippisite/ippidb/templates/compound_v_item.html b/ippisite/ippidb/templates/compound_v_item.html index e6e54ecdcf74b7a66f5ae394e789aee05d56eae7..5beb76adcbd8400905e88a54b85c69aeb6d9489a 100644 --- a/ippisite/ippidb/templates/compound_v_item.html +++ b/ippisite/ippidb/templates/compound_v_item.html @@ -2,7 +2,7 @@ <a href="/compound/{{ compound.id }}">{% include "pubchem_img.html" %}</a> <div class="card-body" style="overflow:hidden; word-wrap:break-word;"> <span class="badge badge-dark"><a href="/compound/{{ compound.id }}">{{ compound.id }}</a></span> - <p>{% for pfam_id in compound.pfam_ids %}{{ pfam_id }}{% endfor %}</p> + <p>{% for family in compound.families %}{{ family.name }}{% endfor %}</p> <p>Molecular Weight: {{ compound.molecular_weight }} g/mol</p> </div> </div>