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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
5b7e42ef
Commit
5b7e42ef
authored
8 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add methods to retrieve complexes
from PPI, CompoundAction, TestActivityDescription fixes #37
parent
b57cfd6e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ippisite/db.sqlite3
+0
-0
0 additions, 0 deletions
ippisite/db.sqlite3
ippisite/ippidb/models.py
+26
-8
26 additions, 8 deletions
ippisite/ippidb/models.py
with
26 additions
and
8 deletions
ippisite/db.sqlite3
+
0
−
0
View file @
5b7e42ef
No preview for this file type
This diff is collapsed.
Click to expand it.
ippisite/ippidb/models.py
+
26
−
8
View file @
5b7e42ef
...
...
@@ -156,6 +156,19 @@ class Ppi(models.Model):
def
__str__
(
self
):
return
'
{} PPI, PDB:{}
'
.
format
(
self
.
symmetry
.
description
,
self
.
pdb_id
or
'
unknown
'
)
def
get_ppi_complexes
(
self
):
"""
return all ppi complexes belonging to this ppi
"""
return
PpiComplex
.
objects
.
filter
(
ppi
=
self
)
def
get_ppi_bound_complexes
(
self
):
"""
return bound ppi complexes belonging to this ppi
"""
#this is the less efficient query ever seen, FIXME
return
PpiComplex
.
objects
.
filter
(
ppi
=
self
,
complex__in
=
ProteinDomainBoundComplex
.
objects
.
all
())
class
PpiComplex
(
models
.
Model
):
ppi
=
models
.
ForeignKey
(
Ppi
)
complex
=
models
.
ForeignKey
(
ProteinDomainComplex
)
...
...
@@ -281,11 +294,14 @@ class TestActivityDescription(models.Model):
cell_line
=
models
.
ForeignKey
(
CellLine
)
def
get_complexes
(
self
):
return
None
# if test_modulation_type is Binding, return all bound complexes for the Ppi
# if test_modulation_type is Inhibition, return all Ppi complexes
# if test_modulation_type is Stabilization, return all bound complexes for the Ppi
# this should be added to the Ppi class as well
"""
get the complexes tested for this PPI
depends on the modulation type
"""
if
self
.
test_modulation_type
==
'
I
'
:
return
self
.
ppi
.
get_ppi_complexes
()
else
:
return
self
.
ppi
.
get_ppi_bound_complexes
()
class
CompoundActivityResult
(
models
.
Model
):
MODULATION_TYPES
=
(
...
...
@@ -364,9 +380,11 @@ class CmpdAction(models.Model):
unique_together
=
((
'
ppi
'
,
'
compound
'
,
'
activation_mode
'
,
'
pdb_id
'
),)
def
get_complexes
(
self
):
return
None
# return all bound complexes for the Ppi
# this should be added to the Ppi class as well
"""
get the complexes involved in the compound action
which are always the bound complexes
"""
return
ppi
.
get_ppi_bound_complexes
()
class
RefCompoundBiblio
(
models
.
Model
):
compound
=
models
.
ForeignKey
(
Compound
)
...
...
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