Exemple #1
0
        protected void ProduceResult(IDataPoints data, ISpectrum spectrum, List <IGlycoPeptide> precursor)
        {
            List <IGlycoPeptideScore> glycoPeptideScores = new List <IGlycoPeptideScore>();
            List <NGlycoPeptideNode>  nodes = GetMaxNodes(data);

            //score precursor
            foreach (IGlycoPeptide glycoPeptide in precursor)
            {
                string        seq    = glycoPeptide.GetPeptide().GetSequence();
                ITableNGlycan glycan = glycoPeptide.GetGlycan() as ITableNGlycan;

                PeakScore score = new PeakScore();
                foreach (NGlycoPeptideNode node in nodes)
                {
                    if (node.GetPeptide().GetSequence() == seq &&
                        IsGlycanMatch(node.GetNGlycan(), glycan))
                    {
                        score.Merge(node);
                    }
                }
                if (score.GetScore() > 0)
                {
                    glycoPeptideScores.Add(new GeneralGlycoPeptideScore(glycoPeptide, score.GetScore()));
                }
            }

            result = new GeneralGlycoPeptideScoreResultProduct(spectrum, glycoPeptideScores);
        }
Exemple #2
0
 public void Merge(INode ancestor)
 {
     if (ancestor != null)
     {
         PeakScore score = ancestor.GetScoreObject() as PeakScore;
         Dictionary <string, double> stable = score.GetScoreTable();
         foreach (string a in stable.Keys)
         {
             if (!scoreTable.ContainsKey(a))
             {
                 scoreTable[a] = stable[a];
             }
             else
             {
                 scoreTable[a] = Math.Max(scoreTable[a], stable[a]);
             }
         }
     }
 }