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
a93a74de
Unverified
Commit
a93a74de
authored
Jul 31, 2019
by
peastman
Committed by
GitHub
Jul 31, 2019
Browse files
Merge pull request #2350 from swails/bugfix/2348
Don't parse resid
parents
2e86184b
f3028508
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
+3
-5
No files found.
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
View file @
a93a74de
...
...
@@ -47,7 +47,7 @@ ONE_TIMESCALE = 1 / TIMESCALE
class
CharmmCrdFile
(
object
):
"""
Reads and parses a CHARMM coordinate file (.crd) into its components,
namely the coordinates, CHARMM atom types,
resid,
resname, etc.
namely the coordinates, CHARMM atom types, resname, etc.
Attributes
----------
...
...
@@ -69,7 +69,6 @@ class CharmmCrdFile(object):
self
.
atomno
=
[]
# Atom number
self
.
resno
=
[]
# Residue number
self
.
resname
=
[]
# Residue name
self
.
resid
=
[]
# Residue ID
self
.
attype
=
[]
# Atom type
self
.
positions
=
[]
# 3N atomic coordinates
self
.
title
=
[]
# .crd file title block
...
...
@@ -105,7 +104,7 @@ class CharmmCrdFile(object):
try
:
self
.
natom
=
int
(
line
.
strip
().
split
()[
0
])
for
row
in
range
(
self
.
natom
):
for
_
in
range
(
self
.
natom
):
line
=
crdfile
.
readline
().
strip
().
split
()
self
.
atomno
.
append
(
int
(
line
[
0
]))
self
.
resno
.
append
(
int
(
line
[
1
]))
...
...
@@ -114,7 +113,6 @@ class CharmmCrdFile(object):
pos
=
Vec3
(
float
(
line
[
4
]),
float
(
line
[
5
]),
float
(
line
[
6
]))
self
.
positions
.
append
(
pos
)
self
.
segid
.
append
(
line
[
7
])
self
.
resid
.
append
(
int
(
line
[
8
]))
self
.
weighting
.
append
(
float
(
line
[
9
]))
if
self
.
natom
!=
len
(
self
.
positions
):
...
...
@@ -124,7 +122,7 @@ class CharmmCrdFile(object):
len
(
self
.
positions
))
)
except
(
ValueError
,
IndexError
)
as
e
:
except
(
ValueError
,
IndexError
):
raise
CharmmFileError
(
'Error parsing CHARMM coordinate file'
)
# Apply units to the positions now. Do it this way to allow for
...
...
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