Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
1d9fdf2a
Commit
1d9fdf2a
authored
Mar 14, 2022
by
Hervé MENAGER
Browse files
Merge branch 'master' into 'contributor-page'
Master See merge request
!36
parents
65c97f0a
3462dd28
Pipeline
#77875
failed with stage
in 43 minutes and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/management/commands/clean_targetcentric.py
View file @
1d9fdf2a
...
...
@@ -34,7 +34,12 @@ class Command(AppCommand):
help
=
"Load Cavities from global csv file and delete all Cavities not present in the csv"
def
__init__
(
self
,
stdout
=
None
,
stderr
=
None
,
no_color
=
False
,
force_color
=
False
,
task
=
None
,
self
,
stdout
=
None
,
stderr
=
None
,
no_color
=
False
,
force_color
=
False
,
task
=
None
,
):
super
(
Command
,
self
).
__init__
(
stdout
=
stdout
,
stderr
=
stderr
,
no_color
=
no_color
,
force_color
=
force_color
...
...
@@ -113,5 +118,16 @@ class Command(AppCommand):
)
if
delete
:
pdb
.
delete
()
pdbs
=
PDB
.
objects
.
filter
(
chain__cavity
=
None
)
for
pdb
in
pdbs
:
if
pdb
.
no_cavities
():
clean
=
1
self
.
stdout
.
write
(
self
.
style
.
WARNING
(
"WARNING {} has no cavities"
.
format
(
pdb
.
code
))
)
if
delete
:
pdb
.
delete
()
if
not
clean
:
self
.
stdout
.
write
(
self
.
style
.
SUCCESS
(
"No PDB to remove"
))
ippisite/ippidb/models/targetcentric.py
View file @
1d9fdf2a
...
...
@@ -90,6 +90,16 @@ class PDB(models.Model):
else
:
return
False
def
no_cavities
(
self
):
chains
=
self
.
chain_set
.
all
()
cavity_num
=
0
for
chain
in
chains
:
cavity_num
+=
chain
.
cavity_set
.
count
()
if
cavity_num
:
return
False
else
:
return
True
def
__unicode__
(
self
):
partners
=
""
onprot
=
""
...
...
ippisite/ippidb/tests/tests.py
View file @
1d9fdf2a
...
...
@@ -516,8 +516,8 @@ class TestGetDoiInfo(TestCase):
self
.
assertEqual
(
resp
[
"biblio_year"
],
2008
)
self
.
assertEqual
(
resp
[
"authors_list"
],
"Dephoure N
.
, Zhou C
.
, Vill
e
n J
.
, Beausoleil S
.
A., "
"Bakalarski C
.
E., Elledge S
.
J., Gygi S
.
P."
,
"Dephoure N
oah
, Zhou C
hunshui
, Vill
é
n J
udit
, Beausoleil S
ean
A., "
"Bakalarski C
orey
E., Elledge S
tephen
J., Gygi S
teven
P."
,
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment