]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_fasta
removed debug message
[biopieces.git] / bp_bin / read_fasta
index b267d3006f127e04dd7ee99f5b9b14265f8307eb..e6494405f4ae7ebd844cebdebf67e495b036acfc 100755 (executable)
@@ -38,21 +38,23 @@ casts << {:long=>'num',     :short=>'n', :type=>'uint',   :mandatory=>false, :de
 options = Biopieces.options_parse(ARGV, casts)
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
-  input.each_record do |record|
-    output.puts record
+  unless options[:data_in] and options[:data_in].first == '-'
+    input.each_record do |record|
+      output.puts record
+    end
   end
 
   num  = 0
   last = false
 
-  if options.has_key? :data_in
+  if options[:data_in]
     options[:data_in].each do |file|
-      Fasta.open(file, mode='r') do |fasta|
+      Fasta.open(file, 'r') do |fasta|
         fasta.each do |entry|
           output.puts entry.to_bp
           num += 1
 
-          if options.has_key? :num and options[:num] == num
+          if options[:num] and options[:num] == num
             last = true
             break
           end