public static void Start() { Console.WriteLine("**Start OMSSA Reader**"); long startMem = System.Environment.WorkingSet; Stopwatch watch = new Stopwatch(); watch.Start(); List<PeptideSpectralMatch> psms; using (PsmReader reader = new OmssaCsvPsmReader("Resources/Omssa_yeast.csv")) { reader.LoadProteins("Resources/yeast_uniprot_120226.fasta"); reader.AddFixedModification(ModificationDictionary.GetModification("CAM")); reader.AddVariableModification(ModificationDictionary.GetModification("Oxidation"),"oxdiation of M"); psms = reader.ReadNextPsm().OrderBy(psm => psm.Score).ToList(); } watch.Stop(); Console.WriteLine("{0:N0} psms were read in", psms.Count); Console.WriteLine("Time elapsed: {0}", watch.Elapsed); Console.WriteLine("Memory used: {0:N0} MB", (System.Environment.WorkingSet - startMem) / (1024 * 1024)); Console.WriteLine("**End OMSSA Reader**"); }
public void Convert(string omssaCSV, MSDataFile dataFile) { string filePath = Path.ChangeExtension(omssaCSV, ".pepxml"); using (PepXmlWriter writer = new PepXmlWriter(filePath)) { writer.WriteSampleProtease(Protease); writer.StartSearchSummary("OMSSA", true, true); writer.WriteProteinDatabase(FastaDatabaseFile); writer.WriteSearchProtease(Protease, MissedClevages); foreach (int modNumber in FixedMods) { OmssaModification mod; if (OmssaModification.TryGetModification(modNumber, out mod)) { writer.WriteModification(mod, mod.Sites, true); } } foreach (int modNumber in VariableMods) { OmssaModification mod; if (OmssaModification.TryGetModification(modNumber, out mod)) { writer.WriteModification(mod, mod.Sites, false); } } writer.SetCurrentStage(PepXmlWriter.Stage.Spectra, true); using (OmssaCsvPsmReader reader = new OmssaCsvPsmReader(omssaCSV, UserModFile)) { reader.AddMSDataFile(dataFile); reader.LoadProteins(FastaDatabaseFile); foreach (PeptideSpectralMatch psm in reader.ReadNextPsm()) { writer.StartSpectrum(psm.SpectrumNumber, psm.Spectrum.RetentionTime, psm.Spectrum.PrecursorMz, psm.Spectrum.PrecursorCharge); writer.WritePSM(psm); writer.EndSpectrum(); } } } }