/// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sii"></param>
        /// <param name="idata"></param>
        public SpectrumIdentificationItemObj(SpectrumIdentificationItemType sii, IdentDataObj idata)
            : base(sii, idata)
        {
            Id          = sii.id;
            Name        = sii.name;
            ChargeState = sii.chargeState;
            ExperimentalMassToCharge        = sii.experimentalMassToCharge;
            _calculatedMassToCharge         = sii.calculatedMassToCharge;
            CalculatedMassToChargeSpecified = sii.calculatedMassToChargeSpecified;
            _calculatedPI         = sii.calculatedPI;
            CalculatedPISpecified = sii.calculatedPISpecified;
            PeptideRef            = sii.peptide_ref;
            Rank          = sii.rank;
            PassThreshold = sii.passThreshold;
            MassTableRef  = sii.massTable_ref;
            SampleRef     = sii.sample_ref;

            PeptideEvidences = new IdentDataList <PeptideEvidenceRefObj>(1);
            Fragmentations   = new IdentDataList <IonTypeObj>(1);

            if (sii.PeptideEvidenceRef?.Count > 0)
            {
                PeptideEvidences.AddRange(sii.PeptideEvidenceRef, pe => new PeptideEvidenceRefObj(pe, IdentData));
            }
            if (sii.Fragmentation?.Count > 0)
            {
                Fragmentations.AddRange(sii.Fragmentation, f => new IonTypeObj(f, IdentData));
            }
        }
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="it"></param>
        /// <param name="idata"></param>
        public IonTypeObj(IonTypeType it, IdentDataObj idata)
            : base(idata)
        {
            Charge = it.charge;

            FragmentArrays = new IdentDataList <FragmentArrayObj>(1);
            CVParams       = new IdentDataList <CVParamObj>(1);
            UserParams     = new IdentDataList <UserParamObj>(1);
            Index          = new List <string>();

            if (it.FragmentArray?.Count > 0)
            {
                FragmentArrays.AddRange(it.FragmentArray, f => new FragmentArrayObj(f, IdentData));
            }

            if (it.cvParam?.Count > 0)
            {
                CVParams.AddRange(it.cvParam.Select(cvp => new CVParamObj(cvp, idata)));
            }

            if (it.userParam?.Count > 0)
            {
                UserParams.AddRange(it.userParam.Select(up => new UserParamObj(up, idata)));
            }
        }
