public void Graph(MassErrorHistogram2DGraphPane graphPane, PeptideDocNode nodeSelected) { graphPane.Title.Text = string.Empty; graphPane.YAxis.Title.Text = Resources.MassErrorReplicateGraphPane_UpdateGraph_Mass_Error; graphPane.XAxis.Title.Text = _xAxis == Histogram2DXAxis.mass_to_charge ? Resources.MassErrorHistogram2DGraphPane_Graph_Mz : Resources.MassErrorHistogram2DGraphPane_Graph_Retention_Time; if (_maxCount == 0) { graphPane.Title.Text = Resources.MassErrorHistogramGraphPane_AddLabels_Mass_Errors_Unavailable; graphPane.CurveList.Clear(); return; } graphPane.YAxis.Scale.Min = _minMass; graphPane.YAxis.Scale.Max = _maxMass; graphPane.XAxis.Scale.Min = _minX; graphPane.XAxis.Scale.Max = _maxX; graphPane.AxisChange(); HeatMapGraphPane.GraphHeatMap(graphPane, _heatMapData, MAX_DOT_RADIUS, MIN_DOT_RADIUS, (float)_minMass, (float)_maxMass, Settings.Default.MassErrorHistogram2DLogScale, 5); }
public override void UpdateGraph(bool selectionChanged) { if (!GraphSummary.DocumentUIContainer.DocumentUI.Settings.HasResults) { _areaCVGraphData = null; return; } var settings = new AreaCVGraphData.AreaCVGraphSettings(GraphSummary.Type); _document = GraphSummary.DocumentUIContainer.DocumentUI; _percentage = !Settings.Default.AreaCVShowDecimals; _decimals = _percentage ? 1 : 3; CurveList.Clear(); var gotData = _cache.TryGet(_document, settings, DataCallback, out _areaCVGraphData); if (!gotData) { Title.Text = Resources.AreaCVHistogram2DGraphPane_UpdateGraph_Calculating____; return; } if (!_areaCVGraphData.IsValid) { Title.Text = Resources.AreaCVHistogram2DGraphPane_Draw_Not_enough_data; return; } var factor = AreaGraphController.GetAreaCVFactorToDecimal(); Title.Text = string.Empty; YAxis.Title.Text = Resources.AreaCVHistogram2DGraphPane_UpdateGraph_CV + (_percentage ? @" (%)" : string.Empty); XAxis.Title.Text = Resources.AreaCvHistogram2DGraphPane_UpdateGraph_Log10_Mean_Area; XAxis.Scale.MinAuto = XAxis.Scale.MinAuto = XAxis.Scale.MaxAuto = YAxis.Scale.MaxAuto = false; XAxis.Scale.Min = Math.Max(0, double.IsNaN(Settings.Default.AreaCVMinLog10Area) ? _areaCVGraphData.MinMeanArea : Settings.Default.AreaCVMinLog10Area); XAxis.Scale.Max = double.IsNaN(Settings.Default.AreaCVMaxLog10Area) ? _areaCVGraphData.MaxMeanArea : Settings.Default.AreaCVMaxLog10Area; YAxis.Scale.Min = 0.0; YAxis.Scale.Max = double.IsNaN(Settings.Default.AreaCVMaxCV) ? _areaCVGraphData.MaxCV * factor : Settings.Default.AreaCVMaxCV; AxisChange(); var points = _areaCVGraphData.Data .Select(d => new HeatMapData.TaggedPoint3D(new Point3D(d.MeanArea, d.CV * factor, d.Frequency), d)) .ToList(); Items = points.Count; // Because heatmaps can't be trusted to have a consistent number of points on all monitors var heatMapData = new HeatMapData(points); HeatMapGraphPane.GraphHeatMap(this, heatMapData, 17, 2, (float)(_areaCVGraphData.MinCV * factor), (float)(_areaCVGraphData.MaxCV * factor), Settings.Default.AreaCVLogScale, 0); var unit = _percentage ? @"%" : string.Empty; if (Settings.Default.AreaCVShowMedianCV) { string text = string.Format(Resources.AreaCVHistogram2DGraphPane_UpdateGraph_Median___0_, HistogramHelper.FormatDouble(_areaCVGraphData.MedianCV * factor, _decimals) + unit); _lineItems[0] = AddLineItem(text, XAxis.Scale.Min, XAxis.Scale.Max, _areaCVGraphData.MedianCV * factor, _areaCVGraphData.MedianCV * factor, Color.Blue); CurveList.Insert(0, _lineItems[0]); } if (Settings.Default.AreaCVShowCVCutoff) { string text = string.Format(Resources.AreaCVHistogramGraphPane_UpdateGraph_Below__0____1_, Settings.Default.AreaCVCVCutoff + unit, HistogramHelper.FormatDouble(_areaCVGraphData.BelowCVCutoff * factor, _decimals) + unit); _lineItems[1] = AddLineItem(text, XAxis.Scale.Min, XAxis.Scale.Max, Settings.Default.AreaCVCVCutoff, Settings.Default.AreaCVCVCutoff, Color.Red); CurveList.Insert(0, _lineItems[1]); } }