Skip to contents

Convert codon to amino acid using standard genetic code indicated in https://en.wikipedia.org/wiki/DNA_and_RNA_codon_tables.

Usage

codon2aa(data, display = FALSE, safer_check = TRUE)

Arguments

data

Single caracter string of three characters, or vector of three characters, indicating the DNA codon (only "A", "T", "G" and "C" allowed). Case insensitive. Omitted if display argument is TRUE.

display

Single logical value. Display the whole genetic table? if TRUE, override data.

safer_check

Single logical value. Perform some "safer" checks (see https://github.com/safer-r)? If TRUE, checkings are performed before main code running: 1) R classical operators (like "<-") not overwritten by another package because of the R scope and 2) required functions and related packages effectively present in local R lybraries. Set to FALSE if this fonction is used inside another "safer" function to avoid pointless multiple checkings.

Value

The 1 letter uppercase amino acid of the submitted codon or the whole table if display argument is TRUE.

See also

translate

Author

Gael Millot <gael.millot@pasteur.fr>

Yushi Han <yushi.han2000@gmail.com>

Haiding Wang <wanghaiding442@gmail.com>

Examples

codon2aa(data = "ATC", display = TRUE)
#> , , third = T
#> 
#>      second
#> first T   C   A   G  
#>     T "F" "S" "Y" "C"
#>     C "L" "P" "H" "R"
#>     A "I" "T" "N" "S"
#>     G "V" "A" "D" "G"
#> 
#> , , third = C
#> 
#>      second
#> first T   C   A   G  
#>     T "F" "S" "Y" "C"
#>     C "L" "P" "H" "R"
#>     A "I" "T" "N" "S"
#>     G "V" "A" "D" "G"
#> 
#> , , third = A
#> 
#>      second
#> first T   C   A      G     
#>     T "L" "S" "stop" "stop"
#>     C "L" "P" "Q"    "R"   
#>     A "I" "T" "K"    "R"   
#>     G "V" "A" "E"    "G"   
#> 
#> , , third = G
#> 
#>      second
#> first T   C   A      G  
#>     T "L" "S" "stop" "W"
#>     C "L" "P" "Q"    "R"
#>     A "M" "T" "K"    "R"
#>     G "V" "A" "E"    "G"
#>