]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/write_fasta_files
beautifying fasta.rb
[biopieces.git] / bp_bin / write_fasta_files
index da4a1c6d347cb22210c1d504327429a7813791fb..debea31cb5c073f3ed6cbbacdb22a3096c7cd201 100755 (executable)
@@ -46,6 +46,8 @@ fh_hash = {}
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
     if record[:SEQ_NAME] and record[:SEQ] and record[key]
+      seq = Seq.new_bp(record)
+
       if fh_hash.has_key? record[key].to_sym
         fasta_io = fh_hash[record[key].to_sym]
       else
@@ -54,7 +56,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
         fh_hash[record[key].to_sym] = fasta_io
       end
 
-      fasta_io.puts record
+      fasta_io.puts seq.to_fasta
     end
 
     output.puts record unless options[:no_stream]