def revcomp(seq):
    """
    return reverse complement of a string
    """ 
    newseq = ""
    comp = {'A':'T',
            'T':'A',
            'G':'C',
            'C':'G',
            'a':'t',
            't':'a',
            'c':'g',
            'g':'c'}
    for i in range(0,len(seq)):
       try:
           newseq = comp[seq[i]] + newseq
       except KeyError:
           newseq = seq[i] + newseq

    return newseq