]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/align/match.rb
clearnup of pair align code
[biopieces.git] / code_ruby / lib / maasha / align / match.rb
index b137711641ba5f9ed8a8fbfaf3fc7ec648cde057..721bf137f6e90bd726a5e8e52f4f49ac9cc39c98 100644 (file)
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
-# Class containing methods for located all Maximally Extended Matches (MEMs) between
-# two strings.
+require 'profile'
+
+# Class containing methods for located all non-redundant Maximally Extended Matches (MEMs)
+# between two strings.
 class Matches
-  # Class method to located all MEMs bewteen two sequences within a given search
-  # space and seed with kmers of a given size.
+  # Class method to located all non-redudant MEMs bewteen two sequences within a given
+  # search space and seeded with kmers of a given size.
   def self.find(q_seq, s_seq, q_min, s_min, q_max, s_max, kmer)
     m = self.new
     m.matches_find(q_seq, s_seq, q_min, s_min, q_max, s_max, kmer)
@@ -47,6 +49,7 @@ class Matches
 
       s_index[q_oligo].each do |s_pos|
         match = Match.new(q_pos, s_pos, kmer)
+        
         unless match_redundant?(redundant, match)
           match_expand(match, q_seq, s_seq, q_min, s_min, q_max, s_max)
           matches << match
@@ -82,7 +85,7 @@ class Matches
   # Method to check if a match is redundant.
   def match_redundant?(redundant, match)
     redundant[match.q_beg].each do |s_interval|
-      if s_interval.include? match.s_beg and s_interval.include? match.s_end
+      if s_interval.include? match.s_beg and s_interval.include? match.s_end   # TODO test if include? is slow
         return true
       end
     end