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.21 .or. itype(i+1).eq.21) goto 1
56 if (itype(j).eq.21 .or. itype(j+1).eq.21) goto 4
60 if (j.eq.i+2 .and. itelj.eq.2) iteli=2
61 if (iteli.eq.2 .and. itelj.eq.2) goto 4
64 ael6_i=ael6_(iteli,itelj)
65 ael3_i=ael3_(iteli,itelj)
69 xj=c(1,j)+0.5*dxj-xmedi
70 yj=c(2,j)+0.5*dyj-ymedi
71 zj=c(3,j)+0.5*dzj-zmedi
72 rrmij=1.0/(xj*xj+yj*yj+zj*zj)
77 cosa=(dxi*dxj+dyi*dyj+dzi*dzj)*vblinv2
78 cosb=(xj*dxi+yj*dyi+zj*dzi)*vrmij
79 cosg=(xj*dxj+yj*dyj+zj*dzj)*vrmij
80 fac=cosa-3.0*cosb*cosg
86 el1=fac3*(4.0+fac*fac-3.0*(cosb*cosb+cosg*cosg))
89 if (j.gt.i+2 .and. eesij.le.elcutoff .or.
90 & j.eq.i+2 .and. eesij.le.elecutoff_14) then
101 write (iout,*) 'Total average electrostatic energy: ',ees
102 write (iout,*) 'VDW energy between peptide-group centers: ',evdw
104 write (iout,*) 'Electrostatic contacts before pruning: '
110 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
111 & i,restyp(it1),i1,restyp(it2),i2,econt(i)
114 c For given residues keep only the contacts with the greatest energy.
116 do while (i.lt.ncont)
122 do while (j.lt.ncont)
124 if (ic1.eq.icont(1,j).and.iabs(icont(2,j)-ic2).le.2 .or.
125 & ic2.eq.icont(2,j).and.iabs(icont(1,j)-ic1).le.2) then
126 c write (iout,*) "i",i," j",j," ic1",ic1," ic2",ic2,
127 c & " jc1",icont(1,j)," jc2",icont(2,j)," ncont",ncont
128 if (econt(j).lt.ene .and. icont(2,j).ne.icont(1,j)+2) then
129 if (ic1.eq.icont(1,j)) then
131 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.icont(2,j)
132 & .and. iabs(icont(1,k)-ic1).le.2 .and.
133 & econt(k).lt.econt(j) ) goto 21
135 else if (ic2.eq.icont(2,j) ) then
137 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.icont(1,j)
138 & .and. iabs(icont(2,k)-ic2).le.2 .and.
139 & econt(k).lt.econt(j) ) goto 21
144 icont(1,k-1)=icont(1,k)
145 icont(2,k-1)=icont(2,k)
150 c write (iout,*) "ncont",ncont
152 c write (iout,*) icont(1,k),icont(2,k)
155 else if (econt(j).gt.ene .and. ic2.ne.ic1+2)
157 if (ic1.eq.icont(1,j)) then
159 if (k.ne.i .and. k.ne.j .and. icont(2,k).eq.ic2
160 & .and. iabs(icont(1,k)-icont(1,j)).le.2 .and.
161 & econt(k).lt.econt(i) ) goto 21
163 else if (ic2.eq.icont(2,j) ) then
165 if (k.ne.i .and. k.ne.j .and. icont(1,k).eq.ic1
166 & .and. iabs(icont(2,k)-icont(2,j)).le.2 .and.
167 & econt(k).lt.econt(i) ) goto 21
172 icont(1,k-1)=icont(1,k)
173 icont(2,k-1)=icont(2,k)
177 c write (iout,*) "ncont",ncont
179 c write (iout,*) icont(1,k),icont(2,k)
190 write (iout,*) 'Electrostatic contacts after pruning: '
196 write (iout,'(i3,2x,a,i4,2x,a,i4,f10.5)')
197 & i,restyp(it1),i1,restyp(it2),i2,econt(i)
202 c--------------------------------------------
203 subroutine secondary2(lprint)
204 implicit real*8 (a-h,o-z)
206 include 'COMMON.CHAIN'
207 include 'COMMON.IOUNITS'
208 include 'COMMON.DISTFIT'
211 include 'COMMON.CONTROL'
212 integer ncont,icont(2,maxcont),isec(maxres,4),nsec(maxres)
213 logical lprint,not_done,freeres
214 double precision p1,p2
217 if(.not.dccart) call chainbuild
218 cd call write_pdb(99,'sec structure',0d0)
228 call elecont(lprint,ncont,icont)
230 c finding parallel beta
231 cd write (iout,*) '------- looking for parallel beta -----------'
237 if(j1-i1.gt.5 .and. freeres(i1,j1,nsec,isec)) then
240 cd write (iout,*) i1,j1
246 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j) .and.
247 & freeres(i1,j1,nsec,isec)) goto 5
251 cd write (iout,*) i1,j1,not_done
255 if (i1-ii1.gt.1) then
259 if(lprint)write(iout,'(a,i3,4i4)')'parallel beta',
260 & nbeta,ii1,i1,jj1,j1
263 bfrag(1,nbfrag)=ii1+1
265 bfrag(3,nbfrag)=jj1+1
266 bfrag(4,nbfrag)=min0(j1+1,nres)
270 isec(ij,nsec(ij))=nbeta
274 isec(ij,nsec(ij))=nbeta
280 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
281 & "DefPropRes 'strand",nstrand,
282 & "' 'num = ",ii1-1,"..",i1-1,"'"
284 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
285 & "DefPropRes 'strand",nstrand,
286 & "' 'num = ",ii1-1,"..",i1-1,"'"
290 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
291 & "DefPropRes 'strand",nstrand,
292 & "' 'num = ",jj1-1,"..",j1-1,"'"
294 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
295 & "DefPropRes 'strand",nstrand,
296 & "' 'num = ",jj1-1,"..",j1-1,"'"
299 & "SetNeigh",ii1-1,i1-1,jj1-1,j1-1
305 c finding alpha or 310 helix
313 if (j1+2.le.nres) p2=phi(j1+2)*rad2deg
317 & ((p1.ge.10.and.p1.le.80).or.i1.le.2).and.
318 & ((p2.ge.10.and.p2.le.80).or.j1.le.2.or.j1.ge.nres-3) )then
319 cd if (j1.eq.i1+3) write (iout,*) "found 1-4 ",i1,j1,p1,p2
320 co if (j1.eq.i1+4) write (iout,*) "found 1-5 ",i1,j1,p1,p2
323 if (nsec(ii1).eq.0) then
332 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j)) goto 10
338 if (p1.lt.10.or.p1.gt.80.or.p2.lt.10.or.p2.gt.80)
340 cd write (iout,*) i1,j1,not_done,p1,p2
343 if (j1-ii1.gt.5) then
345 cd write (iout,*)'helix',nhelix,ii1,j1
355 write (iout,'(a,i3,2i4)') "Helix",nhelix,ii1-1,j1-1
356 if (nhelix.le.9) then
357 write(12,'(a17,i1,a9,i3,a2,i3,a1)')
358 & "DefPropRes 'helix",nhelix,
359 & "' 'num = ",ii1-1,"..",j1-2,"'"
361 write(12,'(a17,i2,a9,i3,a2,i3,a1)')
362 & "DefPropRes 'helix",nhelix,
363 & "' 'num = ",ii1-1,"..",j1-2,"'"
370 if (nhelix.gt.0.and.lprint) then
371 write(12,'(a26,$)') "DefPropRes 'helix' 'helix1"
373 if (nhelix.le.9) then
374 write(12,'(a8,i1,$)') " | helix",i
376 write(12,'(a8,i2,$)') " | helix",i
383 c finding antiparallel beta
384 cd write (iout,*) '--------- looking for antiparallel beta ---------'
389 if (freeres(i1,j1,nsec,isec)) then
392 cd write (iout,*) i1,j1
399 if (i1.eq.icont(1,j).and.j1.eq.icont(2,j) .and.
400 & freeres(i1,j1,nsec,isec)) goto 6
404 cd write (iout,*) i1,j1,not_done
408 if (i1-ii1.gt.1) then
412 bfrag(2,nbfrag)=min0(i1+1,nres)
413 bfrag(3,nbfrag)=min0(jj1+1,nres)
420 if (nsec(ij).le.2) then
421 isec(ij,nsec(ij))=nbeta
427 if (nsec(ij).le.2 .and. nsec(ij).gt.0) then
428 isec(ij,nsec(ij))=nbeta
434 write (iout,'(a,i3,4i4)')'antiparallel beta',
435 & nbeta,ii1-1,i1,jj1,j1-1
437 if (nstrand.le.9) then
438 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
439 & "DefPropRes 'strand",nstrand,
440 & "' 'num = ",ii1-2,"..",i1-1,"'"
442 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
443 & "DefPropRes 'strand",nstrand,
444 & "' 'num = ",ii1-2,"..",i1-1,"'"
447 if (nstrand.le.9) then
448 write(12,'(a18,i1,a9,i3,a2,i3,a1)')
449 & "DefPropRes 'strand",nstrand,
450 & "' 'num = ",j1-2,"..",jj1-1,"'"
452 write(12,'(a18,i2,a9,i3,a2,i3,a1)')
453 & "DefPropRes 'strand",nstrand,
454 & "' 'num = ",j1-2,"..",jj1-1,"'"
457 & "SetNeigh",ii1-2,i1-1,jj1-1,j1-2
463 if (nstrand.gt.0.and.lprint) then
464 write(12,'(a27,$)') "DefPropRes 'sheet' 'strand1"
467 write(12,'(a9,i1,$)') " | strand",i
469 write(12,'(a9,i2,$)') " | strand",i
478 write(12,'(a37)') "DefPropRes 'coil' '! (helix | sheet)'"
479 write(12,'(a20)') "XMacStand ribbon.mac"
482 write(iout,*) 'UNRES seq:'
484 write(iout,*) 'beta ',(bfrag(i,j),i=1,4)
488 write(iout,*) 'helix ',(hfrag(i,j),i=1,2)
494 c-------------------------------------------------
495 logical function freeres(i,j,nsec,isec)
496 implicit real*8 (a-h,o-z)
498 integer isec(maxres,4),nsec(maxres)
501 if (nsec(i).lt.0.or.nsec(j).lt.0) return
502 if (nsec(i).gt.1.or.nsec(j).gt.1) return
505 if (isec(i,k).eq.isec(j,l)) return