Exemplo n.º 1
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="mt"></param>
        /// <param name="idata"></param>
        public MassTableObj(MassTableType mt, IdentDataObj idata)
            : base(mt, idata)
        {
            Id   = mt.id;
            Name = mt.name;

            _residues          = null;
            _ambiguousResidues = null;
            MsLevels           = null;

            if ((mt.Residue != null) && (mt.Residue.Count > 0))
            {
                Residues = new IdentDataList <ResidueObj>();
                foreach (var r in mt.Residue)
                {
                    Residues.Add(new ResidueObj(r, IdentData));
                }
            }
            if ((mt.AmbiguousResidue != null) && (mt.AmbiguousResidue.Count > 0))
            {
                AmbiguousResidues = new IdentDataList <AmbiguousResidueObj>();
                foreach (var ar in mt.AmbiguousResidue)
                {
                    AmbiguousResidues.Add(new AmbiguousResidueObj(ar, IdentData));
                }
            }
            if (mt.msLevel != null)
            {
                MsLevels = new List <string>(mt.msLevel);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="mt"></param>
        /// <param name="idata"></param>
        public MassTableObj(MassTableType mt, IdentDataObj idata)
            : base(mt, idata)
        {
            Id   = mt.id;
            Name = mt.name;

            Residues          = new IdentDataList <ResidueObj>(1);
            AmbiguousResidues = new IdentDataList <AmbiguousResidueObj>(1);
            MsLevels          = null;

            if (mt.Residue?.Count > 0)
            {
                Residues.AddRange(mt.Residue, r => new ResidueObj(r, IdentData));
            }
            if (mt.AmbiguousResidue?.Count > 0)
            {
                AmbiguousResidues.AddRange(mt.AmbiguousResidue, ar => new AmbiguousResidueObj(ar, IdentData));
            }
            if (mt.msLevel != null)
            {
                MsLevels = new List <string>(mt.msLevel);
            }
        }