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
7f802839
Commit
7f802839
authored
Apr 22, 2015
by
Jason Swails
Browse files
Fix up Residue assignment in CharmmPsfFile Topology
Also fixes the test case. Everything should pass now.
parent
84691dc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
wrappers/python/simtk/openmm/app/charmmpsffile.py
wrappers/python/simtk/openmm/app/charmmpsffile.py
+4
-4
wrappers/python/tests/TestCharmmFiles.py
wrappers/python/tests/TestCharmmFiles.py
+1
-1
No files found.
wrappers/python/simtk/openmm/app/charmmpsffile.py
View file @
7f802839
...
...
@@ -612,13 +612,13 @@ class CharmmPsfFile(object):
last_residue
=
None
# Add each chain (separate 'system's) and residue
for
atom
in
self
.
atom_list
:
resid
=
'%d%s'
%
(
atom
.
residue
.
idx
,
atom
.
residue
.
inscode
)
if
atom
.
system
!=
last_chain
:
chain
=
topology
.
addChain
(
atom
.
system
)
last_chain
=
atom
.
system
if
atom
.
residue
.
idx
!=
last_residue
:
last_residue
=
atom
.
residue
.
idx
residue
=
topology
.
addResidue
(
atom
.
residue
.
resname
,
chain
,
str
(
atom
.
residue
.
idx
))
if
resid
!=
last_residue
:
last_residue
=
resid
residue
=
topology
.
addResidue
(
atom
.
residue
.
resname
,
chain
,
resid
)
if
atom
.
type
is
not
None
:
# This is the most reliable way of determining the element
atomic_num
=
atom
.
type
.
atomic_number
...
...
wrappers/python/tests/TestCharmmFiles.py
View file @
7f802839
...
...
@@ -120,7 +120,7 @@ class TestCharmmFiles(unittest.TestCase):
psf
=
CharmmPsfFile
(
'systems/4TVP-dmj_wat-ion.psf'
)
self
.
assertEqual
(
len
(
list
(
psf
.
topology
.
atoms
())),
66264
)
self
.
assertEqual
(
len
(
list
(
psf
.
topology
.
residues
())),
20169
)
self
.
assertEqual
(
len
(
list
(
psf
.
bonds
())),
46634
)
self
.
assertEqual
(
len
(
list
(
psf
.
topology
.
bonds
())),
46634
)
def
test_ImplicitSolventForces
(
self
):
"""Compute forces for different implicit solvent types, and compare them to ones generated with a previous version of OpenMM to ensure they haven't changed."""
...
...
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