| n2s {seqinr} | R Documentation |
By default, if no `levels' arguments is provided, this function
will just transform your vector of integer into a DNA sequence
according to the lexical order: 0 -> "a", 1 -> "c", 2 -> "g",
3 -> "t", others -> NA.
n2s(nseq, levels = c("a", "c", "g", "t"), base4 = TRUE)
nseq |
A vector of integers |
levels |
the translation vector |
base4 |
when this logical is true, the numerical encoding of
levels starts at 0, when it is false the numerical encoding of
levels starts at 1. |
a vector of characters
J.R. Lobry
To have an overview of the seqinR's functionnality, please consult this vignette:
Charif, D., Lobry, J.R. (2005) SeqinR: a contributed package to the R project for statistical
computing devoted to biological sequences retrieval and analysis. Springer Verlag, Biological and Medical Physics/Biomedical Series, in preparation.
##example of the default behaviour:
nseq <- sample(x = 0:3, size = 100, replace = TRUE)
n2s(nseq)
# Show what's happen with out-of-range and NA values:
nseq[1] <- NA
nseq[2] <- 777
n2s(nseq)[1:10]
# How to get an RNA instead:
n2s(nseq, levels = c("a", "c", "g", "u"))