A minimalistic sequence file parser.
Austin G. Davis-Richardson
Supported Formats:
With Ruby 1.9.2 or better:
gem install dna
require 'dna'
File.open('sequences.fasta') do |handle|
records = Dna.new handle, format: 'fastq'
records.each do |record|
puts record.length
end
end
File.open('sequences.fastq') do |handle|
records = Dna.new handle, format: 'fastq'
records.each do |record|
puts record.quality
end
end
File.open('sequences.qseq') do |handle|
records = Dna.new handle, format: 'qseq'
puts records.first.inspect
end