private MSPeak convertDeconPeakToMSPeak(DeconToolsV2.Peaks.clsPeak monoPeak) { MSPeak peak = new MSPeak(); peak.XValue = monoPeak.mdbl_mz; peak.Width = (float)monoPeak.mdbl_FWHM; peak.SignalToNoise = (float)monoPeak.mdbl_SN; peak.Height = (int)monoPeak.mdbl_intensity; return(peak); }
private void GetIsotopicProfilePeaks(DeconToolsV2.Peaks.clsPeak[] peaklist, int chargeState, double monoMZ, ref IsotopicProfile profile) { profile.Peaklist = new List <MSPeak>(); double mzVar = 0.01; // TODO: find a more accurate way of defining the mz variability DeconToolsV2.Peaks.clsPeak monoPeak = lookupPeak(monoMZ, peaklist, mzVar); if (monoPeak != null) { MSPeak mspeak = convertDeconPeakToMSPeak(monoPeak); profile.Peaklist.Add(mspeak); return; } }
public void ApplyFilter() { float[] xData = _msScan.RawMZs; float[] yData = _msScan.RawIntensities; DeconToolsV2.Peaks.clsPeakProcessor peakProcessor = new DeconToolsV2.Peaks.clsPeakProcessor(); DeconToolsV2.Peaks.clsPeakProcessorParameters parameters = new DeconToolsV2.Peaks.clsPeakProcessorParameters(); parameters.PeakBackgroundRatio = PeakToBackgroundRatio; parameters.SignalToNoiseThreshold = SignalToNoiseThreshold; parameters.PeakFitType = DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC; peakProcessor.SetOptions(parameters); DeconToolsV2.Peaks.clsPeak[] peakList = new DeconToolsV2.Peaks.clsPeak[1]; peakProcessor.DiscoverPeaks(ref xData, ref yData, ref peakList, 0, float.MaxValue); float[] mz = new float[peakList.Length]; float[] intensity = new float[peakList.Length]; for (int i = 0; i < peakList.Length; i++) { mz[i] = Convert.ToSingle(peakList[i].mdbl_mz); intensity[i] = Convert.ToSingle(peakList[i].mdbl_intensity); } _msScan.MZs = mz; _msScan.Intensities = intensity; }