= scbi_fastq
== DESCRIPTION:
scbi_fastq is a ruby gem to read/write FASTQ files (DNA/RNA sequences) with qualities in a variety of formats (Sanger, Solexa, Ilumina).
== FEATURES/PROBLEMS:
- Read FASTQ files in Sanger Solexa and Ilumina, making the appropriate quality values conversions
- Quality values can be automatically splitted
- Write FASTQ files in Sanger format
- Iteration over large files without extra memory usage
- Can read gzip files directly
== SYNOPSIS:
=== Reading a compressed FASTQ in gzip with iterator:
require 'scbi_fastq'
fqr=FastqFile.new('file1.fastq.gz')
fqr.each do |name,seq_fasta,qual,comments|
puts name
puts seq_fasta
puts qual
puts comments
end
fqr.close
=== Reading a FASTQ with iterator:
require 'scbi_fastq'
fqr=FastqFile.new('file1.fastq')
fqr.each do |name,seq_fasta,qual,comments|
puts name
puts seq_fasta
puts qual
puts comments
end
fqr.close
=== Reading a FASTQ one sequence at a time:
require 'scbi_fastq'
fqr=FastqFile.new('file1.fastq')
begin
# read one sequence
name,seq_fasta,qual,comments=fqr.next_seq
# name will be nil if there are not more sequences available
if !name.nil?
puts name
puts seq_fasta
puts qual
puts comments
end
end until name.nil?
fqr.close
=== Writing a FASTQ:
require 'scbi_fastq'
f=FastqFile.new('file.fastq','w')
name = 'seq1' seq_fasta= 'acgtacgtacact' seq_qual= [40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40]
f.write_seq(name,seq_fasta,seq_qual,'comments')
f.close
== REQUIREMENTS:
- This is a standalone gem.
== INSTALL:
- gem install scbi_fastq
- Fork it ( https://github.com/[my-github-username]/scbi_fastq/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request