]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/blast_seq_pair
refactoring of ruby code s/has_key?/[]/
[biopieces.git] / bp_bin / blast_seq_pair
index 18b2b5bd404a6fab75f3cf638463a6e08e32f84d..1963eafc4b128d94579d6d02e86cddf14964962c 100755 (executable)
@@ -164,10 +164,12 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
   input.each_record do |record|
     output.puts record
 
-    if record.has_key? :SEQ_NAME and record.has_key? :SEQ
+    if record[:SEQ_NAME] and record[:SEQ]
+      seq = Seq.new_bp(record)
+
       unless got1
         Fasta.open(infile1, mode="w") do |fasta_io|
-          fasta_io.puts record
+          fasta_io.puts seq.to_fasta
         end
 
         got1  = true
@@ -177,7 +179,7 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
 
       unless got2
         Fasta.open(infile2, mode="w") do |fasta_io|
-          fasta_io.puts record
+          fasta_io.puts seq.to_fasta
         end
 
         got2  = true