A Ruby gem to handle FASTQ files
Switch branches/tags
Nothing to show
Pull request Compare This branch is 11 commits ahead, 5 commits behind dariogf:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
script
test
History.txt
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile

README.rdoc

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

SYNOPSIS:

Reading a FASTQ with iterator:

require 'scbi_fastq'

# open file in sanger mode
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'

# open file in sanger mode
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'

# open new file
f=FastqFile.new('file.fastq','w')

# prepare sample data
name = 'seq1'
seq_fasta= 'acgtacgtacact'
seq_qual= [40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40]

# write sequence to disk  
f.write_seq(name,seq_fasta,seq_qual,'comments')

# close file
f.close

REQUIREMENTS:

  • This is a standalone gem.

INSTALL:

  • gem install scbi_fastq

LICENSE:

(The MIT License)

Copyright © 2010 Dario Guerrero

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.