private TransitionGroupChromInfoData(MeasuredResults measuredResults, int replicateIndex, ChromFileInfo chromFileInfo, TransitionGroupChromInfo transitionGroupChromInfo, PeptideDocNode peptideDocNode, TransitionGroupDocNode transitionGroupDocNode) : base(measuredResults, replicateIndex, chromFileInfo, transitionGroupChromInfo, peptideDocNode, transitionGroupDocNode) { }
public RatioValue GetTransitionGroupRatioValue(NormalizationMethod.RatioToLabel ratioToLabel, PeptideDocNode peptideDocNode, TransitionGroupDocNode transitionGroupDocNode, TransitionGroupChromInfo transitionGroupChromInfo) { if (peptideDocNode == null || transitionGroupChromInfo == null) { return(null); } if (transitionGroupDocNode.LabelType.Name == ratioToLabel.IsotopeLabelTypeName) { return(null); } var otherTransitionGroup = FindMatchingTransitionGroup(ratioToLabel, peptideDocNode, transitionGroupDocNode); if (otherTransitionGroup == null) { return(null); } var numerators = new List <double>(); var denominators = new List <double>(); if (SimpleRatios) { foreach (var tran in transitionGroupDocNode.Transitions.Where(tran => tran.IsQuantitative(Document.Settings))) { var chromInfo = FindMatchingTransitionChromInfo(transitionGroupChromInfo.FileId, transitionGroupChromInfo.OptimizationStep, tran); if (chromInfo != null) { numerators.Add(chromInfo.Area); } } foreach (var tran in otherTransitionGroup.Transitions.Where(tran => tran.IsQuantitative(Document.Settings))) { var chromInfo = FindMatchingTransitionChromInfo(transitionGroupChromInfo.FileId, transitionGroupChromInfo.OptimizationStep, tran); if (chromInfo != null) { denominators.Add(chromInfo.Area); } } if (numerators.Count == 0 || denominators.Count == 0) { return(null); } return(RatioValue.ValueOf(numerators.Sum() / denominators.Sum())); } var transitionMap = GetTransitionMap(otherTransitionGroup); foreach (var transition in transitionGroupDocNode.Transitions) { if (!transition.IsQuantitative(Document.Settings)) { continue; } var targetKey = new PeptideDocNode.TransitionKey(transitionGroupDocNode, new TransitionLossKey(transitionGroupDocNode, transition, transition.Losses), otherTransitionGroup.LabelType); if (!transitionMap.TryGetValue( targetKey, out TransitionDocNode otherTransition)) { continue; } if (!otherTransition.IsQuantitative(Document.Settings)) { continue; } var transitionChromInfo = FindMatchingTransitionChromInfo(transitionGroupChromInfo.FileId, transitionGroupChromInfo.OptimizationStep, transition); var otherTransitionChromInfo = FindMatchingTransitionChromInfo(transitionGroupChromInfo.FileId, transitionGroupChromInfo.OptimizationStep, otherTransition); if (transitionChromInfo == null || transitionChromInfo.IsEmpty || otherTransitionChromInfo == null || otherTransitionChromInfo.IsEmpty) { continue; } numerators.Add(transitionChromInfo.Area); denominators.Add(otherTransitionChromInfo.Area); } return(RatioValue.Calculate(numerators, denominators)); }
private TransitionGroupChromInfoData(MeasuredResults measuredResults, int replicateIndex, ChromFileInfo chromFileInfo, TransitionGroupChromInfo transitionGroupChromInfo) : base(measuredResults, replicateIndex, chromFileInfo, transitionGroupChromInfo) { }
public double?GetTransitionGroupValue(NormalizationMethod normalizationMethod, PeptideDocNode peptideDocNode, TransitionGroupDocNode transitionGroupDocNode, TransitionGroupChromInfo transitionGroupChromInfo) { if (transitionGroupChromInfo == null) { return(null); } if (TryGetDenominator(normalizationMethod, transitionGroupDocNode.LabelType, transitionGroupChromInfo.FileId, out double?denominator)) { return(transitionGroupChromInfo.Area / denominator); } if (normalizationMethod is NormalizationMethod.RatioToLabel ratioToLabel) { return(GetTransitionGroupRatioValue(ratioToLabel, peptideDocNode, transitionGroupDocNode, transitionGroupChromInfo)?.Ratio); } return(null); }