]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/length_seq
refactoring of assemble_pairs
[biopieces.git] / bp_bin / length_seq
index 0152ef497846afe930c11f4c7a32aeb44aa41efe..04384db3660c7762ccb1b99f9500d8a2e4bd3dc5 100755 (executable)
@@ -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