Commit 3268d1e7 authored by cmaffeo2's avatar cmaffeo2
Browse files

Updated pdb writers so resid is left justified, system dimensions are 1000 AA

parent 0b4849e4
......@@ -914,7 +914,7 @@ class atomicModel():
open("%s.psf" % prefix,'w') as psf:
## Write headers
pdb.write("CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1\n")
pdb.write("CRYST1 1000. 1000. 1000. 90.00 90.00 90.00 P 1 1\n")
psf.write("PSF NAMD\n\n") # create NAMD formatted psf
psf.write("{:>8d} !NTITLE\n\n".format(0))
......
......@@ -858,10 +858,10 @@ class beadModel():
def writePdb(self, filename):
with open(filename,'w') as fh:
## Write header
fh.write("CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1\n")
fh.write("CRYST1 1000. 1000. 1000. 90.00 90.00 90.00 P 1 1\n")
## Write coordinates
formatString = "ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s} {:>5s}{:1s}{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}\n"
formatString = "ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}{:>5s} {:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}\n"
for n,hid,zid in self.particles:
## http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM
idx = n.idx
......@@ -873,11 +873,11 @@ class beadModel():
beta = zid
x,y,z = [x for x in n.position]
assert(idx < 100000)
assert(idx < 1e5)
resid = "{:<4d}".format(idx)
fh.write( formatString.format(
idx, name[:1], "", resname, chain, resid, "", x, y, z, occ, beta, "", charge ))
idx, name[:1], "", resname, chain, resid, x, y, z, occ, beta, "", charge ))
return
def writePsf(self, filename):
......
......@@ -952,10 +952,10 @@ class beadModelTwist():
def writePdb(self, filename):
with open(filename,'w') as fh:
## Write header
fh.write("CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 1\n")
fh.write("CRYST1 1000. 1000. 1000. 90.00 90.00 90.00 P 1 1\n")
## Write coordinates
formatString = "ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s} {:>5s}{:1s}{:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}\n"
formatString = "ATOM {:>5d} {:^4s}{:1s}{:3s} {:1s}{:>5s} {:8.3f}{:8.3f}{:8.3f}{:6.2f}{:6.2f}{:2s}{:2f}\n"
for n,hid,zid in self.particles:
## http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM
idx = n.idx
......@@ -967,11 +967,11 @@ class beadModelTwist():
beta = zid
x,y,z = [x for x in n.position]
assert(idx < 100000)
assert(idx < 1e5)
resid = "{:<4d}".format(idx)
fh.write( formatString.format(
idx, name[:1], "", resname, chain, resid, "", x, y, z, occ, beta, "", charge ))
idx, name[:1], "", resname, chain, resid, x, y, z, occ, beta, "", charge ))
return
def writePsf(self, filename):
......
Supports Markdown
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