Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 838 Bytes

readme.md

File metadata and controls

47 lines (31 loc) · 838 Bytes

DNA

A minimalistic sequence file parser.

Austin G. Davis-Richardson

Supported Formats:

Request a format

Installation

With Ruby 1.9.2 or better:

gem install dna

Usage

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