]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/read_fastq
changed layout of ruby source
[biopieces.git] / bp_bin / read_fastq
index cb114ff0a707dd8d6873feb79f07dcf415110e1f..063edd6ce2883bbe5b46f286c59175c71cf55456 100755 (executable)
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
-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:]')
 
@@ -52,7 +53,8 @@ if options.has_key? :data_in
   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