]> git.donarmstrong.com Git - biopieces.git/commitdiff
minor changes
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 7 Jul 2009 20:24:39 +0000 (20:24 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 7 Jul 2009 20:24:39 +0000 (20:24 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@556 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/read_tab
bp_bin/swapcase_seq
code_perl/Maasha/Biopieces.pm

index 6517c0c0df48e5c4d1fefc47fcbe8ba923a9ef91..e7a443b14f9c9d9a72410a86ea380d3fd7688b45 100755 (executable)
@@ -28,7 +28,6 @@
 
 use strict;
 use Maasha::Filesys;
-use Maasha::Fasta;
 use Maasha::Biopieces;
 
 
@@ -70,7 +69,7 @@ if ( $options->{ 'data_in' } )
             next;
         }
 
-        next if $line =~ /^#|^$/;
+        next if $line =~ /^#|^$/;  # skip comment lines beginning with # and skip empty lines.
 
         chomp $line;
 
index 06f6089a4d827fa83d274e93fbb22e2a882209f7..62a69796b04e50b53ab529fd951e7db976d21758 100755 (executable)
@@ -1,37 +1,40 @@
 #!/usr/bin/env ruby
 
-require 'Maasha/biopieces'
-require 'getoptlong'
+require 'optparse'
+require 'pp'
 
-options = GetoptLong.new(
-    [ '--help',       '-?', GetoptLong::NO_ARGUMENT ],
-    [ '--stream_in',  '-I', GetoptLong::REQUIRED_ARGUMENT ],
-    [ '--stream_out', '-O', GetoptLong::REQUIRED_ARGUMENT ],
-    [ '--verbose',    '-v', GetoptLong::NO_ARGUMENT ]
-)
+options = {}
 
-if ARGV.length == 0 then
-    biopiece = $0.split( "/" ).last
-    exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki"
-end
+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
+
+       opts.on( '-v', '--verbose' ) do
+               options[ :verbose ] = true
+       end
+
+       opts.on( '-I', '--stream_in FILE', Time ) do |arg|
+               options[:stream_in] = arg
+       end
 
-options.each do | opt, arg |
-    puts "option: #{ opt }   argument: #{ arg }"
-
-    case opt
-        when '--help'
-            biopiece = $0.split( "/" ).last
-            exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help"
-        when '--stream_in'
-            puts "Stream in"
-            stream = File.open( arg )
-        when '--stream_out'
-            puts "Stream out"
-        when '--verbose'
-            puts "blababnlbalbalbalbalab"
-    end
+#      opts.on( '-I', '--stream_in FILE', "Mandatory argument" ) do |arg|
+#              options[:stream_in] = arg
+#      end
+
+       opts.on( '-O', '--stream_in FILE', "Mandatory argument" ) do |arg|
+               options[:stream_out] = arg
+       end
 end
 
-bp_stream = BioPieces.new( "test.stream" )
+optparse.parse!
+
+pp "Options:", options
+pp "ARGV:", ARGV
 
-puts bp_stream.record_get
+if ARGV.length == 0 then
+       biopiece = $0.split( "/" ).last
+       exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki"
+end
index 867f71b011aaf90326ed38ace14927007623d933..61dfdf27e5a29ccc45eadeed1349ec664b3f9236 100644 (file)
@@ -306,7 +306,6 @@ sub parse_options
     # ---- Adding the mandatory arguments to the arg_list ----
 
     push @{ $arg_list }, (
-    
         { long => 'help',       short => '?', type => 'flag',  mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
         { long => 'stream_in',  short => 'I', type => 'file!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
         { long => 'stream_out', short => 'O', type => 'file',  mandatory => 'no', default => undef, allowed => undef, disallowed => undef },