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_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_sketch_page_option_parser_new(void *tool_arguments) { SketchPageArguments *arguments = tool_arguments; GtOptionParser *op; static const char *formats[] = { #ifdef CAIRO_HAS_PDF_SURFACE "pdf", #endif #ifdef CAIRO_HAS_PS_SURFACE "ps", #endif NULL }; GtOption *o; op = gt_option_parser_new("outfile annotationfile", "Draw a multi-page PDF/PS representation of " "an annotation file."); o = gt_option_new_string("seqid", "sequence region to draw\n" "default: first in file", arguments->seqid, NULL); gt_option_parser_add_option(op, o); gt_option_hide_default(o); o = gt_option_new_string("text", "text to show in header\n" "default: file name", arguments->text, NULL); gt_option_parser_add_option(op, o); gt_option_hide_default(o); o = gt_option_new_double("fontsize", "header and footer font size " "(in points)", &arguments->theight, 10.0); gt_option_parser_add_option(op, o); o = gt_option_new_range("range", "range to draw (e.g. 100 10000)\n" "default: full range", &arguments->range, NULL); gt_option_parser_add_option(op, o); gt_option_hide_default(o); o = gt_option_new_ulong_min("linewidth", "base width of a single " "repeated unit", &arguments->width, 2000, 1000); gt_option_is_mandatory(o); gt_option_parser_add_option(op, o); o = gt_option_new_double("width", "page width in millimeters " "(default: DIN A4)", &arguments->pwidth, 210.0); gt_option_parser_add_option(op, o); o = gt_option_new_double("height", "page height in millimeters " "(default: DIN A4)", &arguments->pheight, 297.0); gt_option_parser_add_option(op, o); o = gt_option_new_choice("format", "output format\n" "choose from: " #ifdef CAIRO_HAS_PDF_SURFACE "pdf" #ifdef CAIRO_HAS_PS_SURFACE "|" #endif #endif #ifdef CAIRO_HAS_PS_SURFACE "ps" #endif "", arguments->format, formats[0], formats ); gt_option_parser_add_option(op, o); o = gt_option_new_string("style", "style file to use\n" "default: gtdata/sketch/default.style", arguments->stylefile, gt_str_get(arguments->stylefile)); gt_option_parser_add_option(op, o); gt_option_hide_default(o); o = gt_option_new_filename("seqfile", "sequence file for GC content view", arguments->seqfile); gt_option_parser_add_option(op, o); gt_option_is_extended_option(o); gt_option_parser_set_min_max_args(op, 2, 2); return op; }
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 GtOptionParser* gt_condenser_search_option_parser_new (void *tool_arguments) { GtCondenserSearchArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *score_opt, *ceval_opt, *feval_opt, *blastp_opt, *blastn_opt; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...]", "Perform a BLAST or " "HMMSEARCH on the given compressed database."); /* -blastn */ blastn_opt = gt_option_new_bool("blastn", "perform blastn search", &arguments->blastn, false); /* -blastp */ blastp_opt = gt_option_new_bool("blastp", "perform blastp search", &arguments->blastp, false); gt_option_exclude(blastn_opt, blastp_opt); gt_option_parser_add_option(op, blastn_opt); gt_option_parser_add_option(op, blastp_opt); /* -score */ score_opt = gt_option_new_uword("score", "bitscore threshold for BLAST(p) " "evalue calculation", &arguments->bitscore, (GtUword) 30); gt_option_parser_add_option(op, score_opt); /* -ce */ ceval_opt = gt_option_new_double("ce", "coarse e value for coarse blast search", &arguments->ceval, 5.0); gt_option_parser_add_option(op, ceval_opt); /* -fe */ feval_opt = gt_option_new_double("fe", "fine e value for fine blast search, " "defaults to calculated evalue from the " "given score", &arguments->feval, GT_UNDEF_DOUBLE); gt_option_hide_default(feval_opt); gt_option_parser_add_option(op, feval_opt); gt_option_exclude(score_opt, ceval_opt); gt_option_exclude(score_opt, feval_opt); /* -db */ option = gt_option_new_filename("db", "path of (compressed) fasta database", arguments->dbpath); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -query */ option = gt_option_new_filename("query", "path of fasta query file", arguments->querypath); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -verbose */ option = gt_option_new_bool("verbose", "verbose output", &arguments->verbose, false); gt_option_parser_add_option(op, option); /* -blastthreads */ option = gt_option_new_int_min("blastthreads", "how many threads for blast " "to use", &arguments->blthreads, 8, 1); gt_option_imply_either_2(option, blastn_opt, blastp_opt); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); 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; }