# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-require 'biopieces'
-require 'fastq'
+require 'maasha/biopieces'
+require 'maasha/fastq'
casts = []
casts << {:long=>'data_in', :short=>'i', :type=>'files!', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
casts << {:long=>'num', :short=>'n', :type=>'uint', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>'0'}
+casts << {:long=>'solexa', :short=>'s', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
PHRED_SCORES = Regexp.new('[!"#$%&\'()*+,-./0123456789:]')
options[:data_in].each do |file|
Fastq.open(file, mode='r') do |fastq|
fastq.each do |entry|
- entry.convert! if entry.qual.match PHRED_SCORES
+ entry.convert_phred2illumina! if entry.qual.match PHRED_SCORES
+ entry.convert_solexa2illumina! if options[:solexa]
bp.puts entry.to_bp
num += 1