X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fplot_distribution;h=175ca595377d4e3824d2c51620af5654e2114fd3;hb=381ac0da9f2a23e39e5fe3708b120cea3530b8d6;hp=d2d4d70f387d38e972d61497678652abb5b79ded;hpb=a069f70b678d76462e1e845238a5ecf69d2112f0;p=biopieces.git diff --git a/bp_bin/plot_distribution b/bp_bin/plot_distribution index d2d4d70..175ca59 100755 --- a/bp_bin/plot_distribution +++ b/bp_bin/plot_distribution @@ -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