- if forward = seq.patscan(options[:forward].to_s, pos, options[:mismatches], options[:insertions], options[:deletions])
- record[:FORWARD_POS] = forward.last.pos
- record[:FORWARD_LEN] = forward.last.length
- pos = forward.last.pos + forward.last.length
- seq.subseq!(pos)
+ seq.patscan(options[:forward].to_s, 0, options[:mismatches], options[:insertions], options[:deletions]) do |match|
+ record[:FORWARD_POS] = match.pos
+ record[:FORWARD_LEN] = match.length
+ pos = match.pos + match.length
+ len = seq.length - pos
+ seq.subseq!(pos, len) if len > 0
+ forward = true
+ break