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
166919ad
Commit
166919ad
authored
5 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
add unit test for AlignmentFromChainView in seq.alg
parent
f4a4e273
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/seq/alg/tests/CMakeLists.txt
+1
-0
1 addition, 0 deletions
modules/seq/alg/tests/CMakeLists.txt
modules/seq/alg/tests/test_alignment_from_chain_view.py
+36
-0
36 additions, 0 deletions
modules/seq/alg/tests/test_alignment_from_chain_view.py
with
37 additions
and
0 deletions
modules/seq/alg/tests/CMakeLists.txt
+
1
−
0
View file @
166919ad
...
...
@@ -8,6 +8,7 @@ set(OST_SEQ_ALG_UNIT_TESTS
test_global_align.py
test_semiglobal_align.py
test_weight_matrix.py
test_alignment_from_chain_view.py
)
if
(
COMPOUND_LIB
)
...
...
This diff is collapsed.
Click to expand it.
modules/seq/alg/tests/test_alignment_from_chain_view.py
0 → 100644
+
36
−
0
View file @
166919ad
import
unittest
import
os
import
ost
from
ost
import
seq
,
io
,
mol
class
TestAlignmentFromChainView
(
unittest
.
TestCase
):
def
testAlignment
(
self
):
prot
=
io
.
LoadPDB
(
os
.
path
.
join
(
"
testfiles
"
,
"
dummy.pdb
"
))
view_resnums
=
[
2
,
3
,
4
,
7
,
8
]
query
=
"
rnum=
"
+
'
,
'
.
join
([
str
(
item
)
for
item
in
view_resnums
])
prot_view
=
prot
.
Select
(
query
)
exp_handle_seq
=
''
.
join
([
r
.
one_letter_code
for
r
in
prot
.
residues
])
exp_view_seq
=
[
'
-
'
]
*
len
(
prot
.
residues
)
for
rnum
in
view_resnums
:
exp_view_seq
[
rnum
-
1
]
=
prot
.
residues
[
rnum
-
1
].
one_letter_code
exp_view_seq
=
''
.
join
(
exp_view_seq
)
aln
=
seq
.
alg
.
AlignmentFromChainView
(
prot_view
.
chains
[
0
],
handle_seq_name
=
'
custom_handle_name
'
,
view_seq_name
=
'
custom_view_name
'
)
handle_seq
=
aln
.
GetSequence
(
0
)
view_seq
=
aln
.
GetSequence
(
1
)
self
.
assertEqual
(
handle_seq
.
GetName
(),
'
custom_handle_name
'
)
self
.
assertEqual
(
view_seq
.
GetName
(),
'
custom_view_name
'
)
self
.
assertEqual
(
exp_handle_seq
,
handle_seq
.
GetString
())
self
.
assertEqual
(
exp_view_seq
,
view_seq
.
GetString
())
if
__name__
==
"
__main__
"
:
from
ost
import
testutils
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