This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DNA TO RNA USING USER DEFINED FUNCTION

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

r

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.

0 answers

No answers yet.

Log in to answer this question.