public SrmDocument ChangePeak(SrmDocument doc, SrmTreeNode nodePepTree, TransitionGroupDocNode nodeTranGroup, string nameSet, MsDataFileUri filePath) { if ((_retentionTime ?? StartTime) == null) { return(doc); } var groupPath = new IdentityPath(nodePepTree.Path, nodeTranGroup.Id); doc = _retentionTime.HasValue ? doc.ChangePeak(groupPath, nameSet, filePath, null, _retentionTime.Value, UserSet.TRUE) : doc.ChangePeak(groupPath, nameSet, filePath, null, StartTime, EndTime, UserSet.TRUE, null, false); var activeTransitionGroup = (TransitionGroupDocNode)doc.FindNode(groupPath); if (activeTransitionGroup.RelativeRT != RelativeRT.Matching) { return(doc); } var activeChromInfo = SkylineWindow.FindChromInfo(doc, activeTransitionGroup, nameSet, filePath); var peptide = (PeptideDocNode)doc.FindNode(groupPath.Parent); // See if there are any other transition groups that should have their peak bounds set to the same value foreach (var tranGroup in peptide.TransitionGroups.Where(tranGroup => tranGroup.RelativeRT == RelativeRT.Matching)) { var otherGroupPath = new IdentityPath(groupPath.Parent, tranGroup.TransitionGroup); if (Equals(groupPath, otherGroupPath) || SkylineWindow.FindChromInfo(doc, tranGroup, nameSet, filePath) == null) { continue; } doc = doc.ChangePeak(otherGroupPath, nameSet, filePath, null, activeChromInfo.StartRetentionTime, activeChromInfo.EndRetentionTime, UserSet.TRUE, activeChromInfo.Identified, false); } return(doc); }