Skip to content

Instantly share code, notes, and snippets.

@nalaekaw
Last active October 1, 2021 09:23
Show Gist options
  • Save nalaekaw/7c93660c115d3673ea0e0a2b9dcdb461 to your computer and use it in GitHub Desktop.
Save nalaekaw/7c93660c115d3673ea0e0a2b9dcdb461 to your computer and use it in GitHub Desktop.
R function to sumulate DNA sequence
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