]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/trim_seq
refactoring of ruby code s/has_key?/[]/
[biopieces.git] / bp_bin / trim_seq
index eab60c0b56b7b44e57e626bb460819fb54e8d90f..7afec9c7051bc763cd7b6dc211baf74517624564 100755 (executable)
@@ -41,7 +41,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 and record.has_key? :SCORES
+    if record[:SEQ] and record[:SCORES]
       entry = Seq.new_bp(record)
 
       case options[:trim]
@@ -51,11 +51,9 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
       end
 
       record.merge! entry.to_bp
-
-      output.puts record if entry.length > 0
-    else
-      output.puts record
     end
+
+    output.puts record
   end
 end