This function extends translate
function to include letters that are frequently found in the DNA sequence
databases to indicate missing information and are not part of the
DNA/RNA alphabet. Also, it is able to process sequences as just simple
'character' objects.
Usage
translation(x, ...)
# S4 method for class 'character'
translation(
x,
genetic.code = getGeneticCode("1"),
no.init.codon = FALSE,
if.fuzzy.codon = "error"
)
# S4 method for class 'BioString'
translation(
x,
genetic.code = getGeneticCode("1"),
no.init.codon = FALSE,
if.fuzzy.codon = "error"
)Value
If argument x is a character string, a character string
or vector with the translated amino acid sequence(s) is returned.
Otherwise, the object type returned by
translate is returned, typically an
AAStringSet object.
Details
If argument 'x' belongs to any of the classes admitted by function
translate, then this function is called to make
the translation.
Author
Robersy Sanchez https://genomaths.com
Examples
## Load a small DNA sequence alignment
data("aln", package = "GenomAutomorphism")
translation(aln)
#> AAStringSet object of length 2:
#> width seq
#> [1] 17 TYVGI-ALQLLGSSSLH
#> [2] 17 IYVGITTLQFLGS--LL
## Load a pairwise DNA sequence alignment of COVID-19 genomes
data("covid_aln", package = "GenomAutomorphism")
translation(covid_aln)
#> AAStringSet object of length 2:
#> width seq names
#> [1] 9722 MESLVLGVNEKTHVQLSLPVLQV...MDDFSRQLQNSMSGASADSTQA* lcl|AY390556.1_cd...
#> [2] 9722 MESLVLGVNEKTHVQLSLPVLQV...MDDFSRQLQNSMSGASADSTQA* lcl|KY417151.1_cd...
