public AminoAcid GetAminoAcid()
 {
     if (!(this is AminoAcidLabel))
     {
         return(null);
     }
     return(AminoAcids.FromLetter(((AminoAcidLabel)this).Aa));
 }
 public static AminoAcid GetAminoAcidFromLabel(Modification2 m)
 {
     return(m.AaCount == 0 ? null : AminoAcids.FromLetter(m.GetAaAt(0)));
 }
        /// <summary>
        /// Given string label, return corresponding AminoAcid object, or null for a terminal modiciation.
        /// </summary>
        /// <param name="label">string label, e.g. "DimethLys2"</param>
        /// <returns>AminoAcid object, or null for a terminal modiciation</returns>
        public static AminoAcid GetAminoAcidFromLabel(string label)
        {
            Modification2 m = new Modification2(label);

            return(m.AaCount == 0 ? null : AminoAcids.FromLetter(m.GetAaAt(0)));
        }