Learn R Programming

bio3d (version 2.1-2)

aa123: Convert Between 1-letter and 3-letter Aminoacid Codes

Description

Convert between one-letter IUPAC aminoacid codes and three-letter PDB style aminoacid codes.

Usage

aa123(aa)
aa321(aa)

Arguments

aa
a character vector of individual aminoacid codes.

Value

  • A character vector of aminoacid codes.

Details

Standard conversions will map A to ALA, G to GLY, etc. Non-standard codes in aa will generate a warning and return UNK or X.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696. For a description of IUPAC one-letter codes see: http://www.chem.qmul.ac.uk/iupac/AminoAcid/ For a description of PDB residue codes see Appendix 4: http://msdlocal.ebi.ac.uk/docs/pdb_format/appendix.html

See Also

read.pdb, read.fasta

Examples

Run this code
# Simple conversion
aa123(c("D","L","A","G","S","H"))
aa321(c("ASP", "LEU", "ALA", "GLY", "SER", "HIS"))

# Extract sequence from PDB file's ATOM and SEQRES cards
pdb <- read.pdb( "http://www.rcsb.org/pdb/files/1BG2.pdb" ) 
s <- aa321(pdb$seqres)                   # SEQRES
a <- aa321(pdb$atom[pdb$calpha,"resid"]) # ATOM

# Write both sequences to fasta file
write.fasta(id=c("seqres","atom"), seqs=seqbind(s,a), file="eg2.fa")

Run the code above in your browser using DataLab