seqinr (version 1.0-1)

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. Character values are *ACDEFGHIKLMNPQRSTVWY.

Details

Allowed character values for aa are: Stp, Ala, Cys, Asp, Glu, Phe, Gly, His, Ile, Lys, Leu, Met, Asn, Pro, Gln, Arg, Ser, Thr, Val, Trp, Tyr. All other values will generate a warning and return NA.

References

The IUPAC one-letter code for aminoacids is described at: http://www.chem.qmul.ac.uk/iupac/AminoAcid/ To have an overview of the seqinR's functionnality, please consult this vignette: Charif, D., Lobry, J.R. (2005) SeqinR: a contributed package to the R project for statistical computing devoted to biological sequences retrieval and analysis. Springer Verlag, Biological and Medical Physics/Biomedical Series, in preparation.

See Also

translate, aaa

Examples

Run this code
# show all allowed values
  allowed <- c("Stp", "Ala", "Cys", "Asp", "Glu", "Phe", "Gly", "His", "Ile",
           "Lys", "Leu", "Met", "Asn", "Pro", "Gln", "Arg", "Ser", "Thr",
           "Val", "Trp", "Tyr")
  a(allowed)
  # show what's happen with non-allowed values
  a("SOS") # should be NA and a warning is generated

Run the code above in your browser using DataLab