Beispiel #1
0
 public NormalizationData GetNormalizationData()
 {
     if (_normalizationData == null)
     {
         _normalizationData = _getNormalizationDataFunc();
     }
     return(_normalizationData);
 }
Beispiel #2
0
 public NormalizationData GetNormalizationData()
 {
     if (_normalizationData == null)
     {
         _normalizationData = NormalizationData.GetNormalizationData(SrmDocument, ComparisonDef.UseZeroForMissingPeaks, ComparisonDef.QValueCutoff);
     }
     return(_normalizationData);
 }
Beispiel #3
0
 public NormalizationData GetNormalizationData()
 {
     if (!NormalizationMethod.EQUALIZE_MEDIANS.Equals(ComparisonDef.NormalizationMethod))
     {
         return(null);
     }
     return(_normalizationData = _normalizationData ?? NormalizationData.GetNormalizationData(SrmDocument));
 }
Beispiel #4
0
 public static PeptideQuantifier GetPeptideQuantifier(SrmDocument document, PeptideGroupDocNode peptideGroup,
                                                      PeptideDocNode peptide)
 {
     return(GetPeptideQuantifier(() => NormalizationData.GetNormalizationData(document, false, null),
                                 document.Settings, peptideGroup, peptide));
 }
        private Quantity GetTransitionQuantity(
            SrmSettings srmSettings,
            IDictionary <PeptideDocNode.TransitionKey, TransitionChromInfo> peptideStandards,
            int replicateIndex,
            TransitionGroupDocNode transitionGroup, TransitionDocNode transition)
        {
            if (null == transition.Results)
            {
                return(null);
            }
            if (replicateIndex >= transition.Results.Count)
            {
                return(null);
            }
            var chromInfos = transition.Results[replicateIndex];

            if (null == chromInfos)
            {
                return(null);
            }
            var chromInfo = GetTransitionChromInfo(transition, replicateIndex);

            if (null == chromInfo || chromInfo.IsEmpty)
            {
                return(null);
            }
            double normalizedArea = chromInfo.Area;
            double denominator    = 1.0;

            if (null != peptideStandards)
            {
                TransitionChromInfo chromInfoStandard;
                if (!peptideStandards.TryGetValue(GetRatioTransitionKey(transitionGroup, transition), out chromInfoStandard))
                {
                    return(null);
                }
                else
                {
                    denominator = chromInfoStandard.Area;
                }
            }
            else
            {
                if (chromInfo.IsTruncated.GetValueOrDefault())
                {
                    return(null);
                }
                if (Equals(NormalizationMethod, NormalizationMethod.GLOBAL_STANDARDS))
                {
                    denominator = srmSettings.CalcGlobalStandardArea(replicateIndex, chromInfo.FileId);
                }
                else if (Equals(NormalizationMethod, NormalizationMethod.EQUALIZE_MEDIANS))
                {
                    if (null == NormalizationData)
                    {
                        throw new InvalidOperationException(string.Format("Normalization method '{0}' is not supported here.", NormalizationMethod)); // Not L10N
                    }
                    double?median = NormalizationData.GetMedian(chromInfo.FileId, transitionGroup.TransitionGroup.LabelType);
                    if (!median.HasValue)
                    {
                        return(null);
                    }
                    denominator = Math.Pow(2.0, median.Value);
                }
            }
            return(new Quantity(normalizedArea, denominator));
        }