X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Flength_seq;h=04384db3660c7762ccb1b99f9500d8a2e4bd3dc5;hb=48bea5c28b89dc5586d0bddb338ccd6ba23aa1f9;hp=0152ef497846afe930c11f4c7a32aeb44aa41efe;hpb=494dc53ebd515b1e3e9b91bbebf43059899ca4ce;p=biopieces.git diff --git a/bp_bin/length_seq b/bp_bin/length_seq index 0152ef4..04384db 100755 --- a/bp_bin/length_seq +++ b/bp_bin/length_seq @@ -33,13 +33,13 @@ require 'maasha/biopieces' casts = [] -bp = Biopieces.new +options = Biopieces.options_parse(ARGV, casts) -options = bp.parse(ARGV, casts) - -bp.each_record do |record| - record[:SEQ_LEN] = record[:SEQ].length if record.has_key? :SEQ - bp.puts record +Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| + input.each_record do |record| + record[:SEQ_LEN] = record[:SEQ].length if record[:SEQ] + output.puts record + end end