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_shredder_option_parser_new(void *tool_arguments) { GtShredderArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; gt_assert(arguments); op = gt_option_parser_new("[option ...] [sequence_file ...]", "GtShredder sequence_file into consecutive pieces of " "random length."); o = gt_option_new_ulong_min("coverage", "set the number of times the " "sequence_file is shreddered", &arguments->coverage, 1, 1); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("minlength", "set the minimum length of the shreddered " "fragments", &arguments->minlength, 300); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("maxlength", "set the maximum length of the shreddered " "fragments", &arguments->maxlength, 700); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("overlap", "set the overlap between consecutive " "pieces", &arguments->overlap, 0); gt_option_parser_add_option(op, o); o = gt_option_new_probability("sample", "take samples of the generated " "sequences pieces with the given probability", &arguments->sample_probability, 1.0); gt_option_parser_add_option(op, o); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser* gt_splicesiteinfo_option_parser_new(void *tool_arguments) { SpliceSiteInfoArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Show information " "about splice sites given in GFF3 files."); /* -seqfile, -matchdesc, -usedesc and -regionmapping */ gt_seqid2file_register_options(op, arguments->s2fi); /* -addintrons */ option = gt_option_new_bool("addintrons", "add intron features between " "existing exon features\n(before computing the " "information to be shown)", &arguments->addintrons, false); 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); 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_dev_option_parser_new(void *tool_arguments) { GtToolbox *dev_toolbox = tool_arguments; GtOptionParser *op; gt_assert(dev_toolbox); op = gt_option_parser_new("[option ...] dev_tool_name [argument ...]", "Call development tool with name dev_tool_name and " "pass argument(s) to it."); gt_option_parser_set_comment_func(op, gt_toolbox_show, dev_toolbox); gt_option_parser_set_min_args(op, 1); return op; }
static GtOptionParser* gt_packedindex_option_parser_new(void *tool_arguments) { GtToolbox *index_toolbox = tool_arguments; GtOptionParser *op; gt_assert(index_toolbox); op = gt_option_parser_new("[option ...] index_tool [argument ...]", "Call apacked index subtool and pass argument(s) to " "it."); gt_option_parser_set_comment_func(op, gt_toolbox_show, index_toolbox); gt_option_parser_set_min_args(op, 1); gt_option_parser_refer_to_manual(op); 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_cge_option_parser_new(void *tool_arguments) { GtToolbox *index_toolbox = tool_arguments; GtOptionParser *op; gt_assert(index_toolbox != NULL); op = gt_option_parser_new( "[option ...] congruence_tool [argument ...]", "Call a congruence subtool and pass argument(s) to it."); gt_option_parser_set_comment_func(op, gt_toolbox_show, index_toolbox); gt_option_parser_set_min_args(op, 1U); gt_option_parser_refer_to_manual(op); 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_option_parser_new(void *tool_arguments) { GtToolbox *index_toolbox = tool_arguments; GtOptionParser *op; gt_assert(index_toolbox != NULL); op = gt_option_parser_new( "[option ...] tallymer_tool [argument ...]", "Call tallymer tool with name tallymer_tool and pass " "argument(s) to it."); gt_option_parser_set_comment_func(op, gt_toolbox_show, index_toolbox); gt_option_parser_set_min_args(op, 1U); gt_option_parser_refer_to_manual(op); return op; }
static GtOptionParser* gt_condenser_option_parser_new(void *tool_arguments) { GtToolbox *condenser_toolbox = tool_arguments; GtOptionParser *op; gt_assert(condenser_toolbox); /* init */ op = gt_option_parser_new("[option ...] [file]", "Call one of the CONDENSER tools to prepare " "or manipulate redundancie compressed genomic data." ); gt_option_parser_set_comment_func(op, gt_toolbox_show, condenser_toolbox); gt_option_parser_set_min_args(op, 1U); 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_seqmutate_option_parser_new(void *tool_arguments) { MutateArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; gt_assert(arguments); op = gt_option_parser_new("[option ...] [sequence_file ...]", "Mutate the sequences of the given sequence " "file(s)."); /* -rate */ o = gt_option_new_uint_max("rate", "set the mutation rate", &arguments->rate, 1, 100); gt_option_parser_add_option(op, o); /* -width */ o = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, o); gt_outputfile_register_options(op, &arguments->outfp, arguments->ofi); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser* gt_extractseq_option_parser_new(void *tool_arguments) { ExtractSeqArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *frompos_option, *topos_option, *match_option, *width_option, *fastakeyfile_option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [sequence_file(s)] | fastaindex", "Extract sequences from given sequence file(s) or " "fastaindex."); /* -frompos */ frompos_option = gt_option_new_ulong_min(FROMPOS_OPTION_STR, "extract sequence from this position\n" "counting from 1 on", &arguments->frompos, 0, 1UL); gt_option_parser_add_option(op, frompos_option); /* -topos */ topos_option = gt_option_new_ulong_min(TOPOS_OPTION_STR, "extract sequence up to this position\n" "counting from 1 on", &arguments->topos, 0, 1UL); gt_option_parser_add_option(op, topos_option); /* -match */ match_option = gt_option_new_string("match", "extract all sequences whose " "description matches the given pattern.\n" "The given pattern must be a valid extended " "regular expression.", arguments->pattern, NULL); gt_option_parser_add_option(op, match_option); /* -keys */ fastakeyfile_option = gt_option_new_filename("keys", "extract substrings for keys " "in specified file", arguments->fastakeyfile); gt_option_parser_add_option(op, fastakeyfile_option); /* -width */ width_option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, width_option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, arguments->ofi); /* option implications */ gt_option_imply(frompos_option, topos_option); gt_option_imply(topos_option, frompos_option); /* option exclusions */ gt_option_exclude(frompos_option, match_option); gt_option_exclude(topos_option, match_option); gt_option_exclude(frompos_option, fastakeyfile_option); gt_option_exclude(match_option, fastakeyfile_option); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); 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_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 GtOptionParser* gtr_option_parser_new(GtR *gtr) { GtOptionParser *op; GtOption *o, *only_option, *debug_option, *debugfp_option; gt_assert(gtr); op = gt_option_parser_new("[option ...] [tool | script] [argument ...]", "The GenomeTools genome analysis system."); gt_option_parser_set_comment_func(op, show_gtr_help, gtr->tools); o = gt_option_new_bool("i", "enter interactive mode after executing 'tool' or " "'script'", >r->interactive, false); gt_option_hide_default(o); gt_option_parser_add_option(op, o); o = gt_option_new_bool("q", "suppress warnings", >r->quiet, false); gt_option_hide_default(o); gt_option_parser_add_option(op, o); o = gt_option_new_uint_min("j", "set number of parallel threads used at once", >_jobs, 1, 1); gt_option_is_development_option(o); gt_option_parser_add_option(op, o); o = gt_option_new_bool("test", "perform unit tests and exit", >r->test, false); gt_option_hide_default(o); gt_option_parser_add_option(op, o); only_option = gt_option_new_string("only", "perform single unit test " "(requires -test)", gtr->test_only, ""); gt_option_imply(only_option, o); gt_option_is_development_option(only_option); gt_option_hide_default(only_option); gt_option_parser_add_option(op, only_option); debug_option = gt_option_new_debug(>r->debug); gt_option_parser_add_option(op, debug_option); debugfp_option = gt_option_new_string("debugfp", "set file pointer for debugging output\n" "use ``stdout'' for standard output\n" "use ``stderr'' for standard error\n" "or any other string to use the " "corresponding file (will be overwritten " "without warning!)", gtr->debugfp, "stderr"); gt_option_is_development_option(debugfp_option); gt_option_parser_add_option(op, debugfp_option); gt_option_imply(debugfp_option, debug_option); o = gt_option_new_uint("seed", "set seed for random number generator manually.\n" "0 generates a seed from current time and process id", >r->seed, gtr->seed); gt_option_hide_default(o); gt_option_parser_add_option(op, o); o = gt_option_new_bool("64bit", "exit with code 0 if this is a 64bit binary, " "with 1 otherwise", >r->check64bit, false); gt_option_is_development_option(o); gt_option_parser_add_option(op, o); o = gt_option_new_bool("list", "list all tools and exit", >r->list, false); gt_option_is_development_option(o); gt_option_hide_default(o); gt_option_parser_add_option(op, o); o = gt_option_new_filename("testspacepeak", "alloc 64 MB and mmap the given " "file", gtr->testspacepeak); gt_option_is_development_option(o); gt_option_parser_add_option(op, o); o = gt_option_new_string("createman", "create man page sources in directory", gtr->manoutdir, ""); gt_option_is_development_option(o); gt_option_parser_add_option(op, o); 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_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_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; }