3
# Calculate a table of dihedral angle interactions used in the alpha-helix
4
# and beta-sheet regions of the frustrated protein model described in
5
# provided in figure 8 of the supplemental materials section of:
6
# AI Jewett, A Baumketner and J-E Shea, PNAS, 101 (36), 13192-13197, (2004)
7
# Note that the "A" and "B" parameters were incorrectly reported to be
8
# 5.4*epsilon and 6.0*epsilon. The values used were 5.6 and 6.0 epsilon.
9
# The phiA and phiB values were 57.29577951308232 degrees (1 rad)
10
# and 180 degrees, respectively. Both expA and expB were 6.0.
12
# To generate the table used for the alpha-helix (1 degree resolution) use this:
13
# ./calc_dihedral_table.py 6.0 57.29577951308232 6 5.6 180 6 0.0 359 360
14
# To generate the table used for the beta-sheets (1 degree resolution) use this:
15
# ./calc_dihedral_table.py 5.6 57.29577951308232 6 6.0 180 6 0.0 359 360
17
# (If you're curious as to why I set the location of the minima at phi_alpha
18
# to 1.0 radians (57.2957795 degrees), there was no particularly good reason.
19
# I think the correct value turns out to be something closer to 50 degrees.)
26
# The previous version included the repulsive core term
27
def U(phi, A, phiA, expA, B, phiB, expB, use_radians=False):
31
termA = pow(cos(0.5*(phi-phiA)*conv_units), expA)
32
termB = pow(cos(0.5*(phi-phiB)*conv_units), expB)
33
return -A*termA - B*termB
35
# The previous version included the repulsive core term
36
def F(phi, A, phiA, expA, B, phiB, expB, use_radians=False):
40
termA = (0.5*sin(0.5*(phi-phiA)*conv_units) *
41
expA * pow(cos(0.5*(phi-phiA)*conv_units), expA-1.0))
42
termB = (0.5*sin(0.5*(phi-phiB)*conv_units) *
43
expB * pow(cos(0.5*(phi-phiB)*conv_units), expB-1.0))
44
return -conv_units*(A*termA + B*termB)
46
if len(sys.argv) != 10:
47
sys.stderr.write("Error: expected 9 arguments:\n"
49
"Usage: "+sys.argv[0]+" A phiA expA B phiB expB phiMin phiMax N\n\n")
52
A = float(sys.argv[1])
53
phiA = float(sys.argv[2])
54
expA = float(sys.argv[3])
55
B = float(sys.argv[4])
56
phiB = float(sys.argv[5])
57
expB = float(sys.argv[6])
58
phi_min = float(sys.argv[7])
59
phi_max = float(sys.argv[8])
63
phi = phi_min + i*(phi_max - phi_min)/(N-1)
64
U_phi = U(phi, A, phiA, expA, B, phiB, expB, use_radians=False)
65
F_phi = F(phi, A, phiA, expA, B, phiB, expB, use_radians=False)
66
print(str(i+1)+' '+str(phi)+' '+str(U_phi)+' '+str(F_phi))