Example #1
0
        private void PreparePeptideProteinDictionary()
        {
            Console.WriteLine("Generating peptide protein dictionary");

            if (peptideProteinDictionary.Keys.Count > 0)
            {
                Console.WriteLine("\tNo need for this.");
                return;
            }
            //Fill protein peptide dictionary


            peptideProteinDictionary = new Dictionary <string, List <string> >();

            List <string> allPeptides = (from qp in myQuantPkgs
                                         from p in qp.MyQuants
                                         select PatternTools.pTools.CleanPeptide(p.Key, true)).Distinct().ToList();


            foreach (string peptide in allPeptides)
            {
                List <FastaItem> theItems = MyFastaItems.FindAll(a => a.Sequence.Contains(peptide));
                peptideProteinDictionary.Add(peptide, theItems.Select(a => a.SequenceIdentifier).ToList());
            }

            Console.WriteLine("Done Generating dictionary");
        }
Example #2
0
        private void PrepareProteinPeptideDictionary()
        {
            //Fill protein peptide dictionary
            Console.WriteLine("Generating protein peptide dictionary");

            if (proteinPeptideDictionary.Keys.Count > 0)
            {
                Console.WriteLine("\tNo need for this.");
            }

            proteinPeptideDictionary = new Dictionary <string, List <string> >();

            List <string> allPeptides = (from qp in myQuantPkgs
                                         from p in qp.MyQuants
                                         select p.Key).Distinct().ToList();


            foreach (string peptide in allPeptides)
            {
                List <FastaItem> theItems = MyFastaItems.FindAll(a => a.Sequence.Contains(PatternTools.pTools.CleanPeptide(peptide, true)));

                foreach (FastaItem fi in theItems)
                {
                    if (proteinPeptideDictionary.ContainsKey(fi.SequenceIdentifier))
                    {
                        proteinPeptideDictionary[fi.SequenceIdentifier].Add(peptide);
                    }
                    else
                    {
                        proteinPeptideDictionary.Add(fi.SequenceIdentifier, new List <string>()
                        {
                            peptide
                        });
                    }
                }
            }

            Console.WriteLine("Done Generating dictionary");
        }