# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: longrangeplot - CYANA macro ## ## Parameters: file=.ps (default: longrangeplot.ps) ## ## Plots long-range distance restraints (five or more residues apart) versus ## (two copies of) the sequence. Lines going from upper left to lower right ## represent restraints between side-chain atoms, those going from lower left ## to upper right represent restraints that involve backbone atoms. var info echo ts i j m mm aa scrmax i1 i2 syntax $macro:file=@f.ps=longrangeplot.ps subroutine rescode string var var olc tlc i olc:='LGAVIPSTEDQNKRHFYWMC' tlc:='LEU GLY ALA VAL ILE PRO SER THR GLU ASP GLN ASN LYS ARG HIS PHE TYR TRP MET CYS' string:='$string' if (lenstr(string).eq.1) then i=4*(index(olc,string)-1)+1 if (i.ge.1) then $var:=$tlc(i:i+2) else $var:=? end if else i=(index(tlc,string(1:3))+3)/4 if (i.ge.1) then $var:=$olc(i:i) else $var:=? end if end if end info:=none; echo:=off if (nr.le.0) error "No structure present." plot ps $file ts=2.7*600.0/nr; dx=ts*0.0025 plot textsize=ts font=Courier plot linewidth=0.4 plot x0=-150 x1=150 y0=-300 y1=300 plot X0=0 X1=1 Y0=0 Y1=nr-1 do i 1 nr rescode $rnam(i) aa plot align=right,middle plot text 0-dx*(mod(i+1,2)+0.4) nr-i $aa plot align=left,middle plot text 1+dx*(mod(i+1,2)+0.4) nr-i $aa if (mod(i,10).eq.0) then plot font=Times textsize=0.75*ts plot text 1+dx*2.7 nr-i $rnum(i) plot align=right,middle plot text 0-dx*2.7 nr-i $rnum(i) plot font=Courier textsize=ts end if end do mm=0 if (ndco.eq.0) then do i 1 npeaks if (inpk(i).ge.1.and.ipa(1,i)*ipa(2,i).ne.0) then m=0 do j i i+inpk(i)-1 i1=iar(ipa(1,j)) i2=iar(ipa(2,j)) if (abs(i1-i2).le.4) m=m+1 end do if (m.eq.0) then mm=mm+1 do j i i+inpk(i)-1 i1=iar(ipa(1,j)) i2=iar(ipa(2,j)) plot color=black if (max(lda(iaunit(ipa(1,j))),lda(iaunit(ipa(2,j)))).gt.na) then plot line 0 nr-max(i1,i2) 1 nr-min(i1,i2) else plot line 0 nr-min(i1,i2) 1 nr-max(i1,i2) end if end do end if end if end do else do i 1 ndco if (indco(i).ge.1) then m=0 do j i i+indco(i)-1 i1=iar(idcoa(1,j)) i2=iar(idcoa(2,j)) if (abs(i1-i2).le.3) m=m+1 end do if (m.eq.0) then mm=mm+1 do j i i+indco(i)-1 if (j.eq.i) then plot color=blue else plot color=green end if i1=iar(idcoa(1,j)) i2=iar(idcoa(2,j)) if (max(lda(iaunit(idcoa(1,j))),lda(iaunit(idcoa(2,j)))).gt.na) then plot line 0 nr-max(i1,i2) 1 nr-min(i1,i2) else plot line 0 nr-min(i1,i2) 1 nr-max(i1,i2) end if end do end if end if end do end if plot close print " Plot file \"$file\" written, $mm long range restraints. "