コード例 #1
0
        public PeptideGroupDocNode UpdateMoleculeGroup(PeptideGroupDocNode peptideGroupDocNode)
        {
            CheckCancelled();
            AnnotationUpdater updater;
            var identityPath = new IdentityPath(peptideGroupDocNode.PeptideGroup);

            if (_annotationUpdaters.TryGetValue(AnnotationDef.AnnotationTarget.protein, out updater))
            {
                var protein     = new Protein(SkylineDataSchema, identityPath);
                var annotations = updater.UpdateAnnotations(peptideGroupDocNode.Annotations, protein);
                if (!Equals(annotations, peptideGroupDocNode.Annotations))
                {
                    peptideGroupDocNode = (PeptideGroupDocNode)peptideGroupDocNode.ChangeAnnotations(annotations);
                }
            }

            if (!RecurseMolecules)
            {
                return(peptideGroupDocNode);
            }


            var newChildren = peptideGroupDocNode.Molecules
                              .Select(peptideDocNode => UpdateMolecule(identityPath, peptideDocNode)).ToArray();

            if (!ArrayUtil.ReferencesEqual(peptideGroupDocNode.Children, newChildren))
            {
                peptideGroupDocNode = (PeptideGroupDocNode)peptideGroupDocNode.ChangeChildren(newChildren);
            }

            return(peptideGroupDocNode);
        }