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'
15 double precision e1(3),e2(3),e3(3)
16 logical lprn,perbox,fail
17 C Set lprn=.true. for debugging
24 print *,'before refsys'
25 call refsys(2,3,4,e1,e2,e3,fail)
26 print *,'after refsys'
35 print *,'dc',dc(1,0),dc(2,0),dc(3,0)
53 veclen=veclen+(c(i,2)-c(i,1))**2
77 call locate_side_chain(2)
81 if (theti.ne.theti) theti=100.0
83 if (phii.ne.phii) phii=180.0
92 * Define the matrices of the rotation about the virtual-bond valence angles
93 * theta, T(i,j,k), virtual-bond dihedral angles gamma (miscalled PHI in this
94 * program), R(i,j,k), and, the cumulative matrices of rotation RT
116 rt(2,1,i-2)=sint*cosphi
117 rt(2,2,i-2)=-cost*cosphi
119 rt(3,1,i-2)=-sint*sinphi
120 rt(3,2,i-2)=cost*sinphi
122 call matmult(prod(1,1,i-2),rt(1,1,i-2),prod(1,1,i-1))
124 dc_norm(j,i-1)=prod(j,1,i-1)
125 dc(j,i-1)=vbld(i)*prod(j,1,i-1)
127 call locate_side_chain(i-1)
131 C Define the origin and orientation of the coordinate system and locate the
132 C first three CA's and SC(2).
136 * Build the alpha-carbon chain.
139 call locate_next_res(i)
142 C First and last SC must coincide with the corresponding CA.
146 dc_norm(j,nres+1)=0.0D0
147 dc(j,nres+nres)=0.0D0
148 dc_norm(j,nres+nres)=0.0D0
150 c(j,nres+nres)=c(j,nres)
153 * Temporary diagnosis
158 write (iout,'(/a)') 'Recalculated internal coordinates'
161 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
164 if (i.gt.3) be=rad2deg*beta(i-3,i-2,i-1,i)
165 be1=rad2deg*beta(nres+i,i,maxres2,i+1)
167 if (i.gt.2) alfai=rad2deg*alpha(i-2,i-1,i)
168 write (iout,1212) restyp(itype(i)),i,dist(i-1,i),
169 & alfai,be,dist(nres+i,i),rad2deg*alpha(nres+i,i,maxres2),be1
171 1212 format (a3,'(',i3,')',2(f10.5,2f10.2))
177 c-------------------------------------------------------------------------
178 subroutine orig_frame
180 C Define the origin and orientation of the coordinate system and locate
181 C the first three atoms.
183 implicit real*8 (a-h,o-z)
185 include 'COMMON.CHAIN'
186 include 'COMMON.LOCAL'
240 dc_norm(j,2)=prod(j,1,2)
241 dc(j,2)=vbld(3)*prod(j,1,2)
242 c(j,3)=c(j,2)+dc(j,2)
244 call locate_side_chain(2)
247 c-----------------------------------------------------------------------------
248 subroutine locate_next_res(i)
250 C Locate CA(i) and SC(i-1)
252 implicit real*8 (a-h,o-z)
254 include 'COMMON.CHAIN'
255 include 'COMMON.LOCAL'
258 include 'COMMON.IOUNITS'
259 include 'COMMON.NAMES'
260 include 'COMMON.INTERACT'
262 C Define the rotation matrices corresponding to CA(i)
266 if (theti.ne.theti) theti=100.0
268 if (phii.ne.phii) phii=180.0
277 * Define the matrices of the rotation about the virtual-bond valence angles
278 * theta, T(i,j,k), virtual-bond dihedral angles gamma (miscalled PHI in this
279 * program), R(i,j,k), and, the cumulative matrices of rotation RT
301 rt(2,1,i-2)=sint*cosphi
302 rt(2,2,i-2)=-cost*cosphi
304 rt(3,1,i-2)=-sint*sinphi
305 rt(3,2,i-2)=cost*sinphi
307 call matmult(prod(1,1,i-2),rt(1,1,i-2),prod(1,1,i-1))
309 dc_norm(j,i-1)=prod(j,1,i-1)
310 dc(j,i-1)=vbld(i)*prod(j,1,i-1)
311 c(j,i)=c(j,i-1)+dc(j,i-1)
313 cd print '(2i3,2(3f10.5,5x))', i-1,i,(dc(j,i-1),j=1,3),(c(j,i),j=1,3)
315 C Now calculate the coordinates of SC(i-1)
317 call locate_side_chain(i-1)
320 c-----------------------------------------------------------------------------
321 subroutine locate_side_chain(i)
323 C Locate the side-chain centroid i, 1 < i < NRES. Put in C(*,NRES+i).
325 implicit real*8 (a-h,o-z)
327 include 'COMMON.CHAIN'
328 include 'COMMON.LOCAL'
331 include 'COMMON.IOUNITS'
332 include 'COMMON.NAMES'
333 include 'COMMON.INTERACT'
337 c dsci_inv=dsc_inv(itype(i))
339 dsci_inv=vbld_inv(i+nres)
343 if (alphi.ne.alphi) alphi=100.0
344 if (omegi.ne.omegi) omegi=-100.0
354 yp= dsci*sinalphi*cosomegi
355 zp=-dsci*sinalphi*sinomegi
356 * Now we have to rotate the coordinate system by 180-theta(i)/2 so as to get its
357 * X-axis aligned with the vector DC(*,i)
358 theta2=pi-0.5D0*theta(i+1)
361 xx(1)= xp*cost2+yp*sint2
362 xx(2)=-xp*sint2+yp*cost2
364 cd print '(a3,i3,3f10.5,5x,3f10.5)',restyp(itype(i)),i,
365 cd & xp,yp,zp,(xx(k),k=1,3)
369 * Bring the SC vectors to the common coordinate system.
371 xx(2)=xloc(2,i)*r(2,2,i-1)+xloc(3,i)*r(2,3,i-1)
372 xx(3)=xloc(2,i)*r(3,2,i-1)+xloc(3,i)*r(3,3,i-1)
379 rj=rj+prod(j,k,i-1)*xx(k)
382 dc_norm(j,nres+i)=rj*dsci_inv
383 c(j,nres+i)=c(j,i)+rj