invert_seq can be replaced with biopython. "http://biopython.org/wiki/Seq#Complement_and_reverse_complement"