#example of default behaviour
urndna <- c("a","c","g","t")
seq <- sample( urndna, 100, replace = TRUE ) ; seq
s2n(seq)
#How to deal with RNA
urnrna <- c("a","c","g","t")
seq <- sample( urnrna, 100, replace = TRUE ) ; seq
s2n(seq)
#what's happen with unknown characters
urnmess <- c(urndna,"n")
seq <- sample( urnmess, 100, replace = TRUE ) ; seq
s2n(seq)
#How to change the encoding for unknown characters
tmp <- s2n(seq) ; tmp[is.na(tmp)] <- -1; tmp
Run the code above in your browser using DataLab