当前位置: 首页>>代码示例>>C#>>正文


C# Workspace.readUniModXML方法代码示例

本文整理汇总了C#中Workspace.readUniModXML方法的典型用法代码示例。如果您正苦于以下问题:C# Workspace.readUniModXML方法的具体用法?C# Workspace.readUniModXML怎么用?C# Workspace.readUniModXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Workspace的用法示例。


在下文中一共展示了Workspace.readUniModXML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main( string[] args )
        {
            // Write program headers to the command line
            Console.WriteLine( "IDPickerReport " + Version + " (" + LastModified.ToShortDateString() + ")" );
            Console.WriteLine( "IDPickerWorkspace " + Workspace.Version + " (" + Workspace.LastModified.ToShortDateString() + ")" );
            Console.WriteLine( "IDPickerPresentation " + Presentation.Version + " (" + Presentation.LastModified.ToShortDateString() + ")" );
            Console.WriteLine( IDPREPORT_LICENSE );

            // Process the command line
            List<string> argsList = new List<string>( args );
            if( InitProcess( ref argsList ) )
            {
                return;
            }

            // Init the IDPicker workspace
            long start;
            Workspace ws = new Workspace( rtConfig );
            ws.setStatusOutput( Console.Out );

            // Initialize the modifications that can and can not appear in distinct peptides
            ws.distinctPeptideSettings = new Workspace.DistinctPeptideSettings(
                rtConfig.ModsAreDistinctByDefault, rtConfig.DistinctModsOverride, rtConfig.IndistinctModsOverride );

            // Read the spectra export from a previous search, if given
            if( rtConfig.SpectraExport != string.Empty && rtConfig.SearchScoreNames != string.Empty )
            {
                string[] scores = rtConfig.SearchScoreNames.Split( new char[] { ' ' } );
                ws.spectraExport = new ImportSpectraExport( rtConfig.SpectraExport, scores );
            }

            #region SNP Annotation stuff (TODO: simplify this logic, i.e. use a bool instead of testing for empty string)
            // Read the unimod modification database, if provided
            if( rtConfig.UnimodXMLPath != string.Empty )
            {
                try
                {
                    Console.WriteLine( "Reading modification annotations from unimod xml file path: " + rtConfig.UnimodXMLPath );
                    ws.readUniModXML( rtConfig.UnimodXMLPath );
                    Console.WriteLine( "Finished reading modification annotations." );
                    //ws.printUnimodObjects( 57.03f );
                    //Environment.Exit( 1 );
                } catch( Exception e )
                {
                    Console.Error.WriteLine( e.StackTrace.ToString() );
                    Console.Error.WriteLine( "Error reading unimod xml at : " + rtConfig.UnimodXMLPath );
                }
            }

            // Read the CanProVar database, if provided
            if( rtConfig.ProCanVarFasta != string.Empty && rtConfig.ProCanVarMap != string.Empty )
            {
                Console.WriteLine( "Reading ProCanVar SNP data....." );
                ws.snpAnntoations = new SNPMetaDataGenerator();
                ws.snpAnntoations.getVariantDataFromProCanVarFlatFile( rtConfig.ProCanVarFasta, rtConfig.ProCanVarMap );
                Console.WriteLine( "Finished reading ProCanVar SNP data." );

                /*SNPMetaDataGenerator snpData = new SNPMetaDataGenerator();
                snpData.getVariantDataFromProCanVarFlatFile( rtConfig.ProCanVarFasta, rtConfig.ProCanVarMap );
                Console.WriteLine( "Finished reading ProCanVar SNP data." );
                SNPMetaDataGenerator.SNP test = new SNPMetaDataGenerator.SNP( "Y", "H", "24" );
                string str = snpData.getSNPAnnotationFromProCanVar( "ENSP00000368054", test, "EGFYAVVIFLSIFVIIVTCLMILYR" );
                Console.WriteLine( str );
                Environment.Exit( 1 );*/
            }
            #endregion

            #region Read input idpXML files

            List<string> inputFilepaths = new List<string>();

            for( int i = 1; i < argsList.Count; ++i )
            {
                try
                {
                    string path = Path.GetDirectoryName(argsList[i]);
                    if (path.Length < 1)
                    {
                        path = "." + Path.DirectorySeparatorChar;
                    }
                    //Console.WriteLine( path + " : " + Path.GetFileName( args[i] ) );
                    inputFilepaths.AddRange(Directory.GetFiles(path, Path.GetFileName(argsList[i])));

                    foreach( string inputFilepath in inputFilepaths )
                    {
                        try
                        {
                            if( !Util.TestFileType( inputFilepath, "idpickerpeptides" ) )
                                continue;
                            start = DateTime.Now.Ticks;
                            Console.WriteLine( "Reading and parsing IDPicker XML from filepath: " + inputFilepath );
                            StreamReader inputStream = new StreamReader( inputFilepath );
                            // Read each file and assign them to the root group.
                            ws.readPeptidesXml( inputStream, "", rtConfig.MaxFDR, rtConfig.MaxResultRank );
                            inputStream.Close();
                            Console.WriteLine( "\nFinished reading and parsing IDPicker XML; " + new TimeSpan( DateTime.Now.Ticks - start ).TotalSeconds + " seconds elapsed." );
                        } catch( Exception e )
                        {
                            Console.Error.WriteLine( e.StackTrace.ToString() );
                            Console.Error.WriteLine( "Error reading input filepath \"" + inputFilepath + "\": " + e.Message );
//.........这里部分代码省略.........
开发者ID:hap-adong,项目名称:IDPicker,代码行数:101,代码来源:Program.cs


注:本文中的Workspace.readUniModXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。