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); }
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 OPrval parse_options(int *parsed_args, RegionCovArguments *arguments, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *o; OPrval oprval; gt_error_check(err); op = gt_option_parser_new("[option ...] GFF3_file", "Show which parts of the given sequence regions are " "covered by features."); /* -maxfeaturedist */ o = gt_option_new_ulong("maxfeaturedist", "set the maximum distance two " "features can have while still being in the same " "``cluster''", &arguments->max_feature_dist, 0); gt_option_parser_add_option(op, o); /* -v */ o = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, o); /* parse */ gt_option_parser_set_min_max_args(op, 1, 1); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_shredder_option_parser_new(void *tool_arguments) { GtShredderArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; gt_assert(arguments); op = gt_option_parser_new("[option ...] [sequence_file ...]", "GtShredder sequence_file into consecutive pieces of " "random length."); o = gt_option_new_ulong_min("coverage", "set the number of times the " "sequence_file is shreddered", &arguments->coverage, 1, 1); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("minlength", "set the minimum length of the shreddered " "fragments", &arguments->minlength, 300); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("maxlength", "set the maximum length of the shreddered " "fragments", &arguments->maxlength, 700); gt_option_parser_add_option(op, o); o = gt_option_new_ulong("overlap", "set the overlap between consecutive " "pieces", &arguments->overlap, 0); gt_option_parser_add_option(op, o); o = gt_option_new_probability("sample", "take samples of the generated " "sequences pieces with the given probability", &arguments->sample_probability, 1.0); gt_option_parser_add_option(op, o); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser* gt_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 GtOPrval parse_options(GtStr *indexname,GtStrArray *indexnametab, int *parsed_args, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOPrval oprval; GtOption *option; gt_error_check(err); op = gt_option_parser_new("storeindex <mkvindex1> <mkvindex2> ...", "Merge indexes into one index."); gt_option_parser_set_mail_address(op,"<*****@*****.**>"); option = gt_option_new_filename_array("ii", "specify input index files (mandatory)", indexnametab); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); option = gt_option_new_string("indexname", "specify index to be created", indexname, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_script_filter_option_parser_new(void *tool_arguments) { GtScriptFilterArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [script file(s)]", "Get info about and validate Lua script filters."); /* -showinfo */ option = gt_option_new_bool("showinfo", "show information about filter", &arguments->showinfo, true); gt_option_parser_add_option(op, option); /* -validate */ option = gt_option_new_bool("validate", "validate filter function", &arguments->validate, true); gt_option_parser_add_option(op, option); /* -oneline */ option = gt_option_new_bool("oneline", "show compact information on one line", &arguments->oneline, false); gt_option_parser_add_option(op, option); /* -scriptname */ option = gt_option_new_bool("scriptname", "show script name", &arguments->scriptname, true); gt_option_parser_add_option(op, option); gt_option_parser_set_min_args(op, 1); return op; }
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_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_encseq_check_option_parser_new(void *tool_arguments) { GtEncseqCheckArguments *arguments = tool_arguments; GtOptionParser *op; GT_UNUSED GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [file]", "Check the consistency of an encoded " "sequence file."); option = gt_option_new_ulong("scantrials", "specify number of scan trials", &arguments->scantrials, 0); gt_option_parser_add_option(op, option); option = gt_option_new_ulong("multicharcmptrials", "specify number of multicharacter trials", &arguments->multicharcmptrials, 0); gt_option_parser_add_option(op, option); option = gt_option_new_ulong_min_max("prefixlength", "prefix length", &arguments->prefixlength, 0, 0, MAXPREFIXLENGTH); gt_option_parser_add_option(op, option); gt_option_parser_set_min_args(op, 1); return op; }
static GtOptionParser* gt_encseq_bitextract_option_parser_new(void *tool_arguments) { GtEncseqBitextractArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [indexname]", "Extracts internal data from encoded sequences."); option = gt_option_new_bool("mirrored", "mirror sequence", &arguments->mirror, false); gt_option_parser_add_option(op, option); option = gt_option_new_ulong("stoppos", "output stop positions", &arguments->stoppos, GT_UNDEF_ULONG); gt_option_parser_add_option(op, option); option = gt_option_new_bool("specialranges", "output special ranges", &arguments->specialranges, false); gt_option_parser_add_option(op, option); option = gt_option_new_ulong("bitpos", "extract and display " "two bit encoding for position", &arguments->bitpos, GT_UNDEF_ULONG); gt_option_parser_add_option(op, option); gt_encseq_options_add_readmode_option(op, arguments->readmode); gt_option_parser_set_min_args(op, 1U); 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_inlineseq_split_option_parser_new( void *tool_arguments) { GtInlineseqSplitArguments *arguments = tool_arguments; GtOptionParser *op; GtOption GT_UNUSED *option, *seqopt, *gff3opt; gt_assert(arguments); /* init */ op = gt_option_parser_new("(-seqfile <seqfile> | -gff3file <gff3file>) " "[GFF3_file]", "Split GFF3 annotations with inline sequences into " "separate files."); /* -seqfile */ seqopt = gt_option_new_string("seqfile", "output file for sequences as FASTA", arguments->seqoutfile, NULL); gt_option_parser_add_option(op, seqopt); /* -gff3file */ gff3opt = gt_option_new_string("gff3file", "output file for annotations " "as GFF3", arguments->gffoutfile, NULL); gt_option_parser_add_option(op, gff3opt); gt_option_is_mandatory_either(seqopt, gff3opt); return op; }
static GtOptionParser* gt_cds_option_parser_new(void *tool_arguments) { CDSArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [GFF3_file]", "Add CDS (coding sequence) features to exon " "features given in GFF3 file."); /* -minorflen */ option = gt_option_new_uint_min("minorflen", "set the minimum length an open " "reading frame (ORF) must have to be added " "as a CDS feature (measured in amino acids)", &arguments->minorflen, 64, 1); gt_option_parser_add_option(op, option); /* -startcodon */ option = gt_option_new_bool("startcodon", "require than an ORF must begin " "with a start codon", &arguments->start_codon, false); gt_option_parser_add_option(op, option); /* -finalstopcodon */ option = gt_option_new_bool("finalstopcodon", "require that the final ORF " "must end with a stop codon", &arguments->final_stop_codon, false); gt_option_parser_add_option(op, option); /* -genericstartcodons */ option = gt_option_new_bool("genericstartcodons", "use generic start codons", &arguments->generic_start_codons, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* -seqfile, -matchdesc, -usedesc and -regionmapping */ gt_seqid2file_register_options(op, arguments->s2fi); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, arguments->ofi); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_max_args(op, 1); return op; }
static GtOptionParser* gt_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_condenseq_hmmsearch_option_parser_new(void *tool_arguments) { GtCondenseqHmmsearchArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] -db DATABASE -hmm HMMPROFILE", "Perform a hmmsearch on the given compressed " "database."); /* -db and -verbose */ gt_condenseq_search_register_options(arguments->csa, op); /* -hmm */ option = gt_option_new_string("hmm", "hmm query", arguments->hmm, NULL); gt_option_is_mandatory(option); gt_option_parser_add_option(op, option); /* -hmmsearch */ option = gt_option_new_string("hmmsearch", "path to hmmsearch, please set if " "not installed at (linux) default location", arguments->hmmsearch_path, "/usr/bin/hmmsearch"); gt_option_parser_add_option(op, option); /* -tblout */ option = gt_option_new_string("tblout", "file basename to output tabular " "hmmsearch output to (like hmmer option " "--tblout). Depending on -max_queries will " "produce multiple numbered files.", arguments->outtable_filename, NULL); gt_option_parser_add_option(op, option); /* -force_ow */ option = gt_option_new_bool("force_ow", "force overwrite of existing files", &arguments->force_ow, false); gt_option_parser_add_option(op, option); /* -max_queries */ option = gt_option_new_uint("max_queries", "maximum number of queries per " "fine search, influences file-size and therefore " "speed!, 0 disables splitting", &arguments->max_queries, 5U); gt_option_parser_add_option(op, option); return op; }
static GtOptionParser* gt_splicesiteinfo_option_parser_new(void *tool_arguments) { SpliceSiteInfoArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Show information " "about splice sites given in GFF3 files."); /* -seqfile, -matchdesc, -usedesc and -regionmapping */ gt_seqid2file_register_options(op, arguments->s2fi); /* -addintrons */ option = gt_option_new_bool("addintrons", "add intron features between " "existing exon features\n(before computing the " "information to be shown)", &arguments->addintrons, false); gt_option_parser_add_option(op, option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, arguments->ofi); gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); return op; }
static GtOptionParser* gt_gff3validator_option_parser_new(void *tool_arguments) { GFF3ValidatorArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [GFF3_file ...]", "Strictly validate given GFF3 files."); /* typecheck options */ gt_typecheck_info_register_options(arguments->tci, op); /* xrfcheck options */ gt_xrfcheck_info_register_options(arguments->xci, op); /* -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(option); gt_option_parser_add_option(op, option); 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_cge_spacedseed_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option, *optionesaindex, *optionpckindex; Cge_spacedseed_options *arguments = tool_arguments; op = gt_option_parser_new("[options]", "Match spaced seeds."); gt_option_parser_set_mailaddress(op,"<*****@*****.**>"); optionesaindex = gt_option_new_string("esa", "Specify index (enhanced suffix array)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionesaindex); arguments->refoptionesaindex = gt_option_ref(optionesaindex); optionpckindex = gt_option_new_string("pck", "Specify index (packed index)", arguments->str_inputindex, NULL); gt_option_parser_add_option(op, optionpckindex); arguments->refoptionpckindex = gt_option_ref(optionpckindex); gt_option_exclude(optionesaindex,optionpckindex); gt_option_is_mandatory_either(optionesaindex,optionpckindex); option = gt_option_new_filenamearray("q", "Specify files containing the " "query sequences", arguments->queryfilenames); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); option = gt_option_new_bool("cmp","compare results of offline and online " "searches",&arguments->docompare,false); gt_option_parser_add_option(op, option); gt_option_is_development_option(option); option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); return op; }
static GtOPrval parse_env_options(int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOption *o; GtOPrval oprval; op = gt_option_parser_new("GT_ENV_OPTIONS='[option ...]' ...", "Parse the options contained in the " "environment variable GT_ENV_OPTIONS."); o = gt_option_new_bool("spacepeak", "show space peak on stdout upon deletion", &spacepeak, false); gt_option_parser_add_option(op, o); o = gt_option_new_bool("showtime", "enable output for run-time statistics", &showtime, false); gt_option_parser_add_option(op, o); gt_option_parser_set_max_args(op, 0); oprval = gt_option_parser_parse(op, NULL, argc, argv, gt_versionfunc, err); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_readjoiner_cnttest_option_parser_new( void *tool_arguments) { GtReadjoinerCnttestArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("-readset [option ...]", "Test/development tool for readjoiner containments filtering."); /* -readset */ option = gt_option_new_string("readset", "specify the readset name", arguments->readset, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -test */ option = gt_option_new_string("test", "select among the available tests:\n" "showlist: show content of an cnt list (input: cntlist)\n" "bruteforce: memcmp reads vs all suffixes and prefixes (input: encseq)\n" "kmp: variant of Knuth-Morris-Pratt (input: encseq)\n" "esa: own esa-based algorithm (input: esa)", arguments->teststr, NULL); gt_option_parser_add_option(op, option); gt_option_is_mandatory(option); /* -singlestrand */ option = gt_option_new_bool("singlestrand", "do not use reads " "reverse complements", &arguments->singlestrand, false); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_parser_set_version_func(op, gt_readjoiner_show_version); gt_option_parser_set_max_args(op, 0); return op; }
static OPrval parseChkIndexOptions(int *parsed_args, int argc, const char *argv[], struct chkIndexOptions *params, GtError *err) { GtOptionParser *op; GtOption *option; OPrval oprval; bool extRankCheck; gt_error_check(err); op = gt_option_parser_new("indexname", "Map <indexname> block composition index" "and bwt and check index integrity."); option = gt_option_new_bool("v", "print verbose progress information", ¶ms->verboseOutput, false); gt_option_parser_add_option(op, option); option = gt_option_new_ulong("skip", "number of symbols to skip", ¶ms->skipCount, 0); gt_option_parser_add_option(op, option); option = gt_option_new_ulong("ticks", "print dot after this many symbols" " tested okay", ¶ms->progressInterval, DEFAULT_PROGRESS_INTERVAL); gt_option_parser_add_option(op, option); option = gt_option_new_bool("ext-rank-check", "do additional checks of rank query results", &extRankCheck, false); gt_option_parser_add_option(op, option); gt_option_parser_set_min_max_args(op, 1, 1); oprval = gt_option_parser_parse(op, parsed_args, argc, (const char**) argv, gt_versionfunc, err); gt_option_parser_delete(op); params->checkFlags = EIS_VERIFY_BASIC | (extRankCheck?EIS_VERIFY_EXT_RANK:0); params->EISFeatureSet = EIS_FEATURE_REGION_SUMS; params->encType = BWT_ON_BLOCK_ENC; return oprval; }
static GtOPrval parse_options(int *parsed_args, ChseqidsArguments *arguments, int argc, const char **argv, GtError *err) { GtOptionParser *op; GtOutputFileInfo *ofi; GtOption *option; GtOPrval oprval; gt_error_check(err); /* init */ op = gt_option_parser_new("[option ...] mapping_file [GFF3_file]", "Change sequence ids by the mapping given in " "mapping_file."); ofi = gt_outputfileinfo_new(); /* -sort */ option = gt_option_new_bool("sort", "sort the GFF3 features after changing the " "sequence ids\n(memory consumption is " "proportional to the input file size)", &arguments->sort, false); gt_option_parser_add_option(op, option); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); /* output file options */ gt_outputfile_register_options(op, &arguments->outfp, ofi); /* parse options */ gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL); gt_option_parser_set_min_max_args(op, 1, 2); oprval = gt_option_parser_parse(op, parsed_args, argc, argv, gt_versionfunc, err); /* free */ gt_outputfileinfo_delete(ofi); gt_option_parser_delete(op); return oprval; }
static GtOptionParser* gt_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_bed_to_gff3_option_parser_new(void *tool_arguments) { BEDToGFF3Arguments *arguments = tool_arguments; GtOptionParser *op; GtOption *o; op = gt_option_parser_new("[bed_file]", "Parse BED file and show it as GFF3."); o = gt_option_new_string("featuretype", "Set type of parsed BED features", arguments->feature_type, BED_FEATURE_TYPE); gt_option_parser_add_option(op, o); o = gt_option_new_string("thicktype", "Set type of parsed thick BED features", arguments->thick_feature_type, BED_THICK_FEATURE_TYPE); gt_option_parser_add_option(op, o); o = gt_option_new_string("blocktype", "Set type of parsed BED blocks", arguments->block_type, BED_BLOCK_TYPE); gt_option_parser_add_option(op, o); gt_option_parser_set_max_args(op, 1); return op; }
static GtOptionParser* gt_encseq_encode_option_parser_new(void *tool_arguments) { GtOptionParser *op; GtOption *option; GtEncseqEncodeArguments *arguments = (GtEncseqEncodeArguments*) tool_arguments; /* init */ op = gt_option_parser_new("sequence_file [sequence_file " "[sequence_file ...]]", "Encode sequence files (FASTA/FASTQ, GenBank, " "EMBL) efficiently."); /* -showstats */ option = gt_option_new_bool("showstats", "show compression results", &arguments->showstats, false); gt_option_parser_add_option(op, option); /* -no_esq_header */ option = gt_option_new_bool("no_esq_header", "omit the header in the .esq file", &arguments->no_esq_header, false); gt_option_is_development_option(option); gt_option_parser_add_option(op, option); /* encoded sequence options */ arguments->eopts = gt_encseq_options_register_encoding(op, arguments->indexname, NULL); /* -v */ option = gt_option_new_verbose(&arguments->verbose); gt_option_parser_add_option(op, option); gt_option_parser_set_min_args(op, 1); return op; }
void gt_registerCtxMapOptions(GtOptionParser *op, int *ilogOut) { GtOption *option = gt_option_new_int_min_max( "ctxilog", "specify the interval of context sampling as log value\n" "parameter i means that each 2^i-th position of source is sampled for " "rank\n-1 => chooses default of log(log(sequence length))\n" "-2 => generates no map", ilogOut, CTX_MAP_ILOG_NOMAP, CTX_MAP_ILOG_AUTOSIZE, sizeof (unsigned long) * CHAR_BIT - 1); gt_option_parser_add_option(op, option); }
static GtOptionParser* gt_compreads_compress_option_parser_new(void *tool_arguments) { GtCsrHcrEncodeArguments *arguments = tool_arguments; GtOptionParser *op; GtOption *option; static const char *methods[] = { "page", "regular", "none" }; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] (-files file [...])", "Generates compact encoding for fastq data."); option = gt_option_new_bool("descs","encode descriptions", &arguments->descs, false); gt_option_parser_add_option(op, option); option = gt_option_new_filename_array("files", "File(s) containing reads.", arguments->files); gt_option_parser_add_option(op, option); option = gt_option_new_string("name", "specify base name for HCR to be" " generated. Only mandatory, if more than one" " file was given.", arguments->name, NULL); gt_option_parser_add_option(op, option); option = gt_option_new_string("smap", "file containing alphabet description." " If \"-smap\" is not set, dna alphabet is" " used.", arguments->smap, NULL); gt_option_parser_add_option(op, option); option = gt_option_new_range("qrange", "specify range of quality values." " All values smaller or equal to the lower bound" " will be converted to the lower bound. All" " values equal or larger than the upper bound" " will be converted to the upper bound.", &arguments->arg_range, NULL); gt_option_parser_add_option(op, option); option = gt_option_new_uword("srate", "sampling rate, set to sensible default" " depending on sampling method", &arguments->srate, GT_UNDEF_UWORD); gt_option_parser_add_option(op, option); option = gt_option_new_choice("stype", "type of sampling\n" "one of regular - page - none", arguments->method, "page", methods); gt_option_parser_add_option(op, option); gt_option_parser_set_min_max_args(op, 0U, 0U); return op; }