def program_choose(type1, type2)
program = ""
- if type1 == 'protein'
- if type2 == 'protein'
+ if type1 == :protein
+ if type2 == :protein
program = 'blastp'
else
program = 'tblastn'
end
else
- if type2 == 'protein'
+ if type2 == :protein
program = 'blastx'
else
program = 'blastn'
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
type1 = Seq.new(nil, record[:SEQ][0 ... 100]).type_guess
+ next
end
unless got2
Fasta.open(infile2, mode="w") do |fasta_io|
- fasta_io.puts record
+ fasta_io.puts seq.to_fasta
end
got2 = true