/// <summary> /// Modifies a document in response to the user clicking on a peak in the GraphChromatogram. /// </summary> private static SrmDocument PickPeak(SrmDocument document, PickedPeakEventArgs e) { document = document.ChangePeak(e.GroupPath, e.NameSet, e.FilePath, e.TransitionId, e.RetentionTime.MeasuredTime, UserSet.TRUE); var activeTransitionGroup = (TransitionGroupDocNode) document.FindNode(e.GroupPath); if (activeTransitionGroup.RelativeRT != RelativeRT.Matching) { return document; } var activeChromInfo = FindChromInfo(document, activeTransitionGroup, e.NameSet, e.FilePath); var peptide = (PeptideDocNode) document.FindNode(e.GroupPath.Parent); // See if there are any other transition groups that should have their peak bounds set to the same value foreach (var transitionGroup in peptide.TransitionGroups) { if (transitionGroup.RelativeRT != RelativeRT.Matching) { continue; } var groupPath = new IdentityPath(e.GroupPath.Parent, transitionGroup.TransitionGroup); if (Equals(groupPath, e.GroupPath)) { continue; } var chromInfo = FindChromInfo(document, transitionGroup, e.NameSet, e.FilePath); if (null == chromInfo) { continue; } document = document.ChangePeak(groupPath, e.NameSet, e.FilePath, null, activeChromInfo.StartRetentionTime, activeChromInfo.EndRetentionTime, UserSet.TRUE, activeChromInfo.Identified, true); } return document; }
private void graphChromatogram_PickedPeak(object sender, PickedPeakEventArgs e) { var graphChrom = sender as GraphChromatogram; if (graphChrom != null) graphChrom.LockZoom(); try { ModifyDocument(string.Format(Resources.SkylineWindow_graphChromatogram_PickedPeak_Pick_peak__0_F01_, e.RetentionTime), doc => PickPeak(doc, e)); } finally { if (graphChrom != null) graphChrom.UnlockZoom(); } }
/// <summary> /// Indicates a peak has been picked at a specified retention time /// for a specific replicate of a specific <see cref="TransitionGroupDocNode"/>. /// </summary> /// <param name="nodeGroup">The transition group for which the peak was picked</param> /// <param name="nodeTran">The transition no which the time was chosen</param> /// <param name="peakTime">The retention time at which the peak was picked</param> public void FirePickedPeak(TransitionGroupDocNode nodeGroup, TransitionDocNode nodeTran, ScaledRetentionTime peakTime) { if (PickedPeak != null) { var filePath = FilePath; if (filePath == null) return; int iGroup = _nodeGroups.IndexOfReference(nodeGroup); var e = new PickedPeakEventArgs(_groupPaths[iGroup], nodeTran != null ? nodeTran.Id : null, _nameChromatogramSet, filePath, peakTime); PickedPeak(this, e); } }