Ejemplo n.º 1
0
        /// <summary>
        /// Performs the NET Warping; Generates matches, gets the probabilities,
        /// calculates the alignment matrix and alignment function, gets the transformed NETs
        /// and then calculates the alignment matches
        /// </summary>
        private void PerformNetWarp(double percentCompleteAtStart, double percentCompleteAtEnd)
        {
            OnProgress("NET Warp, get candidate matches", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 0));

            m_lcmsWarp.GenerateCandidateMatches();
            if (m_lcmsWarp.NumCandidateMatches < 10)
            {
                throw new ApplicationException("Insufficient number of candidate matches by mass alone");
            }

            OnProgress("NET Warp, get match probabilities", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 10));
            m_lcmsWarp.GetMatchProbabilities();

            OnProgress("NET Warp, calculate alignment matrix", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 30));
            m_lcmsWarp.CalculateAlignmentMatrix();

            OnProgress("NET Warp, calculate alignment function", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 50));
            m_lcmsWarp.CalculateAlignmentFunction();

            OnProgress("NET Warp, get transformed NETs", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 70));
            m_lcmsWarp.GetTransformedNets();

            OnProgress("NET Warp, calculate alignment matches", ComputeIncrementalProgress(percentCompleteAtStart, percentCompleteAtEnd, 90));
            m_lcmsWarp.CalculateAlignmentMatches();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs the NET Warping; Generates matches, gets the probabilities,
        /// calculates the alignment matrix and alignment function, gets the transformed NETs
        /// and then calculates the alignment matches
        /// </summary>
        private void PerformNetWarp(double percentCompleteAtStart, double percentCompleteAtEnd, IProgress <ProgressData> progress = null)
        {
            var progData = new ProgressData(progress);
            var prog     = new Progress <ProgressData>(p => progData.Report(p.Percent, p.Status));
            var percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                           CurrentLcmsWarpTask.GenerateCandidateMatches);

            OnProgress("NET Warp, get candidate matches", percentCompleteOverall);
            progData.StepRange(10, "NET Warp, get candidate matches");
            progData.Report(0.0);

            _lcmsWarp.GenerateCandidateMatches(prog);

            if (_lcmsWarp.NumCandidateMatches < 10)
            {
                throw new ApplicationException("Insufficient number of candidate matches by mass alone (NumMatches < 10)");
            }

            percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                       CurrentLcmsWarpTask.GetMatchProbabilities);
            OnProgress("NET Warp, get match probabilities", percentCompleteOverall);
            progData.StepRange(90, "NET Warp, get match probabilities");

            _lcmsWarp.GetMatchProbabilities(prog);

            percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                       CurrentLcmsWarpTask.CalculateAlignmentMatrix);
            OnProgress("NET Warp, calculate alignment matrix", percentCompleteOverall);
            progData.StepRange(93, "NET Warp, calculate alignment matrix");

            _lcmsWarp.CalculateAlignmentMatrix(prog);

            percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                       CurrentLcmsWarpTask.CalculateAlignmentFunction);
            OnProgress("NET Warp, calculate alignment function", percentCompleteOverall);
            progData.StepRange(96, "NET Warp, calculate alignment function");

            _lcmsWarp.CalculateAlignmentFunction(prog);

            percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                       CurrentLcmsWarpTask.GetTransformedNets);
            OnProgress("NET Warp, get transformed NETs", percentCompleteOverall);
            progData.StepRange(98, "NET Warp, get transformed NETs");

            _lcmsWarp.GetTransformedNets(prog);

            percentCompleteOverall = UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd,
                                                       CurrentLcmsWarpTask.CalculateAlignmentMatches);
            OnProgress("NET Warp, calculate alignment matches", percentCompleteOverall);
            progData.StepRange(100, "NET Warp, calculate alignment matches");

            _lcmsWarp.CalculateAlignmentMatches(prog);

            UpdateCurrentTask(percentCompleteAtStart, percentCompleteAtEnd, CurrentLcmsWarpTask.Complete);
            progData.Report(100.0, "NET Warp, complete");
        }