示例#1
0
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_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;
}
static GtOptionParser*
gt_compreads_decompress_option_parser_new(void *tool_arguments)
{
  GtCsrHcrDecodeArguments *arguments = tool_arguments;
  GtOptionParser *op;
  GtOption *option;
  gt_assert(arguments);

  /* init */
  op = gt_option_parser_new("[option ...] (-file file)",
                         "Decodes a file of compressed reads.");

  option = gt_option_new_bool("v", "be verbose",
                              &arguments->verbose, false);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_bool("descs","enable description decoding",
                              &arguments->descs, false);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_string("file", "specify base name of files containing"
                                " HCR.",
                                arguments->file, NULL);
  gt_option_is_mandatory(option);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_string("name", "specify base name for decoded hcr"
                                " (suffix will be \".fastq\")",
                                arguments->name, NULL);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_string("smap", "specify file containing alphabet"
                                "description (file must be an .al1 file)."
                                " If \"-smap\" is not set, dna alphabet is"
                                " used.",
                                arguments->smap, NULL);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_range("range", "decode multiple consecutive reads."
                               " If range is not specified, the "
                               " entire file will be decoded.",
                               &arguments->rng, NULL);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_ulong("benchmark", "decode given number random reads "
                               "and report the time to do this",
                               &arguments->bench, 0);
  gt_option_is_development_option(option);
  gt_option_parser_add_option(op, option);

  gt_option_parser_set_min_max_args(op, 0U, 0U);
  return op;
}
示例#5
0
static GtOptionParser *gt_tyr_search_option_parser_new(void *tool_arguments)
{
  GtOptionParser *op;
  GtOption *option, *optiontyr, *optionqueries;
  Tyr_search_options *arguments = tool_arguments;

  op = gt_option_parser_new("[options] -tyr tallymer-index -q queryfile0 "
                            "[queryfile1..] [options]",
                            "Search a set of k-mers in an index constructed "
                            "by \"gt tyr mkindex\".");
  gt_option_parser_set_mailaddress(op,"<*****@*****.**>");

  optiontyr = gt_option_new_string("tyr","specify tallymer-index",
                                   arguments->str_inputindex,
                                   NULL);
  gt_option_is_mandatory(optiontyr);
  gt_option_parser_add_option(op, optiontyr);

  optionqueries = gt_option_new_filenamearray("q","specify query file names",
                                              arguments->queryfilenames);
  gt_option_is_mandatory(optionqueries);
  gt_option_parser_add_option(op, optionqueries);

  option = gt_option_new_string("strand",
                                "specify the strand to be searched: "
                                "use f (for forward strand) or "
                                "p (for reverse complemented strand) or "
                                "fp (for both); default is f",
                                arguments->strandspec,
                                "f");
  gt_option_parser_add_option(op, option);

  option = gt_option_new_stringarray("output",
                                     "specify output flags "
                                     "(qseqnum, qpos, counts, sequence)",
                                     arguments->showmodespec);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_bool("test", "perform tests to verify program "
                                      "correctness", &arguments->performtest,
                                      false);
  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_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;
}
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);
}
示例#8
0
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;
}
示例#9
0
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);
}
示例#10
0
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;
}
示例#11
0
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_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;
}
示例#13
0
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;
}
示例#14
0
static GtOptionParser* gt_speck_option_parser_new(void *tool_arguments)
{
  GtOptionParser *op;
  GtOption *option;
  SpeccheckArguments *arguments = tool_arguments;

  /* init */
  op = gt_option_parser_new("[options] [GFF3_file ...]",
                            "Checks spec definition compliance in GFF3 input.");

  option = gt_option_new_filename("specfile",
                                  "file with specification definition",
                                  arguments->specfile);
  gt_option_parser_add_option(op, option);
  gt_option_is_mandatory(option);

  option = gt_option_new_bool("colored", "show colored output",
                              &arguments->colored, true);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_bool("provideindex", "provide feature index in "
                              "specfile namespace (requires O(n) memory for n "
                              "input features)",
                              &arguments->provideindex, false);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_bool("sort", "sort input before checking (requires "
                              "O(n) memory for n input features)",
                              &arguments->sort, false);
  gt_option_parser_add_option(op, option);

  option = gt_option_new_bool("failhard", "stop processing and report runtime "
                              "errors instead of recording them in the results",
                              &arguments->fail_hard, false);
  gt_option_parser_add_option(op, option);

  /* -format */
  option = gt_option_new_string("output", "output format\n"
                                "choose from: json, text, html, statsonly",
                                arguments->format, "text");
  gt_option_parser_add_option(op, option);

  gt_typecheck_info_register_options_with_default(arguments->tci, op, "so");
  gt_seqid2file_register_options_ext(op, arguments->s2fi, false, false);
  gt_output_file_info_register_options(arguments->ofi, op, &arguments->outfp);
  option = gt_option_new_verbose(&arguments->verbose);
  gt_option_parser_add_option(op, option);

  return op;
}
示例#15
0
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;
}
示例#16
0
void gt_xrfcheck_info_register_options(GtXRFCheckInfo *xci,
                                        GtOptionParser *op)
{
  GtOption *xrfcheck_option;
  gt_assert(xci && op);
  gt_assert(!xci->xrfcheck_option); /* can only called once */

  /* -xrfcheck */
  xrfcheck_option =
    gt_option_new_string("xrfcheck", "check Dbxref and Ontology_term "
                         "attributes for correct syntax according to a "
                         "abbreviation definition file.\nIf no argument is "
                         "given, the GO.xrf_abbs file from the "
                         "gtdata/xrf_abbr directory is used.\nIf an argument "
                         "is given, it is used as an specific filename for an "
                         "abbreviation file.\nIn the case that such a "
                         "file does not exist, '.xrf_abbr' is added to the "
                         "argument and loading the resulting filename from the "
                         "gtdata/xrf_abbr directory is attempted.",
                         xci->xrfcheck, NULL);
  gt_option_argument_is_optional(xrfcheck_option);
  gt_option_parser_add_option(op, xrfcheck_option);
  xci->xrfcheck_option = gt_option_ref(xrfcheck_option);
}
示例#17
0
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;
}
示例#18
0
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;
}
示例#19
0
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;
}
示例#20
0
static GtOptionParser* gt_genomediff_option_parser_new(void *tool_arguments)
{
    GtGenomediffArguments *arguments = tool_arguments;
    GtOptionParser *op;
    GtOption *option, *option_unitfile;
    static const char *indextypes[] = { "esa", "pck", "encseq", NULL };

    gt_assert(arguments);

    /* init */
    op = gt_option_parser_new("[option ...] "
                              "(INDEX | -indexname NAME SEQFILE SEQFILE [...]) ",
                              "Calculates Kr: pairwise distances between genomes.");

    /* options */
    option = gt_option_new_choice("indextype", "specify type of index, one of: "
                                  "esa|pck|encseq. Where encseq is an encoded "
                                  "sequence and an enhanced suffix array will be "
                                  "constructed only in memory.",
                                  arguments->indextype, indextypes[2],
                                  indextypes);
    gt_option_parser_add_option(op, option);

    option = gt_option_new_string("indexname", "Basename of encseq to construct.",
                                  arguments->indexname, NULL);
    gt_option_parser_add_option(op, option);

    /*-unitfile*/
    option_unitfile =
        gt_option_new_filename("unitfile",
                               "specifies genomic units, "
                               "see below for description.",
                               arguments->unitfile);
    gt_option_parser_add_option(op, option_unitfile);
    arguments->ref_unitfile = gt_option_ref(option_unitfile);

    /* encseq options */
    arguments->loadopts =
        gt_encseq_options_register_loading(op, arguments->indexname);

    gt_option_is_development_option(
        gt_encseq_options_lossless_option(arguments->loadopts));
    /* esa options */
    arguments->idxopts =
        gt_index_options_register_esa_noout(op);
    gt_option_is_development_option(
        gt_index_options_spmopt_option(arguments->idxopts));

    /* scan */
    option = gt_option_new_bool("scan", "do not load esa index but scan "
                                "it sequentially.", &arguments->scanfile, true);
    gt_option_is_extended_option(option);
    gt_option_parser_add_option(op, option);

    /* dev options */
    /* -max_n */
    option = gt_option_new_uword("max_n", "Number of precalculated values "
                                 "for ln(n!) and pmax(x).",
                                 &arguments->max_ln_n_fac, 1000UL);
    gt_option_is_development_option(option);
    gt_option_parser_add_option(op, option);

    /* -maxdepth */
    option =  gt_option_new_int("maxdepth", "max depth of .pbi-file, use with "
                                "-indextype pck.",
                                &arguments->user_max_depth, -1);
    gt_option_is_development_option(option);
    gt_option_parser_add_option(op, option);

    /* thresholds */
    /* divergence error */
    option = gt_option_new_double("thr",
                                  "Threshold for difference (du, dl) in "
                                  "divergence calculation.\n"
                                  "default: 1e-9",
                                  &arguments->divergence_threshold,
                                  1e-9);
    gt_option_is_extended_option(option);
    gt_option_hide_default(option);
    gt_option_parser_add_option(op, option);

    /* expected shulen error */
    option = gt_option_new_double("abs_err",
                                  "absolute error for expected shulen "
                                  "calculation.\n"
                                  "default: 1e-5",
                                  &arguments->divergence_abs_err,
                                  1e-5);
    gt_option_is_extended_option(option);
    gt_option_hide_default(option);
    gt_option_parser_add_option(op, option);

    /* relative expected shulen error */
    option = gt_option_new_double("rel_err",
                                  "relative error for expected shulen "
                                  "calculation.\n"
                                  "default: 1e-3",
                                  &arguments->divergence_rel_err,
                                  1e-3);
    gt_option_is_extended_option(option);
    gt_option_hide_default(option);
    gt_option_parser_add_option(op, option);

    /* M */
    option = gt_option_new_double("M",
                                  "threshold for minimum logarithm.\n"
                                  "default: DBL_MIN",
                                  &arguments->divergence_m,
                                  DBL_MIN);
    gt_option_is_extended_option(option);
    gt_option_hide_default(option);
    gt_option_parser_add_option(op, option);

    /* -v */
    option = gt_option_new_verbose(&arguments->verbose);
    gt_option_parser_add_option(op, option);

    /* mail */
    gt_option_parser_set_mail_address(op, "<*****@*****.**>");
    /* doc */
    gt_option_parser_set_comment_func(op, gt_gtdata_show_help, NULL);
    return op;
}
示例#21
0
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;
}
示例#22
0
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;
}
示例#23
0
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 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;
}
示例#25
0
static GtOptionParser* gt_sketch_page_option_parser_new(void *tool_arguments)
{
  SketchPageArguments *arguments = tool_arguments;
  GtOptionParser *op;
  static const char *formats[] = {
#ifdef CAIRO_HAS_PDF_SURFACE
    "pdf",
#endif
#ifdef CAIRO_HAS_PS_SURFACE
    "ps",
#endif
    NULL
  };
  GtOption *o;
  op = gt_option_parser_new("outfile annotationfile",
                            "Draw a multi-page PDF/PS representation of "
                            "an annotation file.");
  o = gt_option_new_string("seqid", "sequence region to draw\n"
                                    "default: first in file",
                           arguments->seqid, NULL);
  gt_option_parser_add_option(op, o);
  gt_option_hide_default(o);

  o = gt_option_new_string("text", "text to show in header\n"
                                  "default: file name",
                           arguments->text, NULL);
  gt_option_parser_add_option(op, o);
  gt_option_hide_default(o);

  o = gt_option_new_double("fontsize", "header and footer font size "
                                       "(in points)",
                           &arguments->theight, 10.0);
  gt_option_parser_add_option(op, o);

  o = gt_option_new_range("range", "range to draw (e.g. 100 10000)\n"
                                   "default: full range",
                          &arguments->range, NULL);
  gt_option_parser_add_option(op, o);
  gt_option_hide_default(o);

  o = gt_option_new_ulong_min("linewidth", "base width of a single "
                                           "repeated unit",
                              &arguments->width, 2000, 1000);
  gt_option_is_mandatory(o);
  gt_option_parser_add_option(op, o);

  o = gt_option_new_double("width", "page width in millimeters "
                                    "(default: DIN A4)",
                           &arguments->pwidth, 210.0);
  gt_option_parser_add_option(op, o);

  o = gt_option_new_double("height", "page height in millimeters "
                                     "(default: DIN A4)",
                           &arguments->pheight, 297.0);
  gt_option_parser_add_option(op, o);

  o = gt_option_new_choice("format", "output format\n"
                                     "choose from: "
#ifdef CAIRO_HAS_PDF_SURFACE
                                       "pdf"
#ifdef CAIRO_HAS_PS_SURFACE
                                       "|"
#endif
#endif
#ifdef CAIRO_HAS_PS_SURFACE
                                       "ps"
#endif
                                       "",
                            arguments->format, formats[0], formats );
  gt_option_parser_add_option(op, o);

  o = gt_option_new_string("style", "style file to use\n"
                                    "default: gtdata/sketch/default.style",
                                arguments->stylefile,
                                gt_str_get(arguments->stylefile));
  gt_option_parser_add_option(op, o);
  gt_option_hide_default(o);

  o = gt_option_new_filename("seqfile", "sequence file for GC content view",
                                arguments->seqfile);
  gt_option_parser_add_option(op, o);
  gt_option_is_extended_option(o);

  gt_option_parser_set_min_max_args(op, 2, 2);
  return op;
}
示例#26
0
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;
}
示例#27
0
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 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;
}
示例#29
0
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_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;
}