Learn R Programming

seqinr (version 3.4-5)

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

Description

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

Usage

a(aa)

Arguments

aa

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

Value

A vector of single characters.

Details

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

References

The IUPAC one-letter code for aminoacids is described at: http://www.chem.qmul.ac.uk/iupac/AminoAcid/ citation("seqinr")

See Also

aaa, translate

Examples

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

Run the code above in your browser using DataLab