reverse_compliment <- function(sequence) { return(chartr("ATGC", "TACG", rev(strsplit(sequence, NULL)[[1]]))) }