diff --git a/ippisite/db.sqlite3.REMOVED.git-id b/ippisite/db.sqlite3.REMOVED.git-id index 406ad56a0680592d95c6f24a4287c90a92ca94ea..0fc6bb90b007a4760562c0146ef75c5b7f91ee15 100644 --- a/ippisite/db.sqlite3.REMOVED.git-id +++ b/ippisite/db.sqlite3.REMOVED.git-id @@ -1 +1 @@ -f9381e78efb52e844670bc977d0f99461134ee9d \ No newline at end of file +5fb9ed7a41b37ceaa343fd897c2db6c4123dfea8 \ No newline at end of file diff --git a/ippisite/ippidb/management/commands/lle_le.py b/ippisite/ippidb/management/commands/lle_le.py index 12f59779743b5c3cebfe8957c27e9d50b8117c33..402818556811523f019f515cf85324aeb63da6cb 100644 --- a/ippisite/ippidb/management/commands/lle_le.py +++ b/ippisite/ippidb/management/commands/lle_le.py @@ -20,7 +20,7 @@ class Command(BaseCommand): if comp.le is not None: le = round(comp.le, 7) lle = round(comp.lle, 7) - le_lle_data.append({'x': le, 'y': lle, 'id': comp.id, 'family_name': comp.best_pXC50_activity_ppi_name}) + le_lle_data.append({'x': le, 'y': lle, 'id': comp.id, 'family_name': comp.best_pXC50_activity_ppi_family}) else: self.stdout.write( self.style.WARNING('compound %s has no LE (probably because no pXC50 activity results have been registered)' % comp.id)) diff --git a/ippisite/ippidb/models.py b/ippisite/ippidb/models.py index 1838e18f9abf4f4ea04783adc57a2ab59031551a..e2dce821f0aaaec97c59ab8cdc8e5505cd08d2f5 100644 --- a/ippisite/ippidb/models.py +++ b/ippisite/ippidb/models.py @@ -457,6 +457,17 @@ class Compound(models.Model): ppi_name = best_activity_car.test_activity_description.ppi.name return ppi_name + @property + def best_pXC50_activity_ppi_family(self): + """ + Family of the PPI corresponding to the best PXC50 activity + """ + best_activity_car = self.best_pXC50_compound_activity_result + if best_activity_car is None: + return None + ppi_family = best_activity_car.test_activity_description.ppi.family.name + return ppi_family + @property def bioch_tests_count(self): """ diff --git a/ippisite/ippidb/templates/compound_card.html b/ippisite/ippidb/templates/compound_card.html index 38e825fa662f0805fb3d66e704425f87bf415789..11f7f3115e632f2f0ba5dd80826e994675efe90e 100644 --- a/ippisite/ippidb/templates/compound_card.html +++ b/ippisite/ippidb/templates/compound_card.html @@ -165,7 +165,7 @@ <div class="card-body"> <canvas id="le_lle_biplot"></canvas> <script> - drawLeLleBiplotChart('le_lle_biplot', {{ compound.id }}, '{{ compound.best_pXC50_activity_ppi_name|default_if_none:"No target family identified" }}', {{ biplot_data | safe }}, 'pharmacology'); + drawLeLleBiplotChart('le_lle_biplot', {{ compound.id }}, '{{ compound.best_pXC50_activity_ppi_family|default_if_none:"No target family identified" }}', {{ biplot_data | safe }}, 'pharmacology'); </script> </div> </div> diff --git a/ippisite/ippidb/templates/compound_v_item.html b/ippisite/ippidb/templates/compound_v_item.html index 5beb76adcbd8400905e88a54b85c69aeb6d9489a..dd71370173dc0aee9c7bf2335ed4d0ce98adb62c 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 family in compound.families %}{{ family.name }}{% endfor %}</p> + <p>{{ compound.best_pXC50_activity_ppi_family }}</p> <p>Molecular Weight: {{ compound.molecular_weight }} g/mol</p> </div> </div>