From c5add71abcb81a72745ef48049bb64e4738fddb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr> Date: Wed, 12 Dec 2018 11:29:34 +0100 Subject: [PATCH] add partner complex filter and badges for external link filters see #7 --- ippisite/ippidb/templates/compound_list.html | 9 ++++++++- ippisite/ippidb/views/compound_query.py | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html index 893bd1b6..3b93d43b 100644 --- a/ippisite/ippidb/templates/compound_list.html +++ b/ippisite/ippidb/templates/compound_list.html @@ -108,6 +108,7 @@ </button> <div class="dropdown-menu" aria-labelledby="ptfMenuButton"> {% include "modal_open_button.html" with label="Bound complex" param_name="boundcomplex" %} + {% include "modal_open_button.html" with label="Partner complex" param_name="partnercomplex" %} {% include "modal_open_button.html" with label="PPI Family" param_name="family" %} {% include "modal_open_button.html" with label="Organism" param_name="taxonomy" %} {% include "modal_open_button.html" with label="Disease" param_name="disease" %} @@ -134,7 +135,7 @@ <div class="m-2 d-flex justify-content-between"> <span>{{ paginator.count }} compounds</span> - {% if nb_donor_h or nb_acceptor_h or tpsa or nb_rotatable_bonds or molecular_weight or a_log_p or nb_aromatic_sssr or nb_chiral_centers or fsp3 or lipinsky or veber or pfizer or best_activity or le or lle or pdb_ligand_av or selected_boundcomplex or selected_family or selected_taxonomy or selected_disease or selected_ppi or similar_to or pubs %} + {% if nb_donor_h or nb_acceptor_h or tpsa or nb_rotatable_bonds or molecular_weight or a_log_p or nb_aromatic_sssr or nb_chiral_centers or fsp3 or lipinsky or veber or pfizer or best_activity or le or lle or pdb_ligand_av or inhibition_role or stabilisation_role or binding_role or pubchem_id or chembl_id or chemspider_id or selected_boundcomplex or selected_partnercomplex or selected_family or selected_taxonomy or selected_disease or selected_ppi or similar_to or pubs %} <span> - filters: {% include "slider_badge.html" with param_name="nb_donor_h" param_value=nb_donor_h param_value_min=nb_donor_h_value_min param_value_max=nb_donor_h_value_max param_label="H donors" %} @@ -160,7 +161,12 @@ {% include "boolean_badge.html" with param_name="stabilisation_role" param_value=stabilisation_role label="Stabilisation role"%} {% include "boolean_badge.html" with param_name="binding_role" param_value=binding_role label="Binding role"%} + {% include "boolean_badge.html" with param_name="pubchem_id" param_value=pubchem_id label="PubChem ID"%} + {% include "boolean_badge.html" with param_name="chembl_id" param_value=chembl_id label="ChEMBL ID"%} + {% include "boolean_badge.html" with param_name="chemspider_id" param_value=chemspider_id label="ChemSpider ID"%} + {% include "selected_badge.html" with param_name="boundcomplex" values=selected_boundcomplex %} + {% include "selected_badge.html" with param_name="partnercomplex" values=selected_partnercomplex %} {% include "selected_badge.html" with param_name="family" values=selected_family %} {% include "selected_badge.html" with param_name="taxonomy" values=selected_taxonomy %} {% include "selected_badge.html" with param_name="disease" values=selected_disease %} @@ -226,6 +232,7 @@ {% include "multiselection_modal.html" with label="Disease" selected_list=selected_disease unselected_list=disease param_name="disease" all_param_name="disease_all" all_param_value=disease_all %} {% include "multiselection_modal.html" with label="Organism" selected_list=selected_taxonomy unselected_list=taxonomy param_name="taxonomy" all_param_name="taxonomy_all" all_param_value=taxonomy_all %} {% include "multiselection_modal.html" with label="Bound complex" selected_list=selected_boundcomplex unselected_list=boundcomplex param_name="boundcomplex" all_param_name="boundcomplex_all" all_param_value=boundcomplex_all %} + {% include "multiselection_modal.html" with label="Partner complex" selected_list=selected_partnercomplex unselected_list=partnercomplex param_name="partnercomplex" all_param_name="partnercomplex_all" all_param_value=boundcomplex_all %} {% include "slider_modal.html" with label="Molecular Weight" param_name="molecular_weight" param_min=molecular_weight_min param_max=molecular_weight_max param_value=molecular_weight param_value_min=molecular_weight_value_min param_value_max=molecular_weight_value_max step='50' param_label='Select a cutoff value for the molecular weight of the compounds to be selected'%} {% include "slider_modal.html" with label="AlogP" param_name="a_log_p" param_min=a_log_p_min param_max=a_log_p_max param_value=a_log_p param_value_min=a_log_p_value_min param_value_max=a_log_p_value_max step='1' param_label='Select a cutoff value for the AlogP of the compounds to be selected'%} {% include "slider_modal.html" with label="H donors" param_name="nb_donor_h" param_min=nb_donor_h_min param_max=nb_donor_h_max param_value=nb_donor_h param_value_min=nb_donor_h_value_min param_value_max=nb_donor_h_value_max step='1' param_label='Select a cutoff value for the number of H donors in the compounds to be selected'%} diff --git a/ippisite/ippidb/views/compound_query.py b/ippisite/ippidb/views/compound_query.py index fda158bf..06568bb1 100644 --- a/ippisite/ippidb/views/compound_query.py +++ b/ippisite/ippidb/views/compound_query.py @@ -13,7 +13,7 @@ from django.views.generic.list import ListView from django.views.generic.base import RedirectView from ippidb.utils import mol2smi, smi2mol -from ippidb.models import Compound, Ppi, ProteinDomainBoundComplex, Disease, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, create_tanimoto +from ippidb.models import Compound, Ppi, ProteinDomainBoundComplex, ProteinDomainPartnerComplex, Disease, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, create_tanimoto DEACTIVATION_MAPPING = { 'lipinsky': set(['molecular_weight', 'nb_acceptor_h', 'nb_donor_h', 'a_log_p']), @@ -312,6 +312,7 @@ class CompoundListView(ListView): CompoundListFilterHandler(Disease, 'compoundaction__ppi__diseases', 'ppi__compoundaction__compound', 'disease', self.filter_context, self.request.GET), CompoundListFilterHandler(Taxonomy, 'compoundaction__ppi_id__ppicomplex__complex__protein__organism', 'protein__proteindomaincomplex__ppicomplex__ppi__compoundaction__compound', 'taxonomy', self.filter_context, self.request.GET), CompoundListFilterHandler(ProteinDomainBoundComplex, 'compoundaction__ppi_id__ppicomplex__complex', 'ppicomplex__ppi__compoundaction__compound', 'boundcomplex', self.filter_context, self.request.GET), + CompoundListFilterHandler(ProteinDomainPartnerComplex, 'compoundaction__ppi_id__ppicomplex__complex', 'ppicomplex__ppi__compoundaction__compound', 'partnercomplex', self.filter_context, self.request.GET), CompoundRangeFilterHandler('molecular_weight', self.filter_context, self.request.GET, 50), CompoundRangeFilterHandler('a_log_p', self.filter_context, self.request.GET), CompoundRangeFilterHandler('nb_donor_h', self.filter_context, self.request.GET), -- GitLab