# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-require 'amatch'
require 'digest'
require 'patternmatcher'
class SeqError < StandardError; end
class Seq
- include Amatch
include PatternMatcher
attr_accessor :seq_name, :seq, :type, :qual
len = self.length - pos
subseq = self.seq[pos ... pos + len].upcase
subadaptor = adaptor[0 ... len].upcase
- m = Hamming.new(subseq)
- hamming_dist = m.match(subadaptor)
hamming_max = (len * hd_percent * 0.01).round
return pos if hamming_dist <= hamming_max
len = pos
subseq = self.seq[0 ... len].upcase
subadaptor = adaptor[adaptor.length - len ... adaptor.length].upcase
- m = Hamming.new(subseq)
- hamming_dist = m.match(subadaptor)
hamming_max = (len * hd_percent * 0.01).round
pos -= 1