2 C Read the PDB file and convert the peptide geometry into virtual-chain
6 include 'DIMENSIONS.ZSCOPT'
7 include 'COMMON.CONTROL'
10 include 'COMMON.CHAIN'
11 include 'COMMON.INTERACT'
12 include 'COMMON.IOUNITS'
14 include 'COMMON.NAMES'
15 character*3 seq,atom,res
17 double precision sccor(3,20)
18 integer i,j,iii,ibeg,ishift,ishift1,ity,ires,ires_old
24 read (ipdbin,'(a80)',end=10) card
25 if (card(:3).eq.'END' .or. card(:3).eq.'TER') goto 10
26 C Fish out the ATOM cards.
27 if (index(card(1:4),'ATOM').gt.0) then
28 read (card(14:16),'(a3)') atom
29 if (atom.eq.'CA' .or. atom.eq.'CH3') then
30 C Calculate the CM of the preceding residue.
31 if (ibeg.eq.0) call sccenter(ires,iii,sccor)
33 ires_old=ires+ishift-ishift1
34 read (card(23:26),*) ires
35 c print *,"ires_old",ires_old," ires",ires
36 if (card(27:27).eq."A" .or. card(27:27).eq."B") then
39 read (card(18:20),'(a3)') res
42 if (res.ne.'GLY' .and. res.ne. 'ACE') then
48 ishift=ishift+ires-ires_old-1
50 ires=ires-ishift+ishift1
51 if (res.eq.'ACE') then
54 itype(ires)=rescode(ires,res,0)
56 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
57 write (iout,'(2i3,2x,a,3f8.3)')
58 & ires,itype(ires),res,(c(j,ires),j=1,3)
61 sccor(j,iii)=c(j,ires)
63 c write (*,*) card(23:27),ires,itype(ires)
64 else if (atom.ne.'O '.and.atom(1:1).ne.'H' .and.
65 & atom.ne.'N ' .and. atom.ne.'C ') then
67 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
71 10 write (iout,'(a,i5)') ' Nres: ',ires
72 C Calculate the CM of the last side chain.
73 call sccenter(ires,iii,sccor)
77 if (itype(nres).ne.10) then
81 dcj=c(j,nres-2)-c(j,nres-3)
82 c(j,nres)=c(j,nres-1)+dcj
95 if (itype(1).eq.21) then
104 C Copy the coordinates to reference coordinates
110 C Calculate internal coordinates.
112 write (iout,'(2i3,2x,a,3f8.3,5x,3f8.3)')
113 & ires,itype(ires),restyp(itype(ires)),(c(j,ires),j=1,3),
114 & (c(j,ires+nres),j=1,3)
117 call int_from_cart(.true.,.true.)
120 theta_ref(i)=theta(i)
127 c---------------------------------------------------------------------------
128 subroutine int_from_cart(lside,lprn)
131 include 'DIMENSIONS.ZSCOPT'
132 include 'COMMON.LOCAL'
134 include 'COMMON.CHAIN'
135 include 'COMMON.INTERACT'
136 include 'COMMON.IOUNITS'
138 include 'COMMON.NAMES'
139 character*3 seq,atom,res
141 double precision sccor(3,20)
143 double precision dist,alpha,beta,di
148 & 'Internal coordinates calculated from crystal structure.'
150 write (iout,'(8a)') ' Res ',' dvb',' Theta',
151 & ' Phi',' Dsc_id',' Dsc',' Alpha',
154 write (iout,'(4a)') ' Res ',' dvb',' Theta',
160 write (iout,*) i,i-1,(c(j,i),j=1,3),(c(j,i-1),j=1,3),dist(i,i-1)
161 if (itype(i-1).ne.21 .and. itype(i).ne.21 .and.
162 & (dist(i,i-1).lt.2.0D0 .or. dist(i,i-1).gt.5.0D0)) then
163 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
166 theta(i+1)=alpha(i-1,i,i+1)
167 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
169 if (itype(1).eq.21) then
171 c(j,1)=c(j,2)+(c(j,3)-c(j,4))
174 if (itype(nres).eq.21) then
176 c(j,nres)=c(j,nres-1)+(c(j,nres-2)-c(j,nres-3))
182 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
187 alph(i)=alpha(nres+i,i,maxres2)
188 omeg(i)=beta(nres+i,i,maxres2,i+1)
191 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
192 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),di,
193 & rad2deg*alph(i),rad2deg*omeg(i)
198 write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
199 & rad2deg*theta(i),rad2deg*phi(i)
204 c---------------------------------------------------------------------------
205 subroutine sccenter(ires,nscat,sccor)
208 include 'COMMON.CHAIN'
209 integer ires,nscat,i,j
210 double precision sccor(3,20),sccmj
214 sccmj=sccmj+sccor(j,i)
216 dc(j,ires)=sccmj/nscat