3 C Build the virtual polypeptide chain. Side-chain centroids are moveable.
6 implicit real*8 (a-h,o-z)
12 include 'COMMON.IOUNITS'
13 include 'COMMON.NAMES'
14 include 'COMMON.INTERACT'
16 C Set lprn=.true. for debugging
19 C Define the origin and orientation of the coordinate system and locate the
20 C first three CA's and SC(2).
24 * Build the alpha-carbon chain.
27 call locate_next_res(i)
30 C First and last SC must coincide with the corresponding CA.
34 dc_norm(j,nres+1)=0.0D0
36 dc_norm(j,nres+nres)=0.0D0
38 c(j,nres+nres)=c(j,nres)
46 write (iout,'(/a)') 'Recalculated internal coordinates'
49 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
52 if (i.gt.3) be=rad2deg*beta(i-3,i-2,i-1,i)
53 be1=rad2deg*beta(nres+i,i,maxres2,i+1)
55 if (i.gt.2) alfai=rad2deg*alpha(i-2,i-1,i)
56 write (iout,1212) restyp(itype(i)),i,dist(i-1,i),
57 & alfai,be,dist(nres+i,i),rad2deg*alpha(nres+i,i,maxres2),be1
59 1212 format (a3,'(',i3,')',2(f10.5,2f10.2))
65 c-------------------------------------------------------------------------
68 C Define the origin and orientation of the coordinate system and locate
69 C the first three atoms.
71 implicit real*8 (a-h,o-z)
73 include 'COMMON.CHAIN'
74 include 'COMMON.LOCAL'
122 dc_norm(j,2)=prod(j,1,2)
123 dc(j,2)=vbl*prod(j,1,2)
124 c(j,3)=c(j,2)+dc(j,2)
126 call locate_side_chain(2)
129 c-----------------------------------------------------------------------------
130 subroutine locate_next_res(i)
132 C Locate CA(i) and SC(i-1)
134 implicit real*8 (a-h,o-z)
136 include 'COMMON.CHAIN'
137 include 'COMMON.LOCAL'
140 include 'COMMON.IOUNITS'
141 include 'COMMON.NAMES'
142 include 'COMMON.INTERACT'
144 C Define the rotation matrices corresponding to CA(i)
152 * Define the matrices of the rotation about the virtual-bond valence angles
153 * theta, T(i,j,k), virtual-bond dihedral angles gamma (miscalled PHI in this
154 * program), R(i,j,k), and, the cumulative matrices of rotation RT
176 rt(2,1,i-2)=sint*cosphi
177 rt(2,2,i-2)=-cost*cosphi
179 rt(3,1,i-2)=-sint*sinphi
180 rt(3,2,i-2)=cost*sinphi
182 call matmult(prod(1,1,i-2),rt(1,1,i-2),prod(1,1,i-1))
184 dc_norm(j,i-1)=prod(j,1,i-1)
185 dc(j,i-1)=vbl*prod(j,1,i-1)
186 c(j,i)=c(j,i-1)+dc(j,i-1)
188 cd print '(2i3,2(3f10.5,5x))', i-1,i,(dc(j,i-1),j=1,3),(c(j,i),j=1,3)
190 C Now calculate the coordinates of SC(i-1)
192 call locate_side_chain(i-1)
195 c-----------------------------------------------------------------------------
196 subroutine locate_side_chain(i)
198 C Locate the side-chain centroid i, 1 < i < NRES. Put in C(*,NRES+i).
200 implicit real*8 (a-h,o-z)
202 include 'COMMON.CHAIN'
203 include 'COMMON.LOCAL'
206 include 'COMMON.IOUNITS'
207 include 'COMMON.NAMES'
208 include 'COMMON.INTERACT'
211 dsci=dsc(iabs(itype(i)))
212 dsci_inv=dsc_inv(iabs(itype(i)))
220 yp= dsci*sinalphi*cosomegi
221 zp=-dsci*sinalphi*sinomegi
222 * Now we have to rotate the coordinate system by 180-theta(i)/2 so as to get its
223 * X-axis aligned with the vector DC(*,i)
224 theta2=pi-0.5D0*theta(i+1)
227 xx(1)= xp*cost2+yp*sint2
228 xx(2)=-xp*sint2+yp*cost2
230 cd print '(a3,i3,3f10.5,5x,3f10.5)',restyp(itype(i)),i,
231 cd & xp,yp,zp,(xx(k),k=1,3)
235 * Bring the SC vectors to the common coordinate system.
237 xx(2)=xloc(2,i)*r(2,2,i-1)+xloc(3,i)*r(2,3,i-1)
238 xx(3)=xloc(2,i)*r(3,2,i-1)+xloc(3,i)*r(3,3,i-1)
245 rj=rj+prod(j,k,i-1)*xx(k)
248 dc_norm(j,nres+i)=rj*dsci_inv
249 c(j,nres+i)=c(j,i)+rj