Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DNA reverse complement
import string
complement = string.maketrans('ACGTacgt','TGCATGCA')
def rcomp(s):
"""Returns the reverse complement of the sequence in s."""
return s.translate(complement)[::-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment