Amino Acids

Set of amino acid symbols also covers IUPAC amino acid symbols plus a gap symbol:

SymbolConstantMeaning
'A'AA_AAlanine
'R'AA_RArginine
'N'AA_NAsparagine
'D'AA_DAspartic acid (Aspartate)
'C'AA_CCysteine
'Q'AA_QGlutamine
'E'AA_EGlutamic acid (Glutamate)
'G'AA_GGlycine
'H'AA_HHistidine
'I'AA_IIsoleucine
'L'AA_LLeucine
'K'AA_KLysine
'M'AA_MMethionine
'F'AA_FPhenylalanine
'P'AA_PProline
'S'AA_SSerine
'T'AA_TThreonine
'W'AA_WTryptophan
'Y'AA_YTyrosine
'V'AA_VValine
'O'AA_OPyrrolysine
'U'AA_USelenocysteine
'B'AA_BAspartic acid or Asparagine
'J'AA_JLeucine or Isoleucine
'Z'AA_ZGlutamine or Glutamic acid
'X'AA_XAny amino acid
'*'AA_TermTermination codon
'-'AA_GapGap (none of the above)

http://www.insdc.org/documents/feature_table.html#7.4.3

Symbols are accessible as constants with AA_ prefix:

julia> AA_A
AA_A

julia> AA_Q
AA_Q

julia> AA_Term
AA_Term

julia> typeof(AA_A)
AminoAcid

Symbols can be constructed by converting regular characters:

julia> convert(AminoAcid, 'A')
AA_A

julia> convert(AminoAcid, 'P') === AA_P
true

julia> convert(AminoAcid, 'a') === convert(AminoAcid, 'A')
true

3-letter and 1-letter abbreviations can be parsed using parse in a case-insensitive way:

julia> parse(AminoAcid, "Pro")  # 3-letter abbreviation
AA_P

julia> parse(AminoAcid, "P")    # 1-letter abbreviation
AA_P

julia> parse(AminoAcid, "Pro") == parse(AminoAcid, "pRo")
true

julia> tryparse(AminoAcid, "Pro")  # tryparse returns either an amino acid or nothing
AA_P

julia> tryparse(AminoAcid, "Pr")