X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fswapcase_seq;h=b1fafa2ccd74cafe9783c3c9008b141426331296;hb=48bea5c28b89dc5586d0bddb338ccd6ba23aa1f9;hp=9681ae2df1b1338e9c32038cf8e760303477f89f;hpb=58e380ec3d42d2534ecc51df877cf67e0c870417;p=biopieces.git diff --git a/bp_bin/swapcase_seq b/bp_bin/swapcase_seq index 9681ae2..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