subroutine define_pairs(iprot) implicit none include 'DIMENSIONS' include 'DIMENSIONS.ZSCOPT' include 'DIMENSIONS.COMPAR' include 'COMMON.IOUNITS' include 'COMMON.TIME1' include 'COMMON.SBRIDGE' include 'COMMON.COMPAR' include 'COMMON.FRAG' include 'COMMON.CHAIN' include 'COMMON.HEADER' include 'COMMON.GEO' include 'COMMON.CONTACTS1' include 'COMMON.PEPTCONT' include 'COMMON.CLASSES' integer i,j,k,ind,ll1,ll2,len_cut,length_frag,ib,iprot,icant #ifdef DEBUG write (iout,*) "define_pairs: iprot",iprot," nfrag",nfrag(1,iprot) #endif do ib=1,nclass(iprot)-1 do j=1,nfrag(1,iprot) length_frag = 0 do k=1,npiece(j,1,ib,iprot) length_frag=length_frag+ifrag(2,k,j,ib,iprot) & -ifrag(1,k,j,ib,iprot)+1 enddo len_frag(j,1,ib,iprot)=length_frag #ifdef DEBUG write (iout,*) "Batch",ib," fragment",j, & " length",len_frag(j,1,ib,iprot) #endif enddo enddo nfrag(2,iprot)=0 do i=1,nfrag(1,iprot) do j=i+1,nfrag(1,iprot) ind = icant(i,j) if (istruct(i,1,iprot).le.1 .or. istruct(j,1,iprot).le.1) & then if (istruct(i,1,iprot).le.1) then ll1=len_frag(i,1,1,iprot) else ll1=len_frag(i,1,1,iprot)/2 endif if (istruct(j,1,iprot).le.1) then ll2=len_frag(j,1,1,iprot) else ll2=len_frag(j,1,1,iprot)/2 endif len_cut=max0(min0(ll1*2/3,ll2*4/5),3) else if (istruct(i,1,iprot).eq.2.or.istruct(i,1,iprot).eq.4) & then ll1=len_frag(i,1,1,iprot)/2 else ll1=len_frag(i,1,1,iprot) endif if (istruct(j,1,iprot).eq.2 .or. istruct(j,1,iprot).eq.4) & then ll2=len_frag(j,1,1,iprot)/2 else ll2=len_frag(j,1,1,iprot) endif len_cut=max0(min0(ll1*4/5,ll2)*4/5,3) endif #ifdef DEBUG write (iout,*) "Fragments",i,j," structure", & istruct(i,1,iprot), & istruct(j,1,iprot)," # contacts", & ncont_frag_ref(ind,1,iprot), & nsccont_frag_ref(ind,1,iprot), & " lengths",len_frag(i,1,1,iprot),len_frag(j,1,1,iprot), & " ll1",ll1," ll2",ll2," len_cut",len_cut #endif if ((istruct(i,1,iprot).eq.1 .or. istruct(j,1,iprot).eq.1) & .and.nsccont_frag_ref(ind,1,iprot).ge.len_cut) then if(istruct(i,1,iprot).eq.1 .and. istruct(j,1,iprot).eq.1) & then write (iout,*) "Adding pair of helices",i,j, & " based on SC contacts" else write (iout,*) "Adding helix+strand/sheet pair",i,j, & " based on SC contacts" endif nfrag(2,iprot)=nfrag(2,iprot)+1 do ib=1,nclass(iprot)-1 #ifdef DEBUG write (iout,*) "Batch",ib #endif if (icont_pair(ib).gt.0 .and. icontp_pair(ib).eq.0) then #ifdef DEBUG write (iout,*) "# SC contacts will be used", & " in comparison." #endif isccont(nfrag(2,iprot),2,ib,iprot)=1 ielecont(nfrag(2,iprot),2,ib,iprot)=0 else if (icontp_pair(ib).gt.0) then #ifdef DEBUG write (iout,*) "# pp contacts will be used", & " in comparison." #endif ielecont(nfrag(2,iprot),2,ib,iprot)=1 isccont(nfrag(2,iprot),2,ib,iprot)=0 else ielecont(nfrag(2,iprot),2,ib,iprot)=0 isccont(nfrag(2,iprot),2,ib,iprot)=0 endif if (irms_pair(ib).gt.0) then #ifdef DEBUG write (iout,*) "Fragment RMSD will be used", & " in comparison." #endif irms(nfrag(2,iprot),2,ib,iprot)=1 endif if (iqwol_pair(ib).gt.0) then #ifdef DEBUG write (iout,*) "Fragment Q will be used", & " in comparison." #endif iqwol(nfrag(2,iprot),2,ib,iprot)=1 qcutfrag(nfrag(2,iprot),2,ib,iprot)=qcut_pair(ib) endif npiece(nfrag(2,iprot),2,ib,iprot)=2 ipiece(1,nfrag(2,iprot),2,ib,iprot)=i ipiece(2,nfrag(2,iprot),2,ib,iprot)=j n_shift(1,nfrag(2,iprot),2,ib,iprot)=nshift_pair(ib) n_shift(2,nfrag(2,iprot),2,ib,iprot)=nshift_pair(ib) nc_fragm(nfrag(2,iprot),2,ib,iprot)=ncfrac_pair(ib) nc_req_setf(nfrag(2,iprot),2,ib,iprot)=ncreq_pair(ib) enddo else if ((istruct(i,1,iprot).ge.2 & .and. istruct(i,1,iprot).le.4) & .and. (istruct(j,1,iprot).ge.2 & .and. istruct(i,1,iprot).le.4) & .and. ncont_frag_ref(ind,1,iprot).ge.len_cut ) then nfrag(2,iprot)=nfrag(2,iprot)+1 write (iout,*) "Adding pair strands/sheets",i,j, & " based on pp contacts" do ib=1,nclass(iprot)-1 #ifdef DEBUG write (iout,*) "Batch",ib #endif if (icont_pair(ib).gt.0 .and. icontsc_pair(ib).eq.0) then #ifdef DEBUG write (iout,*) "# pp contacts will be used", & " in comparison." #endif ielecont(nfrag(2,iprot),2,ib,iprot)=1 isccont(nfrag(2,iprot),2,ib,iprot)=0 else if (icontsc_pair(ib).eq.1) then #ifdef DEBUG write (iout,*) "# sc contacts will be used", & " in comparison." #endif ielecont(nfrag(2,iprot),2,ib,iprot)=0 isccont(nfrag(2,iprot),2,ib,iprot)=1 write (iout,*) nfrag(2,iprot),2,ib,iprot, & isccont(nfrag(2,iprot),2,ib,iprot) else ielecont(nfrag(2,iprot),2,ib,iprot)=0 isccont(nfrag(2,iprot),2,ib,iprot)=0 endif if (irms_pair(ib).gt.0) then #ifdef DEBUG write (iout,*) "Fragment RMSD will be used", & " in comparison." #endif irms(nfrag(2,iprot),2,ib,iprot)=1 else irms(nfrag(2,iprot),2,ib,iprot)=0 endif if (iqwol_pair(ib).gt.0) then #ifdef DEBUG write (iout,*) "Fragment Q will be used", & " in comparison." #endif iqwol(nfrag(2,iprot),2,ib,iprot)=1 qcutfrag(nfrag(2,iprot),2,ib,iprot)=qcut_pair(ib) endif npiece(nfrag(2,iprot),2,ib,iprot)=2 ipiece(1,nfrag(2,iprot),2,ib,iprot)=i ipiece(2,nfrag(2,iprot),2,ib,iprot)=j n_shift(1,nfrag(2,iprot),2,ib,iprot)=nshift_pair(ib) n_shift(2,nfrag(2,iprot),2,ib,iprot)=nshift_pair(ib) nc_fragm(nfrag(2,iprot),2,ib,iprot)=ncfrac_bet(ib) nc_req_setf(nfrag(2,iprot),2,ib,iprot)=ncreq_bet(ib) enddo endif enddo enddo #ifdef DEBUG write (iout,*) "Pairs found" do i=1,nfrag(2,iprot) write (iout,*) ipiece(1,i,2,1,iprot),ipiece(2,i,2,1,iprot) enddo write (iout,*) "ielecont" do ib=1,nclass(iprot)-1 write (iout,*) "structural level",ib do i=1,iabs(nlevel(iprot)) write (iout,*) "Level",i write (iout,*) (ielecont(j,i,ib,iprot),j=1,nfrag(i,iprot)) enddo enddo write (iout,*) "isccont" do ib=1,nclass(iprot)-1 write (iout,*) "structural level",ib do i=1,iabs(nlevel(iprot)) write (iout,*) "Level",i write (iout,*) (isccont(j,i,ib,iprot),j=1,nfrag(i,iprot)) enddo enddo #endif return end