Algorithm 3.
Input: pair of k-mers a, b |
Output: set of stems (patterns with wildcards) shared by a and b |
if if d(a, b) ≤ mthen |
Set stem = a |
Set i = 0 … d positions in the mismatch region of the stem as in b |
Place j1 = 0 … d − i wildcards inside the mismatch region |
Place j2 = 0 … m − max(d − i, j1 + i) wildcards outside the mismatch region |
end if |
ifd(a, b) >mthen |
Set stem = a |
Fix i = d − m … m positions in the mismatch region of the current stem as in b |
Place j = 0 … m − i wild-cards in the remaining d − i positions in the mismatch region |
end if |
Output resulting stems (patterns with wildcards) |