# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
require 'inline'
+require 'maasha/math_aux'
# Class for describing a match between two sequences q and s.
class Match
self
end
+ def redundant?(matches)
+ # Speed-up with binary search
+
+ matches.each do |m|
+ if Math.dist_point2line(self.q_beg, self.s_beg, m.q_beg, m.s_beg, m.q_end, m.s_end) == 0
+ return true
+ end
+ end
+
+ false
+ end
+
def to_s(seq = nil)
s = "q: #{@q_beg}, s: #{@s_beg}, l: #{@length}, s: #{@score}"
s << " #{seq[@q_beg .. q_end]}" if seq