/// <summary> /// Updates parent charge state result based on the selected chrom peak target /// </summary> /// <param name="chromPeakTarget"></param> private void UpdateSelection(ChromPeakIqTarget chromPeakTarget) { var childResult = chromPeakTarget.ParentTarget.GetResult(); var chromPeakResult = chromPeakTarget.GetResult(); childResult.ChromPeakSelected = chromPeakTarget.ChromPeak; childResult.LcScanObs = chromPeakResult.LcScanObs; childResult.LCScanSetSelected = chromPeakResult.LCScanSetSelected; childResult.IqResultDetail.MassSpectrum = chromPeakResult.IqResultDetail.MassSpectrum; TrimData(childResult.IqResultDetail.MassSpectrum, childResult.Target.MZTheor, MsLeftTrimAmount, MsRightTrimAmount); childResult.ObservedIsotopicProfile = chromPeakResult.ObservedIsotopicProfile; childResult.FitScore = chromPeakResult.FitScore; childResult.NETError = chromPeakResult.NETError; childResult.InterferenceScore = chromPeakResult.InterferenceScore; childResult.CorrelationData = chromPeakResult.CorrelationData; childResult.MonoMassObs = chromPeakResult.ObservedIsotopicProfile == null ? 0 : chromPeakResult.ObservedIsotopicProfile.MonoIsotopicMass; childResult.MZObs = chromPeakResult.ObservedIsotopicProfile == null ? 0 : chromPeakResult.ObservedIsotopicProfile.MonoPeakMZ; childResult.MZObsCalibrated = chromPeakResult.ObservedIsotopicProfile == null ? 0 : Run.GetAlignedMZ(childResult.MZObs, chromPeakResult.LcScanObs); childResult.MonoMassObsCalibrated = (childResult.MZObsCalibrated - DeconTools.Backend.Globals.PROTON_MASS) * childResult.MZObsCalibrated / childResult.Target.ChargeState; childResult.MassErrorBefore = chromPeakResult.ObservedIsotopicProfile == null ? 0 : chromPeakResult.MassErrorBefore; childResult.MassErrorAfter = (childResult.MZObsCalibrated - childResult.Target.MZTheor) / childResult.Target.MZTheor * 1e6; var elutionTime = childResult.ChromPeakSelected == null ? 0d : ((ChromPeak)childResult.ChromPeakSelected).NETValue; childResult.ElutionTimeObs = elutionTime; childResult.Abundance = GetAbundance(childResult); }