コード例 #1
0
        //overload calcComparison (this one is for the non baseline case comparing all groups) PairwiseCompairsons for each pair of peptides and every pair of groups
        private List <PairwiseCompairison> calcComparison(List <Peptide> PepsInProt, List <string> groups, int minNumStoichiometries)
        {
            List <PairwiseCompairison> comparePeps = new List <PairwiseCompairison>();

            //loop over all peptide, peptide, group, group permutations
            for (int p1 = 0; p1 < this.PeptidesInProtein.Count(); ++p1)
            {
                for (int p2 = (p1 + 1); p2 < this.PeptidesInProtein.Count(); ++p2)
                {
                    for (int g1 = 0; g1 < groups.Count(); ++g1)
                    {
                        for (int g2 = (g1 + 1); g2 < groups.Count(); ++g2)
                        {
                            PairwiseCompairison temp = new PairwiseCompairison(PepsInProt[p1], PepsInProt[p2], groups[g1], groups[g2], minNumStoichiometries);

                            if (temp.PeptideStoichiometriesGroupOne.Count() >= minNumStoichiometries &&
                                temp.PeptideStoichiometriesGroupTwo.Count() >= minNumStoichiometries)
                            {
                                comparePeps.Add(temp);
                            }
                        }
                    }
                }
            }
            return(comparePeps);
        }
コード例 #2
0
        //overload calcComparison (baseline averaged comparing against only one group) function to compare all modified peptides in protein against baseline using PairwiseCompairison
        private List <PairwiseCompairison> calcComparison(List <Peptide> PepsInProt, List <string> groups, Boolean compareUnmod, int minNumStoichiometries, string groupToCompare)
        {
            List <PairwiseCompairison> comparePeps       = new List <PairwiseCompairison>();
            List <Peptide>             PeptidesToCompare = PepsInProt;

            //if not considering unmod peptides -> remove
            if (!compareUnmod)
            {
                PeptidesToCompare = PeptidesToCompare.Where(p => p.Mod).ToList();
            }
            groups.Remove(groupToCompare);
            //loop over all peptide, group, groupToCompare permutations
            for (int p1 = 0; p1 < PeptidesToCompare.Count(); ++p1)
            {
                for (int g1 = 0; g1 < groups.Count(); ++g1)
                {
                    PairwiseCompairison temp = new PairwiseCompairison(PeptidesToCompare[p1], getBaselineIntensities(), groups[g1], groupToCompare, minNumStoichiometries);
                    if (temp.PeptideStoichiometriesGroupOne.Count() >= minNumStoichiometries && temp.PeptideStoichiometriesGroupTwo.Count() >= minNumStoichiometries)
                    {
                        comparePeps.Add(temp);
                    }
                }
            }
            groups.Add(groupToCompare);
            return(comparePeps);
        }