public void DoUpdateGraph(IControllerSplit graphController, GraphTypeSummary graphType) { var paneKeys = CalcPaneKeys(graphType); bool panesValid = paneKeys.SequenceEqual(GraphPanes.Select(pane => pane.PaneKey)); if (panesValid) { switch (graphType) { case GraphTypeSummary.replicate: panesValid = GraphPanes.All(graphController.IsReplicatePane); break; case GraphTypeSummary.peptide: panesValid = GraphPanes.All(graphController.IsPeptidePane); break; } } if (panesValid) { return; } switch (graphType) { case GraphTypeSummary.replicate: GraphPanes = paneKeys.Select(graphController.CreateReplicatePane); break; case GraphTypeSummary.peptide: GraphPanes = paneKeys.Select(graphController.CreatePeptidePane); break; } }
public static string CustomToString(this GraphTypeSummary type) { switch (type) { case GraphTypeSummary.invalid: return(string.Empty); case GraphTypeSummary.replicate: return(Resources.Extensions_CustomToString_Replicate_Comparison); case GraphTypeSummary.peptide: return(Resources.Extensions_CustomToString_Peptide_Comparison); case GraphTypeSummary.score_to_run_regression: return(Resources.Extensions_CustomToString_Score_To_Run_Regression); case GraphTypeSummary.schedule: return(Resources.Extensions_CustomToString_Scheduling); case GraphTypeSummary.run_to_run_regression: return(Resources.Extensions_CustomToString_Run_To_Run_Regression); case GraphTypeSummary.histogram: return(Resources.Extensions_CustomToString_Histogram); case GraphTypeSummary.histogram2d: return(Resources.Extensions_CustomToString__2D_Histogram); default: return(string.Empty); } }
public AreaCVGraphSettings(GraphTypeSummary graphType, AreaCVNormalizationMethod normalizationMethod, int ratioIndex, string group, string annotation, PointsTypePeakArea pointsType, double qValueCutoff, double cvCutoff, int minimumDetections, double binwidth) { GraphType = graphType; NormalizationMethod = normalizationMethod; RatioIndex = ratioIndex; Group = group; Annotation = annotation; PointsType = pointsType; QValueCutoff = qValueCutoff; CVCutoff = cvCutoff; MinimumDetections = minimumDetections; BinWidth = binwidth; }
public AreaCVGraphSettings(GraphTypeSummary graphType, NormalizeOption normalizeOption, ReplicateValue group, object annotation, PointsTypePeakArea pointsType, double qValueCutoff, double cvCutoff, int minimumDetections, double binwidth, AreaCVMsLevel msLevel, AreaCVTransitions transitions, int countTransitions) { GraphType = graphType; NormalizeOption = normalizeOption; Group = group; Annotation = annotation; PointsType = pointsType; QValueCutoff = qValueCutoff; CVCutoff = cvCutoff; MinimumDetections = minimumDetections; BinWidth = binwidth; MsLevel = msLevel; Transitions = transitions; CountTransitions = countTransitions; }
public AreaCVGraphSettings(SrmSettings srmSettings, GraphTypeSummary graphType, bool convertToDecimal = true) { var factor = !Settings.Default.AreaCVShowDecimals && convertToDecimal ? 0.01 : 1.0; GraphType = graphType; MsLevel = AreaGraphController.AreaCVMsLevel; Transitions = AreaGraphController.AreaCVTransitions; CountTransitions = AreaGraphController.AreaCVTransitionsCount; NormalizeOption = AreaGraphController.AreaCVNormalizeOption; Group = ReplicateValue.FromPersistedString(srmSettings, AreaGraphController.GroupByGroup); Annotation = AreaGraphController.GroupByAnnotation; PointsType = AreaGraphController.PointsType; QValueCutoff = Settings.Default.AreaCVQValueCutoff; CVCutoff = Settings.Default.AreaCVCVCutoff * factor; MinimumDetections = AreaGraphController.MinimumDetections; BinWidth = Settings.Default.AreaCVHistogramBinWidth * factor; }
public AreaCVGraphSettings(GraphTypeSummary graphType, bool convertToDecimal = true) { var factor = !Settings.Default.AreaCVShowDecimals && convertToDecimal ? 0.01 : 1.0; GraphType = graphType; NormalizationMethod = AreaGraphController.NormalizationMethod; RatioIndex = AreaGraphController.AreaCVRatioIndex; Group = AreaGraphController.GroupByGroup != null?string.Copy(AreaGraphController.GroupByGroup) : null; Annotation = AreaGraphController.GroupByAnnotation != null?string.Copy(AreaGraphController.GroupByAnnotation) : null; PointsType = AreaGraphController.PointsType; QValueCutoff = Settings.Default.AreaCVQValueCutoff; CVCutoff = Settings.Default.AreaCVCVCutoff * factor; MinimumDetections = AreaGraphController.MinimumDetections; BinWidth = Settings.Default.AreaCVHistogramBinWidth * factor; }
public GraphSummary(GraphTypeSummary type, IDocumentUIContainer documentUIContainer, IController controller, int targetResultsIndex, int originalIndex = -1) { _targetResultsIndex = targetResultsIndex; _originalResultsIndex = originalIndex; InitializeComponent(); Icon = Resources.SkylineData; graphControl.MasterPane.Border.IsVisible = false; _controller = controller; _controller.GraphSummary = this; _documentContainer = documentUIContainer; _documentContainer.ListenUI(OnDocumentUIChanged); _stateProvider = documentUIContainer as IStateProvider ?? new DefaultStateProvider(); Type = type; Text = Controller.Text + @" - " + Type.CustomToString(); UpdateUI(); }
public GraphSummary(GraphTypeSummary type, IDocumentUIContainer documentUIContainer, IController controller, int targetResultsIndex, int originalIndex = -1) { _targetResultsIndex = targetResultsIndex; _originalResultsIndex = originalIndex; InitializeComponent(); Icon = Resources.SkylineData; graphControl.MasterPane.Border.IsVisible = false; _controller = controller; _controller.GraphSummary = this; _documentContainer = documentUIContainer; _documentContainer.ListenUI(OnDocumentUIChanged); _stateProvider = documentUIContainer as IStateProvider ?? new DefaultStateProvider(); Type = type; Text = Controller.Text + @" - " + Type.CustomToString(); Helpers.PeptideToMoleculeTextMapper.TranslateForm(this, _documentContainer.Document.DocumentType); // Use terminology like "Molecule Comparison" instead of "Peptide Comparison" as appropriate UpdateUI(); }
public PaneKey[] CalcPaneKeys(GraphTypeSummary graphType) { PaneKey[] paneKeys = null; if (Settings.Default.SplitChromatogramGraph) { if (graphType == GraphTypeSummary.replicate) { var selectedTreeNode = StateProvider.SelectedNode as SrmTreeNode; if (null != selectedTreeNode) { TransitionGroupDocNode[] transitionGroups; bool transitionSelected = false; // ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull if (selectedTreeNode.Model is PeptideDocNode) { transitionGroups = ((PeptideDocNode)selectedTreeNode.Model).TransitionGroups.ToArray(); } // ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull else if (selectedTreeNode.Model is TransitionGroupDocNode) { transitionGroups = new[] { (TransitionGroupDocNode)selectedTreeNode.Model }; } else if (selectedTreeNode.Model is TransitionDocNode) { transitionGroups = new[] { (TransitionGroupDocNode)((SrmTreeNode)selectedTreeNode.Parent).Model }; transitionSelected = true; } else { transitionGroups = new TransitionGroupDocNode[0]; } if (transitionGroups.Length == 1) { if (GraphChromatogram.DisplayType == DisplayTypeChrom.all || (GraphChromatogram.DisplayType == DisplayTypeChrom.single && !transitionSelected)) { var transitionGroup = transitionGroups[0]; bool hasPrecursors = transitionGroup.Transitions.Any(transition => transition.IsMs1); bool hasProducts = transitionGroup.Transitions.Any(transition => !transition.IsMs1); if (hasPrecursors && hasProducts) { paneKeys = new[] { PaneKey.PRECURSORS, PaneKey.PRODUCTS }; } } } else if (transitionGroups.Length > 1) { paneKeys = transitionGroups.Select(group => new PaneKey(@group)) .Distinct().ToArray(); } } } else { paneKeys = StateProvider.SelectionDocument.MoleculeTransitionGroups.Select( group => new PaneKey(@group.TransitionGroup.LabelType)).Distinct().ToArray(); } } paneKeys = paneKeys ?? new[] { PaneKey.DEFAULT }; Array.Sort(paneKeys); return(paneKeys); }