1 subroutine natsimil(jcon,iii,iprot,lprn)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.COMPAR'
6 include 'COMMON.IOUNITS'
7 include 'COMMON.COMPAR'
9 include 'COMMON.INTERACT'
11 include 'COMMON.CLASSES'
12 include 'COMMON.VMCPAR'
15 integer i,iii,j,k,ik,kk,inat,lat,jfrag
16 double precision fract
17 double precision rmscalc,rms,rmsnat,qwolynes,gyrate,
21 ib = kbatch(jcon,iprot)
23 write(iout,*) "Protein",iprot," batch",ib," conformation",jcon,
24 & " nlevel",nlevel(iprot)
27 c write (iout,*) "NATSIMIL: Complete reference structure"
29 c write(iout,'(i4,3f10.5)') i,(cref(j,i,iprot),j=1,3)
33 ik = iscore(jcon,1,iprot)
34 if (nlevel(iprot).gt.0) then
35 c Level 1: local structure, Q value, and rmsd
37 c Calculate the difference between the angles of the target structure and those of the native structure
38 call angnorm(j,0,0,ang_cut1(j,ik,iprot),
39 & nu(inat+1,iii,iprot),fract,ib,iprot,.false.)
40 nu(inat+2,iii,iprot)=qwolynes(1,j,ib,iprot)
41 nu(inat+3,iii,iprot)=rmscalc(0,1,j,jcon,ib,iprot,.false.)
42 nu(inat+3,iii,iprot)=nu(inat+3,iii,iprot)/
43 & len_frag(j,1,ib,iprot)
44 nu(inat+4,iii,iprot)=gyrate(1,j,ib,iprot)
45 nu(inat+5,iii,iprot)=1.0d0-strand_signature(j,ib,iprot,.false.)
46 if (lprn) write (iout,'(a,i2,a,i2,a,f8.3,a,f10.5,a,f10.5,
49 & " rms",nu(inat+3,iii,iprot),
50 & " diffang",nu(inat+1,iii,iprot)," Q",nu(inat+2,iii,iprot),
51 & " signature",nu(inat+5,iii,iprot)
52 c Calculate fragment RMSD
55 c Level 2: Q value and rmsd
57 nu(inat+1,iii,iprot)=qwolynes(2,j,ib,iprot)
58 nu(inat+2,iii,iprot)=rmscalc(0,2,j,jcon,ib,iprot,.false.)
59 nu(inat+2,iii,iprot)=nu(inat+2,iii,iprot)/
60 & len_frag(j,2,ib,iprot)
61 nu(inat+3,iii,iprot)=gyrate(2,j,ib,iprot)
62 if (lprn) write (iout,'(a,i2,a,i2,a,f8.3,a,f10.5)')
63 & "i",2," j",j," rms",
64 & nu(inat+2,iii,iprot)," Q",nu(inat+1,iii,iprot)
67 c Next levels: rmsd only
70 nu(inat+1,iii,iprot)=rmscalc(0,i,j,jcon,ib,iprot,.false.)
71 nu(inat+1,iii,iprot)=nu(inat+1,iii,iprot)
72 & /len_frag(j,i,ib,iprot)
73 nu(inat+2,iii,iprot)=gyrate(i,j,ib,iprot)
74 if (lprn) write (iout,'(a,i2,a,i2,a,f8.3)')
75 & "i",i," j",j," rms",nu(inat+1,iii,iprot)
80 call angnorm12(nu(inat+1,iii,iprot),iprot)
81 nu(inat+2,iii,iprot)=qwolynes(0,1,ib,iprot)
82 nu(inat+3,iii,iprot)=rmsnat(jcon,iprot)
83 nu(inat+3,iii,iprot)=nu(inat+3,iii,iprot)/(nct-nnt+1)
84 nu(inat+4,iii,iprot)=gyrate(0,1,ib,iprot)
85 if (lprn) write (iout,'(a,f8.3,a,f10.5,a,f10.5)')
86 & "angnorm_nat",nu(inat+1,iii,iprot),
87 & " qnat",nu(inat+2,iii,iprot)," rmsnat",nu(inat+3,iii,iprot),
88 & " rgy",nu(inat+4,iii,iprot)
90 if (lprn) write (iout,*) "inat",inat," natlike",natlike(iprot)
93 c---------------------------------------------------------------------------------------------------
94 subroutine fragment_list(iprot)
97 include 'DIMENSIONS.ZSCOPT'
98 include 'DIMENSIONS.COMPAR'
99 include 'COMMON.IOUNITS'
100 include 'COMMON.ALLPROT'
101 include 'COMMON.COMPAR'
102 include 'COMMON.CLASSES'
103 logical lprn /.false./
105 integer i,ilevel,j,k,jfrag
106 do ib=1,nclass(iprot)-1
107 do jfrag=1,nfrag(1,iprot)
108 nlist_frag(jfrag,ib,iprot)=0
109 do i=1,npiece(jfrag,1,ib,iprot)
110 if (lprn) write (iout,*) "Protein",iprot," batch",ib,
112 & "i=",i," fragment",ifrag(1,i,jfrag,ib,iprot),
113 & ifrag(2,i,jfrag,ib,iprot)
114 do j=ifrag(1,i,jfrag,ib,iprot),ifrag(2,i,jfrag,ib,iprot)
115 do k=1,nlist_frag(jfrag,ib,iprot)
116 if (list_frag(k,jfrag,ib,iprot).eq.j) goto 10
118 nlist_frag(jfrag,ib,iprot)=nlist_frag(jfrag,ib,iprot)+1
119 list_frag(nlist_frag(jfrag,ib,iprot),jfrag,ib,iprot)=j
125 write (iout,*) "Fragment list for protein",iprot," batch",ib
126 do j=1,nfrag(1,iprot)
127 write (iout,*)"Fragment",j," list",(list_frag(k,j,ib,iprot),
128 & k=1,nlist_frag(j,ib,iprot))
134 c-----------------------------------------------------------------------------
135 subroutine find_near_pept_cont(iprot)
138 include 'DIMENSIONS.ZSCOPT'
139 include 'DIMENSIONS.COMPAR'
140 include 'COMMON.IOUNITS'
141 include 'COMMON.ALLPROT'
142 include 'COMMON.COMPAR'
143 include 'COMMON.CLASSES'
144 include 'COMMON.PEPTCONT'
145 include 'COMMON.INTERACT'
146 include 'COMMON.NAMES'
147 logical lprn /.false./
149 integer i,ii,ilevel,j,lj,k,k1,k2,l
150 do ib=1,nclass(iprot)-1
151 do j=1,nfrag(1,iprot)
152 if (lprn) write (iout,*) "Protein",iprot," batch",ib,
153 & " jfrag=",j," list",(list_frag(k,j,ib,iprot),
154 & k=1,nlist_frag(j,ib,iprot))
155 do k=1,nlist_frag(j,ib,iprot)
157 lj=list_frag(k,j,ib,iprot)
158 c write (iout,*) "j",j," k",k," lj",lj," sec",isec_ref(lj,iprot)
159 if (isec_ref(lj,iprot).eq.1) then
160 do l=1,ncont_pept_ref(iprot)
161 k1 = icont_pept_ref(1,l,iprot)
162 k2 = icont_pept_ref(2,l,iprot)
163 if (k1.eq.lj .and. isec_ref(k2,iprot).eq.1
164 c & .and. k2-lj.gt.3 ) then
165 & .and. iabs(k2-lj).gt.3 ) then
166 c write (iout,*) "k2",k2," sec",isec_ref(k2,iprot)
169 icont_pept_near(ii,lj,ib,iprot)=k2
172 & "Warning number of near contacts for beta fragment",
173 & j," residue",lj," exceeds 2, truncated."
177 if (k2.eq.lj .and. isec_ref(k1,iprot).eq.1
178 c & .and. k1-lj.gt.3) then
179 & .and. iabs(k1-lj).gt.3) then
180 c write (iout,*) "k1",k1," sec",isec_ref(k1,iprot)
183 icont_pept_near(ii,lj,ib,iprot)=k1
186 & "Warning number of near contacts for beta fragment",
187 & j," residue",lj," exceeds 2, truncated."
193 ncont_pept_near(lj,ib,iprot)=ii
198 & "Near peptide group contacts for beta sheet fragments ",
199 & "protein",iprot," class",ib
200 do j=1,nfrag(1,iprot)
201 write (iout,*) "fragment",j
202 do k=1,nlist_frag(j,ib,iprot)
203 lj=list_frag(k,j,ib,iprot)
204 write (iout,'(a4,1h(,i2,1h),2i5)') restyp(itype(lj)),lj,
205 & (icont_pept_near(ii,lj,ib,iprot),
206 & ii=1,ncont_pept_near(lj,ib,iprot))
213 c---------------------------------------------------------------
214 subroutine calc_ref_beta_signatures(iprot)
217 include 'DIMENSIONS.ZSCOPT'
218 include 'DIMENSIONS.COMPAR'
219 include 'COMMON.IOUNITS'
220 include 'COMMON.ALLPROT'
221 include 'COMMON.COMPAR'
222 include 'COMMON.CLASSES'
223 include 'COMMON.PEPTCONT'
224 include 'COMMON.INTERACT'
225 include 'COMMON.NAMES'
226 logical lprn /.false./
228 integer i,ii,ilevel,j,lj,lj1,jc,jc1,k,k1,k2,l
229 double precision signature
231 do ib=1,nclass(iprot)-1
232 do j=1,nfrag(1,iprot)
233 if (lprn) write (iout,*) "Protein",iprot," batch",ib,
234 & " jfrag=",j," list",(list_frag(k,j,ib,iprot),
235 & k=1,nlist_frag(j,ib,iprot))
237 do k=1,nlist_frag(j,ib,iprot)
238 lj=list_frag(k,j,ib,iprot)
239 if (isec_ref(lj,iprot).eq.1) then
240 do l=1,ncont_pept_near(lj,ib,iprot)
241 jc=icont_pept_near(l,lj,ib,iprot)
242 call find_dir(lj,jc,lj1,jc1,ib,iprot)
243 sig_ref(l,lj,ib,iprot)=signature(lj,jc,lj1,jc1,lprn)
244 c write (iout,*) "lj",lj," jc",jc," lj1",lj1," jc1",jc1,
245 c & " sig_ref",sig_ref(l,lj,ib,iprot)
251 & "Reference signatures protein",iprot," class",ib
252 do j=1,nfrag(1,iprot)
253 write (iout,*) "fragment",j
254 do k=1,nlist_frag(j,ib,iprot)
255 lj=list_frag(k,j,ib,iprot)
256 write (iout,'(a4,1h(,i2,1h),8f10.5)') restyp(itype(lj)),lj,
257 & (sig_ref(ii,lj,ib,iprot),ii=1,ncont_pept_near(lj,ib,iprot))
265 c---------------------------------------------------------------
266 double precision function gyrate(ilevel,jfrag,ib,iprot)
267 implicit real*8 (a-h,o-z)
269 include 'DIMENSIONS.ZSCOPT'
270 include 'DIMENSIONS.COMPAR'
271 include 'COMMON.INTERACT'
272 include 'COMMON.CHAIN'
273 include 'COMMON.IOUNITS'
274 include 'COMMON.COMPAR'
277 double precision cen(3),rg
278 logical iadded(maxres),lprn /.false./
279 double precision creff(3,maxres2),cc(3,maxres2)
280 integer inumber(2,maxres)
281 common /ccc/ creff,cc,iadded,inumber
283 IF (ilevel.eq.0) then
295 cen(j)=cen(j)/dble(nct-nnt+1)
300 rg = rg + (c(j,i)-cen(j))**2
304 gyrate = dsqrt(rg/dble(nct-nnt+1))
312 do k=1,npiece(jfrag,ilevel,ib,iprot)
313 if (ilevel.eq.1) then
315 & write (iout,*) "Level 1: jfrag=",jfrag,"k=",k,
316 & " adding fragment",
317 & ifrag(1,k,jfrag,ib,iprot),ifrag(2,k,jfrag,ib,iprot)
318 call cprep(ifrag(1,k,jfrag,ib,iprot),
319 & ifrag(2,k,jfrag,ib,iprot),0,ii,iprot)
321 kk = ipiece(k,jfrag,ilevel,ib,iprot)
322 do l=1,npiece(kk,1,ib,iprot)
324 & write (iout,*) "Level",i,": jfrag=",jfrag,"k=",k," kk=",kk,
325 & " l=",l," adding fragment",
326 & ifrag(1,l,kk,ib,iprot),ifrag(2,l,kk,ib,iprot)
327 call cprep(ifrag(1,l,kk,ib,iprot),ifrag(2,l,kk,ib,iprot),
334 write(iout,'(5i4,2(3f10.5,5x))') ilevel,jfrag,k,inumber(1,k),
335 & inumber(2,k),(creff(l,k),l=1,3),(cc(l,k),l=1,3)
345 cen(j)=cen(j)+cc(j,i)
349 cen(j)=cen(j)/dble(ii)
354 rg = rg + (cc(j,i)-cen(j))**2
358 gyrate = dsqrt(rg/dble(ii))