Skip to content

Commit 11a8808

Browse files
committed
misc
1 parent 2a1daf8 commit 11a8808

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

PolymerChain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def solvate(
610610
#######################################################################################################
611611
f = open("tmp.inp", "w")
612612
f.write(
613-
f"dimension chsize {int(chsize)}\nioformat extended\nstream {self.toppar}\nset parall {n_proc}\n"
613+
f"dimension chsize {int(chsize)} \nioformat extended\nstream {self.toppar}\nset parall {n_proc}\n"
614614
)
615615
f.write(f"open unit 1 card name {self.id.lower()}.psf\n")
616616
f.write(f"read psf card unit 1 \n")
@@ -671,7 +671,7 @@ def solvate(
671671
print("invoking charmm-process")
672672
f = open("tmp.inp", "w")
673673
f.write(
674-
f"dimension chsize {int(chsize)}\nioformat extended\nstream {self.toppar}\nset parall {n_proc}\n"
674+
f"dimension chsize {int(chsize)} \nioformat extended\nstream {self.toppar}\nset parall {n_proc}\n"
675675
)
676676
f.write(
677677
f"open unit 1 card name {self.id.lower()}_in_{solvent_res.lower()}.psf\n"

misc.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,35 @@ def solvation_coordinates(x, y, z, solvent_res, atoms):
9292
return "slvnt.crd"
9393

9494

95+
def fsolvation_coordinates(x, y, z, solvent_res, atoms):
96+
# for now only works for water
97+
coords = product(x, y, z)
98+
f = open("slvnt.crd", "w")
99+
f.write("* NONE *\n")
100+
f.write(f"* DATE {date.today()} CREATED BY TEAPUN\n*\n")
101+
f.write(f" {len(list(coords))*len(atoms)} EXT\n")
102+
coords = product(x, y, z)
103+
ctr1 = 1
104+
for ctr, c in enumerate(coords):
105+
x = c[0]
106+
y = c[1]
107+
z = c[2]
108+
f.write(
109+
f"{ctr1:10d}{ctr+1:10d} {solvent_res:<8.8s} {atoms[0]:<8.8s}{x+1:20.10f}{y:20.10f}{z+1:20.10f} {solvent_res:<8.8s} {ctr+1:<8d}0.0000000000\n"
110+
)
111+
ctr1 += 1
112+
f.write(
113+
f"{ctr1:10d}{ctr+1:10d} {solvent_res:<8.8s} {atoms[1]:<8.8s}{x:20.10f}{y+1:20.10f}{z+1:20.10f} {solvent_res:<8.8s} {ctr+1:<8d}0.0000000000\n"
114+
)
115+
ctr1 += 1
116+
f.write(
117+
f"{ctr1:10d}{ctr+1:10d} {solvent_res:<8.8s} {atoms[2]:<8.8s}{x:20.10f}{y:20.10f}{z:20.10f} {solvent_res:<8.8s} {ctr+1:<8d}0.0000000000\n"
118+
)
119+
ctr1 += 1
120+
f.close()
121+
return "slvnt.crd"
122+
123+
95124
def pack_system(
96125
polymerchainpdb,
97126
n,

0 commit comments

Comments
 (0)