X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fshuffle_records;h=ae62a3108df6cf913cf116ac5598d6b2787598cc;hb=af282a65d141826c15944437b07a0353dd14e79c;hp=b13222956b797c5fd04ed5605cc1ff7e34ab3edf;hpb=2890cdbad8c45c33305d767fb061a36e9e431fd7;p=biopieces.git diff --git a/bp_bin/shuffle_records b/bp_bin/shuffle_records index b132229..ae62a31 100755 --- a/bp_bin/shuffle_records +++ b/bp_bin/shuffle_records @@ -29,22 +29,20 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -require 'biopieces' +require 'maasha/biopieces' -casts = [] - -bp = Biopieces.new - -options = bp.parse(ARGV, casts) +options = Biopieces.options_parse(ARGV) records = [] -bp.each_record do |record| - records << record -end +Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| + input.each_record do |record| + records << record + end -records.shuffle.each do |record| - bp.puts record + records.shuffle.each do |record| + output.puts record + end end