]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/clip_seq
refactoring of ruby code s/has_key?/[]/
[biopieces.git] / bp_bin / clip_seq
index 45a96c74cd094f1141b9c40443af27ea9a7e106a..44d1e508e1b007a0a8ae50b4ba67f37bc88bb20c 100755 (executable)
@@ -37,7 +37,7 @@ 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? :SEQ
+    if record[:SEQ]
       trim_beg = 0
       trim_end = record[:SEQ].length
 
@@ -53,7 +53,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
 
       record[:SEQ]     = record[:SEQ][trim_beg ... trim_end]
       record[:SEQ_LEN] = record[:SEQ].length
-      record[:SCORES]  = record[:SCORES][trim_beg ... trim_end] if record.has_key? :SCORES
+      record[:SCORES]  = record[:SCORES][trim_beg ... trim_end] if record[:SCORES]
     end
 
     output.puts record