]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/analyze_assembly
refactoring of assemble_pairs
[biopieces.git] / bp_bin / analyze_assembly
index 7fe7bd69dee9d09b1347cd66ebda462a81d9e448..614a9e54d8e85bc00e84e2a6deab96049c0ddb5d 100755 (executable)
@@ -50,16 +50,18 @@ tmpdir  = Biopieces.mktmpdir
 infile  = File.join(tmpdir, "in.fna")
 outfile = File.join(tmpdir, "out.prodigal")
 
-Fasta.open(infile, mode="w") do |fasta_output|
+Fasta.open(infile, "w") do |fasta_output|
   Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
     input.each_record do |record|
-      if record.has_key? :SEQ
+      if record[:SEQ]
+        seq = Seq.new_bp(record)
+
         total   += record[:SEQ].length
         lengths << record[:SEQ].length
       end
 
       output.puts record unless options[:no_stream]
-      fasta_output.puts record
+      fasta_output.puts seq.to_fasta
     end
   end
 end