def rc_str(dna):
    """Reverse complement a string
    """
    complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A', 'N': 'N'}
    ks = list(complement.keys())
    for k in ks:
        complement[k.lower()] = complement[k].lower()
    return ''.join([complement[base] for base in dna[::-1]])