]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/analyze_assembly
refactoring of ruby code s/has_key?/[]/
[biopieces.git] / bp_bin / analyze_assembly
index 7fe7bd69dee9d09b1347cd66ebda462a81d9e448..a9a6d12960fa9d743f784451a7a61d3749be4406 100755 (executable)
@@ -53,13 +53,15 @@ outfile = File.join(tmpdir, "out.prodigal")
 Fasta.open(infile, mode="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