Commit 3eb4fe2e authored by Peter Eastman's avatar Peter Eastman
Browse files

Avoid writing numbers that are too large to fit in the allowed set of columns

parent e59e15b2
...@@ -214,7 +214,7 @@ class PDBFile(object): ...@@ -214,7 +214,7 @@ class PDBFile(object):
else: else:
atomName = atom.name atomName = atom.name
coords = positions[posIndex] coords = positions[posIndex]
print >>file, "ATOM %5d %-4s %3s %s%4d %8.3f%8.3f%8.3f 1.00 0.00" % (atomIndex, atomName, resName, chainName, resIndex+1, coords[0], coords[1], coords[2]) print >>file, "ATOM %5d %-4s %3s %s%4d %8.3f%8.3f%8.3f 1.00 0.00" % (atomIndex%100000, atomName, resName, chainName, (resIndex+1)%10000, coords[0], coords[1], coords[2])
posIndex += 1 posIndex += 1
atomIndex += 1 atomIndex += 1
if resIndex == len(residues)-1: if resIndex == len(residues)-1:
......
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