July 29, 2015, 1:03 a.m. by Rosalind Team
We now extend “Find the Most Frequent Words with Mismatches in a String” to find frequent words with both mismatches and reverse complements. Recall that Pattern refers to the reverse complement of Pattern.
Find the most frequent k-mers (with mismatches and reverse complements) in a DNA string.
Given: A DNA string Text as well as integers k and d.
Return: All k-mers Pattern maximizing the sum Countd(Text, Pattern) + Countd(Text, Pattern) over all possible k-mers.
ACGTTGCATGTCGCATGATGCATGAGAGCT 4 1
ATGT ACAT
Note
As in “Find the Most Frequent Words with Mismatches in a String”, it is not necessary for Pattern to appear in Text in order to to solve the Frequent Words with Mismatches and Reverse Complements Problem for Text.