# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: seqplot - CYANA macro ## ## Parameters: file=.ps (default: seqplot.ps) ## ## Analyses the upper limit distance restraints and draws a sequence plot in ## Postscript format. ## The first three lines below the amino acid sequence represent torsion ## angle restraints for the backbone torsion angles f and y, and for the ## side-chain torsion angle c1. For f and y a triangle pointing upwards ## indicates a restraint that allows the torsion angle to take the values ## observed in an ideal a-helix (f = -57, y = -47) or 310-helix (f = -60, y = ## -30); a triangle pointing downwards indicates compatibility with an ideal ## parallel or antiparallel b-strand (f = -119, y = 113 or f = -139, y = 135, ## respectively; Schultz & Schirmer, 1979); a restraint represented by a star ## encloses conformations of both a and b secondary structure types; and a ## filled circle marks a restraint that excludes the torsion angle values of ## these regular secondary structure elements. Torsion angle restraints for ## c1 are depicted by filled squares of three different decreasing sizes, ## depending on whether they allow for one, two, or all three of the ## staggered rotamer positions c1 = -60, 60, 180. Torsion angle restraints ## for c1 that excl ## This command should be executed before distance modify because many of the ## intra-residual and short-range distance restraints will be removed by ## distance modify because the do not effectively restrict the conformation. var xx yy dx dy dyy dyy1 rl lines xp yp aa linew base abase border i j l d istop ipos var info echo font_number font_res font_border syntax $macro:file=@f.ps=seqplot.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 subroutine c_line dist x1 y1 x2 if (nseldis.gt.0) then linew=32.0/seldis**2 plot linewidth=$linew # if (linew.eq.2 .and. seldis.le.dist) then # linew=6 # plot linewidth=$linew # else if (linew.eq.6 .and. seldis.gt.dist) then # linew=2 # plot linewidth=$linew # end if y1=y1+linew/2.0 plot line $x1 $y1 $x2 $y1 end if end subroutine d_line ilin ilen var last if (nseldis.gt.0) then if (i.gt.istop(ilin) .or. base(ilin).ge.abase(ilin)+14) base(ilin)=abase(ilin) last=min(nr,(l+1)*rl) if (i+ilen-1.gt.last) then plot line $xp $base(ilin) ${xp+(last-i+1)*dx} $base(ilin) plot line ${xx+dx} ${base(ilin)-dy} ${xx+(ilen+i-last)*dx} ${base(ilin)-dy} else plot line $xp $base(ilin) ${xp+ilen*dx} $base(ilin) end if # if (base.eq.abase) istop(ilin)=i+ilen istop(ilin)=i+ilen base(ilin)=base(ilin)+2 end if end subroutine star x y size type x=$x; y=$y; size=$size*dx/11.0 if (type.eq.1) then plot polygon x y+size x-0.866*size y-0.5*size x+0.866*size y-0.5*size else if (type.eq.2) then plot polygon x y-size x+0.866*size y+0.5*size x-0.866*size y+0.5*size else if (type.eq.3) then # size=size*0.87 plot polygon x y+size x-0.866*size y-0.5*size x+0.866*size y-0.5*size plot polygon x y-size x+0.866*size y+0.5*size x-0.866*size y+0.5*size else if (type.eq.4) then size=size*0.75 # size=size*0.64 plot arc $x $y $size else size=size*0.75 plot rectangle ${x-size} ${y-size} ${x+size} ${y+size} end if end info:=none; echo:=off plot ps $file linew=2 plot linewidth=$linew rl=40 #resid per line border=8 dx=11 dy=225 dyy1=15 dyy=20 font_number=7 font_res=14 font_border=10 if (nr.gt.120) then dx=7.33 font_res=10.5 rl=60 end if if (nr.gt.180) then dx=5.5 font_res=7 rl=80 end if lines=nr/rl if (mod(nr,rl).ne.0) lines=lines+1 xx=-210 yy=340 #lines=1 do l 1 10 istop(l)=0 base(l)=0 end do do l 0 lines-1 do i 1 10 base(i)=base(i)-dy end do plot font=Times textsize=$font_border align=right yp=yy-l*dy-dyy1 # plot text ${xx-border} $yp @Sf # yp=yp-dyy1 # plot text ${xx-border} $yp @Sy # yp=yp-dyy1 # plot text ${xx-border} $yp @Sc@N@^1 # yp=yp-dyy plot text ${xx-border} $yp @id@N@vNN@N(@ii@N,@ii@N+1) yp=yp-dyy1 plot text ${xx-border} $yp @id@N@v@Sa@TN@N(@ii@N,@ii@N+1) yp=yp-dyy1 plot text ${xx-border} $yp @id@N@v@Sb@TN@N(@ii@N,@ii@N+1) yp=yp-dyy plot text ${xx-border} $yp @id@N@vNN@N(@ii@N,@ii@N+2) abase(1)=$yp yp=yp-dyy plot text ${xx-border} $yp @id@N@v@Sa@TN@N(@ii@N,@ii@N+2) abase(2)=$yp yp=yp-dyy plot text ${xx-border} $yp @id@N@v@Sa@TN@N(@ii@N,@ii@N+3) abase(3)=$yp yp=yp-dyy plot text ${xx-border} $yp @id@N@v@Sab@T@N(@ii@N,@ii@N+3) abase(4)=$yp yp=yp-dyy plot text ${xx-border} $yp @id@N@v@Sa@TN@N(@ii@N,@ii@N+4) abase(5)=$yp plot font=Courier textsize=$font_res align=center do i l*rl+1 min(nr,(l+1)*rl) #print " Residue $rnam(i) $rnum(i)" ipos=i-(l*rl) xp=xx+ipos*dx yp=yy-l*dy rescode $rnam(i) aa if ('$aa'.ne.'?') then plot text $xp $yp $aa if (mod(i,10).eq.0) then plot font=Times textsize=$font_number plot text $xp ${yp+15} $rnum(i) plot font=Courier textsize=$font_res end if plot border=off fill=1 # do jj ifird(i) ifird(i+1)-1 # j=idord(jj) # d=dnam(j) # if (acoviol(j,0.0).ge.0.0) then # if (d.eq.'PHI') then # ta=min(acoviol(j,-57.0),acoviol(j,-60.0)) # tb=min(acoviol(j,-139.0),acoviol(j,-119.0)) # star xp yp-dyy1 5 $if(ta.le.0.0,if(tb.le.0.0,3,1),if(tb.le.0.0,2,4)) # else if (d.eq.'PSI') then # ta=min(acoviol(j,-47.0),acoviol(j,-30.0)) # tb=min(acoviol(j,135.0),acoviol(j,113.0)) # ta=acoviol(j,-47.0) # tb=acoviol(j,125.0) # star xp yp-2*dyy1 5 $if(ta.le.0.0,if(tb.le.0.0,3,1),if(tb.le.0.0,2,4)) # else if (d.eq.'CHI1') then # size=6 # if (acoviol(j,-60.0).le.0.0) size=size-1.2 # if (acoviol(j,60.0).le.0.0) size=size-1.2 # if (acoviol(j,180.0).le.0.0) size=size-1.2 # star xp yp-3*dyy1 $if(size.eq.6,5,size) $if(size.eq.6,4,5) # end if # end if # end do plot border=on fill=0 if (i.lt.nr) then # yp=yp-3*dyy1-dyy yp=yp-dyy1 distance select "H HN $rnum(i), H HN $rnum(i+1)" c_line 3.6 $xp $yp ${xp+dx} yp=yp-dyy1 distance select "HA* QA $rnum(i), H HN $rnum(i+1)" c_line 3.0 $xp $yp ${xp+dx} yp=yp-dyy1 distance select "HB* QB $rnum(i), H HN $rnum(i+1)" c_line 3.6 $xp $yp ${xp+dx} if (i.le.nr-2) then plot linewidth=1 yp=yp-dyy distance select "H HN $rnum(i), H HN $rnum(i+2)" d_line 1 2 yp=yp-dyy distance select "HA* QA $rnum(i), H HN $rnum(i+2)" d_line 2 2 if (i.le.nr-3) then yp=yp-dyy distance select "HA* QA $rnum(i), H HN $rnum(i+3)" d_line 3 3 yp=yp-dyy distance select "HA* QA $rnum(i), HB* QB $rnum(i+3)" d_line 4 3 if (i.le.nr-4) then distance select "HA* QA $rnum(i), H HN $rnum(i+4)" d_line 5 4 end if end if plot linewidth=$linew end if end if end if end do end do distance select "*, *" plot close print " Plot file \"$file\" written."