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.has_key? :SEQ and record.has_key? :SCORES
+ 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