src/utils/qa/graph.csh 1.2

1.2 2010/01/24 07:01:35 kuhn
forgot to implement configurable bar length after adding option in usage statement
Index: src/utils/qa/graph.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/graph.csh,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/utils/qa/graph.csh	24 Jan 2010 06:56:41 -0000	1.1
+++ src/utils/qa/graph.csh	24 Jan 2010 07:01:35 -0000	1.2
@@ -16,9 +16,9 @@
 
 set debug=true 
 set debug=false
 
-if ( $#argv != 1 ) then
+if ( $#argv < 1 || $#argv > 2 ) then
   # no command line args
   echo
   echo "  make a graph from a two-column file."
   echo
@@ -31,8 +31,12 @@
 else
   set file=$argv[1]
 endif
 
+if ( $#argv == 2 ) then
+  set width=$argv[2]  # width of graph in chars
+endif
+
 cat $file | egrep "." > Xfile$$
 set max=`cat $file | grep "." | awk '{print $2}' | sort -nr | head -1`
 set binsize=`echo $max $width | awk '{printf("%3.0f", $1/$2)}'`
 if (  $debug == "true" ) then