# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: dcostat - CYANA macro ## ## Parameters: file=.ps (default: dcostat.ps) ## ## Produces a graphics output file with the given name (a Graf file if the ## extension is ".grf", or a Postscript file otherwise) with two plots that show ## the distribution of distance restraints. The first plot shows the number of ## distance restraints plotted against the residue index difference of the ## corresponding atoms. The second plot shows for every residue the number of ## intra-residual (white), short-range (vertically hatched), medium-range ## (horizontally hatched) and long-range (black) restraints. var echo i m syntax $macro:file=@f.ps=dcostat.ps classes=2<@i<5=3 echo:=off # plot versus range print "x0=-180 y0=50 x1=210 y1=350" >$file(1:indexr('$file','.'))grf print "font=Times textsize=16 autoscale=off" >> m=0 do i 0 nr m=max(m,ndcdis(i)) end do m=int(m*1.2) print "X0=-0.5 Y0=0 X1=${nr-0.5} Y1=$m " >> do i 0 nr-1 print "$i $ndcdis(i)" >> end do print "fill=1 " >> print "frame Range|i-j| \"Number of restraints\" " >> print "rectangle x-0.5 0 x+0.5 y1" >> # plot versus residue number print "y0=-330 y1=-30" >> m=0 do i 1 nr m=max(m,ndcres(i,nr)) end do m=int(m*1.2) print "X0=${rnum(1)-0.5} Y0=0 X1=${rnum(nr)+0.5} Y1=$m " >> do i 1 nr print "$rnum(i) $ndcres(i,nr) $ndcres(i,4) $ndcres(i,1) $ndcres(i,0)" >> end do print "frame Sequence \"Number of restraints\" " >> print "fill=1 " >> print "rectangle x-0.5 y2 x+0.5 y1" >> print "fill=4 " >> print "rectangle x-0.5 y3 x+0.5 y2" >> if (classes.eq.4) then print "fill=6 " >> print "rectangle x-0.5 y4 x+0.5 y3" >> print "fill=8 " >> print "rectangle x-0.5 0 x+0.5 y4" >>. else print "fill=8 " >> print "rectangle x-0.5 0 x+0.5 y3" >>. end if graf $file replace