private void Engine(object sender, EventArgs e) { this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Reading N and C files... (Task 0/6)"; })); ImportData import = new ImportData(backgroundWorker1); List <PSM> MMOutput = new List <PSM>(); List <TheoreticalProtein> database = new List <TheoreticalProtein>(); bool passedFileIO = true; { MMOutput = import.ImportPSMs(nFileName, cFileName, out string error_message); if (error_message.Length > 0) { MessageBox.Show(error_message); } this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Reading database... (Task 1/6)"; })); ClearProgress(); database = import.ImportDatabase(databaseFileName, out string error_message2); if (error_message2.Length > 0) { MessageBox.Show(error_message2); } } if (passedFileIO) { this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Splicing peptides... (Task 2/6)"; })); ClearProgress(); SpliceFragments sf = new SpliceFragments(backgroundWorker1); List <PSM> candidates = sf.ExperimentalTheoreticalMatching(MMOutput, out string error_message); if (error_message.Length > 0) { MessageBox.Show(error_message); } ClearProgress(); AlternativeSequences altSeq = new AlternativeSequences(backgroundWorker1); this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Finding ambiquity... (Task 3/6)"; })); ClearProgress(); altSeq.FindAmbiguity(candidates, database, out string error_message2); if (error_message2.Length > 0) { MessageBox.Show(error_message2); } FalsePositives.generateDecoys = false; this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Recording variants... (Task 4/6)"; })); ClearProgress(); FalsePositives rfp = new FalsePositives(backgroundWorker1); rfp.FindCommonFalsePositives(candidates, database, out string error_message3); if (error_message3.Length > 0) { MessageBox.Show(error_message3); } this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Exporting results... (Task 5/6)"; })); ClearProgress(); ExportData ed = new ExportData(backgroundWorker1); string e3 = ed.ExportAll(candidates, databaseFileName); if (e3.Length > 0) { MessageBox.Show(e3); } this.Invoke(new MethodInvoker(delegate { StatustxtBox.Text = "Complete! (6/6)"; })); MessageBox.Show("Complete!"); } }