]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/plot_distribution
added ugly fix to ruby gnuplot dumb print problem
[biopieces.git] / bp_bin / plot_distribution
index 02f802ee611ea1146c88a7de878705358f982f10..7554432d4d14c0c9bdea86b86d890b3eea0bbabf 100755 (executable)
@@ -54,7 +54,7 @@ count_hash = Hash.new(0)
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
-    if record.has_key? key
+    if record[key]
       count_hash[record[key].to_i] += 1
     end
 
@@ -78,7 +78,7 @@ Gnuplot.open do |gp|
     plot.title    options[:title]
     plot.xlabel   options[:xlabel]
     plot.ylabel   options[:ylabel]
-    plot.output   options[:data_out] if options[:data_out]
+    plot.output   options[:data_out] || "/dev/stderr"
     plot.logscale "y"                if options[:logscale_y]
     plot.xrange   "[#{x.min - 1}:#{x.max + 1}]"
     plot.style    "fill solid 0.5 border"