コード例 #1
0
 public TagSequenceMatch(string sequence, string proteinName, TagMatch tagMatch, char pre, char post)
 {
     Sequence    = sequence;
     ProteinName = proteinName;
     TagMatch    = tagMatch;
     Pre         = pre;
     Post        = post;
 }
コード例 #2
0
        private IEnumerable <TagMatch> FindMatchesWithFeatureMass(MatchedTag matchedTag)
        {
            if (matchedTag.NTermFlankingMass == null || matchedTag.CTermFlankingMass == null)
            {
                yield break;
            }
            var featureMass = (double)matchedTag.NTermFlankingMass + matchedTag.Mass +
                              (double)matchedTag.CTermFlankingMass + Composition.H2O.Mass;
            var shiftMass = matchedTag.Mass + (double)matchedTag.NTermFlankingMass;

            var backwardGraph = new ShiftedSequenceGraph(_aaSet, shiftMass, false,
                                                         matchedTag.StartIndex, featureMass - MinSumModificationMasses);

            foreach (var backwardMatch in GetBackwardMatches(matchedTag, backwardGraph, featureMass))
            {
                // Make a forward graph
                var nTermShiftMass = backwardMatch.Mass + matchedTag.Mass;
                var forwardGraph   = new ShiftedSequenceGraph(_aaSet, nTermShiftMass, true,
                                                              _proteinSequence.Length - matchedTag.EndIndex, featureMass - MinSumModificationMasses);

                foreach (
                    var forwardMatch in
                    GetForwardMatches(matchedTag, forwardGraph, featureMass))
                {
                    var mass = forwardMatch.Mass + matchedTag.Mass + backwardMatch.Mass;
                    if (mass > _maxSequenceMass)
                    {
                        continue;
                    }

                    var offset = matchedTag.EndIndex - backwardMatch.Index - 1;
                    var modStr = string.Join(",", backwardMatch.Modifications.Concat(forwardMatch.Modifications.Select(m => m.GetModificationInstanceWithOffset(offset))));

                    var modList = new List <Modification>();
                    foreach (var mod in backwardMatch.Modifications)
                    {
                        modList.Add(mod.Modification);
                    }
                    foreach (var mod in forwardMatch.Modifications)
                    {
                        modList.Add(mod.Modification);
                    }

                    var tagMatch = new TagMatch(
                        backwardMatch.Index,
                        forwardMatch.Index,
                        matchedTag.Length,
                        backwardMatch.Charge,
                        backwardMatch.Score,
                        forwardMatch.Score,
                        mass,
                        new ModificationCombination(modList),
                        modStr);
                    yield return(tagMatch);
                }
            }
        }