+ self.qual.match(/[K-h]/) ? true : false
+ end
+
+ # Method to determine if a quality score is valid.
+ def qual_valid?(encoding)
+ raise SeqError, "Missing qual" if self.qual.nil?
+
+ case encoding.downcase
+ 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
+
+ false