Beispiel #1
0
        /// <summary>
        /// Adds information about the analysis software to the file
        /// </summary>
        /// <param name="id">Unique identifier for the entry</param>
        /// <param name="name">Name of the analysis software</param>
        /// <param name="version">Version of the analysis software</param>
        /// <param name="cvid">CVID (if it exists) for the analysis software</param>
        /// <param name="userParamSoftwareName">Long name of the Analysis software. Not used unless cvid is "CVID_Unknown"</param>
        /// <returns>The analysis software object to further modify, if needed.</returns>
        public AnalysisSoftwareObj AddAnalysisSoftware(string id, string name, string version, CV.CV.CVID cvid,
                                                       string userParamSoftwareName = "")
        {
            var software = new AnalysisSoftwareObj
            {
                Name         = name,
                Id           = id,
                Version      = version,
                SoftwareName = new ParamObj(),
            };

            if (cvid != CV.CV.CVID.CVID_Unknown)
            {
                software.SoftwareName.Item = new CVParamObj(cvid);
            }
            else
            {
                software.SoftwareName.Item = new UserParamObj()
                {
                    Name = userParamSoftwareName,
                };
            }

            identData.AnalysisSoftwareList.Add(software);

            return(software);
        }
        public MsgfMzidFull(string mzidFilePath) : base(mzidFilePath, false)
        {
            // load mzid file;
            // obviously won't have a 'Job' number available
            identData         = IdentDataReaderWriter.Read(mzidFilePath);
            identData.Version = "1.2"; // Instruct the output to use MzIdentML 1.2 schema and namespace
            var ascoreSoftware = new AnalysisSoftwareObj()
            {
                Id           = "AScore_software",
                Name         = "AScore",
                Version      = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                SoftwareName = new ParamObj()
                {
                    Item = new CVParamObj(CV.CVID.MS_Ascore_software)
                },
            };

            identData.AnalysisSoftwareList.Add(ascoreSoftware);

            identData.AnalysisProtocolCollection.SpectrumIdentificationProtocols.First().AdditionalSearchParams.Items.Add(new CVParamObj(CV.CVID.MS_modification_localization_scoring));

            foreach (var peptide in identData.SequenceCollection.Peptides)
            {
                var modIndex = 1;
                foreach (var mod in peptide.Modifications)
                {
                    mod.CVParams.Add(new CVParamObj(CV.CVID.MS_modification_index, modIndex.ToString()));
                    modIndex++;
                }
            }

            foreach (var list in identData.DataCollection.AnalysisData.SpectrumIdentificationList)
            {
                foreach (var result in list.SpectrumIdentificationResults)
                {
                    foreach (var ident in result.SpectrumIdentificationItems)
                    {
                        data.Add(new SpectrumIdentificationItemWrapper(result, ident));
                    }
                }
            }

            AssignSymbolsToMods(identData.AnalysisProtocolCollection.SpectrumIdentificationProtocols.SelectMany(x => x.ModificationParams)); // TODO

            // maxSteps normally set using DataTable information in base constructor
            maxSteps = data.Count;
        }
Beispiel #3
0
        /// <summary>
        /// Add the settings used with the software "analysisSoftwareInfo"
        /// </summary>
        /// <param name="analysisSoftwareInfo">The object returned by <see cref="AddAnalysisSoftware"/></param>
        /// <param name="name">The name of the set of settings</param>
        /// <param name="searchType">The type of search performed:
        ///     CVID.MS_de_novo_search
        ///     CVID.MS_spectral_library_search
        ///     CVID.MS_spectral_library_search
        ///     CVID.MS_pmf_search
        ///     CVID.MS_tag_search
        ///     CVID.MS_ms_ms_search
        ///     CVID.MS_combined_pmf___ms_ms_search
        ///     CVID.MS_special_processing
        ///     CVID.MS_peptide_level_scoring
        ///     CVID.MS_modification_localization_scoring
        ///     CVID.MS_consensus_scoring
        ///     CVID.MS_sample_pre_fractionation
        ///     CVID.MS_cross_linking_search
        ///     CVID.MS_no_special_processing
        /// </param>
        /// <returns>An object that needs multiple items set - add CV/User params to AdditionalSearchParams, ModificationParams, Enzymes, FragmentTolerances, ParentTolerances, and Threshold</returns>
        public SpectrumIdentificationProtocolObj AddAnalysisSettings(AnalysisSoftwareObj analysisSoftwareInfo, string name, CV.CV.CVID searchType)
        {
            var settings = new SpectrumIdentificationProtocolObj
            {
                Id = "SearchProtocol_" + searchProtocolCounter++,
                AnalysisSoftware = analysisSoftwareInfo,
                Name             = name,
                SearchType       = new ParamObj(),
            };

            if (searchType != CV.CV.CVID.CVID_Unknown)
            {
                settings.SearchType.Item = new CVParamObj(searchType);
            }
            settings.AdditionalSearchParams = new ParamListObj()
            {
                Items = new IdentDataList <ParamBaseObj>()
            };
            settings.ModificationParams = new IdentDataList <SearchModificationObj>();
            settings.Enzymes            = new EnzymeListObj()
            {
                Enzymes = new IdentDataList <EnzymeObj>(),
            };

            settings.FragmentTolerances = new IdentDataList <CVParamObj>();
            settings.ParentTolerances   = new IdentDataList <CVParamObj>();
            settings.Threshold          = new ParamListObj()
            {
                Items = new IdentDataList <ParamBaseObj>(),
            };

            if (identData.AnalysisProtocolCollection.SpectrumIdentificationProtocols == null)
            {
                identData.AnalysisProtocolCollection.SpectrumIdentificationProtocols = new IdentDataList <SpectrumIdentificationProtocolObj>();
            }
            identData.AnalysisProtocolCollection.SpectrumIdentificationProtocols.Add(settings);

            return(settings);
        }