]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/length_seq
refactoring of assemble_pairs
[biopieces.git] / bp_bin / length_seq
index e3e6b094484db2fbb3a83f9344a35194f8fae2b1..04384db3660c7762ccb1b99f9500d8a2e4bd3dc5 100755 (executable)
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-require 'biopieces'
+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