autoload :BackTrack, 'maasha/seq/backtrack'
autoload :Dynamic, 'maasha/seq/dynamic'
autoload :Homopolymer, 'maasha/seq/homopolymer'
+autoload :Hamming, 'maasha/seq/hamming'
autoload :Levenshtein, 'maasha/seq/levenshtein'
autoload :Ambiguity, 'maasha/seq/ambiguity'
@seq = seq
@type = type
@qual = qual
+
+ if @qual
+ raise SeqError, "Sequence length and score length mismatch: #{@seq.length} != #{@qual.length}" if @seq.length != @qual.length
+ end
end
# Method that guesses and returns the sequence type
# two Sequence objects (case insensitive).
def hamming_distance(entry, options = nil)
if options and options[:ambiguity]
- Ambiguity.hamming_distance(self.seq, entry.seq)
+ Hamming.distance(self.seq, entry.seq)
else
self.seq.upcase.hamming_distance(entry.seq.upcase)
end