Exemple #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            DatabaseMakerOptions options = new DatabaseMakerOptions();

            options.InputFiles = fastaLB.Items.OfType <string>().ToList();
            if (radDecoy.Checked)
            {
                options.OutputType = DatabaseType.Decoy;
            }
            else if (radConcatenated.Checked)
            {
                options.OutputType = DatabaseType.Concatenated;
            }
            else
            {
                options.OutputType = DatabaseType.Target;
            }

            if (radShuffle.Checked)
            {
                options.DecoyType = DecoyDatabaseMethod.Shuffle;
            }
            else if (radRandom.Checked)
            {
                options.DecoyType = DecoyDatabaseMethod.Random;
            }
            else
            {
                options.DecoyType = DecoyDatabaseMethod.Reverse;
            }
            options.ExcludeNTerminalResidue    = chkExcludeNTerminus.Checked;
            options.ExcludeNTerminalMethionine = chkOnlyIfNTerminusIsMethionine.Checked;
            options.BlastDatabase   = chkBlast.Checked;
            options.DoNotMergeFiles = !mergeoutputCB.Checked;
            options.OutputFastaFile = txtOutput.Text;
            if (options.OutputFastaFile == string.Empty)
            {
                options.OutputFastaFile = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            }

            DatabaseMaker databaseMaker = new DatabaseMaker(options);

            databaseMaker.CreateDatabase();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var options = new DatabaseMakerOptions();

            var parser = new CommandLineParser(new CommandLineParserSettings(Console.Error));

            if (parser.ParseArguments(args, options))
            {
                var databaseMaker = new DatabaseMaker(options);

                if (options.Verbose)
                {
                    databaseMaker.DisplayVerboseOptions(options.Verbose, options);
                }

                databaseMaker.OnInvalidHeader += databaseMaker_OnInvalidHeader;

                try
                {
                    databaseMaker.CreateDatabase();
                }
                catch (ArgumentNullException e2)
                {
                    Console.WriteLine("\nError: No input files specified");
                }

                catch (ArgumentException e3)
                {
                    Console.WriteLine("\nError: " + e3.Message);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error: " + e.Message);
                }
                finally
                {
                    Console.ReadKey();
                    Environment.Exit(0);
                }
            }
            Environment.Exit(0);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var options = new DatabaseMakerOptions();

            var parser = new CommandLineParser(new CommandLineParserSettings(Console.Error));
            if (parser.ParseArguments(args, options))
            {
                var databaseMaker = new DatabaseMaker(options);

                if (options.Verbose)
                {
                    databaseMaker.DisplayVerboseOptions(options.Verbose, options);
                }

                databaseMaker.OnInvalidHeader += databaseMaker_OnInvalidHeader;

                try
                {
                    databaseMaker.CreateDatabase();
                }
                catch (ArgumentNullException e2)
                {
                    Console.WriteLine("\nError: No input files specified");
                }

                catch (ArgumentException e3)
                {
                    Console.WriteLine("\nError: " + e3.Message);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error: " + e.Message);
                }
                finally
                {
                    Console.ReadKey();
                    Environment.Exit(0);
                }
            }
            Environment.Exit(0);
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            DatabaseMakerOptions options = new DatabaseMakerOptions();
            options.InputFiles = fastaLB.Items.OfType<string>().ToList();
            if(radDecoy.Checked)
            {
                options.OutputType = DatabaseType.Decoy;
            }
            else if(radConcatenated.Checked)
            {
                options.OutputType = DatabaseType.Concatenated;
            }
            else
            {
                options.OutputType = DatabaseType.Target;
            }

            if(radShuffle.Checked)
            {
                options.DecoyType = DecoyDatabaseMethod.Shuffle;
            }
            else if(radRandom.Checked)
            {
                options.DecoyType = DecoyDatabaseMethod.Random;
            }
            else
            {
                options.DecoyType = DecoyDatabaseMethod.Reverse;
            }
            options.ExcludeNTerminalResidue = chkExcludeNTerminus.Checked;
            options.ExcludeNTerminalMethionine = chkOnlyIfNTerminusIsMethionine.Checked;
            options.BlastDatabase = chkBlast.Checked;
            options.DoNotMergeFiles = !mergeoutputCB.Checked;
            options.OutputFastaFile = txtOutput.Text;
            if (options.OutputFastaFile == string.Empty)
            {
                options.OutputFastaFile = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            }

            DatabaseMaker databaseMaker = new DatabaseMaker(options);

            databaseMaker.CreateDatabase();
        }