static GtOptionParser* gt_seqtransform_option_parser_new(void *tool_arguments) { SeqtransformArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; gt_assert(arguments); op = gt_option_parser_new("[option ...] [sequence_file ...]", "Perform simple transformations on the given " "sequence file(s)."); /* -addstopaminos */ o = gt_option_new_bool("addstopaminos", "append stop amino acids ('" GT_STOP_AMINO_CSTR"') to given protein sequences, if " "not already present", &arguments->addstopaminos, false); gt_option_parser_add_option(op, o); /* -width */ o = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, o); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); return op; }
static GtOptionParser* gt_seqtranslate_option_parser_new(void *tool_arguments) { GtTranslateArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [files]", "Translates a nucleotide sequence into a protein " "sequence."); option = gt_option_new_bool("reverse", "also translate reverse complements", &arguments->reverse, true); gt_option_parser_add_option(op, option); option = gt_option_new_uword("fastawidth", "width of the FASTA output", &arguments->fasta_width, 60); gt_option_parser_add_option(op, option); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); gt_option_parser_set_min_args(op, 1); return op; }
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_interfeat_option_parser_new(void *tool_arguments) { InterFeatArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Duplicate " "internal feature nodes in given GFF3 files."); /* -outside */ option = gt_option_new_string("dest", "set destination type", arguments->dest_type, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -inter */ option = gt_option_new_string("source", "set source type", arguments->source_type, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); 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_gff3_to_gtf_option_parser_new(void *tool_arguments) { GFF3ToGTFArguments *arguments = tool_arguments; GtOptionParser *op; op = gt_option_parser_new("[GFF3_file ...]", "Parse GFF3 file(s) and show them as GTF2.2."); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); return op; }
static GtOptionParser* gt_seqfilter_option_parser_new(void *tool_arguments) { SeqFilterArguments *arguments = tool_arguments; GtOption *option; GtOptionParser *op; gt_assert(arguments); op = gt_option_parser_new("[option ...] [sequence_file ...]", "Filter the given sequence file(s) and show the " "results on stdout."); /* -minlength */ option = gt_option_new_uword("minlength", "set minimum length a sequence must " "have to pass the filter", &arguments->minlength, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -maxlength */ option = gt_option_new_uword("maxlength", "set maximum length a sequence can " "have to pass the filter", &arguments->maxlength, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -maxseqnum */ option = gt_option_new_uword("maxseqnum", "set the maximum number of " "sequences which can pass the filter", &arguments->maxseqnum, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -sample */ option = gt_option_new_double_min_max("sample", "set a probability for each " "sequence to pass the filter", &arguments->sample_prob, SEQFILTER_DEF_PROB, SEQFILTER_MIN_PROB, SEQFILTER_MAX_PROB); gt_option_parser_add_option(op, option); /* -step */ option = gt_option_new_uword_min("step", "only every 'step'-th sequence " "passes the filter", &arguments->step, SEQFILTER_DEF_STEP, SEQFILTER_MIN_STEP); gt_option_parser_add_option(op, option); /* -width */ option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, option); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); 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_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_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_inlineseq_add_option_parser_new(void *tool_arguments) { GtOptionParser *op; GT_UNUSED GtOption *option; InlineseqAddArguments *arguments = tool_arguments; /* init */ op = gt_option_parser_new("[options] [GFF3_file ...]", "Adds inline sequences from external source to " "GFF3 input."); gt_seqid2file_register_options(op, arguments->s2fi); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); return op; }
static GtOptionParser* gt_convertseq_option_parser_new(void *tool_arguments) { GtConvertseqArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; gt_assert(arguments); op = gt_option_parser_new("[options] file [...]", "Parse and convert sequence file formats " "(FASTA/FASTQ, GenBank, EMBL)."); o = gt_option_new_bool("v","be verbose", &arguments->verbose, false); gt_option_parser_add_option(op, o); o = gt_option_new_bool("r","reverse complement sequences", &arguments->revcomp, false); gt_option_parser_add_option(op, o); o = gt_option_new_bool("showfilelengthvalues","show filelengths", &arguments->showflv, false); gt_option_parser_add_option(op, o); o = gt_option_new_bool("noseq","do not show sequences", &arguments->showseq, false); gt_option_parser_add_option(op, o); o = gt_option_new_uword("fastawidth", "FASTA output line width, 0 for unlimited", &arguments->fastawidth, 60UL); gt_option_parser_add_option(op, o); o = gt_option_new_bool("contractdnawc", "replace stretches of DNA wildcards " "with a single 'N'", &arguments->reduce_wc_dna, false); gt_option_parser_add_option(op, o); o = gt_option_new_bool("contractproteinwc", "replace stretches of protein " "wildcards with a single 'X'", &arguments->reduce_wc_prot, false); gt_option_parser_add_option(op, o); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); gt_option_parser_set_min_args(op, 1U); return op; }
static GtOptionParser* gt_mergefeat_option_parser_new(void *tool_arguments) { InterFeatArguments *arguments = tool_arguments; GtOptionParser *op; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Merge adjacent " "features without children of the same type in " "given GFF3 file(s)."); /* output file options */ gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); return op; }
static GtOptionParser* gt_encseq_info_option_parser_new(void *tool_arguments) { GtEncseqInfoArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionnomap; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] indexname", "Display meta-information about an " "encoded sequence."); optionnomap = gt_option_new_bool("nomap", "do not map encoded sequence " "(gives less information)", &arguments->nomap, false); gt_option_parser_add_option(op, optionnomap); option = gt_option_new_bool("mirrored", "use mirrored encoded sequence " "(DNA only)", &arguments->mirror, false); gt_option_parser_add_option(op, option); gt_option_exclude(optionnomap, option); option = gt_option_new_bool("noindexname", "do not output index name", &arguments->noindexname, false); gt_option_parser_add_option(op, option); option = gt_option_new_bool("show_alphabet", "output alphabet definition", &arguments->show_alphabet, false); 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_min_max_args(op, 1, 1); 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* 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_condenseq_extract_option_parser_new(void *tool_arguments) { GtCondenserExtractArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionrange, *optionseq, *optionseqrange, *optionmode; static const char *modes[] = {"fasta", "concat", NULL}; gt_assert(arguments); /* init */ op = gt_option_parser_new("[options] archive", "Decompresses condenseq archive."); /* -seq */ optionseq = gt_option_new_uword("seq", "only extract sequence identified by its " "number", &arguments->seq, GT_UNDEF_UWORD); gt_option_parser_add_option(op, optionseq); /* -seqrange */ optionseqrange = gt_option_new_range("seqrange", "only extract (inclusive) range of " "consecutive sequences identified by " "their zero based index numbers", &arguments->seqrange, NULL); gt_option_parser_add_option(op, optionseqrange); gt_option_exclude(optionseq, optionseqrange); /* -range */ optionrange = gt_option_new_range("range", "only extract (inclusive) range of zero " "based positions " "(implies option -output concat)", &arguments->range, NULL); gt_option_parser_add_option(op, optionrange); gt_option_exclude(optionseq, optionrange); gt_option_exclude(optionseqrange, optionrange); /* -output */ optionmode = gt_option_new_choice("output", "specify output format " "(choose from fasta|concat)", arguments->mode, modes[0], modes); gt_option_parser_add_option(op, optionmode); gt_option_imply(optionrange, optionmode); /* -sepchar */ option = gt_option_new_string("sepchar", "specify character to print as SEPARATOR " "(implies option -output concat", arguments->sepchar, "|"); gt_option_parser_add_option(op, option); gt_option_imply(option, optionmode); arguments->sepchar_opt = gt_option_ref(option); gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp); /* -width */ option = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, option); /* -verbose */ option = gt_option_new_bool("verbose", "Print out verbose output to stderr.", &arguments->verbose, false); gt_option_parser_add_option(op, option); 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; }
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; }