Skip to content

Instantly share code, notes, and snippets.

@coleoguy
Created August 24, 2013 19:55
Show Gist options
  • Save coleoguy/6330113 to your computer and use it in GitHub Desktop.
Save coleoguy/6330113 to your computer and use it in GitHub Desktop.
foo <- unlist(strsplit(as.character(read.table("rosalind_revc.txt")[[1]]),""))
DNA <- c("A", "C", "G", "T")
rcDNA <- c("T", "G", "C", "A")
foo2 <- vector(length = length(foo))
for(i in 1:4){
foo2[grep(DNA[i], unlist(foo))] <- rcDNA[i]
}
paste(foo2[length(foo2):1], collapse = "", sep = "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment