public List <IPeptide> Run(string fileName) { List <IPeptide> peptideList = new List <IPeptide>(); HashSet <string> sequenceSeen = new HashSet <string>(); List <IProtein> proteins = fastaReader.Create(fileName); foreach (IPeptideCreatorParameter parameter in parameters) { pepRunner.SetParameter(parameter); foreach (IProtein protein in proteins) { pepRunner.Create(protein); } } foreach (IProtein protein in proteins) { foreach (IPeptide pep in protein.GetPeptides()) { string seq = pep.GetSequence(); if (!sequenceSeen.Contains(seq)) { peptideList.Add(pep); sequenceSeen.Add(seq); //Console.WriteLine(seq); } } } return(peptideList); }
public List <IPeptide> Run(string fileName) { List <IProtein> proteins = fastaReader.Create(fileName); List <IPeptide> peptideList = new List <IPeptide>(); HashSet <string> sequenceSeen = new HashSet <string>(); foreach (IProtein p in proteins) { List <IPeptide> peptides = pepRunner.Create(p); foreach (IPeptide pep in peptides) { string seq = pep.GetSequence(); if (!sequenceSeen.Contains(seq)) { peptideList.Add(pep); sequenceSeen.Add(seq); } } } return(peptideList); }
public void Init(string spectrumFileLocation, string peptideFileLocation, string outputLocation) { spectrumFactory.Init(spectrumFileLocation); proteins = proteinCreator.Create(peptideFileLocation); HashSet <string> seen = new HashSet <string>(); peptides = new List <IPeptide>(); foreach (IProtein protein in proteins) { foreach (IPeptide peptide in peptideCreator.Create(protein)) { if (!seen.Contains(peptide.GetSequence())) { seen.Add(peptide.GetSequence()); peptides.Add(peptide); } } } glycans = glycanCreator.Create(); precursorMatcher.SetPeptides(peptides); precursorMatcher.SetGlycans(glycans); reportProducer.SetOutputLocation(outputLocation); }