Ejemplo n.º 1
0
        /// <summary>
        /// Main function to do all the processing.
        /// </summary>
        /// <param name="args">Arguments to Assemble.</param>
        private static void ProcessData(string[] args)
        {
            MTAssembleArguments  options = new MTAssembleArguments();
            CommandLineArguments parser  = new CommandLineArguments();

            AddAssembleParameters(parser);
            if (args.Length < 1 ||
                args[0].Equals("Help", StringComparison.InvariantCultureIgnoreCase) ||
                args[0].Equals("/h", StringComparison.CurrentCultureIgnoreCase) ||
                args[0].Equals("/help", StringComparison.CurrentCultureIgnoreCase) ||
                args[0].Equals("-h", StringComparison.CurrentCultureIgnoreCase) ||
                args[0].Equals("-help", StringComparison.CurrentCultureIgnoreCase))
            {
                //Output.WriteLine(OutputLevel.Required, StaticResources.ASSEMBLE_HELP);
                PrintHelp(parser);
            }
            else
            {
                try
                {
                    parser.Parse(args, options);
                }
                catch (ArgumentParserException ex)
                {
                    Output.WriteLine(OutputLevel.Error, ex.Message);
                    //Output.WriteLine(OutputLevel.Required, StaticResources.ASSEMBLE_HELP);
                    Environment.Exit(-1);
                }
                if (options.Help)
                {
                    PrintHelp(parser);
                }
                else
                {
                    if (options.Verbose)
                    {
                        Output.TraceLevel = OutputLevel.Information | OutputLevel.Verbose;
                    }
                    else if (!options.Quiet)
                    {
                        Output.TraceLevel = OutputLevel.Information;
                    }

                    //TODO: Replace strings in two places with variables in one
                    var nodeSet   = args.Any(z => z.Contains("min_node_count"));
                    var forceKmer = args.Any(z => z.Contains("force_sqrt"));
                    if (nodeSet && forceKmer)
                    {
                        Console.WriteLine("You cannot set both min_node_count and force_sqrt, as the arguments both alter the same setting.");
                        return;
                    }
                    MTAssembleArguments.MinNodeCountSet = nodeSet;
                    options.ProcessMTDNA();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Assemble function.
        /// </summary>
        /// <param name="args">Arguments to Assemble.</param>
        private static void Assemble(string[] args)
        {
            MTAssembleArguments  options = new MTAssembleArguments();
            CommandLineArguments parser  = new CommandLineArguments();

            AddAssembleParameters(parser);
            if (args.Length > 0)
            {
                try
                {
                    parser.Parse(args, options);
                }
                catch (ArgumentParserException ex)
                {
                    Output.WriteLine(OutputLevel.Error, ex.Message);
                    //Output.WriteLine(OutputLevel.Required, StaticResources.ASSEMBLE_HELP);
                    Environment.Exit(-1);
                }
                if (options.Help)
                {
                    Output.WriteLine(OutputLevel.Required, StaticResources.ASSEMBLE_HELP);
                }
                else
                {
                    if (options.Verbose)
                    {
                        Output.TraceLevel = OutputLevel.Information | OutputLevel.Verbose;
                    }
                    else if (!options.Quiet)
                    {
                        Output.TraceLevel = OutputLevel.Information;
                    }
                    options.AssembleSequences();
                }
            }
            else
            {
                Output.WriteLine(OutputLevel.Required, StaticResources.ASSEMBLE_HELP);
            }
        }