Entering edit mode
4.1 years ago
kareemmoussa
•
0
Hello, While doing my assignment (DNA TO RNA USING USER DEFINED FUNCTION) i ran the following script
DNA <- "ACCTGTCATCATCCC"
DNA_to_RNA.R <- function(DNA){
RNA <- gsub("T", "U", DNA)
Basecheck <- substring(RNA, seq(1, nchar(RNA), by = 1))
return(RNAsequence)
}
My question is can i replace gsub with user defined function that converts dna to rna Thanks
Is this the same assignment as here? script in R to convert DNA to RNA sequence
Also, why are you splitting the converted string by base?
gsub
already did the job. Still, the variable you are returning does not exist in your function. Why user-defined?gsub
is already as lowlevel as it gets. Do not start with something like looping over every base, this is terribly inefficient.