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
7be99f6b
Commit
7be99f6b
authored
5 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
basic unit tests for TMAlign and TMScore
parent
cfd8447f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/bindings/tests/CMakeLists.txt
+1
-0
1 addition, 0 deletions
modules/bindings/tests/CMakeLists.txt
modules/bindings/tests/test_tmtools.py
+59
-0
59 additions, 0 deletions
modules/bindings/tests/test_tmtools.py
with
60 additions
and
0 deletions
modules/bindings/tests/CMakeLists.txt
+
1
−
0
View file @
7be99f6b
...
@@ -6,6 +6,7 @@ set(OST_BINDINGS_UNIT_TESTS
...
@@ -6,6 +6,7 @@ set(OST_BINDINGS_UNIT_TESTS
test_kclust.py
test_kclust.py
test_naccess.py
test_naccess.py
test_cadscore.py
test_cadscore.py
test_tmtools.py
)
)
ost_unittest
(
MODULE bindings
ost_unittest
(
MODULE bindings
...
...
This diff is collapsed.
Click to expand it.
modules/bindings/tests/test_tmtools.py
0 → 100644
+
59
−
0
View file @
7be99f6b
import
unittest
from
ost
import
*
from
ost
import
settings
from
ost
import
testutils
from
ost.seq.alg
import
SequenceIdentity
from
ost.bindings
import
tmtools
class
TestTMBindings
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
protein
=
io
.
LoadEntity
(
"
testfiles/testprotein.pdb
"
)
def
testTMAlign
(
self
):
try
:
cad_calc_path
=
settings
.
Locate
(
'
tmalign
'
)
except
:
print
(
"
Could not find tmalign executable: ignoring unit tests
"
)
return
tm_result
=
tmtools
.
TMAlign
(
self
.
protein
,
self
.
protein
)
# model and reference are the same, we expect pretty good results
self
.
assertEqual
(
tm_result
.
rmsd
,
0.0
)
self
.
assertEqual
(
tm_result
.
tm_score
,
1.0
)
self
.
assertEqual
(
tm_result
.
aligned_length
,
len
(
self
.
protein
.
chains
[
0
].
residues
))
self
.
assertEqual
(
SequenceIdentity
(
tm_result
.
alignment
),
100.0
)
# transformation should be identity matrix (no transformation at all...)
identity
=
geom
.
Mat4
(
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
)
self
.
assertEqual
(
tm_result
.
transform
,
identity
)
def
testTMScore
(
self
):
try
:
cad_calc_path
=
settings
.
Locate
(
'
tmscore
'
)
except
:
print
(
"
Could not find tmalign executable: ignoring unit tests
"
)
return
tm_result
=
tmtools
.
TMScore
(
self
.
protein
,
self
.
protein
)
# model and reference are the same, we expect pretty good results
self
.
assertEqual
(
tm_result
.
rmsd_common
,
0.0
)
self
.
assertEqual
(
tm_result
.
tm_score
,
1.0
)
self
.
assertEqual
(
tm_result
.
max_sub
,
1.0
)
self
.
assertEqual
(
tm_result
.
gdt_ts
,
1.0
)
self
.
assertEqual
(
tm_result
.
gdt_ha
,
1.0
)
self
.
assertEqual
(
tm_result
.
rmsd_below_five
,
0.0
)
# transformation should be identity matrix (no transformation at all...)
identity
=
geom
.
Mat4
(
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
)
self
.
assertEqual
(
tm_result
.
transform
,
identity
)
if
__name__
==
"
__main__
"
:
testutils
.
RunTests
()
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