Commit 29c00341 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add molecular function filter to compounds list (GO terms)

see #7
parent 07768026
Pipeline #8211 passed with stages
in 10 minutes and 38 seconds
......@@ -104,6 +104,10 @@ class MolecularFunction(AutoFillableModel):
info = get_go_info(self.go_id)
self.description = info['label']
@property
def name(self):
return self.go_id + ' ' + self.description
def __str__(self):
return self.description
......
......@@ -113,6 +113,7 @@
{% 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" %}
{% include "modal_open_button.html" with label="Molecular function" param_name="molecular_function" %}
{% include "modal_open_button.html" with label="PPI" param_name="ppi" %}
{% include "modal_open_button.html" with label="Chemical similarity" param_name="marvin" %}
</div>
......@@ -136,7 +137,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_domain 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 or selected_molecular_function %}
<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" %}
......@@ -172,6 +173,7 @@
{% 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 %}
{% include "selected_badge.html" with param_name="molecular_function" values=selected_molecular_function %}
{% include "selected_badge.html" with param_name="ppi" values=selected_ppi %}
{% include "similarity_badge.html" with param_name="similar_to" param_value=similar_to_query param_label="Similar to " %}
......@@ -232,6 +234,7 @@
{% include "multiselection_modal.html" with label="PPI Family" selected_list=selected_family unselected_list=family param_name="family" all_param_name="family_all" all_param_value=family_all %}
{% include "multiselection_modal.html" with label="PPI" selected_list=selected_ppi unselected_list=ppi param_name="ppi" all_param_name="ppi_all" all_param_value=ppi_all %}
{% 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="Molecular function" selected_list=selected_molecular_function unselected_list=molecular_function param_name="molecular_function" all_param_name="molecular_function_all" all_param_value=molecular_function_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 %}
......
......@@ -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, Domain, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, create_tanimoto
from ippidb.models import Compound, Ppi, ProteinDomainBoundComplex, ProteinDomainPartnerComplex, Disease, Domain, Taxonomy, LeLleBiplotData, PcaBiplotData, PpiFamily, MolecularFunction, create_tanimoto
DEACTIVATION_MAPPING = {
'lipinsky': set(['molecular_weight', 'nb_acceptor_h', 'nb_donor_h', 'a_log_p']),
......@@ -313,6 +313,7 @@ class CompoundListView(ListView):
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),
CompoundListFilterHandler(MolecularFunction, 'compoundaction__ppi_id__ppicomplex__complex__protein__molecular_functions', 'protein__proteindomaincomplex__ppicomplex__ppi__compoundaction__compound', 'molecular_function', 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