]> git.donarmstrong.com Git - biopieces.git/commitdiff
got rid of nasty to_sym in biopieces.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 22 Nov 2011 15:24:41 +0000 (15:24 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 22 Nov 2011 15:24:41 +0000 (15:24 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1677 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/bin_vals
bp_bin/plot_distribution

index db9e3b487439d8d5a33774ecc6f4578a19492b25..e5e73c7b4c1e5ecef4831543886b0c95825c1e5f 100755 (executable)
@@ -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
index d2d4d70f387d38e972d61497678652abb5b79ded..02f802ee611ea1146c88a7de878705358f982f10 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]