From f46d61f0881daf3bb2ad3209dd07169ee2453246 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 22 Nov 2011 15:24:41 +0000 Subject: [PATCH] got rid of nasty to_sym in biopieces.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1677 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/bin_vals | 4 ++-- bp_bin/plot_distribution | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bp_bin/bin_vals b/bp_bin/bin_vals index db9e3b4..e5e73c7 100755 --- a/bp_bin/bin_vals +++ b/bp_bin/bin_vals @@ -39,8 +39,8 @@ options = Biopieces.options_parse(ARGV, casts) Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| input.each_record do |record| - if record.has_key? options[:key] - record[(options[:key].to_s + "_BIN").to_sym] = (record[options[:key]].to_i / options[:bin_size]) * options[:bin_size] + if record.has_key? options[:key].to_sym + record[(options[:key] + "_BIN").to_sym] = (record[options[:key].to_sym].to_i / options[:bin_size]) * options[:bin_size] end output.puts record diff --git a/bp_bin/plot_distribution b/bp_bin/plot_distribution index d2d4d70..02f802e 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] -- 2.39.5