2 C Read the PDB file and convert the peptide geometry into virtual-chain
4 implicit real*8 (a-h,o-z)
9 include 'COMMON.INTERACT'
10 include 'COMMON.IOUNITS'
12 include 'COMMON.NAMES'
13 character*3 seq,atom,res
19 read (ipdbin,'(a80)',end=10) card
20 if (card(:3).eq.'END' .or. card(:3).eq.'TER') goto 10
21 C Fish out the ATOM cards.
22 if (index(card(1:4),'ATOM').gt.0) then
23 read (card(14:16),'(a3)') atom
24 if (atom.eq.'CA' .or. atom.eq.'CH3') then
25 C Calculate the CM of the preceding residue.
26 if (ibeg.eq.0) call sccenter(ires,iii,sccor)
28 read (card(24:26),*) ires
29 read (card(18:20),'(a3)') res
32 if (res.ne.'GLY' .and. res.ne. 'ACE') then
39 if (res.eq.'ACE') then
42 itype(ires)=rescode(ires,res,0)
44 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
45 write (iout,'(2i3,2x,a,3f8.3)')
46 & ires,itype(ires),res,(c(j,ires),j=1,3)
49 sccor(j,iii)=c(j,ires)
51 else if (atom.ne.'O '.and.atom(1:1).ne.'H' .and.
52 & atom.ne.'N ' .and. atom.ne.'C ') then
54 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
58 10 write (iout,'(a,i5)') ' Nres: ',ires
59 C Calculate the CM of the last side chain.
60 call sccenter(ires,iii,sccor)
64 if (itype(nres).ne.10) then
68 dcj=c(j,nres-2)-c(j,nres-3)
69 c(j,nres)=c(j,nres-1)+dcj
82 if (itype(1).eq.ntyp1) then
91 C Copy the coordinates to reference coordinates
97 C Calculate internal coordinates.
99 c write (iout,'(2i3,2x,a,3f8.3)')
100 c & ires,itype(ires),restyp(itype(ires)),(c(j,ires),j=1,3)
102 call int_from_cart(.true.,.true.)
105 c---------------------------------------------------------------------------
106 subroutine int_from_cart(lside,lprn)
107 implicit real*8 (a-h,o-z)
109 include 'COMMON.LOCAL'
111 include 'COMMON.CHAIN'
112 include 'COMMON.INTERACT'
113 include 'COMMON.IOUNITS'
115 include 'COMMON.NAMES'
116 character*3 seq,atom,res
118 dimension sccor(3,20)
123 & 'Internal coordinates calculated from crystal structure.'
125 write (iout,'(8a)') ' Res ',' dvb',' Theta',
126 & ' Phi',' Dsc_id',' Dsc',' Alpha',
129 write (iout,'(4a)') ' Res ',' dvb',' Theta',
136 c write (iout,*) i,dist(i,i-1)
137 if (dist(i,i-1).lt.2.0D0 .or. dist(i,i-1).gt.5.0D0) then
138 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
141 theta(i+1)=alpha(i-1,i,i+1)
142 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
147 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
152 alph(i)=alpha(nres+i,i,maxres2)
153 omeg(i)=beta(nres+i,i,maxres2,i+1)
156 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
157 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),di,rad2deg*alph(i),
163 write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
164 & rad2deg*theta(i),rad2deg*phi(i)
169 c---------------------------------------------------------------------------
170 subroutine sccenter(ires,nscat,sccor)
171 implicit real*8 (a-h,o-z)
173 include 'COMMON.CHAIN'
174 dimension sccor(3,20)
178 sccmj=sccmj+sccor(j,i)
180 dc(j,ires)=sccmj/nscat