Commit 07768026 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add filter on domain ("PFAM") for compound query

see #7
parent c5add71a
Pipeline #8210 passed with stages
in 10 minutes and 47 seconds
......@@ -158,6 +158,10 @@ class Domain(AutoFillableModel):
self.pfam_id = info['id']
self.pfam_description = info['description']
@property
def name(self):
return self.pfam_id
def __str__(self):
return '{} ({}-{})'.format(self.pfam_acc, self.pfam_id, self.pfam_description)
......
......@@ -107,6 +107,7 @@
PPI target filters
</button>
<div class="dropdown-menu" aria-labelledby="ptfMenuButton">
{% include "modal_open_button.html" with label="PFAM" param_name="domain" %}
{% 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" %}
......@@ -135,7 +136,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 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 %}
{% 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_domain or selected_boundcomplex or selected_partnercomplex or selected_family or selected_taxonomy or selected_disease or selected_ppi or similar_to or pubs %}
<span>
&nbsp;-&nbsp;filters:&nbsp;
{% 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" %}
......@@ -165,6 +166,7 @@
{% 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="domain" values=selected_domain %}
{% 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 %}
......@@ -233,6 +235,7 @@
{% 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 "multiselection_modal.html" with label="PFAM" selected_list=selected_domain unselected_list=domain param_name="domain" all_param_name="domain_all" all_param_value=domain_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'%}
......
......@@ -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, ProteinDomainPartnerComplex, Disease, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, create_tanimoto
from ippidb.models import Compound, Ppi, ProteinDomainBoundComplex, ProteinDomainPartnerComplex, Disease, Domain, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, create_tanimoto
DEACTIVATION_MAPPING = {
'lipinsky': set(['molecular_weight', 'nb_acceptor_h', 'nb_donor_h', 'a_log_p']),
......@@ -52,7 +52,6 @@ class CompoundListFilterHandler(FilterHandler):
super().__init__(parameter_name, filter_context, request_get)
self.filter_class = filter_class
self.relation_from_compound = relation_from_compound
self.relation_from_compound = relation_from_compound
self.relation_to_compound = relation_to_compound
self.value = request_get.getlist(parameter_name)
......@@ -313,6 +312,7 @@ class CompoundListView(ListView):
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),
CompoundListFilterHandler(Domain, 'compoundaction__ppi_id__ppicomplex__complex__domain', 'proteindomaincomplex__ppicomplex__ppi__compoundaction__compound', 'domain', 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),
......
Supports Markdown
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