private void Run() { richTextBox1.Clear(); string rawFolder = txtRawFolder.Text; List <string> csvFilepaths = new List <string>(lstOmssaCsvFiles.Items.Cast <string>()); List <Modification> fixedModifications = new List <Modification>(from ListViewItem checkedItem in lstSelectedFixedModifications.Items select(Modification) checkedItem.Tag); double maxFalseDiscoveryRate = (double)numMaximumFalseDiscoveryRate.Value; double maxPPM = (double)maximumPPMUD.Value; bool isBatched = checkBox1.Checked; bool is2DFDR = twoDCB.Checked; bool includeFixedMods = checkBox2.Checked; UniquePeptideType uniquePeptideType = (UniquePeptideType)comboBox1.SelectedValue; string outputFolder = txtOutputFolder.Text; if (string.IsNullOrEmpty(outputFolder)) { MessageBox.Show("Output folder must be specified"); return; } Directory.CreateDirectory(outputFolder); FdrOptimizer fdrOptimizer = new FdrOptimizer(csvFilepaths, rawFolder, fixedModifications, maxFalseDiscoveryRate, maxPPM, uniquePeptideType, outputFolder, isBatched, is2DFDR, includeFixedMods); fdrOptimizer.UpdateProgress += HandleUpdateProgress; fdrOptimizer.Finished += fdrOptimizer_Finished; fdrOptimizer.UpdateLog += fdrOptimizer_UpdateLog; prgProgress.Value = prgProgress.Minimum; btnOK.Enabled = false; Thread thread = new Thread(fdrOptimizer.Optimize) { IsBackground = true }; thread.Start(); }
private void Run() { richTextBox1.Clear(); string rawFolder = txtRawFolder.Text; List<string> csvFilepaths = new List<string>(lstOmssaCsvFiles.Items.Cast<string>()); List<Modification> fixedModifications = new List<Modification>(from ListViewItem checkedItem in lstSelectedFixedModifications.Items select (Modification)checkedItem.Tag); double maxFalseDiscoveryRate = (double)numMaximumFalseDiscoveryRate.Value; double maxPPM = (double)maximumPPMUD.Value; bool isBatched = checkBox1.Checked; bool is2DFDR = twoDCB.Checked; bool includeFixedMods = checkBox2.Checked; UniquePeptideType uniquePeptideType = (UniquePeptideType)comboBox1.SelectedValue; string outputFolder = txtOutputFolder.Text; if (string.IsNullOrEmpty(outputFolder)) { MessageBox.Show("Output folder must be specified"); return; } Directory.CreateDirectory(outputFolder); FdrOptimizer fdrOptimizer = new FdrOptimizer(csvFilepaths, rawFolder, fixedModifications, maxFalseDiscoveryRate,maxPPM, uniquePeptideType, outputFolder, isBatched, is2DFDR, includeFixedMods); fdrOptimizer.UpdateProgress += HandleUpdateProgress; fdrOptimizer.Finished += fdrOptimizer_Finished; fdrOptimizer.UpdateLog += fdrOptimizer_UpdateLog; prgProgress.Value = prgProgress.Minimum; btnOK.Enabled = false; Thread thread = new Thread(fdrOptimizer.Optimize) {IsBackground = true}; thread.Start(); }