Пример #1
0
        public static Modification[] GetModifiedVersions(char aa, SilacType type, SilacLabel[] labels1, SilacLabel[] labels2)
        {
            AminoAcid a = AminoAcid.FromLetter(aa);

            switch (type)
            {
            case SilacType.Singlets:
                return(new Modification[1]);

            case SilacType.Doublets:
                Modification[] result = new Modification[2];
                if (a.HasFittingLabel(labels1))
                {
                    SilacLabel sl = a.GetFittingLabel(labels1);
                    result[1] = Tables.modifications[AminoAcid.GetMascotModificationStringForLabel(sl)];
                }
                return(result);

            case SilacType.Triplets:
                result = new Modification[3];
                if (a.HasFittingLabel(labels1))
                {
                    SilacLabel sl = a.GetFittingLabel(labels1);
                    result[1] = Tables.modifications[AminoAcid.GetMascotModificationStringForLabel(sl)];
                }
                if (a.HasFittingLabel(labels2))
                {
                    SilacLabel sl = a.GetFittingLabel(labels2);
                    result[2] = Tables.modifications[AminoAcid.GetMascotModificationStringForLabel(sl)];
                }
                return(result);
            }
            throw new Exception("Never get here.");
        }