Exemplo n.º 1
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            var bw = (BackgroundWorker)sender;


            try
            {
                //This mode was requested by Julia Laskin.
                //This mode detects peaks in each dataset and merges the output
                if (_parameters.ScanBasedWorkflowParameters.ScanBasedWorkflowName.ToLower() == "run_merging_with_peak_export")
                {
                    var workflow = new RunMergingPeakExportingWorkflow(_parameters, _inputFileList, _outputPath, bw);
                    workflow.Execute();
                }
                else
                {
                    foreach (var file in _inputFileList)
                    {
                        _currentFile = file;
                        var workflow = ScanBasedWorkflow.CreateWorkflow(file, _parameterFileName, _outputPath, bw);

                        workflow.Execute();
                    }
                }
            }
            catch (COMException ex)
            {
                // bool isFile =   RunUtilities.RunIsFileOrFolder(_currentFile);

                var errorMessage =
                    "A 'COMException' has occurred. This can happen when the vendor library has not been installed.\n\n";

                errorMessage +=
                    "If you are trying to read Thermo .raw files, please install Thermo's MSFileReader library. ";

                errorMessage += "To do so, Google 'thermo msfilereader' and you should find it. If not, contact us.\n\n";

                errorMessage += "Full error details below:\n";

                errorMessage += ex.Message;

                MessageBox.Show(errorMessage, "COMError occurred");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + "**NOTE: see log file for additional details.");
            }


            if (bw.CancellationPending)
            {
                e.Cancel = true;
            }
        }
        public void Test1()
        {
            var parameters = new DeconToolsParameters();


            var datasetList = new List <string>();

            datasetList.Add(@"\\protoapps\UserData\Slysz\DeconTools_TestFiles\JuliaLaskinRunMergingWorkflow\b-LSOA_HPLC_ESIbox_pos_res60k_RT92-98.raw");
            datasetList.Add(@"\\protoapps\UserData\Slysz\DeconTools_TestFiles\JuliaLaskinRunMergingWorkflow\b-LSOA_HPLC_ESIbox_pos_res60k_RT1255-1282.raw");
            datasetList.Add(@"\\protoapps\UserData\Slysz\DeconTools_TestFiles\JuliaLaskinRunMergingWorkflow\b-LSOA_HPLC_ESIbox_pos_res60k_RT1400-1500.raw");

            var workflow = new RunMergingPeakExportingWorkflow(parameters, datasetList);

            workflow.Execute();
        }