Beispiel #1
0
        /// <summary>
        /// Execute the workflow
        /// </summary>
        public virtual void Execute()
        {
            try
            {
                InitializeWorkflow();
            }
            catch (Exception ex)
            {
                var simpleErrorMessage = "Error - during workflow initialization. Internal error message: " + ex.Message;
                LogError(ex, simpleErrorMessage);
                throw new ApplicationException(simpleErrorMessage, ex);
            }

            WorkflowStats = new WorkflowStats
            {
                TimeStarted = DateTime.Now
            };

            try
            {
                IterateOverScans();
            }
            catch (Exception ex)
            {
                var simpleErrorMessage = "A bad error happened while processing each scan in the dataset. Internal error message: " + ex.Message;
                LogError(ex, simpleErrorMessage);
                throw new ApplicationException(simpleErrorMessage, ex);
            }

            WorkflowStats.TimeFinished = DateTime.Now;
            WorkflowStats.NumFeatures  = Run.ResultCollection.MSFeatureCounter;

            WriteOutSummaryToLogfile();
        }
Beispiel #2
0
        private void IterateOverDatasets()
        {
            _datasetCounter = 0;
            _peaksProcessedInLastDataset = 0;
            _totalPeaksProcessed         = 0;

            WorkflowStats = new WorkflowStats
            {
                TimeStarted = DateTime.UtcNow
            };

            foreach (var datasetFileName in DatasetFileNameList)
            {
                _peaksProcessedInLastDataset = 0;

                Run = new RunFactory().CreateRun(datasetFileName);

                Check.Require(Run != null, "ERROR: tried to initialize Run but failed.");

                if (_datasetCounter == 0)
                {
                    InitializeWorkflow();
                }

                CreateTargetMassSpectra();

                IterateOverScans();

                _totalPeaksProcessed += _peaksProcessedInLastDataset;

                _datasetCounter++;
            }

            WorkflowStats.TimeFinished = DateTime.UtcNow;
            WorkflowStats.NumFeatures  = _totalPeaksProcessed;

            WriteOutSummaryToLogfile();
        }