Last active
October 1, 2021 09:23
-
-
Save nalaekaw/7c93660c115d3673ea0e0a2b9dcdb461 to your computer and use it in GitHub Desktop.
R function to sumulate DNA sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sim.nucls <- function(len=100){ | |
# creates fake nucleotides | |
if(is.numeric(len)){ | |
nucls <- c('A','C','G','T') | |
return(paste(sample(nucls,len,TRUE),collapse="")) | |
}else{ | |
print("ERROR: wrong type of input") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment