Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
410674c0
Commit
410674c0
authored
Mar 03, 2015
by
peastman
Browse files
Merge pull request #842 from peastman/residue
Fixed exception in addExtraParticles()
parents
8d276c26
36cdbc8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+1
-1
wrappers/python/tests/TestModeller.py
wrappers/python/tests/TestModeller.py
+21
-0
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
410674c0
...
@@ -924,7 +924,7 @@ class Modeller(object):
...
@@ -924,7 +924,7 @@ class Modeller(object):
# extra points.
# extra points.
template
=
None
template
=
None
residueNoEP
=
Residue
(
residue
.
name
,
residue
.
index
,
residue
.
chain
)
residueNoEP
=
Residue
(
residue
.
name
,
residue
.
index
,
residue
.
chain
,
residue
.
id
)
residueNoEP
.
_atoms
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
is
not
None
]
residueNoEP
.
_atoms
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
is
not
None
]
if
signature
in
forcefield
.
_templateSignatures
:
if
signature
in
forcefield
.
_templateSignatures
:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
...
...
wrappers/python/tests/TestModeller.py
View file @
410674c0
...
@@ -886,6 +886,27 @@ class TestModeller(unittest.TestCase):
...
@@ -886,6 +886,27 @@ class TestModeller(unittest.TestCase):
validate_equivalence
(
self
,
topology_LYN
,
topology_after
)
validate_equivalence
(
self
,
topology_LYN
,
topology_after
)
def
test_addExtraParticles
(
self
):
"""Test addExtraParticles()."""
# Create a box of water.
ff1
=
ForceField
(
'tip3p.xml'
)
modeller
=
Modeller
(
Topology
(),
[]
*
nanometers
)
modeller
.
addSolvent
(
ff1
,
'tip3p'
,
boxSize
=
Vec3
(
2
,
2
,
2
)
*
nanometers
)
# Now convert the water to TIP4P.
ff2
=
ForceField
(
'tip4pew.xml'
)
modeller
.
addExtraParticles
(
ff2
)
for
residue
in
modeller
.
topology
.
residues
():
atoms
=
list
(
residue
.
atoms
())
self
.
assertEqual
(
4
,
len
(
atoms
))
ep
=
[
atom
for
atom
in
atoms
if
atom
.
element
is
None
]
self
.
assertEqual
(
1
,
len
(
ep
))
def
assertVecAlmostEqual
(
self
,
p1
,
p2
,
tol
=
1e-7
):
def
assertVecAlmostEqual
(
self
,
p1
,
p2
,
tol
=
1e-7
):
scale
=
max
(
1.0
,
norm
(
p1
),)
scale
=
max
(
1.0
,
norm
(
p1
),)
for
i
in
range
(
3
):
for
i
in
range
(
3
):
...
...
Write
Preview
Markdown
is supported
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