def revcmp(seq):
    """Given a sequence return its reverse complement sequence."""
    NTMAP = {'a': 't', 'c': 'g', 't': 'a', 'g': 'c',
             'A': 'T', 'C': 'G', 'T': 'A', 'G': 'C'}
    return "".join([NTMAP[x] for x in seq])[::-1]