3 C Build the virtual polypeptide chain. Side-chain centroids are moveable.
11 include 'COMMON.IOUNITS'
12 include 'COMMON.NAMES'
13 include 'COMMON.INTERACT'
15 C Set lprn=.true. for debugging
18 C Define the origin and orientation of the coordinate system and locate the
19 C first three CA's and SC(2).
23 * Build the alpha-carbon chain.
26 call locate_next_res(i)
29 C First and last SC must coincide with the corresponding CA.
33 dc_norm(j,nres+1)=0.0D0
35 dc_norm(j,nres+nres)=0.0D0
37 c(j,nres+nres)=c(j,nres)
45 write (iout,'(/a)') 'Recalculated internal coordinates'
48 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
51 if (i.gt.3) be=rad2deg*beta(i-3,i-2,i-1,i)
52 be1=rad2deg*beta(nres+i,i,maxres2,i+1)
54 if (i.gt.2) alfai=rad2deg*alpha(i-2,i-1,i)
55 write (iout,1212) restyp(itype(i)),i,dist(i-1,i),
56 & alfai,be,dist(nres+i,i),rad2deg*alpha(nres+i,i,maxres2),be1
58 1212 format (a3,'(',i3,')',2(f10.5,2f10.2))
64 c-------------------------------------------------------------------------
67 C Define the origin and orientation of the coordinate system and locate
68 C the first three atoms.
71 include 'COMMON.CHAIN'
72 include 'COMMON.LOCAL'
120 dc_norm(j,2)=prod(j,1,2)
121 dc(j,2)=vbl*prod(j,1,2)
122 c(j,3)=c(j,2)+dc(j,2)
124 call locate_side_chain(2)
127 c-----------------------------------------------------------------------------
128 subroutine locate_next_res(i)
130 C Locate CA(i) and SC(i-1)
133 include 'COMMON.CHAIN'
134 include 'COMMON.LOCAL'
137 include 'COMMON.IOUNITS'
138 include 'COMMON.NAMES'
139 include 'COMMON.INTERACT'
141 C Define the rotation matrices corresponding to CA(i)
149 * Define the matrices of the rotation about the virtual-bond valence angles
150 * theta, T(i,j,k), virtual-bond dihedral angles gamma (miscalled PHI in this
151 * program), R(i,j,k), and, the cumulative matrices of rotation RT
173 rt(2,1,i-2)=sint*cosphi
174 rt(2,2,i-2)=-cost*cosphi
176 rt(3,1,i-2)=-sint*sinphi
177 rt(3,2,i-2)=cost*sinphi
179 call matmult(prod(1,1,i-2),rt(1,1,i-2),prod(1,1,i-1))
181 dc_norm(j,i-1)=prod(j,1,i-1)
182 dc(j,i-1)=vbl*prod(j,1,i-1)
183 c(j,i)=c(j,i-1)+dc(j,i-1)
185 cd print '(2i3,2(3f10.5,5x))', i-1,i,(dc(j,i-1),j=1,3),(c(j,i),j=1,3)
187 C Now calculate the coordinates of SC(i-1)
189 call locate_side_chain(i-1)
192 c-----------------------------------------------------------------------------
193 subroutine locate_side_chain(i)
195 C Locate the side-chain centroid i, 1 < i < NRES. Put in C(*,NRES+i).
198 include 'COMMON.CHAIN'
199 include 'COMMON.LOCAL'
202 include 'COMMON.IOUNITS'
203 include 'COMMON.NAMES'
204 include 'COMMON.INTERACT'
208 dsci_inv=dsc_inv(itype(i))
216 yp= dsci*sinalphi*cosomegi
217 zp=-dsci*sinalphi*sinomegi
218 * Now we have to rotate the coordinate system by 180-theta(i)/2 so as to get its
219 * X-axis aligned with the vector DC(*,i)
220 theta2=pi-0.5D0*theta(i+1)
223 xx(1)= xp*cost2+yp*sint2
224 xx(2)=-xp*sint2+yp*cost2
226 cd print '(a3,i3,3f10.5,5x,3f10.5)',restyp(itype(i)),i,
227 cd & xp,yp,zp,(xx(k),k=1,3)
231 * Bring the SC vectors to the common coordinate system.
233 xx(2)=xloc(2,i)*r(2,2,i-1)+xloc(3,i)*r(2,3,i-1)
234 xx(3)=xloc(2,i)*r(3,2,i-1)+xloc(3,i)*r(3,3,i-1)
241 rj=rj+prod(j,k,i-1)*xx(k)
244 dc_norm(j,nres+i)=rj*dsci_inv
245 c(j,nres+i)=c(j,i)+rj