static OPrval parse_options(int *parsed_args, RegionCovArguments *arguments, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *o; OPrval oprval; gt_error_check(err); op = gt_option_parser_new("[option ...] GFF3_file", "Show which parts of the given sequence regions are " "covered by features."); /* -maxfeaturedist */ o = gt_option_new_ulong("maxfeaturedist", "set the maximum distance two " "features can have while still being in the same " "``cluster''", &arguments->max_feature_dist, 0); gt_option_parser_add_option(op, o); /* -v */ o = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, o); /* parse */ gt_option_parser_set_min_max_args(op, 1, 1); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_extractfeat_option_parser_new(void *tool_arguments) { GtExtractFeatArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [GFF3_file]", "Extract features given in GFF3 file from " "sequence file."); /* -type */ option = gt_option_new_string("type", "set type of features to extract", arguments->type, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -join */ option = gt_option_new_bool("join", "join feature sequences in the same " "subgraph into a single one", &arguments->join, false); gt_option_parser_add_option(op, option); /* -translate */ option = gt_option_new_bool("translate", "translate the features (of a DNA " "sequence) into protein", &arguments->translate, false); gt_option_parser_add_option(op, option); /* -seqid */ option = gt_option_new_bool("seqid", "add sequence ID of extracted features " "to FASTA descriptions", &arguments->seqid, false); gt_option_parser_add_option(op, option); /* -target */ option = gt_option_new_bool("target", "add target ID(s) of extracted " "features to FASTA descriptions", &arguments->target, false); gt_option_parser_add_option(op, option); /* -seqfile, -matchdesc, -usedesc and -regionmapping */ gt_seqid2file_register_options(op, arguments->s2fi); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* -width */ option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_max_args(op, 1); return op; }
static GtOptionParser* gt_csa_option_parser_new(void *tool_arguments) { CSAArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [GFF3_file]", "Transform spliced alignments from GFF3 file into " "consensus spliced alignments."); /* -join-length */ option = gt_option_new_uword("join-length", "set join length for the spliced " "alignment clustering", &arguments->join_length, GT_DEFAULT_JOIN_LENGTH); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_max_args(op, 1); return op; }
static GtOptionParser* gt_cds_option_parser_new(void *tool_arguments) { CDSArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [GFF3_file]", "Add CDS (coding sequence) features to exon " "features given in GFF3 file."); /* -minorflen */ option = gt_option_new_uint_min("minorflen", "set the minimum length an open " "reading frame (ORF) must have to be added " "as a CDS feature (measured in amino acids)", &arguments->minorflen, 64, 1); gt_option_parser_add_option(op, option); /* -startcodon */ option = gt_option_new_bool("startcodon", "require than an ORF must begin " "with a start codon", &arguments->start_codon, false); gt_option_parser_add_option(op, option); /* -finalstopcodon */ option = gt_option_new_bool("finalstopcodon", "require that the final ORF " "must end with a stop codon", &arguments->final_stop_codon, false); gt_option_parser_add_option(op, option); /* -genericstartcodons */ option = gt_option_new_bool("genericstartcodons", "use generic start codons", &arguments->generic_start_codons, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -seqfile, -matchdesc, -usedesc and -regionmapping */ gt_seqid2file_register_options(op, arguments->s2fi); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, arguments->ofi); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_max_args(op, 1); return op; }
static GtOptionParser* gt_speck_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option; SpeccheckArguments *arguments = tool_arguments; /* init */ op = gt_option_parser_new("[options] [GFF3_file ...]", "Checks spec definition compliance in GFF3 input."); option = gt_option_new_filename("specfile", "file with specification definition", arguments->specfile); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); option = gt_option_new_bool("colored", "show colored output", &arguments->colored, true); gt_option_parser_add_option(op, option); option = gt_option_new_bool("provideindex", "provide feature index in " "specfile namespace (requires O(n) memory for n " "input features)", &arguments->provideindex, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("sort", "sort input before checking (requires " "O(n) memory for n input features)", &arguments->sort, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("failhard", "stop processing and report runtime " "errors instead of recording them in the results", &arguments->fail_hard, false); gt_option_parser_add_option(op, option); /* -format */ option = gt_option_new_string("output", "output format\n" "choose from: json, text, html, statsonly", arguments->format, "text"); gt_option_parser_add_option(op, option); gt_typecheck_info_register_options_with_default(arguments->tci, op, "so"); gt_seqid2file_register_options_ext(op, arguments->s2fi, false, false); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser* gt_speck_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option; SpeccheckArguments *arguments = tool_arguments; /* init */ op = gt_option_parser_new("[options] [GFF3_file ...]", "Checks spec definition compliance in GFF3 input."); option = gt_option_new_filename("specfile", "file with specification definition", arguments->specfile); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); option = gt_option_new_bool("colored", "show colored output", &arguments->colored, true); gt_option_parser_add_option(op, option); option = gt_option_new_bool("allexpects", "show results counted by " "expectations instead of by nodes", &arguments->allexpects, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("provideindex", "provide feature index in " "specfile namespace (requires O(n) memory for n " "input features)", &arguments->provideindex, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("sort", "sort input before checking (requires " "O(n) memory for n input features)", &arguments->sort, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("failhard", "stop processing and report runtime " "errors instead of recording them in the results", &arguments->fail_hard, false); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_seqid2file_register_options(op, arguments->s2fi); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); return op; }
static GtOptionParser* gt_sequniq_option_parser_new(void *tool_arguments) { GtSequniqArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *seqit_option, *verbose_option, *width_option, *rev_option, *nofseqs_option; gt_assert(arguments); op = gt_option_parser_new("[option ...] sequence_file [...] ", "Filter out repeated sequences in given " "sequence files."); /* -seqit */ seqit_option = gt_option_new_bool("seqit", "use sequence iterator", &arguments->seqit, false); gt_option_is_development_option(seqit_option); gt_option_parser_add_option(op, seqit_option); /* -nofseqs */ nofseqs_option = gt_option_new_uword("nofseqs", "number of sequences " "(improves efficiency)\ndefault: unspecified", &arguments->nofseqs, 0); gt_option_is_development_option(nofseqs_option); gt_option_hide_default(nofseqs_option); gt_option_parser_add_option(op, nofseqs_option); /* -rev */ rev_option = gt_option_new_bool("rev", "also filter out sequences whose " "reverse complement is identical to a sequence already output", &arguments->rev, false); gt_option_parser_add_option(op, rev_option); /* -v */ verbose_option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, verbose_option); /* -width */ width_option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, width_option); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); /* option implications */ gt_option_imply(verbose_option, seqit_option); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_min_args(op, 1U); return op; }
static GtOptionParser *gt_tyr_search_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optiontyr, *optionqueries; Tyr_search_options *arguments = tool_arguments; op = gt_option_parser_new("[options] -tyr tallymer-index -q queryfile0 " "[queryfile1..] [options]", "Search a set of k-mers in an index constructed " "by \"gt tyr mkindex\"."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optiontyr = gt_option_new_string("tyr","specify tallymer-index", arguments->str_inputindex, NULL); gt_option_is_mandatory(optiontyr); gt_option_parser_add_option(op, optiontyr); optionqueries = gt_option_new_filenamearray("q","specify query file names", arguments->queryfilenames); gt_option_is_mandatory(optionqueries); gt_option_parser_add_option(op, optionqueries); option = gt_option_new_string("strand", "specify the strand to be searched: " "use f (for forward strand) or " "p (for reverse complemented strand) or " "fp (for both); default is f", arguments->strandspec, "f"); gt_option_parser_add_option(op, option); option = gt_option_new_stringarray("output", "specify output flags " "(qseqnum, qpos, counts, sequence)", arguments->showmodespec); gt_option_parser_add_option(op, option); option = gt_option_new_bool("test", "perform tests to verify program " "correctness", &arguments->performtest, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser *gt_cge_spacedseed_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optionesaindex, *optionpckindex; Cge_spacedseed_options *arguments = tool_arguments; op = gt_option_parser_new("[options]", "Match spaced seeds."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesaindex = gt_option_new_string("esa", "Specify index (enhanced suffix array)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionesaindex); arguments->refoptionesaindex = gt_option_ref(optionesaindex); optionpckindex = gt_option_new_string("pck", "Specify index (packed index)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionpckindex); arguments->refoptionpckindex = gt_option_ref(optionpckindex); gt_option_exclude(optionesaindex,optionpckindex); gt_option_is_mandatory_either(optionesaindex,optionpckindex); option = gt_option_new_filenamearray("q", "Specify files containing the " "query sequences", arguments->queryfilenames); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); option = gt_option_new_bool("cmp","compare results of offline and online " "searches",&arguments->docompare,false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOPrval gthfilestat_parse_options(int *parsed_args, GthFileStatInfo *file_stat_info, int argc, const char **argv, const GthPlugins *plugins, GtError *err) { GtOptionParser *op; GtOption *o; GtOPrval oprval; bool verbose; gt_error_check(err); op = gt_option_parser_new("[option ...] [file ...]", "Show statistics about " "spliced alignments in GenomeThreader output files\n" "containing intermediate results."); /* add sa_filter options */ gth_sa_filter_register_options(op, file_stat_info->sa_filter, false); /* -v */ o = gt_option_new_verbose(&verbose); gt_option_parser_add_option(op, o); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, plugins->gth_version_func, err); if (verbose) file_stat_info->showverbose = gth_show_on_stdout; /* save consensus files */ if (oprval == GT_OPTION_PARSER_OK) { while (*parsed_args < argc) { gt_str_array_add_cstr(file_stat_info->consensusfiles, argv[*parsed_args]); (*parsed_args)++; } } gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_readjoiner_cnttest_option_parser_new( void *tool_arguments) { GtReadjoinerCnttestArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("-readset [option ...]", "Test/development tool for readjoiner containments filtering."); /* -readset */ option = gt_option_new_string("readset", "specify the readset name", arguments->readset, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -test */ option = gt_option_new_string("test", "select among the available tests:\n" "showlist: show content of an cnt list (input: cntlist)\n" "bruteforce: memcmp reads vs all suffixes and prefixes (input: encseq)\n" "kmp: variant of Knuth-Morris-Pratt (input: encseq)\n" "esa: own esa-based algorithm (input: esa)", arguments->teststr, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -singlestrand */ option = gt_option_new_bool("singlestrand", "do not use reads " "reverse complements", &arguments->singlestrand, false); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_parser_set_version_func(op, gt_readjoiner_show_version); gt_option_parser_set_max_args(op, 0); return op; }
static GtOPrval parse_options(int *parsed_args, ChseqidsArguments *arguments, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOutputFileInfo *ofi; GtOption *option; GtOPrval oprval; gt_error_check(err); /* init */ op = gt_option_parser_new("[option ...] mapping_file [GFF3_file]", "Change sequence ids by the mapping given in " "mapping_file."); ofi = gt_outputfileinfo_new(); /* -sort */ option = gt_option_new_bool("sort", "sort the GFF3 features after changing the " "sequence ids\n(memory consumption is " "proportional to the input file size)", &arguments->sort, false); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, ofi); /* parse options */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_min_max_args(op, 1, 2); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); /* free */ gt_outputfileinfo_delete(ofi); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_encseq_encode_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option; GtEncseqEncodeArguments *arguments = (GtEncseqEncodeArguments*) tool_arguments; /* init */ op = gt_option_parser_new("sequence_file [sequence_file " "[sequence_file ...]]", "Encode sequence files (FASTA/FASTQ, GenBank, " "EMBL) efficiently."); /* -showstats */ option = gt_option_new_bool("showstats", "show compression results", &arguments->showstats, false); gt_option_parser_add_option(op, option); /* -no_esq_header */ option = gt_option_new_bool("no_esq_header", "omit the header in the .esq file", &arguments->no_esq_header, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* encoded sequence options */ arguments->eopts = gt_encseq_options_register_encoding(op, arguments->indexname, NULL); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_parser_set_min_args(op, 1); return op; }
static GtOptionParser* gt_readjoiner_assembly_option_parser_new( void *tool_arguments) { GtReadjoinerAssemblyArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *errors_option, *deadend_option, *v_option, *q_option, *bubble_option, *deadend_depth_option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...]", "Construct string graph and output contigs."); /* -readset */ option = gt_option_new_string("readset", "specify the readset name", arguments->readset, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -spmfiles */ option = gt_option_new_uint_min("spmfiles", "number of SPM files to read\n" "this must be equal to the value of -j for the overlap phase", &arguments->nspmfiles, 1U, 1U); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -l */ option = gt_option_new_uint_min("l", "specify the minimum SPM length", &arguments->minmatchlength, 0, 2U); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -depthcutoff */ option = gt_option_new_uint_min("depthcutoff", "specify the minimal " "number of nodes in a contig", &arguments->depthcutoff, 3U, 1U); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -lengthcutoff */ option = gt_option_new_uint_min("lengthcutoff", "specify the minimal " "length of a contig", &arguments->lengthcutoff, 100U, 1U); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -redtrans */ option = gt_option_new_bool("redtrans", "reduce transitive edges", &arguments->redtrans, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -errors */ errors_option = gt_option_new_bool("errors", "search graph features which " "may originate from sequencing errors and remove them", &arguments->errors, false); gt_option_is_extended_option(errors_option); gt_option_parser_add_option(op, errors_option); /* -bubble */ bubble_option = gt_option_new_uint("bubble", "number of rounds of p-bubble " "removal to perform", &arguments->bubble, 3U); gt_option_is_extended_option(bubble_option); gt_option_imply(bubble_option, errors_option); gt_option_parser_add_option(op, bubble_option); /* -deadend */ deadend_option = gt_option_new_uint("deadend", "number of rounds of " "dead end removal to perform a dead end", &arguments->deadend, 10U); gt_option_is_extended_option(deadend_option); gt_option_imply(deadend_option, errors_option); gt_option_parser_add_option(op, deadend_option); /* -deadend-depth */ deadend_depth_option = gt_option_new_uint_min("deadend-depth", "specify the " "maximal depth of a path to an end-vertex by which the path shall be " "considered a dead end", &arguments->deadend_depth, 10U, 1U); gt_option_is_extended_option(deadend_depth_option); gt_option_imply(deadend_depth_option, errors_option); gt_option_parser_add_option(op, deadend_depth_option); /* -paths2seq */ option = gt_option_new_bool("paths2seq", "read <indexname>" GT_READJOINER_SUFFIX_CONTIG_PATHS " and write " "<indexname>" GT_READJOINER_SUFFIX_CONTIGS, &arguments->paths2seq, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -buffersize */ option = gt_option_new_string("buffersize", "specify size for read buffer" " of paths2seq phase (in bytes, the keywords 'MB' and 'GB' are allowed)", arguments->buffersizearg, NULL); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); arguments->refoptionbuffersize = gt_option_ref(option); /* -vd */ option = gt_option_new_bool("vd", "use verbose descriptions for contigs", &arguments->vd, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -astat */ option = gt_option_new_bool("astat", "calculate A-statistics for each contig", &arguments->astat, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -cov */ option = gt_option_new_double("cov", "average coverage value to use for the " "A-statistics calculation", &arguments->coverage, (double)0); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -copynum */ option = gt_option_new_bool("copynum", "load reads copy numbers list from " "file for the A-statistics calculation", &arguments->copynum, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -v */ v_option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, v_option); /* -q */ q_option = gt_option_new_bool("q", "suppress standard output messages", &arguments->quiet, false); gt_option_parser_add_option(op, q_option); gt_option_exclude(q_option, v_option); /* -load */ option = gt_option_new_bool("load", "save the string graph from file", &arguments->load, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -save */ option = gt_option_new_bool("save", "save the string graph to file", &arguments->save, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -show_contigs_info */ option = gt_option_new_bool("cinfo", "output additional files required " "for contigs graph construction (eqlen only)", &arguments->show_contigs_info, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); gt_option_parser_set_version_func(op, gt_readjoiner_show_version); gt_option_parser_set_max_args(op, 0); return op; }
static GtOptionParser* gt_gff3_option_parser_new(void *tool_arguments) { GFF3Arguments *arguments = tool_arguments; GtOptionParser *op; GtOption *sort_option, *load_option, *strict_option, *tidy_option, *mergefeat_option, *addintrons_option, *offset_option, *offsetfile_option, *setsource_option, *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Parse, possibly " "transform, and output GFF3 files."); /* -sort */ sort_option = gt_option_new_bool("sort", "sort the GFF3 features (memory " "consumption is proportional to the input " "file size(s))", &arguments->sort, false); gt_option_parser_add_option(op, sort_option); /* -strict */ strict_option = gt_option_new_bool("strict", "be very strict during GFF3 " "parsing (stricter than the specification " "requires)", &arguments->strict, false); gt_option_is_development_option(strict_option); gt_option_parser_add_option(op, strict_option); /* -tidy */ tidy_option = gt_option_new_bool("tidy", "try to tidy the GFF3 files up " "during parsing", &arguments->tidy, false); gt_option_parser_add_option(op, tidy_option); gt_option_exclude(strict_option, tidy_option); /* -retainids */ option = gt_option_new_bool("retainids", "when available, use the original IDs provided " "in the source file\n" "(memory consumption is proportional to the " "input file size(s))", &arguments->retainids, false); gt_option_parser_add_option(op, option); /* -checkids */ option = gt_option_new_bool("checkids", "make sure the ID attributes are unique " "within the scope of each GFF3_file, as required " "by GFF3 specification\n" "(memory consumption is proportional to the " "input file size(s))", &arguments->checkids, false); gt_option_parser_add_option(op, option); /* -addids */ option = gt_option_new_bool("addids", "add missing \"" GT_GFF_SEQUENCE_REGION"\" lines automatically", &arguments->addids, true); gt_option_parser_add_option(op, option); /* -fixregionboundaries */ option = gt_option_new_bool("fixregionboundaries", "automatically adjust \"" GT_GFF_SEQUENCE_REGION"\" lines to contain all " "their features (memory consumption is " "proportional to the input file size(s))", &arguments->fixboundaries, false); gt_option_parser_add_option(op, option); /* -mergefeat */ mergefeat_option = gt_option_new_bool("mergefeat", "merge adjacent features of the same " "type", &arguments->mergefeat, false); gt_option_is_development_option(mergefeat_option); gt_option_imply(mergefeat_option, sort_option); gt_option_parser_add_option(op, mergefeat_option); /* -load */ load_option = gt_option_new_bool("load", "load the GFF3 features into memory " "(requires space proportional to the input " "file size(s))", &arguments->load, false); gt_option_is_development_option(load_option); gt_option_parser_add_option(op, load_option); /* -addintrons */ addintrons_option = gt_option_new_bool("addintrons", "add intron features " "between existing exon features", &arguments->addintrons, false); gt_option_parser_add_option(op, addintrons_option); /* -offset */ offset_option = gt_option_new_word("offset", "transform all features by the " "given offset", &arguments->offset, GT_UNDEF_WORD); gt_option_parser_add_option(op, offset_option); /* -offsetfile */ offsetfile_option = gt_option_new_filename("offsetfile", "transform all " "features by the offsets given in " "file", arguments->offsetfile); gt_option_parser_add_option(op, offsetfile_option); gt_option_exclude(offset_option, offsetfile_option); /* -setsource */ setsource_option = gt_option_new_string("setsource", "set the 'source' " "value (2nd column) of each feature", arguments->newsource, NULL); gt_option_parser_add_option(op, setsource_option); /* typecheck options */ gt_typecheck_info_register_options(arguments->tci, op); /* -show */ option = gt_option_new_bool("show", "show GFF3 output", &arguments->show, true); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* -width */ option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); /* set comment function */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser *gt_tyr_occratio_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *optionmersizes, *optionesa, *optionminmersize, *optionmaxmersize, *optionstep, *optionoutput, *option; Tyr_occratio_options *arguments = tool_arguments; op = gt_option_parser_new("[options] -esa suffixerator-index [options]", "Compute occurrence ratio for a set of sequences " "represented by an enhanced suffix array."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesa = gt_option_new_string("esa","specify suffixerator-index\n" "(mandatory option)", arguments->str_inputindex, NULL); gt_option_is_mandatory(optionesa); gt_option_parser_add_option(op, optionesa); optionminmersize = gt_option_new_ulong_min("minmersize", "specify minimum mer size for which " "to compute the occurrence distribution", &arguments->minmersize,0,1UL); gt_option_parser_add_option(op, optionminmersize); optionmaxmersize = gt_option_new_ulong_min("maxmersize", "specify maximum mer size for which " "to compute the occurrence distribution", &arguments->maxmersize,0,1UL); gt_option_parser_add_option(op, optionmaxmersize); optionstep = gt_option_new_ulong_min("step", "specify step size when specifying mer sizes", &arguments->stepmersize,1UL,1UL); gt_option_parser_add_option(op, optionstep); optionmersizes = gt_option_new_stringarray( "mersizes", "specify mer sizes as non-empty sequence of " "non decreasing positive integers", arguments->mersizesstrings); arguments->refoptionmersizes = gt_option_ref(optionmersizes); gt_option_parser_add_option(op, optionmersizes); optionoutput = gt_option_new_stringarray( "output", "use combination of the following keywords: " "unique nonunique nonuniquemulti relative total " "to specify kind of output", arguments->outputspec); gt_option_parser_add_option(op, optionoutput); option = gt_option_new_bool("scan", "read suffixerator-index sequentially " "instead of mapping it to memory", &arguments->scanfile, false); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_exclude(optionmersizes,optionminmersize); gt_option_exclude(optionmersizes,optionmaxmersize); gt_option_exclude(optionmersizes,optionstep); return op; }
static GtOptionParser* gt_sketch_option_parser_new(void *tool_arguments) { GtSketchArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *option2; static const char *formats[] = { "png", #ifdef CAIRO_HAS_PDF_SURFACE "pdf", #endif #ifdef CAIRO_HAS_SVG_SURFACE "svg", #endif #ifdef CAIRO_HAS_PS_SURFACE "ps", #endif NULL }; static const char *inputs[] = { "gff", "bed", "gtf", NULL }; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] image_file [GFF3_file ...]", "Create graphical representation of GFF3 " "annotation files."); /* -pipe */ option = gt_option_new_bool("pipe", "use pipe mode (i.e., show all gff3 " "features on stdout)", &arguments->pipe, false); gt_option_parser_add_option(op, option); /* -flattenfiles */ option = gt_option_new_bool("flattenfiles", "do not group tracks by source " "file name and remove file names from track " "description", &arguments->flattenfiles, false); gt_option_parser_add_option(op, option); /* -seqid */ option = gt_option_new_string("seqid", "sequence region identifier\n" "default: first one in file", arguments->seqid, NULL); gt_option_parser_add_option(op, option); gt_option_hide_default(option); /* -start */ option = gt_option_new_uword_min("start", "start position\n" "default: first region start", &arguments->start, GT_UNDEF_UWORD, 1); gt_option_parser_add_option(op, option); gt_option_hide_default(option); /* -end */ option2 = gt_option_new_uword("end", "end position\ndefault: last region end", &arguments->end, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option2); /* -start and -end must be given together */ gt_option_imply(option, option2); gt_option_imply(option2, option); gt_option_hide_default(option2); /* -width */ option = gt_option_new_uint_min("width", "target image width (in pixel)", &arguments->width, 800, 1); gt_option_parser_add_option(op, option); /* -style */ option = gt_option_new_string("style", "style file to use", arguments->stylefile, gt_str_get(arguments->stylefile)); gt_option_parser_add_option(op, option); /* -format */ option = gt_option_new_choice("format", "output graphics format\n" "choose from png" #ifdef CAIRO_HAS_PDF_SURFACE "|pdf" #endif #ifdef CAIRO_HAS_SVG_SURFACE "|svg" #endif #ifdef CAIRO_HAS_PS_SURFACE "|ps" #endif "", arguments->format, formats[0], formats); gt_option_parser_add_option(op, option); /* -input */ option = gt_option_new_choice("input", "input data format\n" "choose from gff|bed|gtf", arguments->input, inputs[0], inputs); gt_option_parser_add_option(op, option); /* -addintrons */ option = gt_option_new_bool("addintrons", "add intron features between " "existing exon features (before drawing)", &arguments->addintrons, false); gt_option_parser_add_option(op, option); /* -unsafe */ option = gt_option_new_bool("unsafe", "enable unsafe mode for style file", &arguments->unsafe, false); gt_option_parser_add_option(op, option); /* -showrecmaps */ option = gt_option_new_bool("showrecmaps", "show RecMaps after image creation", &arguments->showrecmaps, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -streams */ option = gt_option_new_bool("streams", "use streams to write data to file", &arguments->use_streams, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* -force */ option = gt_option_new_bool(GT_FORCE_OPT_CSTR, "force writing to output file", &arguments->force, false); gt_option_parser_add_option(op, option); gt_option_parser_set_min_args(op, 1); return op; }
static GtOptionParser* gt_eval_option_parser_new(void *tool_arguments) { EvalArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *ltroption, *ltrdeltaoption; gt_assert(arguments); op = gt_option_parser_new("reference_file prediction_file ", "Compare annotation files and show " "accuracy measures (prediction vs. reference)."); /* -exondiff */ option = gt_option_new_bool("exondiff", "show a diff for the exons", &arguments->exondiff, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -exondiffcollapsed */ option = gt_option_new_bool("exondiffcollapsed", "show a diff for the " "collapsed exons", &arguments->exondiffcollapsed, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -nuc */ option = gt_option_new_bool("nuc", "evaluate nucleotide level (memory consumption " "is proportional to the input file sizes)", &arguments->nuceval, true); gt_option_parser_add_option(op, option); /* -ltr */ ltroption = gt_option_new_bool("ltr", "evaluate a LTR retrotransposon " "prediction instead of a gene prediction\n" "(all LTR_retrotransposon elements are " "considered to have an undetermined strand)", &arguments->evalLTR, false); gt_option_parser_add_option(op, ltroption); /* -ltrdelta */ ltrdeltaoption = gt_option_new_uword("ltrdelta", "set allowed delta for LTR " "borders to be considered equal", &arguments->LTRdelta, 20); gt_option_parser_add_option(op, ltrdeltaoption); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); /* option implications */ gt_option_imply(ltrdeltaoption, ltroption); /* set comment function */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); /* set minimum and maximum number of arguments */ gt_option_parser_set_min_max_args(op, 2, 2); return op; }
static GtOptionParser *gt_tyr_mkindex_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optionminocc, *optionmaxocc, *optionpl, *optionstoreindex, *optionstorecounts, *optionscan, *optionesa; Tyr_mkindex_options *arguments = tool_arguments; op = gt_option_parser_new("[options] -esa suffixerator-index [options]", "Count and index k-mers in the given enhanced " "suffix array for a fixed value of k."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesa = gt_option_new_string("esa","specify suffixerator-index\n" "(mandatory option)", arguments->str_inputindex, NULL); gt_option_is_mandatory(optionesa); gt_option_parser_add_option(op, optionesa); option = gt_option_new_ulong("mersize", "Specify the mer size.", &arguments->mersize, 20UL); gt_option_parser_add_option(op, option); optionminocc = gt_option_new_ulong("minocc", "Specify the minimum occurrence number for " "the mers to output/index", &arguments->userdefinedminocc, 0); gt_option_parser_add_option(op, optionminocc); optionmaxocc = gt_option_new_ulong("maxocc", "Specify the maximum occurrence number for " "the mers to output/index", &arguments->userdefinedmaxocc, 0); gt_option_parser_add_option(op, optionmaxocc); optionpl = gt_option_new_uint_min("pl", "specify prefix length for bucket boundary construction\n" "recommendation: use without argument;\n" "then a reasonable prefix length is automatically determined", &arguments->userdefinedprefixlength, 0, 1U); gt_option_argument_is_optional(optionpl); gt_option_parser_add_option(op, optionpl); arguments->refoptionpl = gt_option_ref(optionpl); optionstoreindex = gt_option_new_string("indexname", "store the mers specified by options " "-maxocc and -minocc in an index", arguments->str_storeindex, NULL); gt_option_parser_add_option(op, optionstoreindex); optionstorecounts = gt_option_new_bool("counts", "store counts of the mers", &arguments->storecounts,false); gt_option_parser_add_option(op, optionstorecounts); option = gt_option_new_bool("test", "perform tests to verify program " "correctness", &arguments->performtest, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); optionscan = gt_option_new_bool("scan", "read enhanced suffix array sequentially " "instead of mapping it to memory", &arguments->scanfile, false); gt_option_parser_add_option(op, optionscan); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_imply(optionpl, optionstoreindex); gt_option_imply(optionstorecounts, optionstoreindex); gt_option_imply_either_2(optionstoreindex,optionminocc,optionmaxocc); return op; }
static GtOptionParser* gt_select_option_parser_new(void *tool_arguments) { SelectArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *contain_option, *overlap_option, *minaveragessp_option, *singleintron_option, *optiondroppedfile; gt_assert(arguments); static const char *filter_logic[] = { "AND", "OR", NULL }; /* init */ op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Select certain features (specified by the used " "options) from given GFF3 file(s)."); /* -seqid */ option = gt_option_new_string("seqid", "select feature with the given " "sequence ID (all comments are selected). ", arguments->seqid, NULL); gt_option_parser_add_option(op, option); /* -source */ option = gt_option_new_string("source", "select feature with the given " "source (the source is column 2 in regular " "GFF3 lines)" , arguments->source, NULL); gt_option_parser_add_option(op, option); /* -contain */ contain_option = gt_option_new_range("contain", "select all features which " "are contained in the given range", &arguments->contain_range, NULL); gt_option_parser_add_option(op, contain_option); /* -overlap */ overlap_option = gt_option_new_range("overlap", "select all features which " "do overlap with the given range", &arguments->overlap_range, NULL); gt_option_parser_add_option(op, overlap_option); /* -strand */ option = gt_option_new_string(GT_STRAND_OPT, "select all top-level features" "(i.e., features without parents) whose strand " "equals the given one (must be one of '" GT_STRAND_CHARS"')", arguments->gt_strand_char, NULL); gt_option_parser_add_option(op, option); /* -targetstrand */ option = gt_option_new_string(TARGETGT_STRAND_OPT, "select all top-level " "features (i.e., features without parents) " "which have exactly one target attribute whose " "strand equals the given one (must be one of '" GT_STRAND_CHARS"')", arguments->targetgt_strand_char, NULL); gt_option_parser_add_option(op, option); /* -targetbest */ option = gt_option_new_bool("targetbest", "if multiple top-level features " "(i.e., features without parents) with exactly " "one target attribute have the same target_id, " "keep only the feature with the best score. If " "-"TARGETGT_STRAND_OPT" is used at the same time, " "this option is applied after " "-"TARGETGT_STRAND_OPT".\n" "Memory consumption is proportional to the input " "file size(s).", &arguments->targetbest, false); gt_option_parser_add_option(op, option); /* -hascds */ option = gt_option_new_bool("hascds", "select all top-level features which " "do have a CDS child", &arguments->has_CDS, false); gt_option_parser_add_option(op, option); /* -maxgenelength */ option = gt_option_new_uword_min("maxgenelength", "select genes up to the " "given maximum length", &arguments->max_gene_length, GT_UNDEF_UWORD, 1); gt_option_parser_add_option(op, option); /* -maxgenenum */ option = gt_option_new_uword("maxgenenum", "select the first genes up to the " "given maximum number", &arguments->max_gene_num, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -mingenescore */ option = gt_option_new_double("mingenescore", "select genes with the given " "minimum score", &arguments->min_gene_score, GT_UNDEF_DOUBLE); gt_option_parser_add_option(op, option); /* -maxgenescore */ option = gt_option_new_double("maxgenescore", "select genes with the given " "maximum score", &arguments->max_gene_score, GT_UNDEF_DOUBLE); gt_option_parser_add_option(op, option); /* -minaveragessp */ minaveragessp_option = gt_option_new_probability("minaveragessp", "set the minimum average splice site probability", &arguments->min_average_splice_site_prob, GT_UNDEF_DOUBLE); gt_option_parser_add_option(op, minaveragessp_option); /* -singleintronfactor */ singleintron_option = gt_option_new_double_min("singleintronfactor", "factor to multiplicate the average splice site " "probability with for single introns before " "comparing it to the minimum average splice site " "probability", &arguments->single_intron_factor, 1.0, 1.0); gt_option_is_development_option(singleintron_option); gt_option_parser_add_option(op, singleintron_option); /* -featurenum */ option = gt_option_new_uword_min("featurenum", "select feature tree occurring " "at given position in input", &arguments->feature_num, GT_UNDEF_UWORD, 1); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -filter_files */ option = gt_option_new_filename_array("rule_files", "specify Lua files to be used " "for selection", arguments->filter_files); gt_option_parser_add_option(op, option); /* -filter_logic */ option = gt_option_new_choice("rule_logic", "select how multiple Lua " "files should be combined\nchoose from AND|OR", arguments->filter_logic, filter_logic[0], filter_logic); gt_option_parser_add_option(op, option); /* -nh_file */ optiondroppedfile = gt_option_new_filename("dropped_file", "save non-selected features to " "file", arguments->dropped_file); gt_option_parser_add_option(op, optiondroppedfile); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* option exclusions */ gt_option_exclude(contain_option, overlap_option); /* option implications */ gt_option_imply(singleintron_option, minaveragessp_option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOPrval parse_options(int *parsed_args, bool doesa, Suffixeratoroptions *so, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *option, *optionshowprogress, *optiongenomediff, *optionii; GtOPrval oprval; gt_error_check(err); op = gt_option_parser_new("[option ...] (-db file [...] | -ii index)", doesa ? "Compute enhanced suffix array." : "Compute packed index."); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); /* input info */ so->indexname = gt_str_new(); so->inputindex = gt_str_new(); so->db = gt_str_array_new(); /* register options for encoded sequence handling */ so->encopts = gt_encseq_options_register_encoding(op, so->indexname, so->db); so->loadopts = gt_encseq_options_register_loading(op, so->indexname); /* register options for index handling */ if (doesa) so->idxopts = gt_index_options_register_esa(op, so->encopts); else so->idxopts = gt_index_options_register_packedidx(op, so->indexname, so->encopts); /* verbosity */ option = gt_option_new_verbose(&so->beverbose); gt_option_parser_add_option(op, option); optionshowprogress = gt_option_new_bool("showprogress", "show a progress bar", &so->showprogress, false); gt_option_parser_add_option(op, optionshowprogress); optionii = gt_option_new_filename("ii", "specify existing encoded sequence", so->inputindex); gt_option_parser_add_option(op, optionii); gt_option_is_mandatory_either(gt_encseq_options_db_option(so->encopts), optionii); gt_option_exclude(gt_encseq_options_db_option(so->encopts), optionii); gt_option_exclude(optionii, gt_encseq_options_smap_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_dna_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_protein_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_plain_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_sat_option(so->encopts)); optiongenomediff = gt_option_new_bool("genomediff", "directly process the lcp intervals using " "the genomediff algorithm (suffix array and " "lcp-tables are not output)", &so->genomediff, false); gt_option_is_extended_option(optiongenomediff); if (gt_index_options_outsuftab_option(so->idxopts) != NULL) { gt_option_exclude(optiongenomediff, gt_index_options_outsuftab_option(so->idxopts)); } gt_option_parser_add_option(op, optiongenomediff); /* suffixerator and friends do not take arguments */ gt_option_parser_set_min_max_args(op, 0U, 0U); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); if (gt_str_length(so->indexname) == 0UL) { /* we do not have an indexname yet, so there was none given in the -indexname option and it could not be derived from the input filenames. So it must be in the -ii parameter. */ char *basenameptr; basenameptr = gt_basename(gt_str_get(so->inputindex)); gt_str_set(so->indexname, basenameptr); gt_free(basenameptr); } gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_gdiffcalc_option_parser_new(void *tool_arguments) { GtGenomediffArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *option_unitfile; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] " "-indexname NAME AVGSHULEN) ", "Calculates Kr: pairwise distances between genomes."); /* options */ option = gt_option_new_string("indexname", "Basename of encseq to construct.", arguments->indexname, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /*-unitfile*/ option_unitfile = gt_option_new_filename("unitfile", "specifies genomic units, see below for description", arguments->unitfile); gt_option_parser_add_option(op, option_unitfile); arguments->ref_unitfile = gt_option_ref(option_unitfile); /* encseq options */ arguments->loadopts = gt_encseq_options_register_loading(op, arguments->indexname); gt_option_is_development_option( gt_encseq_options_lossless_option(arguments->loadopts)); /* dev options */ /* -max_n */ option = gt_option_new_uword("max_n", "Number of precalculated values " "for ln(n!) and pmax(x)", &arguments->max_ln_n_fac, 1000UL); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* thresholds */ /* divergence error */ option = gt_option_new_double("thr", "Threshold for difference (du, dl) in " "divergence calculation.\n" "default: 1e-9", &arguments->divergence_threshold, 1e-9); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* expected shulen error */ option = gt_option_new_double("abs_err", "absolute error for expected shulen " "calculation.\n" "default: 1e-5", &arguments->divergence_abs_err, 1e-5); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* relative expected shulen error */ option = gt_option_new_double("rel_err", "relative error for expected shulen " "calculation.\n" "default: 1e-3", &arguments->divergence_rel_err, 1e-3); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* M */ option = gt_option_new_double("M", "threshold for minimum logarithm.\n" "default: DBL_MIN", &arguments->divergence_m, DBL_MIN); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* mail */ gt_option_parser_set_mail_address(op, "<*****@*****.**>"); /* doc */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOPrval gthsplit_parse_options(int *parsed_args, Gthsplitinfo *gthsplitinfo, int argc, const char **argv, const GthPlugins *plugins, GtError *err) { GtOptionParser *op; GtOption *optalignmentscore, *optcoverage, *optrange, *optverbose, *optgzip, *optbzip2, *optforce; bool alignmentscore, coverage, verbose, gzip, bzip2; GtOPrval oprval; gt_error_check(err); op = gt_option_parser_new("-alignmentscore | -coverage [option ...] " "[file ...]", "Split GenomeThreader output files " "containing intermediate results."); /* specify all options with a corresponding help-text */ optalignmentscore = gt_option_new_bool("alignmentscore", "split according to " "the overall alignment score (scr)", &alignmentscore, false); gt_option_parser_add_option(op, optalignmentscore); optcoverage = gt_option_new_bool("coverage", "split according to coverage " "(cov)", &coverage, false); gt_option_parser_add_option(op, optcoverage); optrange = gt_option_new_uint_max(RANGE_OPT_CSTR, "set the percentage range " "used to create the sets", >hsplitinfo->range, DEFAULT_RANGE, 100); gt_option_parser_add_option(op, optrange); /* add sa_filter options */ gth_sa_filter_register_options(op, gthsplitinfo->sa_filter, false); /* -v */ optverbose = gt_option_new_verbose(&verbose); gt_option_parser_add_option(op, optverbose); optgzip = gt_option_new_bool("gzip", "write gzip compressed output file(s)", &gzip, false); gt_option_parser_add_option(op, optgzip); optbzip2 = gt_option_new_bool("bzip2", "write bzip2 compressed output " "file(s)", &bzip2, false); gt_option_parser_add_option(op, optbzip2); optforce = gt_option_new_bool(GT_FORCE_OPT_CSTR,"force writing to split " "files", >hsplitinfo->force, false); gt_option_parser_add_option(op, optforce); gt_option_exclude(optalignmentscore, optcoverage); gt_option_exclude(optgzip, optbzip2); gt_option_is_mandatory_either(optalignmentscore, optcoverage); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, plugins->gth_version_func, err); if (oprval == GT_OPTION_PARSER_OK && alignmentscore) gthsplitinfo->splitmode = ALIGNMENTSCORE_SPLIT; if (oprval == GT_OPTION_PARSER_OK && coverage) gthsplitinfo->splitmode = COVERAGE_SPLIT; if (oprval == GT_OPTION_PARSER_OK && 100 % gthsplitinfo->range) { gt_error_set(err, "argument to option %s must divide 100 without rest", RANGE_OPT_CSTR); oprval = GT_OPTION_PARSER_ERROR; } if (oprval == GT_OPTION_PARSER_OK && verbose) gthsplitinfo->showverbose = gth_show_on_stdout; if (oprval == GT_OPTION_PARSER_OK && gzip) gthsplitinfo->file_mode = GT_FILE_MODE_GZIP; if (oprval == GT_OPTION_PARSER_OK && bzip2) gthsplitinfo->file_mode = GT_FILE_MODE_BZIP2; /* save consensus files */ if (oprval == GT_OPTION_PARSER_OK) { while (*parsed_args < argc) { gt_str_array_add_cstr(gthsplitinfo->consensusfiles, argv[*parsed_args]); (*parsed_args)++; } } if (oprval == GT_OPTION_PARSER_OK && !gt_str_array_size(gthsplitinfo->consensusfiles) && (gt_option_is_set(optgzip) || gt_option_is_set(optbzip2))) { gt_error_set(err, "to use compression, at least on input file has to be " "supplied"); oprval = GT_OPTION_PARSER_ERROR; } gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_ltrdigest_option_parser_new(void *tool_arguments) { GtLTRdigestOptions *arguments = tool_arguments; GtOptionParser *op; GtOption *o, *ot, *oto; GtOption *oh, *oc, *oeval; static const char *cutoffs[] = {"NONE", "GA", "TC", NULL}; static GtRange pptlen_defaults = { 8UL, 30UL}, uboxlen_defaults = { 3UL, 30UL}, pbsalilen_defaults = {11UL, 30UL}, pbsoffsetlen_defaults = { 0UL, 5UL}, pbstrnaoffsetlen_defaults = { 0UL, 5UL}; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] gff3_file", "Identifies and annotates sequence features in LTR " "retrotransposon candidates."); /* Output files */ oto = gt_option_new_string("outfileprefix", "prefix for output files (e.g. 'foo' will create " "files called 'foo_*.csv' and 'foo_*.fas')\n" "Omit this option for GFF3 output only.", arguments->prefix, NULL); gt_option_parser_add_option(op, oto); gt_option_hide_default(oto); o = gt_option_new_bool("metadata", "output metadata (run conditions) to separate file", &arguments->print_metadata, true); gt_option_parser_add_option(op, o); gt_option_imply(o, oto); o = gt_option_new_uint("seqnamelen", "set maximal length of sequence names in FASTA headers" " (e.g. for clustalw or similar tools)", &arguments->seqnamelen, 20U); gt_option_parser_add_option(op, o); /* PPT search options */ o = gt_option_new_range("pptlen", "required PPT length range", &arguments->ppt_len, &pptlen_defaults); gt_option_parser_add_option(op, o); o = gt_option_new_range("uboxlen", "required U-box length range", &arguments->ubox_len, &uboxlen_defaults); gt_option_parser_add_option(op, o); o = gt_option_new_uint("uboxdist", "allowed U-box distance range from PPT", &arguments->max_ubox_dist, 0); gt_option_parser_add_option(op, o); o = gt_option_new_uint("pptradius", "radius around beginning of 3' LTR " "to search for PPT", &arguments->ppt_radius, 30U); gt_option_parser_add_option(op, o); o = gt_option_new_probability("pptrprob", "purine emission probability inside PPT", &arguments->ppt_purine_prob, PPT_PURINE_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("pptyprob", "pyrimidine emission probability inside PPT", &arguments->ppt_pyrimidine_prob, PPT_PYRIMIDINE_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("pptgprob", "background G emission probability outside PPT", &arguments->bkg_g_prob, BKG_G_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("pptcprob", "background C emission probability outside PPT", &arguments->bkg_c_prob, BKG_C_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("pptaprob", "background A emission probability outside PPT", &arguments->bkg_a_prob, BKG_A_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("ppttprob", "background T emission probability outside PPT", &arguments->bkg_t_prob, BKG_T_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); o = gt_option_new_probability("pptuprob", "U/T emission probability inside U-box", &arguments->ubox_u_prob, UBOX_U_PROB); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); /* PBS search options */ ot = gt_option_new_filename("trnas", "tRNA library in multiple FASTA format for PBS " "detection\n" "Omit this option to disable PBS search.", arguments->trna_lib); gt_option_parser_add_option(op, ot); gt_option_hide_default(ot); o = gt_option_new_range("pbsalilen", "required PBS/tRNA alignment length range", &arguments->alilen, &pbsalilen_defaults); gt_option_parser_add_option(op, o); gt_option_imply(o, ot); o = gt_option_new_range("pbsoffset", "allowed PBS offset from LTR boundary range", &arguments->offsetlen, &pbsoffsetlen_defaults); gt_option_parser_add_option(op, o); gt_option_imply(o, ot); o = gt_option_new_range("pbstrnaoffset", "allowed PBS/tRNA 3' end alignment offset range", &arguments->trnaoffsetlen, &pbstrnaoffsetlen_defaults); gt_option_parser_add_option(op, o); gt_option_imply(o, ot); o = gt_option_new_uint("pbsmaxedist", "maximal allowed PBS/tRNA alignment unit " "edit distance", &arguments->max_edist, 1U); gt_option_parser_add_option(op, o); gt_option_imply(o, ot); o = gt_option_new_uint("pbsradius", "radius around end of 5' LTR " "to search for PBS", &arguments->pbs_radius, 30U); gt_option_parser_add_option(op, o); gt_option_imply(o, ot); /* Protein domain search options */ oh = gt_option_new_filename_array("hmms", "profile HMM models for domain detection " "(separate by spaces, finish with --) in " "HMMER3 format\n" "Omit this option to disable pHMM search.", arguments->hmm_files); gt_option_parser_add_option(op, oh); oeval = gt_option_new_probability("pdomevalcutoff", "global E-value cutoff for pHMM search\n" "default 1E-6", &arguments->evalue_cutoff, 0.000001); gt_option_parser_add_option(op, oeval); gt_option_is_extended_option(oeval); gt_option_hide_default(oeval); gt_option_imply(oeval, oh); oc = gt_option_new_choice("pdomcutoff", "model-specific score cutoff\n" "choose from TC (trusted cutoff) | " "GA (gathering cutoff) | " "NONE (no cutoffs)", arguments->cutoffs, cutoffs[0], cutoffs); gt_option_parser_add_option(op, oc); gt_option_is_extended_option(oeval); gt_option_imply(oeval, oh); o = gt_option_new_bool("aliout", "output pHMM to amino acid sequence alignments", &arguments->write_alignments, false); gt_option_parser_add_option(op, o); gt_option_imply(o, oh); gt_option_imply(o, oto); o = gt_option_new_bool("aaout", "output amino acid sequences for protein domain " "hits", &arguments->write_aaseqs, false); gt_option_parser_add_option(op, o); gt_option_imply(o, oh); gt_option_imply(o, oto); o = gt_option_new_bool("allchains", "output features from all chains and unchained " "features, labeled with chain numbers", &arguments->output_all_chains, false); gt_option_parser_add_option(op, o); gt_option_imply(o, oh); o = gt_option_new_uint("maxgaplen", "maximal allowed gap size between fragments (in amino " "acids) when chaining pHMM hits for a protein domain", &arguments->chain_max_gap_length, 50U); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_imply(o, oh); o = gt_option_new_uword("threads", "DEPRECATED, only included for compatibility reasons!" " Use the -j parameter of the 'gt' call instead.", &arguments->nthreads, 0); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); /* Extended PBS options */ o = gt_option_new_int("pbsmatchscore", "match score for PBS/tRNA alignments", &arguments->ali_score_match, 5); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_imply(o, ot); o = gt_option_new_int("pbsmismatchscore", "mismatch score for PBS/tRNA alignments", &arguments->ali_score_mismatch, -10); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_imply(o, ot); o = gt_option_new_int("pbsinsertionscore", "insertion score for PBS/tRNA alignments", &arguments->ali_score_insertion, -20); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_imply(o, ot); o = gt_option_new_int("pbsdeletionscore", "deletion score for PBS/tRNA alignments", &arguments->ali_score_deletion, -20); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_imply(o, ot); /* verbosity */ o = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, o); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); /* region mapping and sequence source options */ gt_seqid2file_register_options_ext(op, arguments->s2fi, false, false); return op; }
static GtOptionParser* gt_genomediff_option_parser_new(void *tool_arguments) { GtGenomediffArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *option_unitfile; static const char *indextypes[] = { "esa", "pck", "encseq", NULL }; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] " "(INDEX | -indexname NAME SEQFILE SEQFILE [...]) ", "Calculates Kr: pairwise distances between genomes."); /* options */ option = gt_option_new_choice("indextype", "specify type of index, one of: " "esa|pck|encseq. Where encseq is an encoded " "sequence and an enhanced suffix array will be " "constructed only in memory.", arguments->indextype, indextypes[2], indextypes); gt_option_parser_add_option(op, option); option = gt_option_new_string("indexname", "Basename of encseq to construct.", arguments->indexname, NULL); gt_option_parser_add_option(op, option); /*-unitfile*/ option_unitfile = gt_option_new_filename("unitfile", "specifies genomic units, " "see below for description.", arguments->unitfile); gt_option_parser_add_option(op, option_unitfile); arguments->ref_unitfile = gt_option_ref(option_unitfile); /* encseq options */ arguments->loadopts = gt_encseq_options_register_loading(op, arguments->indexname); gt_option_is_development_option( gt_encseq_options_lossless_option(arguments->loadopts)); /* esa options */ arguments->idxopts = gt_index_options_register_esa_noout(op); gt_option_is_development_option( gt_index_options_spmopt_option(arguments->idxopts)); /* scan */ option = gt_option_new_bool("scan", "do not load esa index but scan " "it sequentially.", &arguments->scanfile, true); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* dev options */ /* -max_n */ option = gt_option_new_uword("max_n", "Number of precalculated values " "for ln(n!) and pmax(x).", &arguments->max_ln_n_fac, 1000UL); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -maxdepth */ option = gt_option_new_int("maxdepth", "max depth of .pbi-file, use with " "-indextype pck.", &arguments->user_max_depth, -1); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* thresholds */ /* divergence error */ option = gt_option_new_double("thr", "Threshold for difference (du, dl) in " "divergence calculation.\n" "default: 1e-9", &arguments->divergence_threshold, 1e-9); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* expected shulen error */ option = gt_option_new_double("abs_err", "absolute error for expected shulen " "calculation.\n" "default: 1e-5", &arguments->divergence_abs_err, 1e-5); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* relative expected shulen error */ option = gt_option_new_double("rel_err", "relative error for expected shulen " "calculation.\n" "default: 1e-3", &arguments->divergence_rel_err, 1e-3); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* M */ option = gt_option_new_double("M", "threshold for minimum logarithm.\n" "default: DBL_MIN", &arguments->divergence_m, DBL_MIN); gt_option_is_extended_option(option); gt_option_hide_default(option); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* mail */ gt_option_parser_set_mail_address(op, "<*****@*****.**>"); /* doc */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser* gt_encseq2spm_option_parser_new(void *tool_arguments) { GtEncseq2spmArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionparts, *optionmemlimit; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [file]", "Compute suffix prefix matches " "from encoded sequence."); /* -l */ option = gt_option_new_uint_min("l", "specify the minimum length", &arguments->minmatchlength, 0, 1U); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -parts */ optionparts = gt_option_new_uint("parts", "specify the number of parts", &arguments->numofparts, 0U); gt_option_parser_add_option(op, optionparts); /* -memlimit */ optionmemlimit = gt_option_new_string("memlimit", "specify maximal amount of memory to be used during " "index construction (in bytes, the keywords 'MB' " "and 'GB' are allowed)", arguments->memlimitarg, NULL); gt_option_parser_add_option(op, optionmemlimit); gt_option_exclude(optionmemlimit, optionparts); arguments->refoptionmemlimit = gt_option_ref(optionmemlimit); /* -checksuftab */ option = gt_option_new_bool("checksuftab", "check the suffix table", &arguments->checksuftab, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -singlestrand */ option = gt_option_new_bool("singlestrand", "use only the forward strand " "of the sequence", &arguments->singlestrand, false); gt_option_parser_add_option(op, option); /* -spm */ option = gt_option_new_string("spm", "specify output for spms", arguments->spmspec, NULL); gt_option_parser_add_option(op, option); /* -ii */ option = gt_option_new_string("ii", "specify the input sequence", arguments->encseqinput, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -onlyaccum */ option = gt_option_new_bool("onlyaccum", "only accumulate codes", &arguments->onlyaccum, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -onlyallfirstcodes */ option = gt_option_new_bool("onlyallfirstcodes", "only determines allcodes", &arguments->onlyallfirstcodes, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -addbscachedepth */ option = gt_option_new_uint("addbscachedepth", "only determines allcodes", &arguments->addbscache_depth, 5U); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -phase2extra */ option = gt_option_new_string("phase2extra", "specify amount of additional space required for " "the second phase of the computation involving the " "processing of the intervals (in bytes, " "the keywords 'MB' and 'GB' are allowed)", arguments->phase2extraarg, NULL); gt_option_parser_add_option(op, option); arguments->refoptionphase2extra = gt_option_ref(option); gt_option_is_development_option(option); /* -radixlarge */ option = gt_option_new_bool("radixlarge", "use large tables for radixsort", &arguments->radixlarge, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -radixparts */ option = gt_option_new_uint("radixparts", "specify the number of parts " "for radixsort", &arguments->radixparts, 1U); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -singlescan */ option = gt_option_new_uint("singlescan", "run a single scan: 1=fast; " "2=fast with check; 3=fast with output; " "4=sfx-mapped4-version", &arguments->singlescan, 0); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -forcek */ option = gt_option_new_uint("forcek", "specify the value of k", &arguments->forcek, 0); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser* gt_seed_extend_option_parser_new(void *tool_arguments) { GtSeedExtendArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *op_gre, *op_xdr, *op_cam, *op_his, *op_dif, *op_pmh, *op_len, *op_err, *op_xbe, *op_sup, *op_frq, *op_mem, *op_ali, *op_bia; gt_assert(arguments != NULL); /* init */ op = gt_option_parser_new("[option ...] encseq_basename [encseq_basename]", "Calculate local alignments using the seed and " "extend algorithm."); /* DIAGBANDSEED OPTIONS */ /* -ii */ option = gt_option_new_string("ii", "Input index for encseq encoded sequences", arguments->dbs_indexname, ""); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -qii */ option = gt_option_new_string("qii", "Query input index (encseq)", arguments->dbs_queryname, ""); gt_option_parser_add_option(op, option); /* -seedlength */ op_len = gt_option_new_uint_min_max("seedlength", "Minimum length of a seed", &arguments->dbs_seedlength, 14UL, 1UL, 32UL); gt_option_parser_add_option(op, op_len); /* -diagbandwidth */ option = gt_option_new_uword("diagbandwidth", "Logarithm of diagonal band width (for filter)", &arguments->dbs_logdiagbandwidth, 6UL); gt_option_parser_add_option(op, option); /* -mincoverage */ option = gt_option_new_uword("mincoverage", "Minimum coverage in two neighbouring diagonal " "bands (for filter)", &arguments->dbs_mincoverage, 35UL); gt_option_parser_add_option(op, option); /* -maxfreq */ op_frq = gt_option_new_uword_min("maxfreq", "Maximum frequency of a k-mer (for filter)", &arguments->dbs_maxfreq, GT_UWORD_MAX, 1UL); gt_option_parser_add_option(op, op_frq); /* -t */ op_sup = gt_option_new_uword_min("t", "Suppress k-mers occurring at least t times " "(for filter)", &arguments->dbs_suppress, GT_UWORD_MAX, 2UL); gt_option_exclude(op_sup, op_frq); gt_option_is_development_option(op_sup); gt_option_parser_add_option(op, op_sup); /* -memlimit */ op_mem = gt_option_new_string("memlimit", "Maximum memory usage to determine the maximum " "frequency of a k-mer (for filter)", arguments->dbs_memlimit_str, ""); gt_option_parser_add_option(op, op_mem); /* -debug-kmer */ option = gt_option_new_bool("debug-kmer", "Output KmerPos lists", &arguments->dbs_debug_kmer, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -debug-seedpair */ option = gt_option_new_bool("debug-seedpair", "Output SeedPair lists", &arguments->dbs_debug_seedpair, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -verify */ option = gt_option_new_bool("verify", "Check that k-mer seeds occur in the sequences", &arguments->dbs_verify, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* SEED EXTENSION OPTIONS */ /* -extendxdrop */ op_xdr = gt_option_new_uword_min_max("extendxdrop", "Extend seed to both sides using xdrop " "algorithm, optional parameter " "specifies sensitivity", &arguments->se_extendxdrop, 97UL, 90UL, 100UL); gt_option_argument_is_optional(op_xdr); gt_option_parser_add_option(op, op_xdr); arguments->se_option_xdrop = gt_option_ref(op_xdr); /* -xdropbelow */ op_xbe = gt_option_new_word("xdropbelow", "Specify xdrop cutoff score (0 means " "automatically defined depending on minidentity)", &arguments->se_xdropbelowscore, 0L); gt_option_imply(op_xbe, op_xdr); gt_option_parser_add_option(op, op_xbe); /* -extendgreedy */ op_gre = gt_option_new_uword_min_max("extendgreedy", "Extend seed to both sides using greedy " "algorithm, optional parameter " "specifies sensitivity", &arguments->se_extendgreedy, 97UL, 90UL, 100UL); gt_option_argument_is_optional(op_gre); gt_option_exclude(op_gre, op_xdr); gt_option_parser_add_option(op, op_gre); arguments->se_option_greedy = gt_option_ref(op_gre); /* -history */ op_his = gt_option_new_uword_min_max("history", "Size of (mis)match history in range [1" "..64] (trimming for greedy extension)", &arguments->se_historysize, 60UL, 1UL, 64UL); gt_option_imply(op_his, op_gre); gt_option_parser_add_option(op, op_his); /* -maxalilendiff */ op_dif = gt_option_new_uword("maxalilendiff", "Maximum difference of alignment length " "(trimming for greedy extension)", &arguments->se_maxalilendiff, 0UL); gt_option_imply(op_dif, op_gre); gt_option_is_development_option(op_dif); gt_option_parser_add_option(op, op_dif); /* -percmathistory */ op_pmh = gt_option_new_uword_min_max("percmathistory", "percentage of matches required in " "history (for greedy extension)", &arguments->se_perc_match_hist, 0UL, 1UL, 100UL); gt_option_imply(op_pmh, op_gre); gt_option_is_development_option(op_pmh); gt_option_parser_add_option(op, op_pmh); /* -bias-parameters */ op_bia = gt_option_new_bool("bias-parameters", "Use -maxalilendiff 30 and let percmathistory " "depend on minidentiy and DNA base distribution", &arguments->bias_parameters, false); gt_option_imply(op_bia, op_gre); gt_option_exclude(op_bia, op_pmh); gt_option_exclude(op_bia, op_dif); gt_option_is_development_option(op_bia); gt_option_parser_add_option(op, op_bia); /* -cam */ op_cam = gt_option_new_string("cam", gt_cam_extendgreedy_comment(), arguments->se_char_access_mode, ""); gt_option_is_development_option(op_cam); gt_option_parser_add_option(op, op_cam); /* -l */ op_len = gt_option_new_uword_min("l", "Minimum alignment length " "(for seed extension)", &arguments->se_alignlength, 20UL, 1UL); gt_option_imply_either_2(op_len, op_xdr, op_gre); gt_option_parser_add_option(op, op_len); /* -minidentity */ op_err = gt_option_new_uword_min_max("minidentity", "Minimum identity of matches " "(for seed extension)", &arguments->se_minidentity, 80UL, GT_EXTEND_MIN_IDENTITY_PERCENTAGE, 99UL); gt_option_imply_either_2(op_err, op_xdr, op_gre); gt_option_parser_add_option(op, op_err); /* -a */ op_ali = gt_option_new_uword_min("a", "show alignments/sequences (optional " "argument is number of columns per line)", &arguments->se_alignmentwidth, 70, 20); gt_option_argument_is_optional(op_ali); gt_option_parser_add_option(op, op_ali); arguments->se_option_withali = gt_option_ref(op_ali); /* -mirror */ option = gt_option_new_bool("mirror", "Add reverse complement reads", &arguments->mirror, false); gt_option_parser_add_option(op, option); /* -overlappingseeds */ option = gt_option_new_bool("overlappingseeds", "Allow overlapping SeedPairs", &arguments->overlappingseeds, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -benchmark */ option = gt_option_new_bool("benchmark", "Measure total running time and be silent", &arguments->benchmark, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -seed-display */ option = gt_option_new_bool("seed-display", "Display seeds in #-line", &arguments->seed_display, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser *gt_idxlocali_option_parser_new (void *tool_arguments) { IdxlocaliOptions *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionesaindex, *optionpckindex, *optiononline, *optioncmp; gt_assert (arguments != NULL); arguments->indexname = gt_str_new (); arguments->queryfiles = gt_str_array_new (); op = gt_option_parser_new ("[options] -q query-file-names [-esa|-pck] indexname", "Find all local alignments using suffix tree."); gt_option_parser_set_mailaddress (op, "<*****@*****.**>"); option = gt_option_new_filenamearray ("q","Specify files containing the " "query sequences", arguments->queryfiles); gt_option_parser_add_option (op, option); option = gt_option_new_long ("match", "Specify match score", &arguments->matchscore, 1L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("mismatch", "Specify mismatch score", &arguments->mismatchscore, -3L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("gapstart", "Specify gap start score", &arguments->gapstart, -5L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("gapextend", "Specify gap extension score", &arguments->gapextend, -2L); gt_option_parser_add_option (op, option); option = gt_option_new_ulong_min ("th", "Specify the threshold", &arguments->threshold, 0, 1UL); gt_option_parser_add_option (op, option); gt_option_is_mandatory (option); optionesaindex = gt_option_new_string ("esa", "Specify index " "(enhanced suffix array)", arguments->indexname, NULL); gt_option_parser_add_option (op, optionesaindex); arguments->refoptionesaindex = gt_option_ref (optionesaindex); optionpckindex = gt_option_new_string ("pck", "Specify index (packed index)", arguments->indexname, NULL); gt_option_parser_add_option (op, optionpckindex); arguments->refoptionpckindex = gt_option_ref (optionpckindex); gt_option_exclude (optionesaindex, optionpckindex); gt_option_is_mandatory_either (optionesaindex, optionpckindex); optiononline = gt_option_new_bool("online","Perform online searches", &arguments->doonline, false); gt_option_parser_add_option(op, optiononline); gt_option_is_development_option(optiononline); optioncmp = gt_option_new_bool("cmp","Compare results of offline and online " "searches", &arguments->docompare, false); gt_option_parser_add_option(op,optioncmp); gt_option_exclude(optiononline,optioncmp); option = gt_option_new_bool("s", "Show alignments", &arguments->showalignment, false); gt_option_parser_add_option (op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }