示例#1
0
        public bool IsMatch(string sequence, IonType ionType, int cleavageOffset)
        {
            if (!IsFragment)
            {
                return(false);
            }
            int ordinal = Transition.OffsetToOrdinal(ionType, cleavageOffset, sequence.Length);

            if (ordinal < MinFragmentLength)
            {
                return(false);
            }
            char aaN = Transition.GetFragmentNTermAA(sequence, cleavageOffset);
            char aaC = Transition.GetFragmentCTermAA(sequence, cleavageOffset);
            // Make sure the specified amino acid is in the fragment set for this ion
            char aa = (IsNTerm() ? aaN : aaC);

            if (Fragment.IndexOf(aa) == -1)
            {
                return(false);
            }
            // Make suer the adjacent amino acid is not in the restricted set for this ion
            aa = (IsNTerm() ? aaC : aaN);
            if (Restrict != null && Restrict.IndexOf(aa) != -1)
            {
                return(false);
            }
            return(true);
        }
示例#2
0
        public bool IsMatch(Target target, IonType ionType, int cleavageOffset)
        {
            if (!IsFragment)
            {
                return(false);
            }
            if (!target.IsProteomic)
            {
                return(false); // TODO(bspratt) small molecule equivalent?
            }
            var sequence = target.Sequence;
            int ordinal  = Transition.OffsetToOrdinal(ionType, cleavageOffset, sequence.Length);

            if (ordinal < MinFragmentLength)
            {
                return(false);
            }
            char aaN = Transition.GetFragmentNTermAA(sequence, cleavageOffset);
            char aaC = Transition.GetFragmentCTermAA(sequence, cleavageOffset);
            // Make sure the specified amino acid is in the fragment set for this ion
            char aa = (IsNTerm() ? aaN : aaC);

            if (Fragment.IndexOf(aa) == -1)
            {
                return(false);
            }
            // Make suer the adjacent amino acid is not in the restricted set for this ion
            aa = (IsNTerm() ? aaC : aaN);
            if (Restrict != null && Restrict.IndexOf(aa) != -1)
            {
                return(false);
            }
            return(true);
        }