Skip to contents

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 the DNA/RNA alphabet. Also, it is able to process sequences as just simple 'character' objects.

Usage

translation(x, ...)

# S4 method for character
translation(
  x,
  genetic.code = getGeneticCode("1"),
  no.init.codon = FALSE,
  if.fuzzy.codon = "error"
)

# S4 method for BioString
translation(
  x,
  genetic.code = getGeneticCode("1"),
  no.init.codon = FALSE,
  if.fuzzy.codon = "error"
)

Arguments

x

A character string or the same arguments given to function translate.

...

Not in use yet.

genetic.code

The same as in translate

no.init.codon, if.fuzzy.codon

Used only if 'x' is not a 'character' object. The same as in translate.

Value

The translated amino acid sequence.

Details

If argument 'x' belong to any of the classes admitted by function translate, then this function is called to make the translation.

See also

Author

Robersy Sanchez https://genomaths.com

Examples

## Load a small DNA sequence alingment 
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 alingment 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...