1 subroutine elecont(lprint,ncont,icont)
2 implicit real*8 (a-h,o-z)
4 include 'COMMON.IOUNITS'
6 include 'COMMON.INTERACT'
8 include 'COMMON.FFIELD'
11 double precision elpp_6(2,2),elpp_3(2,2),ael6_(2,2),ael3_(2,2)
12 double precision app_(2,2),bpp_(2,2),rpp_(2,2)
13 integer ncont,icont(2,maxcont)
14 double precision econt(maxcont)
16 * Load the constants of peptide bond - peptide bond interactions.
17 * Type 1 - ordinary peptide bond, type 2 - alkylated peptide bond (e.g.
18 * proline) - determined by averaging ECEPP energy.
22 c data epp / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
23 data rpp_ / 4.5088d0, 4.5395d0, 4.5395d0, 4.4846d0/
24 data elpp_6 /-0.2379d0,-0.2056d0,-0.2056d0,-0.0610d0/
25 data elpp_3 / 0.0503d0, 0.0000d0, 0.0000d0, 0.0692d0/
26 data elcutoff /-0.3d0/,elecutoff_14 /-0.5d0/
27 if (lprint) write (iout,'(a)')
28 & "Constants of electrostatic interaction energy expression."
32 app_(i,j)=epp(i,j)*rri*rri
33 bpp_(i,j)=-2.0*epp(i,j)*rri
34 ael6_(i,j)=elpp_6(i,j)*4.2**6
35 ael3_(i,j)=elpp_3(i,j)*4.2**3
37 & write (iout,'(2i2,4e15.4)') i,j,app_(i,j),bpp_(i,j),ael6_(i,j),
45 if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1) goto 1
55 xmedi=mod(xmedi,boxxsize)
56 if (xmedi.lt.0) xmedi=xmedi+boxxsize
57 ymedi=mod(ymedi,boxysize)
58 if (ymedi.lt.0) ymedi=ymedi+boxysize
59 zmedi=mod(zmedi,boxzsize)
60 if (zmedi.lt.0) zmedi=zmedi+boxzsize
62 if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1) goto 4
66 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
67 if (iteli.eq.2 .and. itelj.eq.2) goto 4
70 ael6_i=ael6_(iteli,itelj)
71 ael3_i=ael3_(iteli,itelj)
79 if (xj.lt.0) xj=xj+boxxsize
81 if (yj.lt.0) yj=yj+boxysize
83 if (zj.lt.0) zj=zj+boxzsize
84 dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
92 xj=xj_safe+xshift*boxxsize
93 yj=yj_safe+yshift*boxysize
94 zj=zj_safe+zshift*boxzsize
95 dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
96 if(dist_temp.lt.dist_init) then
106 if (isubchap.eq.1) then
115 rij=xj*xj+yj*yj+zj*zj
116 sss=sscale(sqrt(rij))
117 sssgrad=sscagrad(sqrt(rij))
118 rrmij=1.0/(xj*xj+yj*yj+zj*zj)
123 cosa=(dxi*dxj+dyi*dyj+dzi*dzj)*vblinv2
124 cosb=(xj*dxi+yj*dyi+zj*dzi)*vrmij
125 cosg=(xj*dxj+yj*dyj+zj*dzj)*vrmij
126 fac=cosa-3.0*cosb*cosg
132 el1=fac3*(4.0+fac*fac-3.0*(cosb*cosb+cosg*cosg))
135 if (j.gt.i+2 .and. eesij.le.elcutoff .or.
136 & j.eq.i+2 .and. eesij.le.elecutoff_14) then
147 write (iout,*) 'Total average electrostatic energy: ',ees
148 write (iout,*) 'VDW energy between peptide-group centers: ',evdw
150 write (iout,*) 'Electrostatic contacts before pruning: '
156 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
157 & i,restyp(it1),i1,restyp(it2),i2,econt(i)
160 c For given residues keep only the contacts with the greatest energy.
162 do while (i.lt.ncont)
168 do while (j.lt.ncont)
170 if (ic1.eq.icont(1,j).and.iabs(icont(2,j)-ic2).le.2 .or.
171 & ic2.eq.icont(2,j).and.iabs(icont(1,j)-ic1).le.2) then
172 c write (iout,*) "i",i," j",j," ic1",ic1," ic2",ic2,
173 c & " jc1",icont(1,j)," jc2",icont(2,j)," ncont",ncont
174 if (econt(j).lt.ene .and. icont(2,j).ne.icont(1,j)+2) then
175 if (ic1.eq.icont(1,j)) then
177 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.icont(2,j)
178 & .and. iabs(icont(1,k)-ic1).le.2 .and.
179 & econt(k).lt.econt(j) ) goto 21
181 else if (ic2.eq.icont(2,j) ) then
183 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.icont(1,j)
184 & .and. iabs(icont(2,k)-ic2).le.2 .and.
185 & econt(k).lt.econt(j) ) goto 21
190 icont(1,k-1)=icont(1,k)
191 icont(2,k-1)=icont(2,k)
196 c write (iout,*) "ncont",ncont
198 c write (iout,*) icont(1,k),icont(2,k)
201 else if (econt(j).gt.ene .and. ic2.ne.ic1+2)
203 if (ic1.eq.icont(1,j)) then
205 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.ic2
206 & .and. iabs(icont(1,k)-icont(1,j)).le.2 .and.
207 & econt(k).lt.econt(i) ) goto 21
209 else if (ic2.eq.icont(2,j) ) then
211 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.ic1
212 & .and. iabs(icont(2,k)-icont(2,j)).le.2 .and.
213 & econt(k).lt.econt(i) ) goto 21
218 icont(1,k-1)=icont(1,k)
219 icont(2,k-1)=icont(2,k)
223 c write (iout,*) "ncont",ncont
225 c write (iout,*) icont(1,k),icont(2,k)
236 write (iout,*) 'Electrostatic contacts after pruning: '
242 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
243 & i,restyp(it1),i1,restyp(it2),i2,econt(i)
248 c--------------------------------------------
249 subroutine secondary2(lprint)
250 implicit real*8 (a-h,o-z)
252 include 'COMMON.CHAIN'
253 include 'COMMON.IOUNITS'
254 include 'COMMON.DISTFIT'
257 include 'COMMON.CONTROL'
258 integer ncont,icont(2,maxcont),isec(maxres,4),nsec(maxres)
259 logical lprint,not_done,freeres
260 double precision p1,p2
263 cc???? if(.not.dccart) call chainbuild
264 cd call write_pdb(99,'sec structure',0d0)
274 call elecont(lprint,ncont,icont)
276 c finding parallel beta
277 cd write (iout,*) '------- looking for parallel beta -----------'
283 if(j1-i1.gt.5 .and. freeres(i1,j1,nsec,isec)) then
286 cd write (iout,*) i1,j1
292 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j) .and.
293 & freeres(i1,j1,nsec,isec)) goto 5
297 cd write (iout,*) i1,j1,not_done
301 if (i1-ii1.gt.1) then
305 if(lprint)write(iout,'(a,i3,4i4)')'parallel beta',
306 & nbeta,ii1,i1,jj1,j1
309 bfrag(1,nbfrag)=ii1+1
311 bfrag(3,nbfrag)=jj1+1
312 bfrag(4,nbfrag)=min0(j1+1,nres)
316 isec(ij,nsec(ij))=nbeta
320 isec(ij,nsec(ij))=nbeta
326 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
327 & "DefPropRes 'strand",nstrand,
328 & "' 'num = ",ii1-1,"..",i1-1,"'"
330 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
331 & "DefPropRes 'strand",nstrand,
332 & "' 'num = ",ii1-1,"..",i1-1,"'"
336 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
337 & "DefPropRes 'strand",nstrand,
338 & "' 'num = ",jj1-1,"..",j1-1,"'"
340 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
341 & "DefPropRes 'strand",nstrand,
342 & "' 'num = ",jj1-1,"..",j1-1,"'"
345 & "SetNeigh",ii1-1,i1-1,jj1-1,j1-1
351 c finding alpha or 310 helix
359 if (j1+2.le.nres) p2=phi(j1+2)*rad2deg
363 & ((p1.ge.10.and.p1.le.80).or.i1.le.2).and.
364 & ((p2.ge.10.and.p2.le.80).or.j1.le.2.or.j1.ge.nres-3) )then
365 cd if (j1.eq.i1+3) write (iout,*) "found 1-4 ",i1,j1,p1,p2
366 co if (j1.eq.i1+4) write (iout,*) "found 1-5 ",i1,j1,p1,p2
369 if (nsec(ii1).eq.0) then
378 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j)) goto 10
384 if (p1.lt.10.or.p1.gt.80.or.p2.lt.10.or.p2.gt.80)
386 cd write (iout,*) i1,j1,not_done,p1,p2
389 if (j1-ii1.gt.5) then
391 cd write (iout,*)'helix',nhelix,ii1,j1
401 write (iout,'(a,i3,2i4)') "Helix",nhelix,ii1-1,j1-1
402 if (nhelix.le.9) then
403 write(12,'(a17,i1,a9,i3,a2,i3,a1)')
404 & "DefPropRes 'helix",nhelix,
405 & "' 'num = ",ii1-1,"..",j1-2,"'"
407 write(12,'(a17,i2,a9,i3,a2,i3,a1)')
408 & "DefPropRes 'helix",nhelix,
409 & "' 'num = ",ii1-1,"..",j1-2,"'"
416 if (nhelix.gt.0.and.lprint) then
417 write(12,'(a26,$)') "DefPropRes 'helix' 'helix1"
419 if (nhelix.le.9) then
420 write(12,'(a8,i1,$)') " | helix",i
422 write(12,'(a8,i2,$)') " | helix",i
429 c finding antiparallel beta
430 cd write (iout,*) '--------- looking for antiparallel beta ---------'
435 if (freeres(i1,j1,nsec,isec)) then
438 cd write (iout,*) i1,j1
445 if (i1.eq.icont(1,j).and.j1.eq.icont(2,j) .and.
446 & freeres(i1,j1,nsec,isec)) goto 6
450 cd write (iout,*) i1,j1,not_done
454 if (i1-ii1.gt.1) then
458 bfrag(2,nbfrag)=min0(i1+1,nres)
459 bfrag(3,nbfrag)=min0(jj1+1,nres)
466 if (nsec(ij).le.2) then
467 isec(ij,nsec(ij))=nbeta
473 if (nsec(ij).le.2 .and. nsec(ij).gt.0) then
474 isec(ij,nsec(ij))=nbeta
480 write (iout,'(a,i3,4i4)')'antiparallel beta',
481 & nbeta,ii1-1,i1,jj1,j1-1
483 if (nstrand.le.9) then
484 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
485 & "DefPropRes 'strand",nstrand,
486 & "' 'num = ",ii1-2,"..",i1-1,"'"
488 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
489 & "DefPropRes 'strand",nstrand,
490 & "' 'num = ",ii1-2,"..",i1-1,"'"
493 if (nstrand.le.9) then
494 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
495 & "DefPropRes 'strand",nstrand,
496 & "' 'num = ",j1-2,"..",jj1-1,"'"
498 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
499 & "DefPropRes 'strand",nstrand,
500 & "' 'num = ",j1-2,"..",jj1-1,"'"
503 & "SetNeigh",ii1-2,i1-1,jj1-1,j1-2
509 if (nstrand.gt.0.and.lprint) then
510 write(12,'(a27,$)') "DefPropRes 'sheet' 'strand1"
513 write(12,'(a9,i1,$)') " | strand",i
515 write(12,'(a9,i2,$)') " | strand",i
524 write(12,'(a37)') "DefPropRes 'coil' '! (helix | sheet)'"
525 write(12,'(a20)') "XMacStand ribbon.mac"
528 write(iout,*) 'UNRES seq:'
530 write(iout,*) 'beta ',(bfrag(i,j),i=1,4)
534 write(iout,*) 'helix ',(hfrag(i,j),i=1,2)
540 c-------------------------------------------------
541 logical function freeres(i,j,nsec,isec)
542 implicit real*8 (a-h,o-z)
544 integer isec(maxres,4),nsec(maxres)
547 if (nsec(i).lt.0.or.nsec(j).lt.0) return
548 if (nsec(i).gt.1.or.nsec(j).gt.1) return
551 if (isec(i,k).eq.isec(j,l)) return