Exemplo n.º 1
0
        public static IsobaricType ReadIsobaricType(XElement iso)
        {
            var item = new IsobaricType();

            item.Name = iso.FindElement("name").Value;
            foreach (var tag in iso.FindElements("tag_mz"))
            {
                item.TagMassH.Add(double.Parse(tag.Value));
            }

            var channels = iso.FindElements("channel");

            for (int index = 0; index < channels.Count; index++)
            {
                var channel = channels[index];
                var cha     = new IsobaricChannel();
                cha.Index      = index;
                cha.Name       = channel.FindAttribute("name").Value;
                cha.Mz         = double.Parse(channel.FindAttribute("mz").Value);
                cha.Percentage = double.Parse(channel.FindAttribute("percentage").Value);
                item.Channels.Add(cha);

                foreach (var isotopic in channel.FindElements("isotopic"))
                {
                    var isot = new IsobaricIsotope();
                    isot.Name       = isotopic.FindAttribute("name").Value;
                    isot.Percentage = double.Parse(isotopic.FindAttribute("percentage").Value);
                    cha.Isotopics.Add(isot);
                }
            }

            item.Initialize();
            return(item);
        }
        public object Clone()
        {
            var result = new IsobaricChannel();

            result.Index      = Index;
            result.Name       = Name;
            result.Mz         = Mz;
            result.Percentage = Percentage;
            result.Isotopics  = Isotopics;

            return(result);
        }