Example #1
0
        /// <summary>
        /// Sets the parents NET value based on the scan numbers observed in the children.
        /// </summary>
        public void setParentNetFromChildren(IqTarget target)
        {
            var children = target.ChildTargets();
            var scanList = new List <int>();

            foreach (IqChargeStateTarget chargeStateTarget in children)
            {
                scanList.Add(chargeStateTarget.ObservedScan);
            }
            scanList.Sort();
            target.ElutionTimeTheor = Run.NetAlignmentInfo.GetNETValueForScan(scanList[scanList.Count / 2]);
        }
        /// <summary>
        /// for cloning a IqTarget. Recursive
        /// </summary>
        /// <param name="target">Input the root target so all children will be cloned</param>
        /// <returns></returns>
        public IqTarget Clone(IqTarget target)
        {
            IqTarget tempTarget = new IqTargetBasic();

            CopyTargetProperties(target, tempTarget);

            //child targets
            var childTargets = target.ChildTargets().ToList();

            if (target.HasChildren() && childTargets.Count > 0)
            {
                foreach (var child in childTargets)
                {
                    var clone = Clone(child);
                    clone.ParentTarget = target;
                    tempTarget.AddTarget(clone);
                }
            }
            return(tempTarget);
        }