Esempio n. 1
0
        /// <summary>
        /// Parses ScaffoldGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ScaffoldGeneration(string[] args)
        {
            ScaffoldArguments    arguments = new ScaffoldArguments();
            CommandLineArguments parser    = new CommandLineArguments();

            // Add scaffold parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");
            parser.Parameter(ArgumentType.Optional, "KmerLength", ArgumentValueType.Int, "k", "Length of k-mer");
            parser.Parameter(ArgumentType.Optional, "Redundancy", ArgumentValueType.Int, "r", "Number of paired read required to connect two contigs.");
            parser.Parameter(ArgumentType.Optional, "Depth", ArgumentValueType.Int, "d", "Depth for graph traversal.");
            parser.Parameter(ArgumentType.Optional, "CloneLibraryName", ArgumentValueType.String, "n", "Clone Library Name");
            parser.Parameter(ArgumentType.Optional, "MeanLengthOfInsert", ArgumentValueType.Int, "i", "Mean Length of clone library.");
            parser.Parameter(ArgumentType.Optional, "StandardDeviationOfInsert", ArgumentValueType.Int, "sd", "Standard Deviation of Clone Library.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentParserException ex)
                {
                    DisplayErrorMessage(ex.Message);
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.GenerateScaffolds();
                }
                else
                {
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.ScaffoldUtilHelp);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Parses ScaffoldGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ScaffoldGeneration(string[] args)
        {
            ScaffoldArguments arguments = new ScaffoldArguments();
            CommandLineArguments parser = new CommandLineArguments();

            // Add scaffold parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");
            parser.Parameter(ArgumentType.Optional, "KmerLength", ArgumentValueType.Int, "k", "Length of k-mer");
            parser.Parameter(ArgumentType.Optional, "Redundancy", ArgumentValueType.Int, "r", "Number of paired read required to connect two contigs.");
            parser.Parameter(ArgumentType.Optional, "Depth", ArgumentValueType.Int, "d", "Depth for graph traversal.");
            parser.Parameter(ArgumentType.Optional, "CloneLibraryName", ArgumentValueType.String, "n", "Clone Library Name");
            parser.Parameter(ArgumentType.Optional, "MeanLengthOfInsert", ArgumentValueType.Int, "i", "Mean Length of clone library.");
            parser.Parameter(ArgumentType.Optional, "StandardDeviationOfInsert", ArgumentValueType.Int, "sd", "Standard Deviation of Clone Library.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentParserException ex)
                {
                    DisplayErrorMessage(ex.Message);
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.GenerateScaffolds();
                }
                else
                {
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                } 
            }
            else
            {
                DisplayErrorMessage(Resources.ScaffoldUtilHelp);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Parses ScaffoldGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ScaffoldGeneration(string[] args)
        {
            ScaffoldArguments arguments = new ScaffoldArguments();

            if (args.Length > 1 && Parser.ParseArguments(args, arguments))
            {
                if (arguments.FilePath.Length == 2)
                {
                    arguments.GenerateScaffolds();
                }
                else
                {
                    DisplayErrorMessage(Resources.ScaffoldUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.ScaffoldUtilHelp);
            }
        }