def forward2reverse(dna):
    """Converts an oligonucleotide(k-mer) to its reverse complement sequence.
    All ambiguous bases are treated as Ns.
    """
    translation_dict = {"A": "T", "T": "A", "C": "G", "G": "C", "N": "N",
                        "K": "N", "M": "N", "R": "N", "Y": "N", "S": "N",
                        "W": "N", "B": "N", "V": "N", "H": "N", "D": "N",
                        "X": "N"}
    letters = list(dna)
    letters = [translation_dict[base] for base in letters]
    return ''.join(letters)[::-1]