Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
Fasta.open(file_fasta, mode="w") do |fasta_io|
input.each_record do |record|
- if options[:scaffold] # we need to fix the sequence name for mate-pair IDBA
- if record[:SEQ_NAME] =~ /1$/
- record[:SEQ_NAME] = "read#{count}/1"
- else
- record[:SEQ_NAME] = "read#{count}/2"
+ if record[:SEQ_NAME] and record[:SEQ]
+ seq = Seq.new_bp(record)
- count += 1
+ if options[:scaffold] # we need to fix the sequence name for mate-pair IDBA
+ if seq.seq_name =~ /1$/
+ seq.seq_name = "read#{count}/1"
+ else
+ seq.seq_name = "read#{count}/2"
+
+ count += 1
+ end
end
- end
- fasta_io.puts record
+ fasta_io.puts seq.to_fasta
+ end
end
end