Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
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
ProMod3
Commits
ee8101a8
Commit
ee8101a8
authored
10 years ago
by
Bienchen
Committed by
BIOPZ-Johner Niklaus
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Checked test_raw_modeling.py
parent
757b47e3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
meld/src/CMakeLists.txt
+5
-2
5 additions, 2 deletions
meld/src/CMakeLists.txt
meld/tests/CMakeLists.txt
+0
-1
0 additions, 1 deletion
meld/tests/CMakeLists.txt
meld/tests/test_raw_modeling.py
+89
-84
89 additions, 84 deletions
meld/tests/test_raw_modeling.py
with
94 additions
and
87 deletions
meld/src/CMakeLists.txt
+
5
−
2
View file @
ee8101a8
...
@@ -8,8 +8,11 @@ gap.hh
...
@@ -8,8 +8,11 @@ gap.hh
model.hh
model.hh
)
)
module
(
NAME meld HEADERS
${
MELD_HEADERS
}
SOURCES
${
MELD_SOURCES
}
DEPENDS_ON
module
(
NAME meld
promod3_core LINK
${
OPENGL_LIBRARIES
}
${
OST_LIBRARIES
}
${
BOOST_LIBRARIES
}
)
HEADERS
${
MELD_HEADERS
}
SOURCES
${
MELD_SOURCES
}
DEPENDS_ON promod3_core
LINK
${
OPENGL_LIBRARIES
}
${
OST_LIBRARIES
}
${
BOOST_LIBRARIES
}
)
if
(
QMEAN_ROOT
)
if
(
QMEAN_ROOT
)
target_link_libraries
(
promod3_meld
${
QMEAN_LIBRARIES
}
)
target_link_libraries
(
promod3_meld
${
QMEAN_LIBRARIES
}
)
...
...
This diff is collapsed.
Click to expand it.
meld/tests/CMakeLists.txt
+
0
−
1
View file @
ee8101a8
...
@@ -20,4 +20,3 @@ set(MELD_TEST_DATA
...
@@ -20,4 +20,3 @@ set(MELD_TEST_DATA
promod3_unittest
(
MODULE meld
promod3_unittest
(
MODULE meld
SOURCES
"
${
MELD_UNIT_TESTS
}
"
SOURCES
"
${
MELD_UNIT_TESTS
}
"
DATA
"
${
MELD_TEST_DATA
}
"
)
DATA
"
${
MELD_TEST_DATA
}
"
)
This diff is collapsed.
Click to expand it.
meld/tests/test_raw_modeling.py
+
89
−
84
View file @
ee8101a8
"""
Unit tests for meld.
"""
import
unittest
import
unittest
from
promod3
import
meld
from
promod3
import
meld
from
ost
import
conop
,
seq
,
io
,
mol
from
ost
import
conop
,
seq
,
io
,
mol
class
RawModelingTests
(
unittest
.
TestCase
):
class
RawModelingTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
compound_lib
=
conop
.
CompoundLib
.
Load
(
'
data/raw-modeling/compounds.chemlib
'
)
compound_lib
=
conop
.
CompoundLib
.
Load
(
conop
.
SetDefaultLib
(
compound_lib
)
'
data/raw-modeling/compounds.chemlib
'
)
io
.
profiles
[
'
DEFAULT
'
].
processor
=
conop
.
RuleBasedProcessor
(
compound_lib
)
conop
.
SetDefaultLib
(
compound_lib
)
io
.
profiles
[
'
DEFAULT
'
].
processor
=
conop
.
RuleBasedProcessor
(
compound_lib
)
def
testRaiseNoAttachedView
(
self
):
def
testRaiseNoAttachedView
(
self
):
# test that BuildRawModel throws exception when no view is attached
# test that BuildRawModel throws exception when no view is attached
aln
=
seq
.
CreateAlignment
(
seq
.
CreateSequence
(
'
A
'
,
'
acdef
'
),
aln
=
seq
.
CreateAlignment
(
seq
.
CreateSequence
(
'
A
'
,
'
acdef
'
),
seq
.
CreateSequence
(
'
B
'
,
'
ac-ef
'
))
seq
.
CreateSequence
(
'
B
'
,
'
ac-ef
'
))
self
.
assertRaises
(
RuntimeError
,
meld
.
BuildRawModel
,
aln
)
self
.
assertRaises
(
RuntimeError
,
meld
.
BuildRawModel
,
aln
)
def
testModeledSequence
(
self
):
# test if the model has the sequence we want.
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/seq.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
seq1
=
seq
.
SequenceFromChain
(
'
MODEL
'
,
result
.
model
.
chains
[
0
])
self
.
assertEqual
(
seq1
.
string
,
aln
.
sequences
[
0
].
string
)
def
testDeletion
(
self
):
def
testModeledSequence
(
self
):
# test if the result contains a "deletion" gap at the right spot.
# test if the model has the sequence we want.
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/del.fasta
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/seq.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
seq1
=
seq
.
SequenceFromChain
(
'
MODEL
'
,
result
.
model
.
chains
[
0
])
self
.
assertEqual
(
len
(
result
.
gaps
),
1
)
self
.
assertEqual
(
seq1
.
string
,
aln
.
sequences
[
0
].
string
)
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
residues
[
2
])
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
3
])
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
''
)
def
testInsertion
(
self
):
def
testDeletion
(
self
):
# test if the result contains an "insertion" gap at the right spot.
# test if the result contains a "deletion" gap at the right spot.
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/ins.fasta
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/del.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
residues
=
result
.
model
.
residues
self
.
assertEqual
(
len
(
result
.
gaps
),
1
)
self
.
assertEqual
(
len
(
result
.
gaps
),
1
)
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
residues
[
1
])
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
residues
[
2
])
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
2
])
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
3
])
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
'
AV
'
)
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
''
)
def
testTer
(
self
):
# test if the result contains two terminal gaps, one at the beginning,
# one at the end
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/ter.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
self
.
assertEqual
(
len
(
result
.
gaps
),
2
)
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
mol
.
ResidueHandle
())
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
0
])
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
'
G
'
)
self
.
assertEqual
(
result
.
gaps
[
1
].
before
,
residues
[
-
1
])
self
.
assertEqual
(
result
.
gaps
[
1
].
after
,
mol
.
ResidueHandle
())
self
.
assertEqual
(
result
.
gaps
[
1
].
seq
,
'
G
'
)
def
testModified
(
self
):
def
testInsertion
(
self
):
# test if we correctly strip off modifications
# test if the result contains an "insertion" gap at the right spot.
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/sep.pdb
'
)
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/sep.fasta
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/ins.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
residues
=
result
.
model
.
residues
self
.
assertEqual
(
len
(
residues
),
1
)
self
.
assertEqual
(
len
(
result
.
gaps
),
1
)
self
.
assertEqual
(
len
(
residues
[
0
].
atoms
),
6
)
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
residues
[
1
])
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
N
"
))
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
2
])
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
CA
"
))
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
'
AV
'
)
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
C
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
O
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
CB
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
OG
"
))
def
testInsertCBeta
(
self
):
def
testTer
(
self
):
# test if the dst residues contain cbeta, unless they are glycines
# test if the result contains two terminal gaps, one at the beginning,
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/cbeta.pdb
'
)
# one at the end
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/cbeta.fasta
'
)
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/gly.pdb
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/ter.fasta
'
)
result
=
meld
.
BuildRawModel
(
aln
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
residues
=
result
.
model
.
residues
result
=
meld
.
BuildRawModel
(
aln
)
assert
not
residues
[
0
].
FindAtom
(
"
CB
"
).
IsValid
()
residues
=
result
.
model
.
residues
assert
not
residues
[
1
].
FindAtom
(
"
CB
"
).
IsValid
()
self
.
assertEqual
(
len
(
result
.
gaps
),
2
)
assert
residues
[
2
].
FindAtom
(
"
CB
"
).
IsValid
()
self
.
assertEqual
(
result
.
gaps
[
0
].
before
,
mol
.
ResidueHandle
())
assert
residues
[
3
].
FindAtom
(
"
CB
"
).
IsValid
()
self
.
assertEqual
(
result
.
gaps
[
0
].
after
,
residues
[
0
])
self
.
assertEqual
(
result
.
gaps
[
0
].
seq
,
'
G
'
)
self
.
assertEqual
(
result
.
gaps
[
1
].
before
,
residues
[
-
1
])
self
.
assertEqual
(
result
.
gaps
[
1
].
after
,
mol
.
ResidueHandle
())
self
.
assertEqual
(
result
.
gaps
[
1
].
seq
,
'
G
'
)
def
testModified
(
self
):
# test if we correctly strip off modifications
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/sep.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/sep.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
self
.
assertEqual
(
len
(
residues
),
1
)
self
.
assertEqual
(
len
(
residues
[
0
].
atoms
),
6
)
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
N
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
CA
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
C
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
O
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
CB
"
))
self
.
assertTrue
(
residues
[
0
].
FindAtom
(
"
OG
"
))
def
testInsertCBeta
(
self
):
# test if the dst residues contain cbeta, unless they are glycines
tpl
=
io
.
LoadPDB
(
'
data/raw-modeling/cbeta.pdb
'
)
aln
=
io
.
LoadAlignment
(
'
data/raw-modeling/cbeta.fasta
'
)
aln
.
AttachView
(
1
,
tpl
.
CreateFullView
())
result
=
meld
.
BuildRawModel
(
aln
)
residues
=
result
.
model
.
residues
self
.
assertFalse
(
residues
[
0
].
FindAtom
(
"
CB
"
).
IsValid
())
self
.
assertFalse
(
residues
[
1
].
FindAtom
(
"
CB
"
).
IsValid
())
self
.
assertTrue
(
residues
[
2
].
FindAtom
(
"
CB
"
).
IsValid
())
self
.
assertTrue
(
residues
[
3
].
FindAtom
(
"
CB
"
).
IsValid
())
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
from
ost
import
testutils
from
ost
import
testutils
testutils
.
RunTests
()
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