Description Usage Arguments Value Examples
View source: R/as_three_letter.R
Converts amino acid one-letter abbreviations to three-letter codes, e.g., L to Leu. The accepted codes in the input include the 20 standard amino acids and also B (Asparagine or Aspartic acid), converted to Asx, and Z (Glutamine or Glutamic acid) converted to Glx.
1 |
x |
A character vector of one-letter amino acid codes, e.g. |
A character vector of three-letter amino acid codes, e.g. "Ser"
,
"Arg"
, "Leu"
, or "Pro"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Convert S to Ser, R to Arg and P to Pro.
as_three_letter(c('S', 'R', 'P'))
# The function `as_three_letter()` is case insensitive on the input but will
# always return the three-letter codes with the first letter in uppercase.
as_three_letter(c('S', 's', 'p', 'P'))
# Convert also special case codes B (Asparagine or Aspartic acid) and Z
# (Glutamine or Glutamic acid)
as_three_letter(c('B', 'Z'))
# Invalid codes in the input are converted to NA.
# "S" is correctly mapped to "Ser" but "Ser" and "Serine" are not
# one-letter amino acid codes and are therefore converted to NA.
as_three_letter(c('S', 's', 'Ser', 'Serine'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.