static GtOptionParser* gt_compressedbits_option_parser_new(void *tool_arguments) { GtCompressdbitsArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...]", "Testing compressed bitsequence, save to disk, reload."); /* -size */ option = gt_option_new_ulong("size", "size of GtBitsequence to create " "(words 32/64 bit)", &arguments->size, 20UL); gt_option_parser_add_option(op, option); arguments->size_op = gt_option_ref(option); /* -samplerate */ option = gt_option_new_uint("samplerate", "samplerate of random GtBitsequence to test", &arguments->samplerate, 32U); gt_option_parser_add_option(op, option); /* -rand */ option = gt_option_new_bool("rand", "create random bitvector", &arguments->fill_random, false); gt_option_parser_add_option(op, option); arguments->rand_op = gt_option_ref(option); /* -check */ option = gt_option_new_bool("check", "compare original with compressed and " "loaded from file", &arguments->check_consistency, false); gt_option_parser_add_option(op, option); arguments->rand_op = gt_option_ref(option); /* -input */ option = gt_option_new_filename( "input", "load vector from file, format is as follows:\n" "[ULL size in bits][[ULL bits]...]\n" " not usable with -size and -rand", arguments->filename); gt_option_parser_add_option(op, option); arguments->filename_op = gt_option_ref(option); gt_option_exclude(arguments->filename_op, arguments->size_op); gt_option_exclude(arguments->filename_op, arguments->rand_op); /* -benches */ option = gt_option_new_ulong("benches", "number of function calls to benchmark", &arguments->benches, 100000UL); gt_option_parser_add_option(op, option); return op; }
void gt_typecheck_info_register_options(GtTypecheckInfo *tci, GtOptionParser *op) { GtOption *typecheck_option, *built_in_option; gt_assert(tci && op); gt_assert(!tci->typecheck_option); /* can only called once */ /* -typecheck */ typecheck_option = gt_option_new_string("typecheck", "check GFF3 types against \"id\" and " "\"name\" tags in given OBO file and validate parent " "(part-of) relationships.\nIf no argument is given, " "the sofa.obo file from the gtdata/obo_files " "directory is used.\nIf an argument is given, it is " "used as an OBO filename.\nIn the case that such a " "file does not exist '.obo' is added to the argument " "and loading the resulting filename from the " "gtdata/obo_files directory is attempted.", tci->typecheck, NULL); gt_option_argument_is_optional(typecheck_option); gt_option_parser_add_option(op, typecheck_option); tci->typecheck_option = gt_option_ref(typecheck_option); /* -typecheck-built-in */ built_in_option = gt_option_new_bool("typecheck-built-in", "use built-in type checker", &tci->typecheck_built_in, false); gt_option_is_development_option(built_in_option); gt_option_parser_add_option(op, built_in_option); gt_option_exclude(typecheck_option, built_in_option); }
void gt_output_file_info_register_options(GtOutputFileInfo *ofi, GtOptionParser *op, GtFile **outfp) { GtOption *opto, *optgzip, *optbzip2, *optforce; gt_assert(outfp && ofi); ofi->outfp = outfp; /* register option -o */ opto = gt_option_new_filename("o", "redirect output to specified file", ofi->output_filename); gt_option_parser_add_option(op, opto); /* register option -gzip */ optgzip = gt_option_new_bool("gzip", "write gzip compressed output file", &ofi->gzip, false); gt_option_parser_add_option(op, optgzip); /* register option -bzip2 */ optbzip2 = gt_option_new_bool("bzip2", "write bzip2 compressed output file", &ofi->bzip2, false); gt_option_parser_add_option(op, optbzip2); /* register option -force */ optforce = gt_option_new_bool(GT_FORCE_OPT_CSTR, "force writing to output file", &ofi->force, false); gt_option_parser_add_option(op, optforce); /* options -gzip and -bzip2 exclude each other */ gt_option_exclude(optgzip, optbzip2); /* option implications */ gt_option_imply(optgzip, opto); gt_option_imply(optbzip2, opto); gt_option_imply(optforce, opto); /* set hook function to determine <outfp> */ gt_option_parser_register_hook(op, determine_outfp, ofi); }
void gt_typecheck_info_register_options_with_default(GtTypecheckInfo *tci, GtOptionParser *op, const char *default_v) { GtOption *typecheck_option, *built_in_option; gt_assert(tci && op); gt_assert(!tci->typecheck_option); /* can only called once */ /* -typecheck */ typecheck_option = gt_option_new_string("typecheck", "use an ontology given in an OBO file " "to validate parent-child relationships.\n" "If no argument is given, " "the sofa.obo file from the gtdata/obo_files " "directory is used.\nIf an argument is given, it is " "used as an OBO filename.\nIn the case that such a " "file does not exist '.obo' is added to the argument " "and loading the resulting filename from the " "gtdata/obo_files directory is attempted.", tci->typecheck, default_v); gt_option_argument_is_optional(typecheck_option); gt_option_parser_add_option(op, typecheck_option); tci->typecheck_option = gt_option_ref(typecheck_option); /* -typecheck-built-in */ built_in_option = gt_option_new_bool("typecheck-built-in", "use built-in type checker", &tci->typecheck_built_in, false); gt_option_is_development_option(built_in_option); gt_option_parser_add_option(op, built_in_option); gt_option_exclude(typecheck_option, built_in_option); }
static GtOptionParser* gt_splitfasta_option_parser_new(void *tool_arguments) { SplitfastaArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *targetsize_option, *splitdesc_option, *o, *numfiles_option; gt_assert(arguments); op = gt_option_parser_new("[option ...] fastafile","Split the supplied fasta " "file."); numfiles_option = gt_option_new_uint_min("numfiles", "set the number of target files " "", &arguments->num_files, 0, 1); gt_option_parser_add_option(op, numfiles_option); targetsize_option = gt_option_new_ulong_min("targetsize", "set the target file " "size in MB", &arguments->max_filesize_in_MB, 50, 1); gt_option_parser_add_option(op, targetsize_option); splitdesc_option = gt_option_new_string("splitdesc", "put every fasta entry in " "a separate file named by its " "description in the given directory", arguments->splitdesc, NULL); gt_option_parser_add_option(op, splitdesc_option); gt_option_exclude(targetsize_option, splitdesc_option); gt_option_exclude(numfiles_option, splitdesc_option); gt_option_exclude(numfiles_option, targetsize_option); o = gt_option_new_width(&arguments->width); gt_option_parser_add_option(op, o); o = gt_option_new_bool(GT_FORCE_OPT_CSTR, "force writing to output file", &arguments->force, false); gt_option_parser_add_option(op, o); gt_option_parser_set_min_max_args(op, 1, 1); return op; }
static GtOptionParser *gt_cge_spacedseed_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optionesaindex, *optionpckindex; Cge_spacedseed_options *arguments = tool_arguments; op = gt_option_parser_new("[options]", "Match spaced seeds."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesaindex = gt_option_new_string("esa", "Specify index (enhanced suffix array)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionesaindex); arguments->refoptionesaindex = gt_option_ref(optionesaindex); optionpckindex = gt_option_new_string("pck", "Specify index (packed index)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionpckindex); arguments->refoptionpckindex = gt_option_ref(optionpckindex); gt_option_exclude(optionesaindex,optionpckindex); gt_option_is_mandatory_either(optionesaindex,optionpckindex); option = gt_option_new_filenamearray("q", "Specify files containing the " "query sequences", arguments->queryfilenames); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); option = gt_option_new_bool("cmp","compare results of offline and online " "searches",&arguments->docompare,false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static 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_seqorder_option_parser_new(void *tool_arguments) { GtSeqorderArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *invert_option, *sort_option, *revsort_option, *shuffle_option; gt_assert(arguments); /* init */ op = gt_option_parser_new("(-invert|-sort|-revsort|-shuffle) encseq", "Output sequences as MultiFasta in specified " "order."); /* -invert */ invert_option = gt_option_new_bool("invert", "invert order of sequences", &arguments->invert, false); gt_option_parser_add_option(op, invert_option); /* -sort */ sort_option = gt_option_new_bool("sort", "sort sequences lexicographically", &arguments->sort, false); gt_option_exclude(sort_option, invert_option); gt_option_parser_add_option(op, sort_option); /* -revsort */ revsort_option = gt_option_new_bool("revsort", "sort sequences in reverse " "lexicographic order", &arguments->revsort, false); gt_option_exclude(revsort_option, invert_option); gt_option_exclude(revsort_option, sort_option); gt_option_parser_add_option(op, revsort_option); /* -shuffle */ shuffle_option = gt_option_new_bool("shuffle", "shuffle sequences " "pseudo-randomly", &arguments->shuffle, false); gt_option_exclude(shuffle_option, invert_option); gt_option_exclude(shuffle_option, sort_option); gt_option_exclude(shuffle_option, revsort_option); gt_option_parser_add_option(op, shuffle_option); gt_option_parser_set_min_max_args(op, 1U, 1U); return op; }
static GtOptionParser* gt_condenseq_compress_option_parser_new(void *tool_arguments) { GtCondenseqCompressArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *option_fraction; gt_assert(arguments); /* init */ op = gt_option_parser_new("[options] INPUTENCSEQ", "Compresses a GtEncseq to a UniqueEncseq."); /* -indexname */ option = gt_option_new_string("indexname", "path and basename of files to store", arguments->indexname, NULL); gt_option_parser_add_option(op, option); /* -kmersize */ option = gt_option_new_uint_min("kmersize", "kmer-size used for the seeds, default " "depends on alphabet size", &arguments->kmersize, GT_UNDEF_UINT, 2U); gt_option_parser_add_option(op, option); /* -windowsize */ option = gt_option_new_uint("windowsize", "Size of window in which to search for hit pairs " "of kmers, has to be larger than kmersize" , &arguments->windowsize, GT_UNDEF_UINT); gt_option_parser_add_option(op, option); /* -initsize */ option = gt_option_new_uword("initsize", "length of inital unique database in bases, " "should be larger than -alignlength", &arguments->initsize, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -alignlength */ option = gt_option_new_uword("alignlength", "required minimal length of an xdrop-alignment, " "should be larger than -windowsize", &arguments->minalignlength, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); /* -cutoff */ option = gt_option_new_uword("cutoff", "if a kmer is found more often than this value " "it will be ignored for alignment searches. " "Setting this to 0 will disable cutoffs, " "leaving it undefined will use a cutoff based " "on the mean number of occurences of a k-word.", &arguments->cutoff_value, GT_UNDEF_UWORD); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -fraction */ option_fraction = gt_option_new_uword("fraction", "when cutoffs aren'd disabled and no specific " "value is set the mean number of occurrences " "of each kmer divided by -fraction will be used " "as cutoff", &arguments->fraction, (GtUword) 2); gt_option_is_extended_option(option_fraction); gt_option_exclude(option, option_fraction); gt_option_parser_add_option(op, option_fraction); /* -disable_prune */ option = gt_option_new_bool("disable_prune", "when cutoffs and this option are set, " "the database will still save every kmer, even " "though only cutoff many kmers will be used.", &arguments->prune, false); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -mat */ option = gt_option_new_int("mat", "matchscore for extension-alignment, " "requirements: mat > mis, mat > 2ins, mat > 2del", &arguments->scores.mat, 2); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -mis */ option = gt_option_new_int("mis", "mismatchscore for extension-alignment, ", &arguments->scores.mis, -1); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -ins */ option = gt_option_new_int("ins", "insertionscore for extension-alignment", &arguments->scores.ins, -2); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -del */ option = gt_option_new_int("del", "deletionscore for extension-alignment", &arguments->scores.del, -2); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -xdrop */ option = gt_option_new_word("xdrop", "xdrop score for extension-alignment", &arguments->xdrop, (GtWord) 3); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -brute_force */ option = gt_option_new_bool("brute_force", "disable filtering of seeds. " "Incompatible with -diagonals yes " "or -full_diags yes", &arguments->brute, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -diagonals */ option = gt_option_new_bool("diagonals", "use sparse diagonals. " "Incompatible with -brute_force yes. " "Disabling both diagonals will result in simple " "filtering of seed positions.", &arguments->diags, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -full_diags */ option = gt_option_new_bool("full_diags", "use full (time efficient " "space inefficient) diagonals. " "Incompatible with -brute_force yes. " "Disabling both diagonals will result in simple " "filtering of seed positions.", &arguments->full_diags, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -clean_percent */ option = gt_option_new_uint("diags_clean", "Percentage of sparse diagonals that is allowed " "to be marked as deletable. Sensible default is " "set." , &arguments->clean_percent, GT_UNDEF_UINT); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -verbose */ option = gt_option_new_bool("verbose", "enable verbose output", &arguments->verbose, false); gt_option_parser_add_option(op, option); /* -kdb*/ option = gt_option_new_bool("kdb", "prints out the kmer database (frequency " "of each kmer), if -verbose each startposition " "will be shown instead", &arguments->kdb, false); gt_option_parser_add_option(op, option); return op; }
static GtIndexOptions* gt_index_options_register_generic_output(GtOptionParser *op, GtIndexOptions *idxo, GtStr *indexname, GtEncseqOptions *encopts) { gt_assert(idxo != NULL); gt_assert(op != NULL && idxo->type != GT_INDEX_OPTIONS_UNDEFINED && encopts != NULL); idxo->encopts = encopts; idxo->indexname = indexname != NULL ? gt_str_ref(indexname) : NULL; idxo->optionkys = gt_option_new_string("kys", "output/sort according to keys of the form " "|key| in fasta header", idxo->kysargumentstring, "nosort"); gt_option_argument_is_optional(idxo->optionkys); gt_option_imply(idxo->optionkys, gt_encseq_options_sds_option(idxo->encopts)); gt_option_parser_add_option(op, idxo->optionkys); gt_encseq_options_add_readmode_option(op, idxo->dir); if (idxo->type == GT_INDEX_OPTIONS_ESA) { idxo->optionoutsuftab = gt_option_new_bool("suf", "output suffix array (suftab) to file", &idxo->outsuftab, false); gt_option_parser_add_option(op, idxo->optionoutsuftab); idxo->optionoutlcptab = gt_option_new_bool("lcp", "output lcp table (lcptab) to file", &idxo->outlcptab, false); gt_option_parser_add_option(op, idxo->optionoutlcptab); idxo->option = gt_option_new_bool("lcpdist", "output distributions of values in lcptab", &idxo->lcpdist, false); gt_option_is_extended_option(idxo->option); gt_option_imply(idxo->option, idxo->optionoutlcptab); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("swallow-tail", "swallow the tail of the suffix array and lcptab", &idxo->swallow_tail, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->optionoutbwttab = gt_option_new_bool("bwt", "output Burrows-Wheeler Transformation " "(bwttab) to file", &idxo->outbwttab, false); gt_option_exclude(idxo->optionspmopt, idxo->optionoutbwttab); gt_option_parser_add_option(op, idxo->optionoutbwttab); idxo->optionoutbcktab = gt_option_new_bool("bck", "output bucket table to file", &idxo->outbcktab, false); gt_option_parser_add_option(op, idxo->optionoutbcktab); } else { idxo->optionoutsuftab = idxo->optionoutlcptab = idxo->optionoutbwttab = NULL; idxo->sfxstrategy.spmopt_minlength = 0; #ifndef S_SPLINT_S gt_registerPackedIndexOptions(op, &idxo->bwtIdxParams, BWTDEFOPT_CONSTRUCTION, idxo->indexname); #endif } gt_option_parser_register_hook(op, gt_index_options_check_set_out_opts, idxo); return idxo; }
static GtIndexOptions* gt_index_options_register_generic_create( GtOptionParser *op, GtIndexOptionsIndexType t) { GtIndexOptions *idxo; gt_assert(op != NULL && t != GT_INDEX_OPTIONS_UNDEFINED); idxo = gt_index_options_new(); idxo->type = t; idxo->optionprefixlength = gt_option_new_uint_min("pl", "specify prefix length for bucket sort\n" "recommendation: use without argument;\n" "then a reasonable prefix length is " "automatically determined.", &idxo->prefixlength, GT_PREFIXLENGTH_AUTOMATIC, 1U); gt_option_argument_is_optional(idxo->optionprefixlength); gt_option_parser_add_option(op, idxo->optionprefixlength); idxo->optionuserdefinedsortmaxdepth = gt_option_new_uint_min("sortmaxdepth","sort only up to the given depth.", &idxo->sfxstrategy.userdefinedsortmaxdepth, 0, 1U); gt_option_parser_add_option(op, idxo->optionuserdefinedsortmaxdepth); gt_option_is_development_option(idxo->optionuserdefinedsortmaxdepth); idxo->optiondifferencecover = gt_option_new_uint_min("dc", "specify difference cover value", &idxo->sfxstrategy.differencecover, 0, 4U); gt_option_parser_add_option(op, idxo->optiondifferencecover); gt_option_exclude(idxo->optionuserdefinedsortmaxdepth, idxo->optiondifferencecover); idxo->optioncmpcharbychar = gt_option_new_bool("cmpcharbychar", "compare suffixes character " "by character", &idxo->sfxstrategy.cmpcharbychar, false); gt_option_is_development_option(idxo->optioncmpcharbychar); gt_option_parser_add_option(op, idxo->optioncmpcharbychar); idxo->optionnoshortreadsort = gt_option_new_bool("noshortreadsort", "do not use short read sort", &idxo->sfxstrategy.noshortreadsort, false); gt_option_is_development_option(idxo->optionnoshortreadsort); gt_option_parser_add_option(op, idxo->optionnoshortreadsort); idxo->optionmaxwidthrealmedian = gt_option_new_uword("maxwidthrealmedian", "compute real median for " "intervals of at most the " "given widthprefixes", &idxo->sfxstrategy. maxwidthrealmedian, 1UL); gt_option_is_development_option(idxo->optionmaxwidthrealmedian); gt_option_parser_add_option(op, idxo->optionmaxwidthrealmedian); idxo->optionalgbounds = gt_option_new_string_array("algbds", "length boundaries for the different " "algorithms to sort buckets of suffixes\n" "first number: maxbound for insertion sort\n" "second number: maxbound for blindtrie sort\n" "third number: maxbound for counting sort", idxo->algbounds); gt_option_is_development_option(idxo->optionalgbounds); gt_option_parser_add_option(op, idxo->optionalgbounds); idxo->optionstorespecialcodes = gt_option_new_bool("storespecialcodes", "store special codes (this may speed up the program)", &idxo->sfxstrategy.storespecialcodes,false); gt_option_is_development_option(idxo->optionstorespecialcodes); gt_option_parser_add_option(op, idxo->optionstorespecialcodes); idxo->optionparts = gt_option_new_uint_max("parts", "specify number of parts in which the index " "construction is performed", &idxo->numofparts, 1U, (unsigned) ((1 << 22) - 1)); gt_option_is_development_option(idxo->optionparts); gt_option_parser_add_option(op, idxo->optionparts); if (idxo->type == GT_INDEX_OPTIONS_ESA) { idxo->optionspmopt = gt_option_new_uint_min("spmopt", "optimize esa-construction for " "suffix-prefix matching", &idxo->sfxstrategy.spmopt_minlength, 0,1U); gt_option_parser_add_option(op, idxo->optionspmopt); gt_option_exclude(idxo->optionspmopt, idxo->optiondifferencecover); idxo->optionmemlimit = gt_option_new_string("memlimit", "specify maximal amount of memory to be used during " "index construction (in bytes, the keywords 'MB' " "and 'GB' are allowed)", idxo->memlimit, NULL); gt_option_parser_add_option(op, idxo->optionmemlimit); gt_option_exclude(idxo->optionmemlimit, idxo->optionparts); } idxo->option = gt_option_new_bool("iterscan", "use iteratorbased-kmer scanning", &idxo->sfxstrategy.iteratorbasedkmerscanning, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("samplewithprefixlengthnull", "sort sample with prefixlength=0", &idxo->sfxstrategy.samplewithprefixlengthnull, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("suftabuint", "use uint32_t for suftab", &idxo->sfxstrategy.suftabuint, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("onlybucketinsertion", "perform only bucket insertion", &idxo->sfxstrategy.onlybucketinsertion, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("kmerswithencseqreader", "always perform kmerscanning with encseq-reader", &idxo->sfxstrategy.kmerswithencseqreader, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("dccheck", "check intermediate results in difference cover", &idxo->sfxstrategy.dccheck, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("withradixsort", "use radixsort to sort the buckets", &idxo->sfxstrategy.withradixsort, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); idxo->option = gt_option_new_bool("compressedoutput", "output suftab and lcptab in compressed " "form", &idxo->sfxstrategy.compressedoutput, false); gt_option_is_development_option(idxo->option); gt_option_parser_add_option(op, idxo->option); gt_option_parser_register_hook(op, gt_index_options_check_set_create_opts, idxo); return idxo; }
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 GtOPrval parse_options(int *parsed_args, bool doesa, Suffixeratoroptions *so, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *option, *optionshowprogress, *optiongenomediff, *optionii; GtOPrval oprval; gt_error_check(err); op = gt_option_parser_new("[option ...] (-db file [...] | -ii index)", doesa ? "Compute enhanced suffix array." : "Compute packed index."); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); /* input info */ so->indexname = gt_str_new(); so->inputindex = gt_str_new(); so->db = gt_str_array_new(); /* register options for encoded sequence handling */ so->encopts = gt_encseq_options_register_encoding(op, so->indexname, so->db); so->loadopts = gt_encseq_options_register_loading(op, so->indexname); /* register options for index handling */ if (doesa) so->idxopts = gt_index_options_register_esa(op, so->encopts); else so->idxopts = gt_index_options_register_packedidx(op, so->indexname, so->encopts); /* verbosity */ option = gt_option_new_verbose(&so->beverbose); gt_option_parser_add_option(op, option); optionshowprogress = gt_option_new_bool("showprogress", "show a progress bar", &so->showprogress, false); gt_option_parser_add_option(op, optionshowprogress); optionii = gt_option_new_filename("ii", "specify existing encoded sequence", so->inputindex); gt_option_parser_add_option(op, optionii); gt_option_is_mandatory_either(gt_encseq_options_db_option(so->encopts), optionii); gt_option_exclude(gt_encseq_options_db_option(so->encopts), optionii); gt_option_exclude(optionii, gt_encseq_options_smap_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_dna_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_protein_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_plain_option(so->encopts)); gt_option_exclude(optionii, gt_encseq_options_sat_option(so->encopts)); optiongenomediff = gt_option_new_bool("genomediff", "directly process the lcp intervals using " "the genomediff algorithm (suffix array and " "lcp-tables are not output)", &so->genomediff, false); gt_option_is_extended_option(optiongenomediff); if (gt_index_options_outsuftab_option(so->idxopts) != NULL) { gt_option_exclude(optiongenomediff, gt_index_options_outsuftab_option(so->idxopts)); } gt_option_parser_add_option(op, optiongenomediff); /* suffixerator and friends do not take arguments */ gt_option_parser_set_min_max_args(op, 0U, 0U); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); if (gt_str_length(so->indexname) == 0UL) { /* we do not have an indexname yet, so there was none given in the -indexname option and it could not be derived from the input filenames. So it must be in the -ii parameter. */ char *basenameptr; basenameptr = gt_basename(gt_str_get(so->inputindex)); gt_str_set(so->indexname, basenameptr); gt_free(basenameptr); } gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_linspace_align_option_parser_new(void *tool_arguments) { GtLinspaceArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *optionstrings, *optionfiles, *optionglobal, *optionlocal, *optiondna, *optionprotein, *optioncostmatrix, *optionlinearcosts, *optionaffinecosts, *optionoutputfile, *optionshowscore, *optionshowsequences, *optiondiagonal, *optiondiagonalbonds, *optionsimilarity, *optiontsfactor, *optionspacetime, *optionscoreonly, *optionwildcardsymbol; gt_assert(arguments); /* init */ op = gt_option_parser_new("[ss|ff] sequence1 sequence2 [dna|protein] " "[global|local] [a|l] costs/scores " "[additional options]", "Apply function to compute alignment."); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); /* -bool */ optionglobal = gt_option_new_bool("global", "global alignment", &arguments->global, false); gt_option_parser_add_option(op, optionglobal); optionlocal = gt_option_new_bool("local", "local alignment", &arguments->local, false); gt_option_parser_add_option(op, optionlocal); optiondiagonal = gt_option_new_bool("d", "diagonalband alignment", &arguments->diagonal, false); gt_option_parser_add_option(op, optiondiagonal); optiondna = gt_option_new_bool("dna", "type of sequences: DNA", &arguments->dna, false); gt_option_parser_add_option(op, optiondna); optionprotein = gt_option_new_bool("protein", "type of sequences: protein", &arguments->protein, false); gt_option_parser_add_option(op, optionprotein); optionwildcardsymbol = gt_option_new_bool("wildcard", "show symbol used to " "represented wildcards in output", &arguments->wildcardshow, false); gt_option_parser_add_option(op, optionwildcardsymbol); /* special case, if given matrix includes cost values in place of scores */ optioncostmatrix = gt_option_new_bool("costmatrix", "describes type of " "given substituation matrix", &arguments->has_costmatrix, false); gt_option_parser_add_option(op, optioncostmatrix); optionshowscore = gt_option_new_bool("showscore", "show score for alignment, " "please note it will calculate costs " "for global alignments and scores for " "local alignemnts always, independtly " "of input ", &arguments->showscore, false); gt_option_parser_add_option(op, optionshowscore); optionshowsequences = gt_option_new_bool("showsequences", "show sequences u " "and v in front of alignment", &arguments->showsequences, false); gt_option_parser_add_option(op, optionshowsequences); optionscoreonly = gt_option_new_bool("showonlyscore", "show only score for " "generated alignment to compare with " "other algorithms", &arguments->scoreonly, false); gt_option_parser_add_option(op, optionscoreonly); optionspacetime = gt_option_new_bool("spacetime", "write space peak and time" " overall on stdout", &arguments->spacetime, false); gt_option_parser_add_option(op, optionspacetime); /* -str */ optionstrings = gt_option_new_string_array("ss", "input, use two strings", arguments->strings); gt_option_parser_add_option(op, optionstrings); optionfiles = gt_option_new_filename_array("ff", "input, use two files", arguments->files); gt_option_parser_add_option(op, optionfiles); optionlinearcosts = gt_option_new_string_array("l", "lineargapcosts, " "use match, mismatch and " "gapcost, alternatively " "substituationmatrix and " "gapcost", arguments->linearcosts); gt_option_parser_add_option(op, optionlinearcosts); optionaffinecosts = gt_option_new_string_array("a", "affinegapcosts, " "use match, mismatch, gap_extension " "and gap_opening, alternatively " "substituationmatrix, gap_extension " "and gap_opening", arguments->affinecosts); gt_option_parser_add_option(op, optionaffinecosts); optiondiagonalbonds = gt_option_new_string_array("lr", "specified left and " "right shift of diagonal", arguments->diagonalbonds); gt_option_parser_add_option(op, optiondiagonalbonds); optionoutputfile = gt_option_new_string("o", "print alignment, " "use outputfile", arguments->outputfile, "stdout"); gt_option_parser_add_option(op, optionoutputfile); /* -ulong */ optiontsfactor = gt_option_new_ulong("t", "timesquarefactor to organize " "time and space", &arguments->timesquarefactor,1); gt_option_parser_add_option(op, optiontsfactor); /* -double */ optionsimilarity = gt_option_new_probability("similarity", "specified left " "and right shift of diagonal by " "similarity of sequences, " "0 <= similarty <= 1", &arguments->similarity, 0); gt_option_parser_add_option(op, optionsimilarity); /* dependencies */ gt_option_is_mandatory_either(optionstrings, optionfiles); gt_option_is_mandatory_either(optiondna, optionprotein); gt_option_exclude(optionlocal, optionglobal); gt_option_exclude(optionlinearcosts, optionaffinecosts); gt_option_exclude(optiondna, optionprotein); gt_option_exclude(optionshowsequences, optionscoreonly); gt_option_exclude(optionsimilarity, optiondiagonalbonds); gt_option_imply_either_2(optionfiles, optionglobal, optionlocal); gt_option_imply_either_2(optiondna, optionstrings, optionfiles); gt_option_imply_either_2(optionstrings, optionglobal, optionlocal); gt_option_imply_either_2(optionprotein, optionstrings, optionfiles); gt_option_imply_either_2(optionlocal, optionlinearcosts, optionaffinecosts); gt_option_imply_either_2(optionglobal, optionlinearcosts, optionaffinecosts); gt_option_imply_either_2(optionshowscore,optionlinearcosts,optionaffinecosts); gt_option_imply_either_2(optionshowsequences, optionstrings, optionfiles); gt_option_imply_either_2(optionscoreonly,optionlinearcosts,optionaffinecosts); gt_option_imply(optiondiagonal, optionglobal); gt_option_imply(optiondiagonalbonds, optiondiagonal); gt_option_imply(optionsimilarity, optiondiagonal); gt_option_imply(optioncostmatrix, optionprotein); /* extended options */ gt_option_is_extended_option(optiontsfactor); gt_option_is_extended_option(optionshowscore); gt_option_is_extended_option(optionwildcardsymbol); gt_option_is_extended_option(optioncostmatrix); /* development option(s) */ gt_option_is_development_option(optionspacetime); gt_option_is_development_option(optionscoreonly);/*only useful to test*/ return op; }
static GtOPrval gthsplit_parse_options(int *parsed_args, Gthsplitinfo *gthsplitinfo, int argc, const char **argv, const GthPlugins *plugins, GtError *err) { GtOptionParser *op; GtOption *optalignmentscore, *optcoverage, *optrange, *optverbose, *optgzip, *optbzip2, *optforce; bool alignmentscore, coverage, verbose, gzip, bzip2; GtOPrval oprval; gt_error_check(err); op = gt_option_parser_new("-alignmentscore | -coverage [option ...] " "[file ...]", "Split GenomeThreader output files " "containing intermediate results."); /* specify all options with a corresponding help-text */ optalignmentscore = gt_option_new_bool("alignmentscore", "split according to " "the overall alignment score (scr)", &alignmentscore, false); gt_option_parser_add_option(op, optalignmentscore); optcoverage = gt_option_new_bool("coverage", "split according to coverage " "(cov)", &coverage, false); gt_option_parser_add_option(op, optcoverage); optrange = gt_option_new_uint_max(RANGE_OPT_CSTR, "set the percentage range " "used to create the sets", >hsplitinfo->range, DEFAULT_RANGE, 100); gt_option_parser_add_option(op, optrange); /* add sa_filter options */ gth_sa_filter_register_options(op, gthsplitinfo->sa_filter, false); /* -v */ optverbose = gt_option_new_verbose(&verbose); gt_option_parser_add_option(op, optverbose); optgzip = gt_option_new_bool("gzip", "write gzip compressed output file(s)", &gzip, false); gt_option_parser_add_option(op, optgzip); optbzip2 = gt_option_new_bool("bzip2", "write bzip2 compressed output " "file(s)", &bzip2, false); gt_option_parser_add_option(op, optbzip2); optforce = gt_option_new_bool(GT_FORCE_OPT_CSTR,"force writing to split " "files", >hsplitinfo->force, false); gt_option_parser_add_option(op, optforce); gt_option_exclude(optalignmentscore, optcoverage); gt_option_exclude(optgzip, optbzip2); gt_option_is_mandatory_either(optalignmentscore, optcoverage); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, plugins->gth_version_func, err); if (oprval == GT_OPTION_PARSER_OK && alignmentscore) gthsplitinfo->splitmode = ALIGNMENTSCORE_SPLIT; if (oprval == GT_OPTION_PARSER_OK && coverage) gthsplitinfo->splitmode = COVERAGE_SPLIT; if (oprval == GT_OPTION_PARSER_OK && 100 % gthsplitinfo->range) { gt_error_set(err, "argument to option %s must divide 100 without rest", RANGE_OPT_CSTR); oprval = GT_OPTION_PARSER_ERROR; } if (oprval == GT_OPTION_PARSER_OK && verbose) gthsplitinfo->showverbose = gth_show_on_stdout; if (oprval == GT_OPTION_PARSER_OK && gzip) gthsplitinfo->file_mode = GT_FILE_MODE_GZIP; if (oprval == GT_OPTION_PARSER_OK && bzip2) gthsplitinfo->file_mode = GT_FILE_MODE_BZIP2; /* save consensus files */ if (oprval == GT_OPTION_PARSER_OK) { while (*parsed_args < argc) { gt_str_array_add_cstr(gthsplitinfo->consensusfiles, argv[*parsed_args]); (*parsed_args)++; } } if (oprval == GT_OPTION_PARSER_OK && !gt_str_array_size(gthsplitinfo->consensusfiles) && (gt_option_is_set(optgzip) || gt_option_is_set(optbzip2))) { gt_error_set(err, "to use compression, at least on input file has to be " "supplied"); oprval = GT_OPTION_PARSER_ERROR; } gt_option_parser_delete(op); return oprval; }
static GtOptionParser *gt_tyr_occratio_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *optionmersizes, *optionesa, *optionminmersize, *optionmaxmersize, *optionstep, *optionoutput, *option; Tyr_occratio_options *arguments = tool_arguments; op = gt_option_parser_new("[options] -esa suffixerator-index [options]", "Compute occurrence ratio for a set of sequences " "represented by an enhanced suffix array."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesa = gt_option_new_string("esa","specify suffixerator-index\n" "(mandatory option)", arguments->str_inputindex, NULL); gt_option_is_mandatory(optionesa); gt_option_parser_add_option(op, optionesa); optionminmersize = gt_option_new_ulong_min("minmersize", "specify minimum mer size for which " "to compute the occurrence distribution", &arguments->minmersize,0,1UL); gt_option_parser_add_option(op, optionminmersize); optionmaxmersize = gt_option_new_ulong_min("maxmersize", "specify maximum mer size for which " "to compute the occurrence distribution", &arguments->maxmersize,0,1UL); gt_option_parser_add_option(op, optionmaxmersize); optionstep = gt_option_new_ulong_min("step", "specify step size when specifying mer sizes", &arguments->stepmersize,1UL,1UL); gt_option_parser_add_option(op, optionstep); optionmersizes = gt_option_new_stringarray( "mersizes", "specify mer sizes as non-empty sequence of " "non decreasing positive integers", arguments->mersizesstrings); arguments->refoptionmersizes = gt_option_ref(optionmersizes); gt_option_parser_add_option(op, optionmersizes); optionoutput = gt_option_new_stringarray( "output", "use combination of the following keywords: " "unique nonunique nonuniquemulti relative total " "to specify kind of output", arguments->outputspec); gt_option_parser_add_option(op, optionoutput); option = gt_option_new_bool("scan", "read suffixerator-index sequentially " "instead of mapping it to memory", &arguments->scanfile, false); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_exclude(optionmersizes,optionminmersize); gt_option_exclude(optionmersizes,optionmaxmersize); gt_option_exclude(optionmersizes,optionstep); return op; }
static GtOptionParser* gt_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_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_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_matstat_option_parser_new(void *tool_arguments) { Gfmsubcallinfo *arguments = tool_arguments; GtOptionParser *op; gt_assert(arguments); op = gt_option_parser_new("[options ...] -query queryfile [...]", arguments->doms ? "Compute matching statistics." : "Compute length of minimum unique prefixes."); gt_option_parser_set_mail_address(op,"<*****@*****.**>"); arguments->optionfmindex = gt_option_new_string("fmi", "specify fmindex", arguments->indexname,NULL); gt_option_parser_add_option(op, arguments->optionfmindex); arguments->optionesaindex = gt_option_new_string("esa", "specify suffix array", arguments->indexname,NULL); gt_option_parser_add_option(op, arguments->optionesaindex); arguments->optionpckindex = gt_option_new_string("pck", "specify packed index", arguments->indexname,NULL); gt_option_parser_add_option(op, arguments->optionpckindex); gt_option_exclude(arguments->optionfmindex,arguments->optionesaindex); gt_option_exclude(arguments->optionpckindex,arguments->optionesaindex); gt_option_exclude(arguments->optionpckindex,arguments->optionfmindex); arguments->optionquery = gt_option_new_filename_array("query", "specify queryfiles", arguments->queryfilenames); gt_option_is_mandatory(arguments->optionquery); gt_option_parser_add_option(op, arguments->optionquery); arguments->optionmin = gt_option_new_uword_min("min", "only output length " "if >= given minimum length", &arguments->minlength. valueunsignedlong, 0,(GtUword) 1); gt_option_parser_add_option(op, arguments->optionmin); arguments->optionmax = gt_option_new_uword_min("max", "only output length " "if <= given maximum length", &arguments->maxlength. valueunsignedlong, 0,(GtUword) 1); gt_option_parser_add_option(op, arguments->optionmax); arguments->optionoutput = gt_option_new_string_array("output", arguments->doms ? "set output flags (sequence, querypos, subjectpos)" : "set output flags (sequence, querypos)", arguments->flagsoutputoption); gt_option_parser_add_option(op, arguments->optionoutput); if (arguments->doms) { arguments->optionverify = gt_option_new_bool("verify", "verify witness positions", &arguments->verifywitnesspos, false); gt_option_is_development_option(arguments->optionverify); gt_option_parser_add_option(op, arguments->optionverify); } else { arguments->verifywitnesspos = false; } gt_option_parser_refer_to_manual(op); 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_kmer_database_option_parser_new(void *tool_arguments) { GtKmerDatabaseArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *option_verbose, *option_use_cutoff, *option_hash, *option_mean_cutoff; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [file]", "Makes a GtKmerDatabase from the input file."); /* -kmersize */ option = gt_option_new_uint_min_max("kmersize", "kmersize used", &arguments->kmersize, 3U, 1U, 10U); gt_option_parser_add_option(op, option); /* -verbose */ option_verbose = gt_option_new_bool("verbose", "prints out results of " "merging", &arguments->verbose, false); gt_option_parser_add_option(op, option_verbose); /* -merge_only */ option = gt_option_new_bool("merge_only", "only uses merge to build DB, " "doesn_t build two DBs to compare merge with a " "different method (much faster). It also allows " "for random intervals which are biffer than the " "maximum buffer size (will be split internally).", &arguments->merge_only, false); gt_option_parser_add_option(op, option); /* -use_cutoff */ option_use_cutoff = gt_option_new_bool("use_cutoff", "uses a cutoff. see " "-set_cutoff description. Only works " "with merge_only", &arguments->cutoff, false); gt_option_parser_add_option(op, option_use_cutoff); gt_option_imply(option_use_cutoff, option); /* -set_cutoff */ option = gt_option_new_uword_min("set_cutoff", "kmers occuring more often " "than this value won't be saved", &arguments->cutoff_value, (GtUword) 30, (GtUword) 1); gt_option_parser_add_option(op, option); gt_option_imply(option, option_use_cutoff); /* -mean_cutoff */ option_mean_cutoff = gt_option_new_bool("mean_cutoff", "2*mean of kmer " "occurrence will be" " used as cutoff value", &arguments->mean_cutoff, false); gt_option_parser_add_option(op, option_mean_cutoff); gt_option_imply(option_mean_cutoff, option_use_cutoff); gt_option_exclude(option_mean_cutoff, option); /* -disable_prune */ option = gt_option_new_bool("disable_prune", "disables the removel of kmers, " "which occure more often than the cutoff.", &arguments->prune, false); gt_option_parser_add_option(op, option); gt_option_imply(option, option_use_cutoff); /* -use_hash */ option_hash = gt_option_new_bool("use_hash", "saves each kmer in kdb and " "also in a hash. afterwards both will be " "accessed and time for saving and " "accessing will be shown.", &arguments->use_hash, false); gt_option_parser_add_option(op, option_hash); gt_option_exclude(option_hash, option_use_cutoff); gt_option_exclude(option_hash, option_verbose); /* -benchmark */ option = gt_option_new_bool("benchmark", "measures the time the tool takes to" " fill the database. Doesn't test for consistency" " though!", &arguments->bench, false); gt_option_parser_add_option(op, option); /* -bsize */ option = gt_option_new_uword_min("bsize", "size of the buffer", &arguments->sb_size, (GtUword) 100000, (GtUword) 2); gt_option_parser_add_option(op, option); gt_option_exclude(option, option_hash); /* -outfile */ option = gt_option_new_string("outfile", "specifies file for verbose output", arguments->print_filename, NULL); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser *gt_idxlocali_option_parser_new (void *tool_arguments) { IdxlocaliOptions *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionesaindex, *optionpckindex, *optiononline, *optioncmp; gt_assert (arguments != NULL); arguments->indexname = gt_str_new (); arguments->queryfiles = gt_str_array_new (); op = gt_option_parser_new ("[options] -q query-file-names [-esa|-pck] indexname", "Find all local alignments using suffix tree."); gt_option_parser_set_mailaddress (op, "<*****@*****.**>"); option = gt_option_new_filenamearray ("q","Specify files containing the " "query sequences", arguments->queryfiles); gt_option_parser_add_option (op, option); option = gt_option_new_long ("match", "Specify match score", &arguments->matchscore, 1L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("mismatch", "Specify mismatch score", &arguments->mismatchscore, -3L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("gapstart", "Specify gap start score", &arguments->gapstart, -5L); gt_option_parser_add_option (op, option); option = gt_option_new_long ("gapextend", "Specify gap extension score", &arguments->gapextend, -2L); gt_option_parser_add_option (op, option); option = gt_option_new_ulong_min ("th", "Specify the threshold", &arguments->threshold, 0, 1UL); gt_option_parser_add_option (op, option); gt_option_is_mandatory (option); optionesaindex = gt_option_new_string ("esa", "Specify index " "(enhanced suffix array)", arguments->indexname, NULL); gt_option_parser_add_option (op, optionesaindex); arguments->refoptionesaindex = gt_option_ref (optionesaindex); optionpckindex = gt_option_new_string ("pck", "Specify index (packed index)", arguments->indexname, NULL); gt_option_parser_add_option (op, optionpckindex); arguments->refoptionpckindex = gt_option_ref (optionpckindex); gt_option_exclude (optionesaindex, optionpckindex); gt_option_is_mandatory_either (optionesaindex, optionpckindex); optiononline = gt_option_new_bool("online","Perform online searches", &arguments->doonline, false); gt_option_parser_add_option(op, optiononline); gt_option_is_development_option(optiononline); optioncmp = gt_option_new_bool("cmp","Compare results of offline and online " "searches", &arguments->docompare, false); gt_option_parser_add_option(op,optioncmp); gt_option_exclude(optiononline,optioncmp); option = gt_option_new_bool("s", "Show alignments", &arguments->showalignment, false); gt_option_parser_add_option (op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser* gt_encseq2spm_option_parser_new(void *tool_arguments) { GtEncseq2spmArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *optionparts, *optionmemlimit; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [file]", "Compute suffix prefix matches " "from encoded sequence."); /* -l */ option = gt_option_new_uint_min("l", "specify the minimum length", &arguments->minmatchlength, 0, 1U); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -parts */ optionparts = gt_option_new_uint("parts", "specify the number of parts", &arguments->numofparts, 0U); gt_option_parser_add_option(op, optionparts); /* -memlimit */ optionmemlimit = gt_option_new_string("memlimit", "specify maximal amount of memory to be used during " "index construction (in bytes, the keywords 'MB' " "and 'GB' are allowed)", arguments->memlimitarg, NULL); gt_option_parser_add_option(op, optionmemlimit); gt_option_exclude(optionmemlimit, optionparts); arguments->refoptionmemlimit = gt_option_ref(optionmemlimit); /* -checksuftab */ option = gt_option_new_bool("checksuftab", "check the suffix table", &arguments->checksuftab, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -singlestrand */ option = gt_option_new_bool("singlestrand", "use only the forward strand " "of the sequence", &arguments->singlestrand, false); gt_option_parser_add_option(op, option); /* -spm */ option = gt_option_new_string("spm", "specify output for spms", arguments->spmspec, NULL); gt_option_parser_add_option(op, option); /* -ii */ option = gt_option_new_string("ii", "specify the input sequence", arguments->encseqinput, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -onlyaccum */ option = gt_option_new_bool("onlyaccum", "only accumulate codes", &arguments->onlyaccum, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -onlyallfirstcodes */ option = gt_option_new_bool("onlyallfirstcodes", "only determines allcodes", &arguments->onlyallfirstcodes, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -addbscachedepth */ option = gt_option_new_uint("addbscachedepth", "only determines allcodes", &arguments->addbscache_depth, 5U); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -phase2extra */ option = gt_option_new_string("phase2extra", "specify amount of additional space required for " "the second phase of the computation involving the " "processing of the intervals (in bytes, " "the keywords 'MB' and 'GB' are allowed)", arguments->phase2extraarg, NULL); gt_option_parser_add_option(op, option); arguments->refoptionphase2extra = gt_option_ref(option); gt_option_is_development_option(option); /* -radixlarge */ option = gt_option_new_bool("radixlarge", "use large tables for radixsort", &arguments->radixlarge, false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -radixparts */ option = gt_option_new_uint("radixparts", "specify the number of parts " "for radixsort", &arguments->radixparts, 1U); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -singlescan */ option = gt_option_new_uint("singlescan", "run a single scan: 1=fast; " "2=fast with check; 3=fast with output; " "4=sfx-mapped4-version", &arguments->singlescan, 0); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); /* -forcek */ option = gt_option_new_uint("forcek", "specify the value of k", &arguments->forcek, 0); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser *gt_repfind_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *reverseoption, *queryoption, *extendseedoption, *scanoption, *sampleoption, *forwardoption, *spmoption; Maxpairsoptions *arguments = tool_arguments; op = gt_option_parser_new("[options] -ii indexname", "Compute maximal repeats."); gt_option_parser_set_mail_address(op,"<*****@*****.**>"); option = gt_option_new_uint_min("l","Specify minimum length of repeats", &arguments->userdefinedleastlength, 20U, 1U); gt_option_parser_add_option(op, option); forwardoption = gt_option_new_bool("f","Compute maximal forward repeats", &arguments->forward, true); gt_option_parser_add_option(op, forwardoption); arguments->refforwardoption = gt_option_ref(forwardoption); reverseoption = gt_option_new_bool("r","Compute maximal reverse matches", &arguments->reverse, false); gt_option_parser_add_option(op, reverseoption); sampleoption = gt_option_new_uword_min("samples","Specify number of samples", &arguments->samples, 0, 1UL); gt_option_is_development_option(sampleoption); gt_option_parser_add_option(op, sampleoption); spmoption = gt_option_new_bool("spm","Search for suffix prefix matches", &arguments->searchspm, false); gt_option_is_development_option(spmoption); gt_option_parser_add_option(op, spmoption); extendseedoption = gt_option_new_bool("extend","Extend seed to both sides", &arguments->extendseed, false); gt_option_is_development_option(extendseedoption); gt_option_parser_add_option(op, extendseedoption); scanoption = gt_option_new_bool("scan","scan index rather than mapping " "it to main memory", &arguments->scanfile, false); gt_option_parser_add_option(op, scanoption); option = gt_option_new_string("ii", "Specify input index", arguments->indexname, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); queryoption = gt_option_new_filename_array("q", "Specify query files", arguments->queryfiles); gt_option_is_development_option(queryoption); gt_option_parser_add_option(op, queryoption); option = gt_option_new_bool("v", "be verbose ", &arguments->beverbose, false); gt_option_parser_add_option(op, option); gt_option_exclude(queryoption,sampleoption); gt_option_exclude(queryoption,scanoption); gt_option_exclude(queryoption,reverseoption); gt_option_exclude(queryoption,spmoption); gt_option_exclude(reverseoption,spmoption); gt_option_exclude(queryoption,spmoption); gt_option_exclude(sampleoption,spmoption); return op; }
static GtOPrval parse_options(int *parsed_args, Cmppairwiseopt *pw, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *optionstrings, *optionfiles, *optioncharlistlen, *optiontext, *optionshowedist; GtStrArray *charlistlen; GtOPrval oprval; gt_error_check(err); charlistlen = gt_str_array_new(); pw->strings = gt_str_array_new(); pw->files = gt_str_array_new(); pw->text = gt_str_new(); pw->charlistlen = NULL; pw->showedist = false; op = gt_option_parser_new("options", "Apply function to pairs of strings."); gt_option_parser_set_mail_address(op, "<*****@*****.**>"); optionstrings = gt_option_new_string_array("ss", "use two strings", pw->strings); gt_option_parser_add_option(op, optionstrings); optionfiles = gt_option_new_filename_array("ff", "use two files", pw->files); gt_option_parser_add_option(op, optionfiles); optioncharlistlen = gt_option_new_string_array("a", "use character list and length", charlistlen); gt_option_parser_add_option(op, optioncharlistlen); optiontext = gt_option_new_string("t", "use text", pw->text, NULL); gt_option_parser_add_option(op, optiontext); optionshowedist = gt_option_new_bool("e", "output unit edit distance", &pw->showedist, false); gt_option_parser_add_option(op, optionshowedist); gt_option_exclude(optionstrings, optionfiles); gt_option_exclude(optionstrings, optioncharlistlen); gt_option_exclude(optionstrings, optiontext); gt_option_exclude(optionfiles, optioncharlistlen); gt_option_exclude(optionfiles, optiontext); gt_option_exclude(optioncharlistlen, optiontext); gt_option_imply(optionshowedist, optionstrings); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); if (oprval == GT_OPTION_PARSER_OK) { if (gt_option_is_set(optionstrings)) { if (gt_str_array_size(pw->strings) != 2UL) { gt_error_set(err, "option -ss requires two string arguments"); oprval = GT_OPTION_PARSER_ERROR; } } else { if (gt_option_is_set(optionfiles)) { if (gt_str_array_size(pw->files) != 2UL) { gt_error_set(err, "option -ff requires two filename arguments"); oprval = GT_OPTION_PARSER_ERROR; } } else { if (gt_option_is_set(optioncharlistlen)) { GtWord readint; if (gt_str_array_size(charlistlen) != 2UL) { gt_error_set(err, "option -a requires charlist and length argument"); oprval = GT_OPTION_PARSER_ERROR; } pw->charlistlen = gt_malloc(sizeof *pw->charlistlen); pw->charlistlen->charlist = gt_str_ref(gt_str_array_get_str(charlistlen, 0)); if (sscanf(gt_str_array_get(charlistlen,1UL), GT_WD, &readint) != 1 || readint < 1L) { gt_error_set(err, "option -a requires charlist and length argument"); oprval = GT_OPTION_PARSER_ERROR; } pw->charlistlen->len = (GtUword) readint; } else { if (!gt_option_is_set(optiontext)) { gt_error_set(err, "use exactly one of the options -ss, -ff, -a, -t"); oprval = GT_OPTION_PARSER_ERROR; } } } } } gt_option_parser_delete(op); if (oprval == GT_OPTION_PARSER_OK && *parsed_args != argc) { gt_error_set(err, "superfluous program parameters"); oprval = GT_OPTION_PARSER_ERROR; } gt_str_array_delete(charlistlen); return oprval; }
static GtOptionParser* gt_seed_extend_option_parser_new(void *tool_arguments) { GtSeedExtendArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *op_gre, *op_xdr, *op_cam, *op_his, *op_dif, *op_pmh, *op_len, *op_err, *op_xbe, *op_sup, *op_frq, *op_mem, *op_ali, *op_bia; gt_assert(arguments != NULL); /* init */ op = gt_option_parser_new("[option ...] encseq_basename [encseq_basename]", "Calculate local alignments using the seed and " "extend algorithm."); /* DIAGBANDSEED OPTIONS */ /* -ii */ option = gt_option_new_string("ii", "Input index for encseq encoded sequences", arguments->dbs_indexname, ""); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -qii */ option = gt_option_new_string("qii", "Query input index (encseq)", arguments->dbs_queryname, ""); gt_option_parser_add_option(op, option); /* -seedlength */ op_len = gt_option_new_uint_min_max("seedlength", "Minimum length of a seed", &arguments->dbs_seedlength, 14UL, 1UL, 32UL); gt_option_parser_add_option(op, op_len); /* -diagbandwidth */ option = gt_option_new_uword("diagbandwidth", "Logarithm of diagonal band width (for filter)", &arguments->dbs_logdiagbandwidth, 6UL); gt_option_parser_add_option(op, option); /* -mincoverage */ option = gt_option_new_uword("mincoverage", "Minimum coverage in two neighbouring diagonal " "bands (for filter)", &arguments->dbs_mincoverage, 35UL); gt_option_parser_add_option(op, option); /* -maxfreq */ op_frq = gt_option_new_uword_min("maxfreq", "Maximum frequency of a k-mer (for filter)", &arguments->dbs_maxfreq, GT_UWORD_MAX, 1UL); gt_option_parser_add_option(op, op_frq); /* -t */ op_sup = gt_option_new_uword_min("t", "Suppress k-mers occurring at least t times " "(for filter)", &arguments->dbs_suppress, GT_UWORD_MAX, 2UL); gt_option_exclude(op_sup, op_frq); gt_option_is_development_option(op_sup); gt_option_parser_add_option(op, op_sup); /* -memlimit */ op_mem = gt_option_new_string("memlimit", "Maximum memory usage to determine the maximum " "frequency of a k-mer (for filter)", arguments->dbs_memlimit_str, ""); gt_option_parser_add_option(op, op_mem); /* -debug-kmer */ option = gt_option_new_bool("debug-kmer", "Output KmerPos lists", &arguments->dbs_debug_kmer, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -debug-seedpair */ option = gt_option_new_bool("debug-seedpair", "Output SeedPair lists", &arguments->dbs_debug_seedpair, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -verify */ option = gt_option_new_bool("verify", "Check that k-mer seeds occur in the sequences", &arguments->dbs_verify, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* SEED EXTENSION OPTIONS */ /* -extendxdrop */ op_xdr = gt_option_new_uword_min_max("extendxdrop", "Extend seed to both sides using xdrop " "algorithm, optional parameter " "specifies sensitivity", &arguments->se_extendxdrop, 97UL, 90UL, 100UL); gt_option_argument_is_optional(op_xdr); gt_option_parser_add_option(op, op_xdr); arguments->se_option_xdrop = gt_option_ref(op_xdr); /* -xdropbelow */ op_xbe = gt_option_new_word("xdropbelow", "Specify xdrop cutoff score (0 means " "automatically defined depending on minidentity)", &arguments->se_xdropbelowscore, 0L); gt_option_imply(op_xbe, op_xdr); gt_option_parser_add_option(op, op_xbe); /* -extendgreedy */ op_gre = gt_option_new_uword_min_max("extendgreedy", "Extend seed to both sides using greedy " "algorithm, optional parameter " "specifies sensitivity", &arguments->se_extendgreedy, 97UL, 90UL, 100UL); gt_option_argument_is_optional(op_gre); gt_option_exclude(op_gre, op_xdr); gt_option_parser_add_option(op, op_gre); arguments->se_option_greedy = gt_option_ref(op_gre); /* -history */ op_his = gt_option_new_uword_min_max("history", "Size of (mis)match history in range [1" "..64] (trimming for greedy extension)", &arguments->se_historysize, 60UL, 1UL, 64UL); gt_option_imply(op_his, op_gre); gt_option_parser_add_option(op, op_his); /* -maxalilendiff */ op_dif = gt_option_new_uword("maxalilendiff", "Maximum difference of alignment length " "(trimming for greedy extension)", &arguments->se_maxalilendiff, 0UL); gt_option_imply(op_dif, op_gre); gt_option_is_development_option(op_dif); gt_option_parser_add_option(op, op_dif); /* -percmathistory */ op_pmh = gt_option_new_uword_min_max("percmathistory", "percentage of matches required in " "history (for greedy extension)", &arguments->se_perc_match_hist, 0UL, 1UL, 100UL); gt_option_imply(op_pmh, op_gre); gt_option_is_development_option(op_pmh); gt_option_parser_add_option(op, op_pmh); /* -bias-parameters */ op_bia = gt_option_new_bool("bias-parameters", "Use -maxalilendiff 30 and let percmathistory " "depend on minidentiy and DNA base distribution", &arguments->bias_parameters, false); gt_option_imply(op_bia, op_gre); gt_option_exclude(op_bia, op_pmh); gt_option_exclude(op_bia, op_dif); gt_option_is_development_option(op_bia); gt_option_parser_add_option(op, op_bia); /* -cam */ op_cam = gt_option_new_string("cam", gt_cam_extendgreedy_comment(), arguments->se_char_access_mode, ""); gt_option_is_development_option(op_cam); gt_option_parser_add_option(op, op_cam); /* -l */ op_len = gt_option_new_uword_min("l", "Minimum alignment length " "(for seed extension)", &arguments->se_alignlength, 20UL, 1UL); gt_option_imply_either_2(op_len, op_xdr, op_gre); gt_option_parser_add_option(op, op_len); /* -minidentity */ op_err = gt_option_new_uword_min_max("minidentity", "Minimum identity of matches " "(for seed extension)", &arguments->se_minidentity, 80UL, GT_EXTEND_MIN_IDENTITY_PERCENTAGE, 99UL); gt_option_imply_either_2(op_err, op_xdr, op_gre); gt_option_parser_add_option(op, op_err); /* -a */ op_ali = gt_option_new_uword_min("a", "show alignments/sequences (optional " "argument is number of columns per line)", &arguments->se_alignmentwidth, 70, 20); gt_option_argument_is_optional(op_ali); gt_option_parser_add_option(op, op_ali); arguments->se_option_withali = gt_option_ref(op_ali); /* -mirror */ option = gt_option_new_bool("mirror", "Add reverse complement reads", &arguments->mirror, false); gt_option_parser_add_option(op, option); /* -overlappingseeds */ option = gt_option_new_bool("overlappingseeds", "Allow overlapping SeedPairs", &arguments->overlappingseeds, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -benchmark */ option = gt_option_new_bool("benchmark", "Measure total running time and be silent", &arguments->benchmark, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -seed-display */ option = gt_option_new_bool("seed-display", "Display seeds in #-line", &arguments->seed_display, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser* gt_show_seedext_option_parser_new(void *tool_arguments) { GtShowSeedextArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option, *op_ali, *option_filename, *op_relax_polish, *op_seed_extend, *op_sortmatches, *op_showeoplist; gt_assert(arguments); /* init */ op = gt_option_parser_new("[options] -f <matchfilename>", "Parse output of a seed extension and show/verify " "the alignment."); /* -a */ op_ali = gt_option_new_bool("a", "show alignment", &arguments->show_alignment, false); gt_option_parser_add_option(op, op_ali); /* -seed-display */ option = gt_option_new_bool("seed-display", "Display seeds in #-line and by " "character + (instead of |) in middle " "row of alignment column", &arguments->seed_display, false); gt_option_parser_add_option(op, option); /* -seed-extend */ op_seed_extend = gt_option_new_bool("seed-extend", "read the seeds from the # seed: -lines and " "extend them; match lines are ignored; " "match coordindates are displayed", &arguments->seed_extend, false); gt_option_parser_add_option(op, op_seed_extend); /* -relax-polish */ op_relax_polish = gt_option_new_bool("relax-polish", "do not force alignments to have " "polished ends", &arguments->relax_polish,false); gt_option_parser_add_option(op, op_relax_polish); gt_option_is_development_option(op_relax_polish); gt_option_imply(op_relax_polish, op_ali); /* -sort */ op_sortmatches = gt_option_new_bool("sort","sort matches in ascending order " "of their end positon on the " "query", &arguments->sortmatches,false); gt_option_parser_add_option(op, op_sortmatches); /* -e */ op_showeoplist = gt_option_new_bool("e","show list of edit operations", &arguments->showeoplist,false); gt_option_parser_add_option(op, op_showeoplist); /* -f */ option_filename = gt_option_new_filename("f", "path to file with match coordinates", arguments->matchfilename); gt_option_is_mandatory(option_filename); gt_option_parser_add_option(op, option_filename); gt_option_exclude(op_seed_extend, op_sortmatches); gt_option_exclude(op_relax_polish, op_seed_extend); return op; }
static GtOptionParser* gt_encseq_decode_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optionsep, *optionseq, *optionseqrange, *optionmode; GtEncseqDecodeArguments *arguments = (GtEncseqDecodeArguments*) tool_arguments; static const char *modes[] = {"fasta", "concat", NULL}; /* init */ op = gt_option_parser_new("(sequence_file|indexname)", "Decode/extract encoded sequences."); /* encseq options */ arguments->eopts = gt_encseq_options_register_loading(op, NULL); gt_encseq_options_add_readmode_option(op, arguments->dir); /* -singlechars */ option = gt_option_new_bool("singlechars", "do not use a GtEncseqReader but access each " "sequence character separately", &arguments->singlechars, false); gt_option_is_extended_option(option); gt_option_parser_add_option(op, option); /* -seq */ optionseq = gt_option_new_uword("seq", "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", "extract multiple consecutive sequences", &arguments->seqrng, NULL); gt_option_parser_add_option(op, optionseqrange); gt_option_exclude(optionseqrange, optionseq); /* -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); /* -range */ option = gt_option_new_range("range", "concatenated range to extract " "(implies '-output concat')", &arguments->rng, NULL); gt_option_parser_add_option(op, option); gt_option_imply(option, optionmode); /* -sepchar */ optionsep = gt_option_new_string("sepchar", "specify character to print as SEPARATOR", arguments->sepchar, "|"); gt_option_parser_add_option(op, optionsep); gt_option_imply(optionsep, optionmode); 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; }