2 C Read the PDB file and convert the peptide geometry into virtual-chain
8 include 'COMMON.INTERACT'
9 include 'COMMON.IOUNITS'
11 include 'COMMON.NAMES'
12 character*3 seq,atom,res
18 read (ipdbin,'(a80)',end=10) card
19 if (card(:3).eq.'END' .or. card(:3).eq.'TER') goto 10
20 C Fish out the ATOM cards.
21 if (index(card(1:4),'ATOM').gt.0) then
22 read (card(14:16),'(a3)') atom
23 if (atom.eq.'CA' .or. atom.eq.'CH3') then
24 C Calculate the CM of the preceding residue.
25 if (ibeg.eq.0) call sccenter(ires,iii,sccor)
27 read (card(24:26),*) ires
28 read (card(18:20),'(a3)') res
31 if (res.ne.'GLY' .and. res.ne. 'ACE') then
38 if (res.eq.'ACE') then
41 itype(ires)=rescode(ires,res,0)
43 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
44 write (iout,'(2i3,2x,a,3f8.3)')
45 & ires,itype(ires),res,(c(j,ires),j=1,3)
48 sccor(j,iii)=c(j,ires)
50 else if (atom.ne.'O '.and.atom(1:1).ne.'H' .and.
51 & atom.ne.'N ' .and. atom.ne.'C ') then
53 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
57 10 write (iout,'(a,i5)') ' Nres: ',ires
58 C Calculate the CM of the last side chain.
59 call sccenter(ires,iii,sccor)
63 if (itype(nres).ne.10) then
67 dcj=c(j,nres-2)-c(j,nres-3)
68 c(j,nres)=c(j,nres-1)+dcj
81 if (itype(1).eq.21) then
90 C Copy the coordinates to reference coordinates
96 C Calculate internal coordinates.
98 c write (iout,'(2i3,2x,a,3f8.3)')
99 c & ires,itype(ires),restyp(itype(ires)),(c(j,ires),j=1,3)
101 if (itype(1).eq.21) then
106 if (itype(nres).eq.21) then
116 call int_from_cart(.true.,.true.)
119 c---------------------------------------------------------------------------
120 subroutine int_from_cart(lside,lprn)
122 include 'COMMON.LOCAL'
124 include 'COMMON.CHAIN'
125 include 'COMMON.INTERACT'
126 include 'COMMON.IOUNITS'
128 include 'COMMON.NAMES'
129 character*3 seq,atom,res
131 dimension sccor(3,20)
136 & 'Internal coordinates calculated from crystal structure.'
138 write (iout,'(8a)') ' Res ',' dvb',' Theta',
139 & ' Phi',' Dsc_id',' Dsc',' Alpha',
142 write (iout,'(4a)') ' Res ',' dvb',' Theta',
148 if (dist(i,i-1).lt.2.0D0 .or. dist(i,i-1).gt.5.0D0) then
149 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
152 theta(i+1)=alpha(i-1,i,i+1)
153 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
158 if (nnt.gt.1) c(j,2*maxres)=0.5D0*(c(j,i-1)+c(j,i+1))
163 alph(i)=alpha(nres+i,i,2*maxres)
164 omeg(i)=beta(nres+i,i,2*maxres,i+1)
167 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
168 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),di,rad2deg*alph(i),
174 write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
175 & rad2deg*theta(i),rad2deg*phi(i)
180 c---------------------------------------------------------------------------
181 subroutine sccenter(ires,nscat,sccor)
183 include 'COMMON.CHAIN'
184 dimension sccor(3,20)
188 sccmj=sccmj+sccor(j,i)
190 dc(j,ires)=sccmj/nscat