Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
openstructure
Commits
80fcb5a0
Verified
Commit
80fcb5a0
authored
2 years ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
feat: SCHWED-5783 ensure is_ligand is set properly upon Copy()
parent
23939b51
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mol/alg/tests/test_ligand_scoring.py
+8
-0
8 additions, 0 deletions
modules/mol/alg/tests/test_ligand_scoring.py
with
8 additions
and
0 deletions
modules/mol/alg/tests/test_ligand_scoring.py
+
8
−
0
View file @
80fcb5a0
...
@@ -23,6 +23,8 @@ class TestLigandScoring(unittest.TestCase):
...
@@ -23,6 +23,8 @@ class TestLigandScoring(unittest.TestCase):
assert
len
(
sc
.
target_ligands
)
==
7
assert
len
(
sc
.
target_ligands
)
==
7
assert
len
(
sc
.
model_ligands
)
==
1
assert
len
(
sc
.
model_ligands
)
==
1
assert
len
([
r
for
r
in
sc
.
target
.
residues
if
r
.
is_ligand
])
==
7
assert
len
([
r
for
r
in
sc
.
model
.
residues
if
r
.
is_ligand
])
==
1
def
test_init_given_ligands
(
self
):
def
test_init_given_ligands
(
self
):
"""
Test that we can instantiate the scorer with ligands contained in
"""
Test that we can instantiate the scorer with ligands contained in
...
@@ -38,6 +40,9 @@ class TestLigandScoring(unittest.TestCase):
...
@@ -38,6 +40,9 @@ class TestLigandScoring(unittest.TestCase):
assert
len
(
sc
.
target_ligands
)
==
4
assert
len
(
sc
.
target_ligands
)
==
4
assert
len
(
sc
.
model_ligands
)
==
1
assert
len
(
sc
.
model_ligands
)
==
1
# IsLigand flag should still be set even on not selected ligands
assert
len
([
r
for
r
in
sc
.
target
.
residues
if
r
.
is_ligand
])
==
7
assert
len
([
r
for
r
in
sc
.
model
.
residues
if
r
.
is_ligand
])
==
1
# Ensure the residues are not copied
# Ensure the residues are not copied
assert
len
(
sc
.
target
.
Select
(
"
rname=MG
"
).
residues
)
==
2
assert
len
(
sc
.
target
.
Select
(
"
rname=MG
"
).
residues
)
==
2
...
@@ -83,6 +88,9 @@ class TestLigandScoring(unittest.TestCase):
...
@@ -83,6 +88,9 @@ class TestLigandScoring(unittest.TestCase):
assert
len
(
sc
.
target_ligands
)
==
7
assert
len
(
sc
.
target_ligands
)
==
7
assert
len
(
sc
.
model_ligands
)
==
1
assert
len
(
sc
.
model_ligands
)
==
1
# Ensure we set the is_ligand flag
assert
len
([
r
for
r
in
sc
.
target
.
residues
if
r
.
is_ligand
])
==
7
assert
len
([
r
for
r
in
sc
.
model
.
residues
if
r
.
is_ligand
])
==
1
# Pass residues
# Pass residues
mdl_ligs_res
=
[
mdl_ligs
[
0
].
residues
[
0
]]
mdl_ligs_res
=
[
mdl_ligs
[
0
].
residues
[
0
]]
...
...
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