Commit f3028508 authored by Jason Swails's avatar Jason Swails
Browse files

Don't parse resid, since we don't do anything with it anyway and it is not...

Don't parse resid, since we don't do anything with it anyway and it is not required to be an integer.
parent ec5f7a18
...@@ -47,7 +47,7 @@ ONE_TIMESCALE = 1 / TIMESCALE ...@@ -47,7 +47,7 @@ ONE_TIMESCALE = 1 / TIMESCALE
class CharmmCrdFile(object): class CharmmCrdFile(object):
""" """
Reads and parses a CHARMM coordinate file (.crd) into its components, 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 Attributes
---------- ----------
...@@ -69,7 +69,6 @@ class CharmmCrdFile(object): ...@@ -69,7 +69,6 @@ class CharmmCrdFile(object):
self.atomno = [] # Atom number self.atomno = [] # Atom number
self.resno = [] # Residue number self.resno = [] # Residue number
self.resname = [] # Residue name self.resname = [] # Residue name
self.resid = [] # Residue ID
self.attype = [] # Atom type self.attype = [] # Atom type
self.positions = [] # 3N atomic coordinates self.positions = [] # 3N atomic coordinates
self.title = [] # .crd file title block self.title = [] # .crd file title block
...@@ -105,7 +104,7 @@ class CharmmCrdFile(object): ...@@ -105,7 +104,7 @@ class CharmmCrdFile(object):
try: try:
self.natom = int(line.strip().split()[0]) self.natom = int(line.strip().split()[0])
for row in range(self.natom): for _ in range(self.natom):
line = crdfile.readline().strip().split() line = crdfile.readline().strip().split()
self.atomno.append(int(line[0])) self.atomno.append(int(line[0]))
self.resno.append(int(line[1])) self.resno.append(int(line[1]))
...@@ -114,7 +113,6 @@ class CharmmCrdFile(object): ...@@ -114,7 +113,6 @@ class CharmmCrdFile(object):
pos = Vec3(float(line[4]), float(line[5]), float(line[6])) pos = Vec3(float(line[4]), float(line[5]), float(line[6]))
self.positions.append(pos) self.positions.append(pos)
self.segid.append(line[7]) self.segid.append(line[7])
self.resid.append(int(line[8]))
self.weighting.append(float(line[9])) self.weighting.append(float(line[9]))
if self.natom != len(self.positions): if self.natom != len(self.positions):
...@@ -124,7 +122,7 @@ class CharmmCrdFile(object): ...@@ -124,7 +122,7 @@ class CharmmCrdFile(object):
len(self.positions)) len(self.positions))
) )
except (ValueError, IndexError) as e: except (ValueError, IndexError):
raise CharmmFileError('Error parsing CHARMM coordinate file') raise CharmmFileError('Error parsing CHARMM coordinate file')
# Apply units to the positions now. Do it this way to allow for # Apply units to the positions now. Do it this way to allow for
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment