X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Ftrim_seq;h=c89eefb6d6ef95c18c0f89279a6370956e7d3874;hb=9ff3f4f82dedb5ccaa924fe311486bad3ed1248d;hp=7afec9c7051bc763cd7b6dc211baf74517624564;hpb=5a9b7c80e4e4428e404575ed3c0290cde15a7402;p=biopieces.git diff --git a/bp_bin/trim_seq b/bp_bin/trim_seq index 7afec9c..c89eefb 100755 --- a/bp_bin/trim_seq +++ b/bp_bin/trim_seq @@ -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