]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/plot_distribution
removed debug message
[biopieces.git] / bp_bin / plot_distribution
index d2d4d70f387d38e972d61497678652abb5b79ded..7554432d4d14c0c9bdea86b86d890b3eea0bbabf 100755 (executable)
@@ -45,7 +45,7 @@ casts << {:long=>'logscale_y', :short=>'L', :type=>'flag',   :mandatory=>false,
 
 options = Biopieces.options_parse(ARGV, casts)
 
-key = options[:key]
+key = options[:key].to_sym
 
 options[:xlabel] = key unless options[:xlabel]
 options[:ylabel] = "log10(#{options[:ylabel]})" if options[:logscale_y]
@@ -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"