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
7b4f4e79
Commit
7b4f4e79
authored
Sep 28, 2012
by
Peter Eastman
Browse files
Bug fixes to amber_file_parser
parent
1db349e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+13
-4
No files found.
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
7b4f4e79
...
...
@@ -875,7 +875,10 @@ def readAmberCoordinates(filename, read_box=False, read_velocities=False, verbos
mm
=
simtk
.
openmm
natoms_read
=
0
while
(
natoms_read
<
natoms
):
line
=
infile
.
readline
().
strip
()
line
=
infile
.
readline
()
if
len
(
line
)
==
0
:
raise
ValueError
(
"Unexpected end of file while reading coordinates"
)
line
=
line
.
strip
()
elements
=
line
.
split
()
while
(
len
(
elements
)
>
0
):
coordinates
.
append
(
mm
.
Vec3
(
float
(
elements
.
pop
(
0
)),
float
(
elements
.
pop
(
0
)),
float
(
elements
.
pop
(
0
))))
...
...
@@ -896,11 +899,14 @@ def readAmberCoordinates(filename, read_box=False, read_velocities=False, verbos
velocities
=
[]
natoms_read
=
0
while
(
natoms_read
<
natoms
):
line
=
infile
.
readline
().
strip
()
line
=
infile
.
readline
()
if
len
(
line
)
==
0
:
raise
ValueError
(
"Unexpected end of file while reading velocities"
)
line
=
line
.
strip
()
elements
=
line
.
split
()
while
(
len
(
elements
)
>
0
):
velocities
.
append
(
20.455
*
mm
.
Vec3
(
float
(
elements
.
pop
(
0
)),
float
(
elements
.
pop
(
0
)),
float
(
elements
.
pop
(
0
))))
natoms_read
+=
1
natoms_read
+=
1
if
asNumpy
:
newvel
=
numpy
.
zeros
([
natoms
,
3
],
numpy
.
float32
)
for
i
in
range
(
len
(
velocities
)):
...
...
@@ -913,7 +919,10 @@ def readAmberCoordinates(filename, read_box=False, read_velocities=False, verbos
# Read box size if present
box_vectors
=
None
if
(
read_box
):
line
=
infile
.
readline
().
strip
()
line
=
infile
.
readline
()
if
len
(
line
)
==
0
:
raise
ValueError
(
"Unexpected end of file while reading box vectors"
)
line
=
line
.
strip
()
elements
=
line
.
split
()
nelements
=
len
(
elements
)
box_dimensions
=
[
0.0
]
*
nelements
...
...
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