1 subroutine contact(lprint,ncont,icont,co)
2 implicit real*8 (a-h,o-z)
4 include 'COMMON.IOUNITS'
6 include 'COMMON.INTERACT'
7 include 'COMMON.FFIELD'
9 real*8 facont /1.569D0/ ! facont = (2/(1-sqrt(1-1/4)))**(1/6)
10 integer ncont,icont(2,maxcont)
19 c rcomp=sigmaii(iti,itj)+1.0D0
20 rcomp=facont*sigmaii(iti,itj)
22 c rcomp=sigma(iti,itj)+1.0D0
23 rcomp=facont*sigma(iti,itj)
26 c print *,'rcomp=',rcomp,' dist=',dist(nres+i,nres+j)
27 if (dist(nres+i,nres+j).lt.rcomp) then
35 write (iout,'(a)') 'Contact map:'
41 write (iout,'(i3,2x,a,i4,2x,a,i4)')
42 & i,restyp(it1),i1,restyp(it2),i2
47 co = co + dfloat(iabs(icont(1,i)-icont(2,i)))
49 co = co / (nres*ncont)
52 c----------------------------------------------------------------------------
53 double precision function contact_fract(ncont,ncont_ref,
55 implicit real*8 (a-h,o-z)
57 include 'COMMON.IOUNITS'
58 integer ncont,ncont_ref,icont(2,maxcont),icont_ref(2,maxcont)
60 c print *,'ncont=',ncont,' ncont_ref=',ncont_ref
61 c write (iout,'(20i4)') (icont_ref(1,i),i=1,ncont_ref)
62 c write (iout,'(20i4)') (icont_ref(2,i),i=1,ncont_ref)
63 c write (iout,'(20i4)') (icont(1,i),i=1,ncont)
64 c write (iout,'(20i4)') (icont(2,i),i=1,ncont)
67 if (icont(1,i).eq.icont_ref(1,j) .and.
68 & icont(2,i).eq.icont_ref(2,j)) nmatch=nmatch+1
71 c print *,' nmatch=',nmatch
72 c contact_fract=dfloat(nmatch)/dfloat(max0(ncont,ncont_ref))
73 contact_fract=dfloat(nmatch)/dfloat(ncont_ref)
76 c----------------------------------------------------------------------------
77 double precision function contact_fract_nn(ncont,ncont_ref,
79 implicit real*8 (a-h,o-z)
81 include 'COMMON.IOUNITS'
82 integer ncont,ncont_ref,icont(2,maxcont),icont_ref(2,maxcont)
84 c print *,'ncont=',ncont,' ncont_ref=',ncont_ref
85 c write (iout,'(20i4)') (icont_ref(1,i),i=1,ncont_ref)
86 c write (iout,'(20i4)') (icont_ref(2,i),i=1,ncont_ref)
87 c write (iout,'(20i4)') (icont(1,i),i=1,ncont)
88 c write (iout,'(20i4)') (icont(2,i),i=1,ncont)
91 if (icont(1,i).eq.icont_ref(1,j) .and.
92 & icont(2,i).eq.icont_ref(2,j)) nmatch=nmatch+1
95 c print *,' nmatch=',nmatch
96 c contact_fract=dfloat(nmatch)/dfloat(max0(ncont,ncont_ref))
97 contact_fract_nn=dfloat(ncont-nmatch)/dfloat(ncont)
100 c----------------------------------------------------------------------------
101 subroutine hairpin(lprint,nharp,iharp)
102 implicit real*8 (a-h,o-z)
104 include 'COMMON.IOUNITS'
105 include 'COMMON.CHAIN'
106 include 'COMMON.INTERACT'
107 include 'COMMON.FFIELD'
108 include 'COMMON.NAMES'
109 integer ncont,icont(2,maxcont)
110 integer nharp,iharp(4,maxres/3)
111 logical lprint,not_done
115 c print *,'nnt=',nnt,' nct=',nct
118 c(k,2*nres+1)=0.5d0*(c(k,i)+c(k,i+1))
122 c(k,2*nres+2)=0.5d0*(c(k,j)+c(k,j+1))
124 if (dist(2*nres+1,2*nres+2).lt.rcomp) then
132 write (iout,'(a)') 'PP contact map:'
138 write (iout,'(i3,2x,a,i4,2x,a,i4)')
139 & i,restyp(it1),i1,restyp(it2),i2
147 if (j1.eq.i1+2 .and. i1.gt.nnt .and. j1.lt.nct) then
148 c write (iout,*) "found turn at ",i1,j1
156 if (i1.eq.icont(1,j) .and. j1.eq.icont(2,j)) goto 10
160 c write (iout,*) i1,j1,not_done
170 c write (iout,*)'nharp',nharp,' iharp',(iharp(k,nharp),k=1,4)
175 c write (iout,*)'i',i,' iharp',(iharp(k,i),k=1,4)
178 write (iout,*) "Hairpins:",nharp
185 write (iout,'(20(a,i3,1x))') (restyp(itype(k)),k,k=i1,ii1)
186 write (iout,'(20(a,i3,1x))') (restyp(itype(k)),k,k=j1,jj1,-1)
188 c write (iout,'(a,i3,$)') restyp(itype(k)),k
194 c----------------------------------------------------------------------------