public void DisplayVerboseOptions(bool verboseOptions, DatabaseMakerOptions Options) { Console.WriteLine("Input File(s): {0}", string.Join("\n", Options.InputFiles)); Console.WriteLine("\nOutput File: {0}", Options.OutputFastaFile); Console.WriteLine("\nDatabase Maker PARAMETERS"); Console.WriteLine("\nDatabase Type: {0}", Options.OutputType); if (Options.OutputType != DatabaseType.Target) { Console.WriteLine("\nDecoy Database Method: {0}", Options.DecoyType); Console.WriteLine("\nExclude N-Terminus: {0}", Options.ExcludeNTerminalResidue); Console.WriteLine("\nOnly If N-Terminus Is Methionine: {0}", Options.ExcludeNTerminalMethionine); } Console.WriteLine("\nMerging Fasta Files: {0}", Options.DoNotMergeFiles); Console.WriteLine("\nEnforce Standard Uniprot Headers: {0}", Options.EnforceUniprot); Console.WriteLine("\nCreate a BLAST Database: {0}", Options.BlastDatabase); }
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(); }
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(); }
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); }
public DatabaseMaker(DatabaseMakerOptions options) { Options = options; }