Beispiel #1
0
        public Peak GetChromPeakForGivenSource(MSPeakResult peakResult)
        {
            if (PeakDataIsNullOrEmpty)
            {
                return(null);
            }

            double averagePeakWidth = PeakList.Average(p => p.Width);
            var    peakWidthSigma   = averagePeakWidth / 2.35; //   width@half-height =  2.35σ   (Gaussian peak theory)

            var fourSigma = 4 * peakWidthSigma;

            return(GetChromPeakForGivenSource(peakResult, fourSigma));
        }
Beispiel #2
0
        public Peak GetChromPeakForGivenSource(MSPeakResult peakResult, double scanTolerance)
        {
            if (PeakDataIsNullOrEmpty)
            {
                return(null);
            }

            var peakQuery = (from n in PeakList where Math.Abs(n.XValue - peakResult.Scan_num) <= scanTolerance select n).ToList();

            var peaksWithinTol = peakQuery.Count;

            if (peaksWithinTol == 0)
            {
                return(null);
            }

            var sortedPeaks = peakQuery.OrderByDescending(p => p.Height);

            return(sortedPeaks.First());
        }
        public void FillMSPeakResults()
        {
            if (this.Run is UIMFRun)
            {
                var uimfrun = (UIMFRun)Run;

                foreach (MSPeak peak in this.Run.PeakList)
                {
                    PeakCounter++;
                    var peakResult = new MSPeakResult(PeakCounter, uimfrun.CurrentScanSet.PrimaryScanNumber,
                                                      uimfrun.CurrentIMSScanSet.PrimaryScanNumber, peak);
                    this.MSPeakResultList.Add(peakResult);
                }
            }
            else
            {
                foreach (MSPeak peak in this.Run.PeakList)
                {
                    PeakCounter++;
                    var peakResult = new MSPeakResult(PeakCounter, this.Run.CurrentScanSet.PrimaryScanNumber, peak);
                    this.MSPeakResultList.Add(peakResult);
                }
            }
        }