]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/align/match.rb
worked on pair aligner
[biopieces.git] / code_ruby / lib / maasha / align / match.rb
index e4d5fe06627c5346b5fbc6a982ab4b98461e6bf1..c17ec7f62076706e92697184a7f01241130d270e 100644 (file)
@@ -60,7 +60,7 @@ class Matches
   # Method that indexes a sequence within a given interval such that the
   # index contains all oligos of a given kmer size and the positions where
   # this oligo was located.
-  def index_seq(seq, min, max, kmer)
+  def index_seq(seq, min, max, kmer, step = 1)
     index_hash = Hash.new { |h, k| h[k] = [] }
 
     pos = min
@@ -69,7 +69,7 @@ class Matches
       oligo = seq[pos ... pos + kmer]
       index_hash[oligo] << pos
 
-      pos += 1
+      pos += step
     end
 
     index_hash