supplement2. 124KB Jun 05 2011 09:30:50 PM
Supplement 2: Computer Programs to
Evaluate the Loop Polynomial CoeÆ
ients
William J. Wedemeyer, Harold A. S
heraga
This se
ond supplement provides a
omputer program poly
oeffs.
whi
h
omputes the seventeen loop polynomial
oeÆ
ients R0 R16 ,
orresponding to equation (7) in the text. This program
alls routines in
poly fun
s.
and poly fun
s.h, whi
h are also given in this supplement.
The programs are written in ANSI-
ompliant C, and should
ompile without
diÆ
ulty. A typi
al
omputation of the loop
oeÆ
ients takes less than a
millise
ond of CPU time.
1
Contents
poly
oes.
3
poly fun
s.h
18
poly fun
s.
20
2
poly
oes.
/* ****************************************************
poly_
oeffs.
This program
omputes the
oeffi
ients of the
tripeptide loop
losure polynomial
The ECEPP peptide bond geometry is assumed, whi
h
fixes the angles gamma1, alpha2, gamma2 and gamma3.
The bond angles at the CA atoms are assumed to be
exa
tly 109.5 degrees, whi
h fixes the angles delta1,
delta2 and delta3. The four angles alpha1, beta1,
alpha3 and omega0 are given on the
ommand line.
Lastly, the angles beta2 and beta3 are determined
from beta1. Sin
e they pertain to the same triangle,
the sum of beta1, beta2 and the supplement of beta3
must add up to PI radians. Moreover, the supplement
of beta3 must equal beta1 be
ause the triangle is
iso
eles.
Copyright, 1998, William J. Wedemeyer
******************************************************* */
#in
lude
#in
lude
#in
lude
#in
lude "poly_fun
s.h"
/* ****************** */
/* Ma
ros and Defines */
/* ****************** */
3
#define PI 3.14159265358
#define MAX_DEGREE 16
#define MAX_DEGREE_PLUS_ONE 17
/* **************** */
/* The Main Program */
/* **************** */
main(int arg
,
har *argv[℄)
{
int i, j, k;
int deg_index;
double temp1, temp2, temp3;
double zeta1, zeta3;
double w1, z1, z3, z3_2;
double omega0, omega1, omega3;
double
double
double
double
alpha1, alpha2, alpha3;
beta1, beta2, beta3;
gamma1, gamma2, gamma3;
delta1, delta2, delta3;
double alpha1_deg, beta1_deg;
double alpha3_deg, omega0_deg;
double
0,
1,
2,
3,
4;
double d0, d1, d2, d3, d4;
double l0, l1, l2, l3, l4;
double m0, m1, m2, m3, m4;
double n0, n1, n2, n3, n4;
4
double P00, P01, P02;
double P10, P11, P12;
double P20, P21, P22;
double
double
double
double
double
Q00,
Q11,
Q02,
Q13,
Q04,
Q20, Q40;
Q31;
Q22, Q42;
Q33;
Q24, Q44;
double B0, B1, B2;
double K0, K1, K2, K3;
double A0, A1, A2, A3, A4;
double
double
double
double
double
a0[MAX_DEGREE_PLUS_ONE℄;
a1[MAX_DEGREE_PLUS_ONE℄;
a2[MAX_DEGREE_PLUS_ONE℄;
a3[MAX_DEGREE_PLUS_ONE℄;
a4[MAX_DEGREE_PLUS_ONE℄;
double b0[MAX_DEGREE_PLUS_ONE℄;
double b1[MAX_DEGREE_PLUS_ONE℄;
double b2[MAX_DEGREE_PLUS_ONE℄;
double
double
double
double
double
double
b0b0[MAX_DEGREE_PLUS_ONE℄;
b1b1[MAX_DEGREE_PLUS_ONE℄;
b2b2[MAX_DEGREE_PLUS_ONE℄;
b0b1[MAX_DEGREE_PLUS_ONE℄;
b1b2[MAX_DEGREE_PLUS_ONE℄;
b2b0[MAX_DEGREE_PLUS_ONE℄;
double
double
double
double
loop_poly[MAX_DEGREE_PLUS_ONE℄;
temp1_poly[MAX_DEGREE_PLUS_ONE℄;
temp2_poly[MAX_DEGREE_PLUS_ONE℄;
temp3_poly[MAX_DEGREE_PLUS_ONE℄;
5
/* Skip line for aestheti
s */
printf("\n");
/* ********************** */
/* Command-line arguments */
/* ********************** */
if (arg
< 5)
{
printf("Proper format:\n\n");
printf("%s
argv[0℄);
exit(1);
}
alpha1_deg
beta1_deg
alpha3_deg
omega0_deg
=
=
=
=
\n\n",
atof(argv[1℄);
atof(argv[2℄);
atof(argv[3℄);
atof(argv[4℄);
printf("Input parameters:\n");
printf("alpha1 = %-5.1lf deg
beta1 = %-5.1lf deg\n",
alpha1_deg, beta1_deg);
printf("alpha3 = %-5.1lf deg
omega0 = %-5.1lf deg\n\n",
alpha3_deg, omega0_deg);
/* ******************************* */
/* Assign the geometri
parameters */
/* ******************************* */
alpha1
beta1
alpha3
omega0
=
=
=
=
alpha1_deg
beta1_deg
alpha3_deg
omega0_deg
*
*
*
*
(PI/180.0);
(PI/180.0);
(PI/180.0);
(PI/180.0);
6
gamma1 = (20.9/180.0)*PI;
delta1 = (70.5/180.0)*PI;
alpha2
beta2
gamma2
delta2
=
=
=
=
(14.9/180.0)*PI;
PI - 2.0*beta1;
(20.9/180.0)*PI;
(109.5/180.0)*PI;
beta3 = PI - beta1;
gamma3 = (14.9/180.0)*PI;
delta3 = (70.5/180.0)*PI;
printf("Parameters derived from fixed virtual bond lengths:\n");
printf("Beta2 = %-5.1lf deg
Beta3 = %-5.1lf deg\n\n",
180.0 - 2.0*(beta1_deg), 180.0 - beta1_deg);
printf("Parameters derived from ECEPP bond geometry:\n");
printf("Gamma1 = Gamma2 = 20.9 deg\n");
printf("Alpha2 = Gamma3 = 14.9 deg\n");
printf("Delta1 = Delta3 = 70.5 deg
Delta2 = 109.5 deg\n\n");
/* ******************************** */
/* P equation: Get the
oeffi
ients */
/* ******************************** */
n0
n1
n2
n3
n4
P00
P10
P01
P11
P20
P02
=
=
=
=
=
os(alpha3) *
os(beta3) *
os(gamma3) -
os(delta3);
sin(alpha3) * sin(beta3) *
os(gamma3);
os(alpha3) * sin(beta3) * sin(gamma3);
-sin(alpha3) *
os(beta3) * sin(gamma3);
sin(alpha3) * sin(gamma3);
=
=
=
=
=
=
n0 + n1 *
os(omega0) + n2 + n3 *
os(omega0);
2.0 * (n1 + n3) * sin(omega0);
-2.0 * n4 * sin(omega0);
4.0 * n4 *
os(omega0);
n0 - n1 *
os(omega0) + n2 - n3 *
os(omega0);
n0 + n1 *
os(omega0) - n2 - n3 *
os(omega0);
7
P12 = 2.0 * (n1 - n3) * sin(omega0);
P21 = 2.0 * n4 * sin(omega0);
P22 = n0 - n1 *
os(omega0) - n2 + n3 *
os(omega0);
/* ******************************** */
/* D equation: Get the
oeffi
ients */
/* ******************************** */
0
1
2
3
4
=
=
=
=
=
os(alpha1) *
os(beta1) *
os(gamma1) -
os(delta1);
sin(alpha1) * sin(beta1) *
os(gamma1);
os(alpha1) * sin(beta1) * sin(gamma1);
-sin(alpha1) *
os(beta1) * sin(gamma1);
sin(alpha1) * sin(gamma1);
d0
d1
d2
d3
d4
=
=
=
=
=
0 +
1 +
0 -
1 +
0 +
1
0 -
1 4.0 *
4;
2
2
2
2
+
+
3;
3;
3;
3;
/* ******************************** */
/* M equation: Get the
oeffi
ients */
/* ******************************** */
l0
l1
l2
l3
l4
=
=
=
=
=
os(alpha2) *
os(beta2) *
os(gamma2) -
os(delta2);
sin(alpha2) * sin(beta2) *
os(gamma2);
os(alpha2) * sin(beta2) * sin(gamma2);
-sin(alpha2) *
os(beta2) * sin(gamma2);
sin(alpha2) * sin(gamma2);
m0
m1
m2
m3
m4
=
=
=
=
=
l0 - l1 +
l0 + l1 +
l0 - l1 l0 + l1 4.0 * l4;
l2
l2
l2
l2
+
+
-
l3;
l3;
l3;
l3;
8
/* ******************************** */
/* Q equation: Get the
oeffi
ients */
/* ******************************** */
temp1 = d0*m1 - d2*m0;
Q00 = temp1 * temp1;
temp2 = d1*m1 - d3*m0;
Q40 = temp2 * temp2;
temp1 = d1 * m1 - d3 * m0;
temp2 = d0 * m1 - d2 * m0;
Q20 = 2.0 * temp1 * temp2 + d4*d4*m0*m1;
temp1 = d0 * m1 + d2 * m0;
Q11 = - d4 * m4 * temp1;
temp2 = d1 * m1 + d3 * m0;
Q31 = - d4 * m4 * temp2;
temp1 = m4 * m4 - 2.0 * m0 * m3 - 2.0 * m1 * m2;
Q02 = 2.0 * d0 * d0 * m1 * m3 +
2.0 * d2 * d2 * m0 * m2 + d0 * d2 * temp1;
Q42 = 2.0 * d1 * d1 * m1 * m3 +
2.0 * d3 * d3 * m0 * m2 + d1 * d3 * temp1;
Q22 = 4.0 * d0 * d1
4.0 * d2 * d3
d4 * d4 * (m0
(d0 * d3 + d1
*
*
*
*
m1 * m3 +
m0 * m2 +
m3 + m1 * m2) +
d2) * temp1;
temp1 = d0 * m3 + d2 * m2;
Q13 = - d4 * m4 * temp1;
temp2 = d1 * m3 + d3 * m2;
Q33 = - d4 * m4 * temp2;
9
temp1 = d0*m3 - d2*m2;
Q04 = temp1 * temp1;
temp2 = d1*m3 - d3*m2;
Q44 = temp2 * temp2;
temp1 = d1 * m3 - d3 * m2;
temp2 = d0 * m3 - d2 * m2;
Q24 = 2.0 * temp1 * temp2 + d4*d4*m2*m3;
/* ******************************************** */
/* Get the
oeffi
ients for the loop polynomial */
/* ******************************************** */
for (deg_index=0; deg_index
Evaluate the Loop Polynomial CoeÆ
ients
William J. Wedemeyer, Harold A. S
heraga
This se
ond supplement provides a
omputer program poly
oeffs.
whi
h
omputes the seventeen loop polynomial
oeÆ
ients R0 R16 ,
orresponding to equation (7) in the text. This program
alls routines in
poly fun
s.
and poly fun
s.h, whi
h are also given in this supplement.
The programs are written in ANSI-
ompliant C, and should
ompile without
diÆ
ulty. A typi
al
omputation of the loop
oeÆ
ients takes less than a
millise
ond of CPU time.
1
Contents
poly
oes.
3
poly fun
s.h
18
poly fun
s.
20
2
poly
oes.
/* ****************************************************
poly_
oeffs.
This program
omputes the
oeffi
ients of the
tripeptide loop
losure polynomial
The ECEPP peptide bond geometry is assumed, whi
h
fixes the angles gamma1, alpha2, gamma2 and gamma3.
The bond angles at the CA atoms are assumed to be
exa
tly 109.5 degrees, whi
h fixes the angles delta1,
delta2 and delta3. The four angles alpha1, beta1,
alpha3 and omega0 are given on the
ommand line.
Lastly, the angles beta2 and beta3 are determined
from beta1. Sin
e they pertain to the same triangle,
the sum of beta1, beta2 and the supplement of beta3
must add up to PI radians. Moreover, the supplement
of beta3 must equal beta1 be
ause the triangle is
iso
eles.
Copyright, 1998, William J. Wedemeyer
******************************************************* */
#in
lude
#in
lude
#in
lude
#in
lude "poly_fun
s.h"
/* ****************** */
/* Ma
ros and Defines */
/* ****************** */
3
#define PI 3.14159265358
#define MAX_DEGREE 16
#define MAX_DEGREE_PLUS_ONE 17
/* **************** */
/* The Main Program */
/* **************** */
main(int arg
,
har *argv[℄)
{
int i, j, k;
int deg_index;
double temp1, temp2, temp3;
double zeta1, zeta3;
double w1, z1, z3, z3_2;
double omega0, omega1, omega3;
double
double
double
double
alpha1, alpha2, alpha3;
beta1, beta2, beta3;
gamma1, gamma2, gamma3;
delta1, delta2, delta3;
double alpha1_deg, beta1_deg;
double alpha3_deg, omega0_deg;
double
0,
1,
2,
3,
4;
double d0, d1, d2, d3, d4;
double l0, l1, l2, l3, l4;
double m0, m1, m2, m3, m4;
double n0, n1, n2, n3, n4;
4
double P00, P01, P02;
double P10, P11, P12;
double P20, P21, P22;
double
double
double
double
double
Q00,
Q11,
Q02,
Q13,
Q04,
Q20, Q40;
Q31;
Q22, Q42;
Q33;
Q24, Q44;
double B0, B1, B2;
double K0, K1, K2, K3;
double A0, A1, A2, A3, A4;
double
double
double
double
double
a0[MAX_DEGREE_PLUS_ONE℄;
a1[MAX_DEGREE_PLUS_ONE℄;
a2[MAX_DEGREE_PLUS_ONE℄;
a3[MAX_DEGREE_PLUS_ONE℄;
a4[MAX_DEGREE_PLUS_ONE℄;
double b0[MAX_DEGREE_PLUS_ONE℄;
double b1[MAX_DEGREE_PLUS_ONE℄;
double b2[MAX_DEGREE_PLUS_ONE℄;
double
double
double
double
double
double
b0b0[MAX_DEGREE_PLUS_ONE℄;
b1b1[MAX_DEGREE_PLUS_ONE℄;
b2b2[MAX_DEGREE_PLUS_ONE℄;
b0b1[MAX_DEGREE_PLUS_ONE℄;
b1b2[MAX_DEGREE_PLUS_ONE℄;
b2b0[MAX_DEGREE_PLUS_ONE℄;
double
double
double
double
loop_poly[MAX_DEGREE_PLUS_ONE℄;
temp1_poly[MAX_DEGREE_PLUS_ONE℄;
temp2_poly[MAX_DEGREE_PLUS_ONE℄;
temp3_poly[MAX_DEGREE_PLUS_ONE℄;
5
/* Skip line for aestheti
s */
printf("\n");
/* ********************** */
/* Command-line arguments */
/* ********************** */
if (arg
< 5)
{
printf("Proper format:\n\n");
printf("%s
argv[0℄);
exit(1);
}
alpha1_deg
beta1_deg
alpha3_deg
omega0_deg
=
=
=
=
\n\n",
atof(argv[1℄);
atof(argv[2℄);
atof(argv[3℄);
atof(argv[4℄);
printf("Input parameters:\n");
printf("alpha1 = %-5.1lf deg
beta1 = %-5.1lf deg\n",
alpha1_deg, beta1_deg);
printf("alpha3 = %-5.1lf deg
omega0 = %-5.1lf deg\n\n",
alpha3_deg, omega0_deg);
/* ******************************* */
/* Assign the geometri
parameters */
/* ******************************* */
alpha1
beta1
alpha3
omega0
=
=
=
=
alpha1_deg
beta1_deg
alpha3_deg
omega0_deg
*
*
*
*
(PI/180.0);
(PI/180.0);
(PI/180.0);
(PI/180.0);
6
gamma1 = (20.9/180.0)*PI;
delta1 = (70.5/180.0)*PI;
alpha2
beta2
gamma2
delta2
=
=
=
=
(14.9/180.0)*PI;
PI - 2.0*beta1;
(20.9/180.0)*PI;
(109.5/180.0)*PI;
beta3 = PI - beta1;
gamma3 = (14.9/180.0)*PI;
delta3 = (70.5/180.0)*PI;
printf("Parameters derived from fixed virtual bond lengths:\n");
printf("Beta2 = %-5.1lf deg
Beta3 = %-5.1lf deg\n\n",
180.0 - 2.0*(beta1_deg), 180.0 - beta1_deg);
printf("Parameters derived from ECEPP bond geometry:\n");
printf("Gamma1 = Gamma2 = 20.9 deg\n");
printf("Alpha2 = Gamma3 = 14.9 deg\n");
printf("Delta1 = Delta3 = 70.5 deg
Delta2 = 109.5 deg\n\n");
/* ******************************** */
/* P equation: Get the
oeffi
ients */
/* ******************************** */
n0
n1
n2
n3
n4
P00
P10
P01
P11
P20
P02
=
=
=
=
=
os(alpha3) *
os(beta3) *
os(gamma3) -
os(delta3);
sin(alpha3) * sin(beta3) *
os(gamma3);
os(alpha3) * sin(beta3) * sin(gamma3);
-sin(alpha3) *
os(beta3) * sin(gamma3);
sin(alpha3) * sin(gamma3);
=
=
=
=
=
=
n0 + n1 *
os(omega0) + n2 + n3 *
os(omega0);
2.0 * (n1 + n3) * sin(omega0);
-2.0 * n4 * sin(omega0);
4.0 * n4 *
os(omega0);
n0 - n1 *
os(omega0) + n2 - n3 *
os(omega0);
n0 + n1 *
os(omega0) - n2 - n3 *
os(omega0);
7
P12 = 2.0 * (n1 - n3) * sin(omega0);
P21 = 2.0 * n4 * sin(omega0);
P22 = n0 - n1 *
os(omega0) - n2 + n3 *
os(omega0);
/* ******************************** */
/* D equation: Get the
oeffi
ients */
/* ******************************** */
0
1
2
3
4
=
=
=
=
=
os(alpha1) *
os(beta1) *
os(gamma1) -
os(delta1);
sin(alpha1) * sin(beta1) *
os(gamma1);
os(alpha1) * sin(beta1) * sin(gamma1);
-sin(alpha1) *
os(beta1) * sin(gamma1);
sin(alpha1) * sin(gamma1);
d0
d1
d2
d3
d4
=
=
=
=
=
0 +
1 +
0 -
1 +
0 +
1
0 -
1 4.0 *
4;
2
2
2
2
+
+
3;
3;
3;
3;
/* ******************************** */
/* M equation: Get the
oeffi
ients */
/* ******************************** */
l0
l1
l2
l3
l4
=
=
=
=
=
os(alpha2) *
os(beta2) *
os(gamma2) -
os(delta2);
sin(alpha2) * sin(beta2) *
os(gamma2);
os(alpha2) * sin(beta2) * sin(gamma2);
-sin(alpha2) *
os(beta2) * sin(gamma2);
sin(alpha2) * sin(gamma2);
m0
m1
m2
m3
m4
=
=
=
=
=
l0 - l1 +
l0 + l1 +
l0 - l1 l0 + l1 4.0 * l4;
l2
l2
l2
l2
+
+
-
l3;
l3;
l3;
l3;
8
/* ******************************** */
/* Q equation: Get the
oeffi
ients */
/* ******************************** */
temp1 = d0*m1 - d2*m0;
Q00 = temp1 * temp1;
temp2 = d1*m1 - d3*m0;
Q40 = temp2 * temp2;
temp1 = d1 * m1 - d3 * m0;
temp2 = d0 * m1 - d2 * m0;
Q20 = 2.0 * temp1 * temp2 + d4*d4*m0*m1;
temp1 = d0 * m1 + d2 * m0;
Q11 = - d4 * m4 * temp1;
temp2 = d1 * m1 + d3 * m0;
Q31 = - d4 * m4 * temp2;
temp1 = m4 * m4 - 2.0 * m0 * m3 - 2.0 * m1 * m2;
Q02 = 2.0 * d0 * d0 * m1 * m3 +
2.0 * d2 * d2 * m0 * m2 + d0 * d2 * temp1;
Q42 = 2.0 * d1 * d1 * m1 * m3 +
2.0 * d3 * d3 * m0 * m2 + d1 * d3 * temp1;
Q22 = 4.0 * d0 * d1
4.0 * d2 * d3
d4 * d4 * (m0
(d0 * d3 + d1
*
*
*
*
m1 * m3 +
m0 * m2 +
m3 + m1 * m2) +
d2) * temp1;
temp1 = d0 * m3 + d2 * m2;
Q13 = - d4 * m4 * temp1;
temp2 = d1 * m3 + d3 * m2;
Q33 = - d4 * m4 * temp2;
9
temp1 = d0*m3 - d2*m2;
Q04 = temp1 * temp1;
temp2 = d1*m3 - d3*m2;
Q44 = temp2 * temp2;
temp1 = d1 * m3 - d3 * m2;
temp2 = d0 * m3 - d2 * m2;
Q24 = 2.0 * temp1 * temp2 + d4*d4*m2*m3;
/* ******************************************** */
/* Get the
oeffi
ients for the loop polynomial */
/* ******************************************** */
for (deg_index=0; deg_index