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
eb1c5858
"wrappers/python/vscode:/vscode.git/clone" did not exist on "af2e3c2fff52cdcf426811fcf257d79f660e1631"
Commit
eb1c5858
authored
Nov 06, 2015
by
Peter Eastman
Browse files
Bug fix
parent
bc41b7a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+2
-2
wrappers/python/tests/TestModeller.py
wrappers/python/tests/TestModeller.py
+7
-5
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
eb1c5858
...
@@ -1029,11 +1029,11 @@ class Modeller(object):
...
@@ -1029,11 +1029,11 @@ class Modeller(object):
if
atom1
in
newExtraPoints
:
if
atom1
in
newExtraPoints
:
a1
=
newExtraPoints
[
atom1
]
a1
=
newExtraPoints
[
atom1
]
else
:
else
:
a1
=
matchingAtoms
[
atom1
]
a1
=
newAtoms
[
matchingAtoms
[
atom1
]
]
if
atom2
in
newExtraPoints
:
if
atom2
in
newExtraPoints
:
a2
=
newExtraPoints
[
atom2
]
a2
=
newExtraPoints
[
atom2
]
else
:
else
:
a2
=
matchingAtoms
[
atom2
]
a2
=
newAtoms
[
matchingAtoms
[
atom2
]
]
newTopology
.
addBond
(
a1
,
a2
)
newTopology
.
addBond
(
a1
,
a2
)
for
bond
in
self
.
topology
.
bonds
():
for
bond
in
self
.
topology
.
bonds
():
...
...
wrappers/python/tests/TestModeller.py
View file @
eb1c5858
...
@@ -953,27 +953,29 @@ class TestModeller(unittest.TestCase):
...
@@ -953,27 +953,29 @@ class TestModeller(unittest.TestCase):
</ForceField>"""
</ForceField>"""
ff
=
ForceField
(
StringIO
(
xml
))
ff
=
ForceField
(
StringIO
(
xml
))
# Create
a
zinc atom.
# Create
two
zinc atom
s
.
topology
=
Topology
()
topology
=
Topology
()
chain
=
topology
.
addChain
()
chain
=
topology
.
addChain
()
residue
=
topology
.
addResidue
(
'ZN'
,
chain
)
residue
=
topology
.
addResidue
(
'ZN'
,
chain
)
topology
.
addAtom
(
'ZN'
,
element
.
zinc
,
residue
)
topology
.
addAtom
(
'ZN'
,
element
.
zinc
,
residue
)
residue
=
topology
.
addResidue
(
'ZN'
,
chain
)
topology
.
addAtom
(
'ZN'
,
element
.
zinc
,
residue
)
# Add the extra particles.
# Add the extra particles.
modeller
=
Modeller
(
topology
,
[
Vec3
(
0.5
,
1.0
,
1.5
)]
*
nanometers
)
modeller
=
Modeller
(
topology
,
[
Vec3
(
0.5
,
1.0
,
1.5
)
,
Vec3
(
2.0
,
2.0
,
0.0
)
]
*
nanometers
)
modeller
.
addExtraParticles
(
ff
)
modeller
.
addExtraParticles
(
ff
)
top
=
modeller
.
topology
top
=
modeller
.
topology
pos
=
modeller
.
positions
pos
=
modeller
.
positions
# Check that the correct particles were added.
# Check that the correct particles were added.
self
.
assertEqual
(
len
(
pos
),
5
)
self
.
assertEqual
(
len
(
pos
),
10
)
for
i
,
atom
in
enumerate
(
top
.
atoms
()):
for
i
,
atom
in
enumerate
(
top
.
atoms
()):
self
.
assertEqual
(
element
.
zinc
if
i
==
0
else
None
,
atom
.
element
)
self
.
assertEqual
(
element
.
zinc
if
i
in
(
0
,
5
)
else
None
,
atom
.
element
)
# Check that the
ir
positions are reasonable.
# Check that the positions
in the first residue
are reasonable.
center
=
Vec3
(
0.5
,
1.0
,
1.5
)
*
nanometers
center
=
Vec3
(
0.5
,
1.0
,
1.5
)
*
nanometers
self
.
assertEqual
(
center
,
modeller
.
positions
[
0
])
self
.
assertEqual
(
center
,
modeller
.
positions
[
0
])
...
...
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