예제 #1
0
        public void OnUpdateGraph()
        {
            switch (GraphSummary.Type)
            {
            case GraphTypeSummary.replicate:
            case GraphTypeSummary.peptide:
                GraphSummary.DoUpdateGraph(this, GraphSummary.Type);
                break;

            case GraphTypeSummary.histogram:
                if (!(GraphSummary.GraphPanes.FirstOrDefault() is MassErrorHistogramGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new MassErrorHistogramGraphPane(GraphSummary) }
                }
                ;
                break;

            case GraphTypeSummary.histogram2d:
                if (!(GraphSummary.GraphPanes.FirstOrDefault() is MassErrorHistogram2DGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new MassErrorHistogram2DGraphPane(GraphSummary) }
                }
                ;
                break;
            }
        }
예제 #2
0
        public void OnUpdateGraph()
        {
            // CONSIDER: Need a better guarantee that this ratio index matches the
            //           one in the sequence tree, but at least this will keep the UI
            //           from crashing with IndexOutOfBoundsException.
            var settings = GraphSummary.DocumentUIContainer.DocumentUI.Settings;

            GraphSummary.NormalizeOption = NormalizeOption.Constrain(settings, GraphSummary.NormalizeOption);

            var pane = GraphSummary.GraphPanes.FirstOrDefault();

            switch (GraphSummary.Type)
            {
            case GraphTypeSummary.replicate:
            case GraphTypeSummary.peptide:
                GraphSummary.DoUpdateGraph(this, GraphSummary.Type);
                break;

            case GraphTypeSummary.histogram:
                if (!(pane is AreaCVHistogramGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new AreaCVHistogramGraphPane(GraphSummary) }
                }
                ;
                break;

            case GraphTypeSummary.histogram2d:
                if (!(pane is AreaCVHistogram2DGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new AreaCVHistogram2DGraphPane(GraphSummary) }
                }
                ;
                break;
            }

            if (!ReferenceEquals(GraphSummary.GraphPanes.FirstOrDefault(), pane))
            {
                var disposable = pane as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
예제 #3
0
        public void OnUpdateGraph()
        {
            // CONSIDER: Need a better guarantee that this ratio index matches the
            //           one in the sequence tree, but at least this will keep the UI
            //           from crashing with IndexOutOfBoundsException.
            var settings = GraphSummary.DocumentUIContainer.DocumentUI.Settings;
            var mods     = settings.PeptideSettings.Modifications;

            GraphSummary.RatioIndex = Math.Min(GraphSummary.RatioIndex, mods.RatioInternalStandardTypes.Count - 1);

            // Only show ratios if document changes to have valid ratios
            if (AreaView == AreaNormalizeToView.area_ratio_view && !mods.HasHeavyModifications)
            {
                AreaView = AreaNormalizeToView.none;
            }

            // Only show ratios if type and info match
            if (NormalizationMethod == AreaCVNormalizationMethod.ratio && !mods.HasHeavyModifications ||
                NormalizationMethod == AreaCVNormalizationMethod.global_standards && !settings.HasGlobalStandardArea)
            {
                NormalizationMethod = AreaCVNormalizationMethod.none;
            }

            AreaCVRatioIndex = Math.Min(AreaCVRatioIndex, mods.RatioInternalStandardTypes.Count - 1);

            var globalStandards = NormalizationMethod == AreaCVNormalizationMethod.global_standards;

            if (globalStandards && !GraphSummary.DocumentUIContainer.DocumentUI.Settings.HasGlobalStandardArea)
            {
                NormalizationMethod = AreaCVNormalizationMethod.none;
            }

            var pane = GraphSummary.GraphPanes.FirstOrDefault();

            switch (GraphSummary.Type)
            {
            case GraphTypeSummary.replicate:
            case GraphTypeSummary.peptide:
                GraphSummary.DoUpdateGraph(this, GraphSummary.Type);
                break;

            case GraphTypeSummary.histogram:
                if (!(pane is AreaCVHistogramGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new AreaCVHistogramGraphPane(GraphSummary) }
                }
                ;
                break;

            case GraphTypeSummary.histogram2d:
                if (!(pane is AreaCVHistogram2DGraphPane))
                {
                    GraphSummary.GraphPanes = new[] { new AreaCVHistogram2DGraphPane(GraphSummary) }
                }
                ;
                break;
            }

            if (!ReferenceEquals(GraphSummary.GraphPanes.FirstOrDefault(), pane))
            {
                var disposable = pane as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }