You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This question asks to generate the reverse complement of a sequence using "gsub". Using "gsub" is quite dangerous in this question. A better solution is to use "match", despite this not being the point of the exercise:
sequence <- "ATTACGACGCGATTCCCGGTTAATCGAATTCCCA"
# Complement of each nucleotide
dna_code <- c("A","C","G","T")
complement_code <- c("T","G", "C","A")
# Complement of sequence
comp_seq <- complement_code[match(sequence, dna_code)]
# Reverse
rev_comp <- rev(rev_comp)
# paste together
rev_comp <- paste(rev_comp, collapse = "")
The text was updated successfully, but these errors were encountered:
On 2017-Jul-20, at 18:15, Rodrigo Pracana ***@***.***> wrote:
This question asks to generate the reverse complement of a sequence using "gsub". Using "gsub" is quite dangerous in this question. A better solution is to use "match", despite this not being the point of the exercise:
sequence <- "ATTACGACGCGATTCCCGGTTAATCGAATTCCCA"
# Complement of each nucleotide
dna_code <- c("A","C","G","T")
complement_code <- c("T","G", "C","A")
# Complement of sequence
comp_seq <- complement_code[match(sequence, dna_code)]
# Reverse
rev_comp <- rev(rev_comp)
# paste together
rev_comp <- paste(rev_comp, collapse = "")
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
This question asks to generate the reverse complement of a sequence using "gsub". Using "gsub" is quite dangerous in this question. A better solution is to use "match", despite this not being the point of the exercise:
The text was updated successfully, but these errors were encountered: