Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
adb7bfb9
Commit
adb7bfb9
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add select on bound complex to compounds list
Former-commit-id: 4519106f57e981f615014827ca5f2f841cc2f477
parent
520ded06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ippisite/ippidb/models.py
+2
-1
2 additions, 1 deletion
ippisite/ippidb/models.py
ippisite/ippidb/templates/compound_list.html
+1
-0
1 addition, 0 deletions
ippisite/ippidb/templates/compound_list.html
ippisite/ippidb/views.py
+16
-2
16 additions, 2 deletions
ippisite/ippidb/views.py
with
19 additions
and
3 deletions
ippisite/ippidb/models.py
+
2
−
1
View file @
adb7bfb9
...
...
@@ -163,6 +163,8 @@ class ProteinDomainComplex(models.Model):
def
__str__
(
self
):
return
'
{}-{}
'
.
format
(
self
.
protein_id
,
self
.
domain_id
)
def
name
(
self
):
return
self
.
protein
.
short_name
class
ProteinDomainBoundComplex
(
ProteinDomainComplex
):
ppp_copy_nb_per_p
=
models
.
IntegerField
(
...
...
@@ -244,7 +246,6 @@ class PpiComplex(models.Model):
def
__str__
(
self
):
return
'
PPI {}, Complex {} ({})
'
.
format
(
self
.
ppi
,
self
.
complex
,
self
.
cc_nb
)
class
Compound
(
models
.
Model
):
canonical_smile
=
models
.
CharField
(
'
Canonical Smile
'
,
unique
=
True
,
max_length
=
500
)
...
...
This diff is collapsed.
Click to expand it.
ippisite/ippidb/templates/compound_list.html
+
1
−
0
View file @
adb7bfb9
...
...
@@ -37,6 +37,7 @@
{% include "multiselection_list_menu.html" with label="PPI" selected_list=selected_ppis unselected_list=ppis param_name="ppi" limit_param_name="ppis_limit" limit_param_value=ppis_limit %}
{% include "multiselection_list_menu.html" with label="Disease" selected_list=selected_diseases unselected_list=diseases param_name="disease" limit_param_name="diseases_limit" limit_param_value=diseases_limit %}
{% include "multiselection_list_menu.html" with label="Organism" selected_list=selected_taxonomies unselected_list=taxonomies param_name="taxonomy" limit_param_name="taxonomies_limit" limit_param_value=taxonomies_limit %}
{% include "multiselection_list_menu.html" with label="Bound complex" selected_list=selected_boundcomplexes unselected_list=boundcomplexes param_name="boundcomplex" limit_param_name="boundcomplexes_limit" limit_param_value=boundcomplexes_limit %}
</form>
</div>
<main
class=
"col-12 col-md-9 col-xl-10 pl-md-5 bd-content"
role=
"main"
>
...
...
This diff is collapsed.
Click to expand it.
ippisite/ippidb/views.py
+
16
−
2
View file @
adb7bfb9
...
...
@@ -5,7 +5,7 @@ from django.http import HttpResponseRedirect, Http404
from
django.core.paginator
import
Paginator
,
EmptyPage
,
PageNotAnInteger
from
formtools.wizard.views
import
SessionWizardView
,
NamedUrlSessionWizardView
from
.forms
import
IdForm
,
BibliographyForm
,
PDBForm
,
ProteinForm
,
ProteinDomainComplexTypeForm
,
ProteinDomainComplexForm
,
PpiForm
,
PpiComplexForm
,
ProteinFormSet
,
ActivityForm
,
CompoundForm
,
CompoundFormSet
from
.models
import
Protein
,
Bibliography
,
ProteinDomainComplex
,
RefCompoundBiblio
,
TestActivityDescription
,
Compound
,
Ppi
,
Disease
,
Taxonomy
from
.models
import
Protein
,
Bibliography
,
ProteinDomainComplex
,
ProteinDomainBoundComplex
,
RefCompoundBiblio
,
TestActivityDescription
,
Compound
,
Ppi
,
Disease
,
Taxonomy
from
.ws
import
get_pdb_uniprot_mapping
...
...
@@ -197,6 +197,8 @@ def compound_list(request):
compounds
=
compounds
.
filter
(
compoundaction__ppi__diseases__id__in
=
request
.
GET
.
getlist
(
'
disease
'
))
if
request
.
GET
.
get
(
'
taxonomy
'
):
compounds
=
compounds
.
filter
(
compoundaction__ppi_id__ppicomplex__complex__protein__organism__id__in
=
request
.
GET
.
getlist
(
'
taxonomy
'
))
if
request
.
GET
.
get
(
'
boundcomplexes
'
):
compounds
=
compounds
.
filter
(
compoundaction__ppi_id__ppicomplex__complex__id__in
=
request
.
GET
.
getlist
(
'
boundcomplex
'
))
try
:
ppis_limit
=
int
(
request
.
GET
.
get
(
'
ppis_limit
'
))
except
:
...
...
@@ -209,6 +211,10 @@ def compound_list(request):
taxonomies_limit
=
int
(
request
.
GET
.
get
(
'
taxonomies_limit
'
))
except
:
taxonomies_limit
=
None
try
:
boundcomplexes_limit
=
int
(
request
.
GET
.
get
(
'
boundcomplexes_limit
'
))
except
:
boundcomplexes_limit
=
None
selected_ppis
=
Ppi
.
objects
.
filter
(
id__in
=
request
.
GET
.
getlist
(
'
ppi
'
))
ppis
=
Ppi
.
objects
.
exclude
(
id__in
=
request
.
GET
.
getlist
(
'
ppi
'
))
if
ppis_limit
is
not
None
:
...
...
@@ -221,6 +227,10 @@ def compound_list(request):
taxonomies
=
Taxonomy
.
objects
.
exclude
(
id__in
=
request
.
GET
.
getlist
(
'
taxonomy
'
))
if
taxonomies_limit
is
not
None
:
taxonomies
=
taxonomies
[:
taxonomies_limit
]
selected_boundcomplexes
=
ProteinDomainBoundComplex
.
objects
.
filter
(
id__in
=
request
.
GET
.
getlist
(
'
boundcomplex
'
))
boundcomplexes
=
ProteinDomainBoundComplex
.
objects
.
exclude
(
id__in
=
request
.
GET
.
getlist
(
'
boundcomplex
'
))
if
boundcomplexes_limit
is
not
None
:
boundcomplexes
=
boundcomplexes
[:
boundcomplexes_limit
]
# handle pagination in compounds list
paginator
=
Paginator
(
compounds
,
5
)
page
=
request
.
GET
.
get
(
'
page
'
)
...
...
@@ -241,7 +251,11 @@ def compound_list(request):
'
diseases_limit
'
:
ppis_limit
,
'
selected_taxonomies
'
:
selected_taxonomies
,
'
taxonomies
'
:
taxonomies
,
'
taxonomies_limit
'
:
taxonomies_limit
})
'
taxonomies_limit
'
:
taxonomies_limit
,
'
selected_boundcomplexes
'
:
selected_boundcomplexes
,
'
boundcomplexes
'
:
boundcomplexes
,
'
boundcomplexes_limit
'
:
boundcomplexes_limit
})
def
compound_card
(
request
,
compound_id
):
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment