# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: gridplot - CYANA macro ## ## Parameters: file=.ps (default: gridplot.ps) ## width= (default: 16.0) ## ## Produces a plot in Postscript format of the allowed dihedral angle ## values in the standard grid memory. var first i j jj k l m n y dy top a1 a2 name dnames greek dn dna id ld syntax $macro:file=@f.ps=gridplot.ps width=@r=16.0 dnames:=PHI,PSI,CHI,ALPHA,BETA,GAMMA,DELTA,NU,EPSI,ZETA greek:=f,y,c,a,b,g,d,n,e,z m=0; first=1 do i 1 ndfree if (intervals(i).ge.0) m=m+1 if (m.gt.80 .and. idr(i).lt.idr(i+1)) then first:=$first,${i+1} m=0 end if end do first:=$first,${ndfree+1} l=length('first') do j 1 l-1 i=indexr('$file','.') name:=$file if (l.gt.2) name:=$file(1:i-1)$j(I2.2)$file(i:) plot ps $name # plot X0=-180 X1=180 x0=-200 x1=250 textsize=8 plot X0=-180 X1=180 x0=-12.5*width x1=15.9*width textsize=8 plot dash=solid linewidth=2.5 align=left,middle top=340.0; y=top; dy=8.0; k=100000 do i first(j) first(j+1)-1 n=intervals(i) if (n.ge.0) then y=y-dy if (idr(i).ne.k) then k=idr(i) plot linewidth=0.3 plot line -180-800/width ${y+0.5*dy} 180 ${y+0.5*dy} plot linewidth=2.5 plot text -180-800/width $y "$rnum(k) $rnam(k)" end if dn='$dnam(i)' do id 1 length('dnames') dna='$dnames(id)'; ld=lenstr(dna) if (dn(1:ld).eq.dna) then dn:=@S$greek(id)@N$dn(ld+1:) break end if end do # print "id=$id, ld=$ld, dn=$dn, dna=$dna" plot text -180-320/width $y "$dn" do jj 1 n a1=mod(mod(interval(i,1,jj),360.0)+540.0,360.0)-180.0 a2=mod(mod(interval(i,2,jj),360.0)+540.0,360.0)-180.0 if (a1.lt.a2) then plot line $a1 $y $a2 $y else plot line -180.0 $y $a2 $y plot line $a1 $y 180.0 $y end if end do end if end do plot align=center,bottom dash=dotted linewidth=0.3 do jj -180 180 30 plot text $jj ${top+5} $jj plot line $jj $top $jj ${y-0.5*dy} end do plot close print " Plot file \"$name\" written." end do