]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/seq.rb
fixed SCORE_BASE global var
[biopieces.git] / code_ruby / lib / maasha / seq.rb
index f2d93d1fc5bbf86b6611e56e9eb9ce98d9185795..577d51a6b1d01aa96aae7170cda425638daaf21e 100644 (file)
@@ -67,15 +67,16 @@ TRANS_TAB11 = {
   "GTG" => "V", "GCG" => "A", "GAG" => "E", "GGG" => "G"
 }
 
-# Quality scores bases
-SCORE_BASE = 64
-SCORE_MIN  = 0
-SCORE_MAX  = 40
 
 # Error class for all exceptions to do with Seq.
 class SeqError < StandardError; end
 
 class Seq
+  # Quality scores bases
+  SCORE_BASE = 64
+  SCORE_MIN  = 0
+  SCORE_MAX  = 40
+
   include Digest
   include Trim
 
@@ -552,12 +553,12 @@ class Seq
     raise SeqError, "Missing qual" if self.qual.nil?
 
     case encoding.downcase
-    when "sanger"     then return true if self.qual.match(/^[!-I]*$/)
-    when "454"        then return true if self.qual.match(/^[@-h]*$/)
-    when "solexa"     then return true if self.qual.match(/^[;-h]*$/)
-    when "illumina13" then return true if self.qual.match(/^[@-h]*$/)
-    when "illumina15" then return true if self.qual.match(/^[@-h]*$/)
-    when "illumina18" then return true if self.qual.match(/^[!-J]*$/)
+    when "sanger"     then return true if self.qual.match(/^[!-~]*$/)
+    when "454"        then return true if self.qual.match(/^[@-~]*$/)
+    when "solexa"     then return true if self.qual.match(/^[;-~]*$/)
+    when "illumina13" then return true if self.qual.match(/^[@-~]*$/)
+    when "illumina15" then return true if self.qual.match(/^[@-~]*$/)
+    when "illumina18" then return true if self.qual.match(/^[!-~]*$/)
     else raise SeqError, "unknown quality score encoding: #{encoding}"
     end