public void Add(PeptideDocNode nodePep, ChromDataSet chromDataSet) { // If this is coming from the same PeptideDocNode, then just add it, otherwise // a merged copy of the PeptideDocNode needs to be created that includes // this new precursor. if (ReferenceEquals(nodePep, NodePep)) { if (!FindAndMerge(chromDataSet)) { // Not necessary to update children, because found in peptide AddDataSet(chromDataSet); } else { // Merging causes a change in the children UpdatePepChildren(); } } // Unless we already have one of these else if (!HasEquivalentGroupNode(chromDataSet.NodeGroup)) { if (!FindAndMerge(chromDataSet)) { AddDataSet(chromDataSet); } // Change children no matter what, since this was not in the peptide UpdatePepChildren(); } // Important not to lose iRT type if (nodePep.GlobalStandardType == PeptideDocNode.STANDARD_TYPE_IRT && NodePep.GlobalStandardType != PeptideDocNode.STANDARD_TYPE_IRT) { NodePep = NodePep.ChangeStandardType(PeptideDocNode.STANDARD_TYPE_IRT); } }
private void UpdatePepChildren() { var childrenNew = DataSets.Select(d => d.NodeGroup).ToArray(); NodePep = (PeptideDocNode)NodePep.ChangeChildrenChecked(childrenNew); }