public PrecursorResultSummary(Precursor precursor, IEnumerable <PrecursorResult> results) : base(precursor.DataSchema) { #pragma warning disable 612 Precursor = precursor; #pragma warning restore 612 var bestRetentionTimes = new List <double>(); var maxFhwms = new List <double>(); var totalAreas = new List <double>(); var totalAreasNormalized = new List <double>(); var totalAreasRatio = new List <double>(); var maxHeights = new List <double>(); var detectionQValues = new List <double>(); foreach (var result in results) { if (result.BestRetentionTime.HasValue) { bestRetentionTimes.Add(result.BestRetentionTime.Value); } if (result.MaxFwhm.HasValue) { maxFhwms.Add(result.MaxFwhm.Value); } if (result.TotalArea.HasValue) { totalAreas.Add(result.TotalArea.Value); } if (result.TotalAreaNormalized.HasValue) { totalAreasNormalized.Add(result.TotalAreaNormalized.Value); } if (result.TotalAreaRatio.HasValue) { totalAreasRatio.Add(result.TotalAreaRatio.Value); } if (result.MaxHeight.HasValue) { maxHeights.Add(result.MaxHeight.Value); } if (result.DetectionQValue.HasValue) { detectionQValues.Add(result.DetectionQValue.Value); } } if (bestRetentionTimes.Count > 0) { BestRetentionTime = new RetentionTimeSummary(new Statistics(bestRetentionTimes)); } if (detectionQValues.Count > 0) { DetectionQValue = new DetectionQValueSummary(new Statistics(detectionQValues)); } if (maxFhwms.Count > 0) { MaxFwhm = new FwhmSummary(new Statistics(maxFhwms)); } if (totalAreas.Count > 0) { TotalArea = new AreaSummary(new Statistics(totalAreas)); } if (totalAreasNormalized.Count > 0) { TotalAreaNormalized = new AreaNormalizedSummary(new Statistics(totalAreasNormalized)); } if (totalAreasRatio.Count > 0) { TotalAreaRatio = new AreaRatioSummary(new Statistics(totalAreasRatio)); } if (maxHeights.Count > 0) { MaxHeight = new AreaSummary(new Statistics(maxHeights)); } }
public void ChangeChromInfo(EditDescription editDescription, Func <TransitionGroupChromInfo, TransitionGroupChromInfo> newChromInfo) { Precursor.ChangeDocNode(editDescription, docNode => docNode.ChangeResults(GetResultFile() .ChangeChromInfo(docNode.Results, newChromInfo))); }
public override ElementRef GetElementRef() { return(PrecursorResultRef.PROTOTYPE.ChangeChromInfo(GetResultFile().Replicate.ChromatogramSet, ChromInfo) .ChangeParent(Precursor.GetElementRef())); }
public PrecursorResult(Precursor precursor, ResultFile file) : base(precursor, file) { _chromInfo = CachedValue.Create(DataSchema, () => GetResultFile().FindChromInfo(precursor.DocNode.Results)); }
public void ChangeChromInfo(EditDescription editDescription, TransitionGroupChromInfo newChromInfo) { var newDocNode = Precursor.DocNode.ChangeResults(GetResultFile().ChangeChromInfo(Precursor.DocNode.Results, newChromInfo)); Precursor.ChangeDocNode(editDescription, newDocNode); }