#!/usr/bin/env ruby
-require 'optparse'
-require 'pp'
+# Copyright (C) 2007-2011 Martin A. Hansen.
-options = {}
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
-optparse = OptionParser.new do |opts|
- opts.on( '-?', '--help', 'Display this screen' ) do
- biopiece = $0.split( "/" ).last
- exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help"
- exit
- end
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
- opts.on( '-v', '--verbose' ) do
- options[ :verbose ] = true
- end
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- opts.on( '-I', '--stream_in FILE', Time ) do |arg|
- options[:stream_in] = arg
- end
+# http://www.gnu.org/copyleft/gpl.html
-# opts.on( '-I', '--stream_in FILE', "Mandatory argument" ) do |arg|
-# options[:stream_in] = arg
-# end
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+# This program is part of the Biopieces framework (www.biopieces.org).
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+# Swap lower case sequence to uppercase and visa versa for all sequences in the stream.
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- opts.on( '-O', '--stream_in FILE', "Mandatory argument" ) do |arg|
- options[:stream_out] = arg
- end
-end
-optparse.parse!
+require 'maasha/biopieces'
-pp "Options:", options
-pp "ARGV:", ARGV
+options = Biopieces.options_parse(ARGV)
-if ARGV.length == 0 then
- biopiece = $0.split( "/" ).last
- exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki"
+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
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+__END__