Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
138172fb
Commit
138172fb
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add new "name" property for the PPI based on proteins in complexes
Former-commit-id: cac6d4ec52af22686f1f100b4b6662ebd5b7c2ee
parent
1f45bfda
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/models.py
+11
-0
11 additions, 0 deletions
ippisite/ippidb/models.py
with
11 additions
and
0 deletions
ippisite/ippidb/models.py
+
11
−
0
View file @
138172fb
...
...
@@ -220,6 +220,17 @@ class Ppi(models.Model):
# this is the less efficient query ever seen, FIXME
return
PpiComplex
.
objects
.
filter
(
ppi
=
self
,
complex__in
=
ProteinDomainBoundComplex
.
objects
.
all
())
@property
def
name
(
self
):
all_protein_names
=
set
([
ppi_complex
.
complex
.
protein
.
short_name
for
ppi_complex
in
self
.
get_ppi_complexes
()])
bound_protein_names
=
set
([
ppi_complex
.
complex
.
protein
.
short_name
for
ppi_complex
in
self
.
get_ppi_bound_complexes
()])
partner_protein_names
=
all_protein_names
-
bound_protein_names
bound_str
=
'
,
'
.
join
(
bound_protein_names
)
partner_str
=
'
,
'
.
join
(
partner_protein_names
)
name
=
bound_str
if
partner_str
!=
''
:
name
+=
'
/
'
+
partner_str
return
name
class
PpiComplex
(
models
.
Model
):
ppi
=
models
.
ForeignKey
(
Ppi
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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