Learn R Programming

seqinr (version 4.2-36)

aaa: Converts amino-acid one-letter code into the three-letter one

Description

This is a vectorized function to convert one-letter amino-acid code into the three-letter one, for instance "A" into "Ala".

Usage

aaa(aa)

Value

A vector of char string. All strings are 3 chars long.

Arguments

aa

A vector of single characters.

Author

J.R. Lobry

Details

Allowed character values for aa are given by a(). All other values will generate a warning and return NA. Called without arguments, aaa() returns the list of all possible output values.

References

The IUPAC one-letter code for aminoacids is described at: https://www.bioinformatics.org/sms/iupac.html citation("seqinr")

See Also

a, translate

Examples

Run this code
  #
  # Show all possible input values:
  #
  
  a()
  
  #
  # Convert them in one letter-code:
  #
  
  aaa(a())
  
  #
  # Check consistency of results:
  #
  
  stopifnot(a(aaa(a())) == a())
  
  #
  # Show what happens with non-allowed values:
  #
  
  aaa("Z") # should be NA and a warning is generated

Run the code above in your browser using DataLab