"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
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