X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fswapcase_seq;h=b1fafa2ccd74cafe9783c3c9008b141426331296;hb=af282a65d141826c15944437b07a0353dd14e79c;hp=cb1989cf9d1f10c4f0c6eef9c9048bea2062b707;hpb=4cf3dcf93cf69e4b3e29d59ed7dd81ee74f5e6cf;p=biopieces.git diff --git a/bp_bin/swapcase_seq b/bp_bin/swapcase_seq index cb1989c..b1fafa2 100755 --- a/bp_bin/swapcase_seq +++ b/bp_bin/swapcase_seq @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# Copyright (C) 2007-2010 Martin A. Hansen. +# Copyright (C) 2007-2011 Martin A. Hansen. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -24,22 +24,20 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -# Swap lowercase sequence to uppercase and visa versa for all sequences in the stream. +# Swap lower case sequence to uppercase and visa versa for all sequences in the stream. # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -require 'biopieces' +require 'maasha/biopieces' -casts = [] +options = Biopieces.options_parse(ARGV) -bp = Biopieces.new - -options = bp.parse(ARGV, casts) - -bp.each_record do |record| - record[:SEQ].swapcase! 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].swapcase! if record[:SEQ] + output.puts record + end end