public PrecursorQuantificationResult GetPrecursorQuantificationResult(int replicateIndex, TransitionGroupDocNode transitionGroupDocNode) { PrecursorQuantificationResult result = null; if (IsotopologResponseCurve) { result = new PrecursorQuantificationResult(); var calibrationPoint = new CalibrationPoint(replicateIndex, transitionGroupDocNode.LabelType); CalibrationCurve calibrationCurve = GetCalibrationCurve(); result = (PrecursorQuantificationResult)result.ChangeNormalizedArea(GetNormalizedPeakArea(calibrationPoint)); if (HasExternalStandards() || HasInternalStandardConcentration()) { double?calculatedConcentration = GetCalculatedConcentration(calibrationCurve, calibrationPoint); result = (PrecursorQuantificationResult)result.ChangeCalculatedConcentration(calculatedConcentration); double?expectedConcentration = transitionGroupDocNode.PrecursorConcentration; result = (PrecursorQuantificationResult)result.ChangeAccuracy(calculatedConcentration / expectedConcentration); result = (PrecursorQuantificationResult)result.ChangeUnits(QuantificationSettings.Units); } } var targetIonRatio = GetTargetIonRatio(transitionGroupDocNode); var ionRatio = PeptideQuantifier.GetQualitativeIonRatio(SrmSettings, transitionGroupDocNode, replicateIndex); if (targetIonRatio.HasValue || ionRatio.HasValue) { result = result ?? new PrecursorQuantificationResult(); var status = ValueStatus.GetStatus(ionRatio, GetTargetIonRatio(transitionGroupDocNode), SrmSettings.PeptideSettings.Quantification.QualitativeIonRatioThreshold / 100); result = result.ChangeIonRatio(targetIonRatio, ionRatio, status); } return(result); }
public double?GetTargetIonRatio(TransitionGroupDocNode transitionGroupDocNode) { var measuredResults = SrmSettings.MeasuredResults; double totalQualitativeIonRatio = 0; int qualitativeIonRatioCount = 0; foreach (var replicateIndex in EnumerateReplicates()) { if (IsExcluded(replicateIndex)) { continue; } var chromatogramSet = measuredResults.Chromatograms[replicateIndex]; if (!SampleType.STANDARD.Equals(chromatogramSet.SampleType)) { continue; } var qualitativeIonRatio = PeptideQuantifier.GetQualitativeIonRatio(SrmSettings, transitionGroupDocNode, replicateIndex); if (qualitativeIonRatio.HasValue) { totalQualitativeIonRatio += qualitativeIonRatio.Value; qualitativeIonRatioCount++; } } if (qualitativeIonRatioCount != 0) { return(totalQualitativeIonRatio / qualitativeIonRatioCount); } return(null); }