Convert DNA to 3-base codons
dna2codon(x, ...)
x | character vector assumed to contain DNA or RNA nucleotides |
---|---|
... | additional arguments are ignored. |
character vector where each element contains three characters,
e.g. all(nchar(dna2codon(x)) == 3)
.
This function takes character string input, either as one large string or vector of strings such as those read from a FASTA file, and returns a vector of 3-base codons. The final codon must contain all three character values otherwise it is removed.
Other jam codon usage functions:
codonUsage2df()
,
jamCai()
#> 1 2 3 4 #> "atg" "gga" "tta" "tag"# example adding one extra base, which does not make a full codon dnaext1 <- c("atgggattataga"); dna2codon(dnaext1);#> Warning: data length [13] is not a sub-multiple or multiple of the number of rows [5]#> 1 2 3 4 #> "atg" "gga" "tta" "tag"