Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
input.each_record do |record|
if record.has_key? :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
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
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|
- fasta_io.puts record
+ if record[:SEQ_NAME] and record[:SEQ]
+ seq = Seq.new_bp(record)
+
+ fasta_io.puts seq.to_fasta
+ end
end
end
file_fasta = File.join(options[:directory], "sequence_in.fna")
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|
- fasta_io.puts record
- end
+ Fasta.open(file_fasta, mode="w") do |fasta_io|
+ input.each_record do |record|
+ if record[:SEQ_NAME] and record[:SEQ]
+ seq = Seq.new_bp(record)
+ fasta_io.puts seq.to_fasta
+ end
+ end
end
unless File.size(file_fasta) == 0