]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/length_seq
fixed pair end issue
[biopieces.git] / bp_bin / length_seq
index 0152ef497846afe930c11f4c7a32aeb44aa41efe..e9f87269e0a5d944e31a7e3296bfd02af36ef896 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.has_key? :SEQ
+    output.puts record
+  end
 end