Пример #3
0
        /// <summary>
        /// Object equality
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(IdentDataList <T> other)
        {
            if (this.Count == 0 && (other == null || other.Count == 0))
            {
                return(true);
            }
            if (other == null || other.Count == 0)
            {
                return(false);
            }
            if (this.Count != other.Count)
            {
                return(false);
            }
            foreach (var item in this)
            {
                var found = false;

                foreach (var item2 in other)
                {
                    if (item.Equals(item2))
                    {
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    return(false);
                }
            }
            return(true);
        }
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sc"></param>
        /// <param name="idata"></param>
        public SequenceCollectionObj(SequenceCollectionType sc, IdentDataObj idata)
            : base(idata)
        {
            DBSequences      = new IdentDataList <DbSequenceObj>(1);
            Peptides         = new IdentDataList <PeptideObj>(1);
            PeptideEvidences = new IdentDataList <PeptideEvidenceObj>(1);

            idata.SequenceCollection = this;

            if (sc.DBSequence?.Count > 0)
            {
                DBSequences.AddIdMap();
                DBSequences.AddRange(sc.DBSequence, dbs => new DbSequenceObj(dbs, IdentData));
            }
            if (sc.Peptide?.Count > 0)
            {
                Peptides.AddIdMap();
                Peptides.AddRange(sc.Peptide, p => new PeptideObj(p, IdentData));
            }
            if (sc.PeptideEvidence?.Count > 0)
            {
                PeptideEvidences.AddIdMap();
                PeptideEvidences.AddRange(sc.PeptideEvidence, pe => new PeptideEvidenceObj(pe, IdentData));
            }
        }
Пример #5
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="s"></param>
        /// <param name="idata"></param>
        public SampleObj(SampleType s, IdentDataObj idata)
            : base(s, idata)
        {
            Id   = s.id;
            Name = s.name;

            _contactRoles = null;
            _subSamples   = null;

            if ((s.ContactRole != null) && (s.ContactRole.Count > 0))
            {
                ContactRoles = new IdentDataList <ContactRoleObj>();
                foreach (var cr in s.ContactRole)
                {
                    ContactRoles.Add(new ContactRoleObj(cr, IdentData));
                }
            }
            if ((s.SubSample != null) && (s.SubSample.Count > 0))
            {
                SubSamples = new IdentDataList <SubSampleObj>();
                foreach (var ss in s.SubSample)
                {
                    SubSamples.Add(new SubSampleObj(ss, IdentData));
                }
            }
        }
Пример #6
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="si"></param>
        /// <param name="idata"></param>
        public SpectrumIdentificationObj(SpectrumIdentificationType si, IdentDataObj idata)
            : base(si, idata)
        {
            SpectrumIdentificationProtocolRef = si.spectrumIdentificationProtocol_ref;
            SpectrumIdentificationListRef     = si.spectrumIdentificationList_ref;

            _inputSpectra    = null;
            _searchDatabases = null;

            if ((si.InputSpectra != null) && (si.InputSpectra.Count > 0))
            {
                InputSpectra = new IdentDataList <InputSpectraRefObj>();
                foreach (var ispec in si.InputSpectra)
                {
                    InputSpectra.Add(new InputSpectraRefObj(ispec, IdentData));
                }
            }
            if ((si.SearchDatabaseRef != null) && (si.SearchDatabaseRef.Count > 0))
            {
                SearchDatabases = new IdentDataList <SearchDatabaseRefObj>();
                foreach (var sd in si.SearchDatabaseRef)
                {
                    SearchDatabases.Add(new SearchDatabaseRefObj(sd, IdentData));
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public EnzymeListObj()
        {
            _independent         = false;
            IndependentSpecified = false;

            Enzymes = new IdentDataList <EnzymeObj>(1);
        }
Пример #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ProteinDetectionListObj()
        {
            Id   = null;
            Name = null;

            ProteinAmbiguityGroups = new IdentDataList <ProteinAmbiguityGroupObj>(1);
        }
Пример #9
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sc"></param>
        /// <param name="idata"></param>
        public SequenceCollectionObj(SequenceCollectionType sc, IdentDataObj idata)
            : base(idata)
        {
            _dBSequences      = null;
            _peptides         = null;
            _peptideEvidences = null;

            idata.SequenceCollection = this;

            if ((sc.DBSequence != null) && (sc.DBSequence.Count > 0))
            {
                DBSequences = new IdentDataList <DbSequenceObj>();
                foreach (var dbs in sc.DBSequence)
                {
                    DBSequences.Add(new DbSequenceObj(dbs, IdentData));
                }
            }
            if ((sc.Peptide != null) && (sc.Peptide.Count > 0))
            {
                Peptides = new IdentDataList <PeptideObj>();
                foreach (var p in sc.Peptide)
                {
                    Peptides.Add(new PeptideObj(p, IdentData));
                }
            }
            if ((sc.PeptideEvidence != null) && (sc.PeptideEvidence.Count > 0))
            {
                PeptideEvidences = new IdentDataList <PeptideEvidenceObj>();
                foreach (var pe in sc.PeptideEvidence)
                {
                    PeptideEvidences.Add(new PeptideEvidenceObj(pe, IdentData));
                }
            }
        }
Пример #10
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);
            }
        }
Пример #11
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public PeptideHypothesisObj()
        {
            _peptideEvidenceRef = null;

            _peptideEvidence            = null;
            SpectrumIdentificationItems = new IdentDataList <SpectrumIdentificationItemRefObj>();
        }
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sip"></param>
        /// <param name="idata"></param>
        public SpectrumIdentificationProtocolObj(SpectrumIdentificationProtocolType sip, IdentDataObj idata)
            : base(idata)
        {
            Id   = sip.id;
            Name = sip.name;
            AnalysisSoftwareRef = sip.analysisSoftware_ref;

            _searchType             = null;
            _additionalSearchParams = null;
            _enzymes             = null;
            _threshold           = null;
            _databaseTranslation = null;

            ModificationParams = new IdentDataList <SearchModificationObj>(1);
            MassTables         = new IdentDataList <MassTableObj>(1);
            FragmentTolerances = new IdentDataList <CVParamObj>(1);
            ParentTolerances   = new IdentDataList <CVParamObj>(1);
            DatabaseFilters    = new IdentDataList <FilterInfo>(1);

            if (sip.SearchType != null)
            {
                _searchType = new ParamObj(sip.SearchType, IdentData);
            }
            if (sip.AdditionalSearchParams != null)
            {
                _additionalSearchParams = new ParamListObj(sip.AdditionalSearchParams, IdentData);
            }
            if (sip.ModificationParams?.Count > 0)
            {
                ModificationParams.AddRange(sip.ModificationParams, mp => new SearchModificationObj(mp, IdentData));
            }
            if (sip.Enzymes != null)
            {
                _enzymes = new EnzymeListObj(sip.Enzymes, IdentData);
            }
            if (sip.MassTable?.Count > 0)
            {
                MassTables.AddRange(sip.MassTable, mt => new MassTableObj(mt, IdentData));
            }
            if (sip.FragmentTolerance?.Count > 0)
            {
                FragmentTolerances.AddRange(sip.FragmentTolerance, ft => new CVParamObj(ft, IdentData));
            }
            if (sip.ParentTolerance?.Count > 0)
            {
                ParentTolerances.AddRange(sip.ParentTolerance, pt => new CVParamObj(pt, IdentData));
            }
            if (sip.Threshold != null)
            {
                _threshold = new ParamListObj(sip.Threshold, IdentData);
            }
            if (sip.DatabaseFilters?.Count > 0)
            {
                DatabaseFilters.AddRange(sip.DatabaseFilters, df => new FilterInfo(df, IdentData));
            }
            if (sip.DatabaseTranslation != null)
            {
                _databaseTranslation = new DatabaseTranslationObj(sip.DatabaseTranslation, IdentData);
            }
        }
Пример #13
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sil"></param>
        /// <param name="idata"></param>
        public SpectrumIdentificationListObj(SpectrumIdentificationListType sil, IdentDataObj idata)
            : base(sil, idata)
        {
            Id   = sil.id;
            Name = sil.name;
            _numSequencesSearched         = sil.numSequencesSearched;
            NumSequencesSearchedSpecified = sil.numSequencesSearchedSpecified;

            _fragmentationTables           = null;
            _spectrumIdentificationResults = null;

            if ((sil.FragmentationTable != null) && (sil.FragmentationTable.Count > 0))
            {
                FragmentationTables = new IdentDataList <MeasureObj>();
                foreach (var f in sil.FragmentationTable)
                {
                    FragmentationTables.Add(new MeasureObj(f, IdentData));
                }
            }
            if ((sil.SpectrumIdentificationResult != null) && (sil.SpectrumIdentificationResult.Count > 0))
            {
                SpectrumIdentificationResults = new IdentDataList <SpectrumIdentificationResultObj>();
                foreach (var sir in sil.SpectrumIdentificationResult)
                {
                    SpectrumIdentificationResults.Add(new SpectrumIdentificationResultObj(sir, IdentData));
                }
            }
        }
Пример #14
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public ProteinAmbiguityGroupObj()
        {
            Id   = null;
            Name = null;

            ProteinDetectionHypotheses = new IdentDataList <ProteinDetectionHypothesisObj>();
        }
Пример #15
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="i"></param>
        /// <param name="idata"></param>
        public InputsObj(InputsType i, IdentDataObj idata)
            : base(idata)
        {
            _sourceFiles     = null;
            _searchDatabases = null;
            _spectraDataList = null;

            if ((i.SourceFile != null) && (i.SourceFile.Count > 0))
            {
                SourceFiles = new IdentDataList <SourceFileInfo>();
                foreach (var sf in i.SourceFile)
                {
                    SourceFiles.Add(new SourceFileInfo(sf, IdentData));
                }
            }
            if ((i.SearchDatabase != null) && (i.SearchDatabase.Count > 0))
            {
                SearchDatabases = new IdentDataList <SearchDatabaseInfo>();
                foreach (var sd in i.SearchDatabase)
                {
                    SearchDatabases.Add(new SearchDatabaseInfo(sd, IdentData));
                }
            }
            if ((i.SpectraData != null) && (i.SpectraData.Count > 0))
            {
                SpectraDataList = new IdentDataList <SpectraDataObj>();
                foreach (var sd in i.SpectraData)
                {
                    SpectraDataList.Add(new SpectraDataObj(sd, IdentData));
                }
            }
        }
Пример #16
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="sip"></param>
        /// <param name="idata"></param>
        public SpectrumIdentificationProtocolObj(SpectrumIdentificationProtocolType sip, IdentDataObj idata)
            : base(idata)
        {
            Id = sip.id;
            Name = sip.name;
            AnalysisSoftwareRef = sip.analysisSoftware_ref;

            _searchType = null;
            _additionalSearchParams = null;
            _modificationParams = null;
            _enzymes = null;
            _massTables = null;
            _fragmentTolerances = null;
            _parentTolerances = null;
            _threshold = null;
            _databaseFilters = null;
            _databaseTranslation = null;

            if (sip.SearchType != null)
                _searchType = new ParamObj(sip.SearchType, IdentData);
            if (sip.AdditionalSearchParams != null)
                _additionalSearchParams = new ParamListObj(sip.AdditionalSearchParams, IdentData);
            if ((sip.ModificationParams != null) && (sip.ModificationParams.Count > 0))
            {
                ModificationParams = new IdentDataList<SearchModificationObj>();
                foreach (var mp in sip.ModificationParams)
                    ModificationParams.Add(new SearchModificationObj(mp, IdentData));
            }
            if (sip.Enzymes != null)
                _enzymes = new EnzymeListObj(sip.Enzymes, IdentData);
            if ((sip.MassTable != null) && (sip.MassTable.Count > 0))
            {
                MassTables = new IdentDataList<MassTableObj>();
                foreach (var mt in sip.MassTable)
                    MassTables.Add(new MassTableObj(mt, IdentData));
            }
            if ((sip.FragmentTolerance != null) && (sip.FragmentTolerance.Count > 0))
            {
                FragmentTolerances = new IdentDataList<CVParamObj>();
                foreach (var ft in sip.FragmentTolerance)
                    FragmentTolerances.Add(new CVParamObj(ft, IdentData));
            }
            if (sip.ParentTolerance != null)
            {
                ParentTolerances = new IdentDataList<CVParamObj>();
                foreach (var pt in sip.ParentTolerance)
                    ParentTolerances.Add(new CVParamObj(pt, IdentData));
            }
            if (sip.Threshold != null)
                _threshold = new ParamListObj(sip.Threshold, IdentData);
            if ((sip.DatabaseFilters != null) && (sip.DatabaseFilters.Count > 0))
            {
                DatabaseFilters = new IdentDataList<FilterInfo>();
                foreach (var df in sip.DatabaseFilters)
                    DatabaseFilters.Add(new FilterInfo(df, IdentData));
            }
            if (sip.DatabaseTranslation != null)
                _databaseTranslation = new DatabaseTranslationObj(sip.DatabaseTranslation, IdentData);
        }
Пример #17
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public IonTypeObj()
        {
            Charge = 0;

            FragmentArrays = new IdentDataList <FragmentArrayObj>();
            _cvParam       = null;
            Index          = new List <string>();
        }
Пример #18
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public PersonObj()
        {
            LastName    = null;
            FirstName   = null;
            MidInitials = null;

            Affiliations = new IdentDataList <AffiliationObj>();
        }
Пример #19
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SearchModificationObj()
        {
            FixedMod = false;
            MassDelta = 0;
            Residues = null;

            SpecificityRules = new IdentDataList<SpecificityRulesListObj>(1);
        }
Пример #20
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public SampleObj()
        {
            Id   = null;
            Name = null;

            ContactRoles = new IdentDataList <ContactRoleObj>();
            SubSamples   = new IdentDataList <SubSampleObj>();
        }
Пример #21
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public MassTableObj()
        {
            Id   = null;
            Name = null;

            Residues          = new IdentDataList <ResidueObj>();
            AmbiguousResidues = new IdentDataList <AmbiguousResidueObj>();
            MsLevels          = new List <string>();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public IonTypeObj()
        {
            Charge = 0;

            FragmentArrays = new IdentDataList <FragmentArrayObj>(1);
            CVParams       = new IdentDataList <CVParamObj>(1);
            UserParams     = new IdentDataList <UserParamObj>(1);
            Index          = new List <string>();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ProteinDetectionObj()
        {
            _proteinDetectionListRef     = null;
            _proteinDetectionProtocolRef = null;

            _proteinDetectionList        = null;
            _proteinDetectionProtocol    = null;
            InputSpectrumIdentifications = new IdentDataList <InputSpectrumIdentificationsObj>(1);
        }
Пример #24
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PeptideObj()
        {
            Id              = null;
            Name            = null;
            PeptideSequence = null;

            Modifications             = new IdentDataList <ModificationObj>(1);
            SubstitutionModifications = new IdentDataList <SubstitutionModificationObj>(1);
        }
Пример #25
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public SpectrumIdentificationObj()
        {
            _spectrumIdentificationProtocolRef = null;
            _spectrumIdentificationListRef     = null;

            _spectrumIdentificationProtocol = null;
            _spectrumIdentificationList     = null;
            InputSpectra    = new IdentDataList <InputSpectraRefObj>();
            SearchDatabases = new IdentDataList <SearchDatabaseRefObj>();
        }
Пример #26
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public SpectrumIdentificationResultObj()
        {
            Id              = null;
            Name            = null;
            SpectrumID      = null;
            _spectraDataRef = null;

            _spectraData = null;
            SpectrumIdentificationItems = new IdentDataList <SpectrumIdentificationItemObj>();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public SpectrumIdentificationListObj()
        {
            Id   = null;
            Name = null;
            _numSequencesSearched         = -1;
            NumSequencesSearchedSpecified = false;

            FragmentationTables           = new IdentDataList <MeasureObj>(1);
            SpectrumIdentificationResults = new IdentDataList <SpectrumIdentificationResultObj>(1);
        }
Пример #28
0
        /// <summary>
        ///     Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="p"></param>
        /// <param name="idata"></param>
        public PeptideObj(PeptideType p, IdentDataObj idata)
            : base(p, idata)
        {
            Id              = p.id;
            Name            = p.name;
            PeptideSequence = p.PeptideSequence;

            _modifications             = null;
            _substitutionModifications = null;
        }
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="pg"></param>
        /// <param name="idata"></param>
        public ParamGroupObj(IParamGroup pg, IdentDataObj idata)
            : base(pg, idata)
        {
            UserParams = new IdentDataList <UserParamObj>(1);

            if (pg.userParam?.Count > 0)
            {
                UserParams.AddRange(pg.userParam, up => new UserParamObj(up, IdentData));
            }
        }
Пример #30
0
        /// <summary>
        /// Create an object using the contents of the corresponding MzIdentML object
        /// </summary>
        /// <param name="cvpg"></param>
        /// <param name="idata"></param>
        public CVParamGroupObj(ICVParamGroup cvpg, IdentDataObj idata)
            : base(idata)
        {
            CVParams = new IdentDataList <CVParamObj>(1);

            if (cvpg.cvParam?.Count > 0)
            {
                CVParams.AddRange(cvpg.cvParam, cvp => new CVParamObj(cvp, IdentData));
            }
        }