private void AddCurve(SrmDocument document, Color color) { var predict = document.Settings.PeptideSettings.Prediction; bool fullScan = document.Settings.TransitionSettings.FullScan.IsEnabledMsMs; // TODO: Guess this value from the document const bool singleWindow = false; List <PrecursorScheduleBase> listSchedules = new List <PrecursorScheduleBase>(); double xMax = double.MinValue, xMin = double.MaxValue; foreach (var nodePep in document.Molecules) { foreach (TransitionGroupDocNode nodeGroup in nodePep.Children) { double timeWindow; double?retentionTime = predict.PredictRetentionTime(document, nodePep, nodeGroup, SchedulingReplicateIndex, SchedulingAlgorithm, singleWindow, out timeWindow); var nodeGroupPrimary = PrimaryTransitionCount > 0 ? nodePep.GetPrimaryResultsGroup(nodeGroup) : null; if (retentionTime.HasValue) { // TODO: Make it possible to see transition scheduling when full-scan enabled. var schedule = new PrecursorScheduleBase(nodeGroup, nodeGroupPrimary, retentionTime.Value, timeWindow, fullScan, SchedulingReplicateIndex, PrimaryTransitionCount, 0); xMin = Math.Min(xMin, schedule.StartTime); xMax = Math.Max(xMax, schedule.EndTime); listSchedules.Add(schedule); } } } PointPairList points = new PointPairList(); xMin -= 1.0; xMax += 1.0; for (double x = xMin; x < xMax; x += 0.1) { points.Add(x, PrecursorScheduleBase.GetOverlapCount(listSchedules, x)); } string label = string.Format(Resources.RTScheduleGraphPane_AddCurve__0__Minute_Window, GetSchedulingWindow(document)); var curve = AddCurve(label, points, color); curve.Line.IsAntiAlias = true; curve.Line.IsOptimizedDraw = true; // TODO: Give this graph its own line width curve.Line.Width = Settings.Default.ChromatogramLineWidth; curve.Symbol.IsVisible = false; }
private void AddCurve(SrmDocument document, Color color, IProgressMonitor progressMonitor) { if (!string.IsNullOrEmpty(BrukerTemplateFile)) { IPointList brukerPoints = null; if (BrukerMetrics != null) { brukerPoints = BrukerMetrics.Get(BrukerMetricType); } else { BrukerTimsTofMethodExporter.GetScheduling(document, new ExportDlgProperties(new ExportMethodDlg(document, ExportFileType.Method), new CancellationToken()) { MethodType = ExportMethodType.Scheduled }, BrukerTemplateFile, progressMonitor, out brukerPoints); } AddCurve(document, brukerPoints, color); return; } var predict = document.Settings.PeptideSettings.Prediction; bool fullScan = document.Settings.TransitionSettings.FullScan.IsEnabledMsMs; // TODO: Guess this value from the document const bool singleWindow = false; List <PrecursorScheduleBase> listSchedules = new List <PrecursorScheduleBase>(); double xMax = double.MinValue, xMin = double.MaxValue; foreach (var nodePep in document.Molecules) { foreach (TransitionGroupDocNode nodeGroup in nodePep.Children) { double timeWindow; double?retentionTime = predict.PredictRetentionTime(document, nodePep, nodeGroup, SchedulingReplicateIndex, SchedulingAlgorithm, singleWindow, out timeWindow); var nodeGroupPrimary = PrimaryTransitionCount > 0 ? nodePep.GetPrimaryResultsGroup(nodeGroup) : null; if (retentionTime.HasValue) { // TODO: Make it possible to see transition scheduling when full-scan enabled. var schedule = new PrecursorScheduleBase(nodeGroup, nodeGroupPrimary, retentionTime.Value, timeWindow, fullScan, SchedulingReplicateIndex, PrimaryTransitionCount, 0); xMin = Math.Min(xMin, schedule.StartTime); xMax = Math.Max(xMax, schedule.EndTime); listSchedules.Add(schedule); } } } PointPairList points = new PointPairList(); xMin -= 1.0; xMax += 1.0; for (double x = xMin; x < xMax; x += 0.1) { points.Add(x, PrecursorScheduleBase.GetOverlapCount(listSchedules, x)); } AddCurve(document, points, color); }
private void AddCurve(SrmDocument document, Color color) { var predict = document.Settings.PeptideSettings.Prediction; bool fullScan = document.Settings.TransitionSettings.FullScan.IsEnabledMsMs; // TODO: Guess this value from the document const bool singleWindow = false; List<PrecursorScheduleBase> listSchedules = new List<PrecursorScheduleBase>(); double xMax = double.MinValue, xMin = double.MaxValue; foreach (var nodePep in document.Molecules) { foreach (TransitionGroupDocNode nodeGroup in nodePep.Children) { double timeWindow; double? retentionTime = predict.PredictRetentionTime(document, nodePep, nodeGroup, SchedulingReplicateIndex, SchedulingAlgorithm, singleWindow, out timeWindow); var nodeGroupPrimary = PrimaryTransitionCount > 0 ? nodePep.GetPrimaryResultsGroup(nodeGroup) : null; if (retentionTime.HasValue) { // TODO: Make it possible to see transition scheduling when full-scan enabled. var schedule = new PrecursorScheduleBase(nodeGroup, nodeGroupPrimary, retentionTime.Value, timeWindow, fullScan, SchedulingReplicateIndex, PrimaryTransitionCount, 0); xMin = Math.Min(xMin, schedule.StartTime); xMax = Math.Max(xMax, schedule.EndTime); listSchedules.Add(schedule); } } } PointPairList points = new PointPairList(); xMin -= 1.0; xMax += 1.0; for (double x = xMin; x < xMax; x += 0.1) points.Add(x, PrecursorScheduleBase.GetOverlapCount(listSchedules, x)); string label = string.Format(Resources.RTScheduleGraphPane_AddCurve__0__Minute_Window, GetSchedulingWindow(document)); var curve = AddCurve(label, points, color); curve.Line.IsAntiAlias = true; curve.Line.IsOptimizedDraw = true; // TODO: Give this graph its own line width curve.Line.Width = Settings.Default.ChromatogramLineWidth; curve.Symbol.IsVisible = false; }