]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/trim_seq
rewrite of FASTQ internals
[biopieces.git] / bp_bin / trim_seq
index 7afec9c7051bc763cd7b6dc211baf74517624564..c89eefb6d6ef95c18c0f89279a6370956e7d3874 100755 (executable)
@@ -39,15 +39,17 @@ casts << {:long=>'trim',     :short=>'t', :type=>'string', :mandatory=>true, :de
 
 options = Biopieces.options_parse(ARGV, casts)
 
+trim = options[:trim].to_sym
+
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
     if record[:SEQ] and record[:SCORES]
       entry = Seq.new_bp(record)
 
-      case options[:trim]
-      when /both/  then entry.quality_trim!(options[:min_qual], options[:min_len])
-      when /left/  then entry.quality_trim_left!(options[:min_qual], options[:min_len])
-      when /right/ then entry.quality_trim_right!(options[:min_qual], options[:min_len])
+      case trim
+      when :both  then entry.quality_trim!(options[:min_qual], options[:min_len])
+      when :left  then entry.quality_trim_left!(options[:min_qual], options[:min_len])
+      when :right then entry.quality_trim_right!(options[:min_qual], options[:min_len])
       end
 
       record.merge! entry.to_bp