Search for k-mer words in sequences using a reference sequence