public void ExportPSMs(int nbPsmPerQuery, string filename) { //List<Query> qs = queries.ComputeAtFDR(1); MSSearcher.Export(filename, queries); }
public void Export(double fdr, string keyword = "", bool onlyPrecursors = false) { dbOptions.ConSole.WriteLine("Exporting at " + (fdr * 100) + "% FDR (Decoy/Target)..."); List <Precursor> prec = null; if (precursors != null) { if (matchedPrecursors == null) { this.matchedPrecursors = new Precursors(); foreach (Precursor precursor in precursors) { if (precursor.psms.Count > 0) { matchedPrecursors.Add(precursor); } } }/* * List<Precursor> prec = FDR.PrecursorsV2(precursors, fdr, 1); * Sol.CONSOLE.OutputLine("> " + prec.Count + " Precursors"); * MSSearcher.Export(dbOptions.outputFolder + keyword + "precursors.csv", prec);//*/ /* * prec = Optimizer.PrecursorOptimizer(matchedPrecursors, fdr); * Sol.CONSOLE.OutputLine("> " + prec.Count + " Optimized Precursors"); * MSSearcher.Export(dbOptions.outputFolder + keyword + "Optimized_precursors.csv", prec);//*/ prec = matchedPrecursors.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + prec.Count + " Uptimized V5 Precursors"); MSSearcher.Export(dbOptions.OutputFolder + keyword + "UptimizedV5_precursors.csv", prec); } if (!onlyPrecursors) { if (queries != null) { List <Query> qs = queries.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + qs.Count + " PSMs (Top 10)"); MSSearcher.Export(dbOptions.OutputFolder + keyword + "queries.csv", qs); } if (clusters != null) { //List<PeptideSpectrumMatch> psms = FDR.PSMs(clusters, fdr, 1, 10); //dbOptions.ConSole.WriteLine("> " + psms.Count + " PSMs (Top 10)"); //MSSearcher.Export(dbOptions.outputFolder + keyword + "psms_Top10.csv", psms); //psms = FDR.PSMs(clusters, fdr, 1, 1); //dbOptions.ConSole.WriteLine("> " + psms.Count + " PSMs"); //MSSearcher.Export(dbOptions.outputFolder + keyword + "psms_Best.csv", psms); } if (peptides != null) { List <PeptideMatch> pep = peptideSequences.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + pep.Count + " Peptides Sequences (Version 5)"); PeptideSearcher.Export(dbOptions.OutputFolder + keyword + "peptideSequencesV5_.csv", pep); PeptideSearcher sr = new PeptideSearcher(dbOptions); PeptideMatches seqs = sr.Search(clusters, prec, false); pep = seqs.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + pep.Count + " Peptides Sequences (Version 5b)"); PeptideSearcher.Export(dbOptions.OutputFolder + keyword + "peptideSequencesV5b_PrecursorFDRed.csv", pep); pep = peptides.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + pep.Count + " Peptides (Version 5)"); PeptideSearcher.Export(dbOptions.OutputFolder + keyword + "peptidesV5_.csv", pep); } if (proteins != null) { List <ProteinGroupMatch> prots = proteins.ComputeAtFDR(fdr); dbOptions.ConSole.WriteLine("> " + prots.Count + " Proteins"); ProteinSearcher.Export(dbOptions.OutputFolder + keyword + "proteins_.csv", prots); } } }