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

enable listing and displaying PPI families for a compound

Former-commit-id: 8e38acc04f6bb2e703791158b930ee6699e18fec
parent f655abd1
No related branches found
No related tags found
No related merge requests found
...@@ -471,6 +471,13 @@ class Compound(models.Model): ...@@ -471,6 +471,13 @@ class Compound(models.Model):
""" """
return self.compoundactivityresult_set.all().filter(test_activity_description__test_type='CELL').count() 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): class LeLleBiplotData(models.Model):
le_lle_biplot_data = models.CharField('LE-LLE biplot JSON data', max_length=150000, blank=True, null=True) le_lle_biplot_data = models.CharField('LE-LLE biplot JSON data', max_length=150000, blank=True, null=True)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a href="/compound/{{ compound.id }}">{% include "pubchem_img.html" %}</a> <a href="/compound/{{ compound.id }}">{% include "pubchem_img.html" %}</a>
<div class="card-body" style="overflow:hidden; word-wrap:break-word;"> <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> <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> <p>Molecular Weight: {{ compound.molecular_weight }} g/mol</p>
</div> </div>
</div> </div>
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