/// <summary> /// Constructor /// </summary> /// <param name="originalSpec"></param> /// <param name="peaks"></param> public DeconvolutedSpectrum(Spectrum originalSpec, DeconvolutedPeak[] peaks) : base(originalSpec.ScanNum) { MsLevel = originalSpec.MsLevel; NativeId = originalSpec.NativeId; ElutionTime = originalSpec.ElutionTime; TotalIonCurrent = originalSpec.TotalIonCurrent; var ms2Spec = originalSpec as ProductSpectrum; if (ms2Spec == null) { ActivationMethod = ActivationMethod.Unknown; } else { ActivationMethod = ms2Spec.ActivationMethod; IsolationWindow = new IsolationWindow(ms2Spec.IsolationWindow.IsolationWindowTargetMz, ms2Spec.IsolationWindow.IsolationWindowLowerOffset, ms2Spec.IsolationWindow.IsolationWindowUpperOffset, ms2Spec.IsolationWindow.MonoisotopicMz, ms2Spec.IsolationWindow.Charge); } var dPeaks = new DeconvolutedPeak[peaks.Length]; peaks.CopyTo(dPeaks, 0); Peaks = dPeaks; }
/// <summary> /// Constructor /// </summary> /// <param name="originalSpec"></param> /// <param name="peaks"></param> public DeconvolutedSpectrum(Spectrum originalSpec, IReadOnlyList <DeconvolutedPeak> peaks) : base(originalSpec.ScanNum) { MsLevel = originalSpec.MsLevel; NativeId = originalSpec.NativeId; ElutionTime = originalSpec.ElutionTime; TotalIonCurrent = originalSpec.TotalIonCurrent; if (originalSpec is ProductSpectrum ms2Spec) { ActivationMethod = ms2Spec.ActivationMethod; IsolationWindow = new IsolationWindow(ms2Spec.IsolationWindow.IsolationWindowTargetMz, ms2Spec.IsolationWindow.IsolationWindowLowerOffset, ms2Spec.IsolationWindow.IsolationWindowUpperOffset, ms2Spec.IsolationWindow.MonoisotopicMz, ms2Spec.IsolationWindow.Charge); } else { ActivationMethod = ActivationMethod.Unknown; } StorePeaks(peaks); }