mirror of
http://43.156.76.180:8026/YuuMJ/EukPhylo.git
synced 2025-12-28 01:20:24 +08:00
1107 lines
44 KiB
C
1107 lines
44 KiB
C
/*
|
|
File autogenerated by gengetopt version 2.13.1
|
|
generated with the following command:
|
|
/d/bioinfo/users/privmane/code/gengetopt-2.13.1/src/gengetopt -isemphy.ggo -Fsemphy_cmdline -f semphy_cmdline_parser --arg-struct-name=semphy_args_info
|
|
|
|
The developers of gengetopt consider the fixed text that goes in all
|
|
gengetopt output files to be in the public domain:
|
|
we make no copyright claims on it.
|
|
*/
|
|
|
|
/* If we use autoconf. */
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "getopt.h"
|
|
|
|
#include "semphy_cmdline.h"
|
|
|
|
static
|
|
void clear_given (struct semphy_args_info *args_info);
|
|
static
|
|
void clear_args (struct semphy_args_info *args_info);
|
|
|
|
static int
|
|
semphy_cmdline_parser_internal (int argc, char * const *argv, struct semphy_args_info *args_info, int override, int initialize, int check_required, const char *additional_error);
|
|
|
|
|
|
static char *
|
|
gengetopt_strdup (const char *s);
|
|
|
|
static
|
|
void clear_given (struct semphy_args_info *args_info)
|
|
{
|
|
args_info->help_given = 0 ;
|
|
args_info->version_given = 0 ;
|
|
args_info->SEMPHY_given = 0 ;
|
|
args_info->bbl_given = 0 ;
|
|
args_info->likelihood_given = 0 ;
|
|
args_info->PerPosLike_given = 0 ;
|
|
args_info->PerPosPosterior_given = 0 ;
|
|
args_info->NJ_given = 0 ;
|
|
args_info->rate_given = 0 ;
|
|
args_info->max_semphy_iter_given = 0 ;
|
|
args_info->max_bbl_iter_given = 0 ;
|
|
args_info->dont_use_NJ_given = 0 ;
|
|
args_info->BPrepeats_given = 0 ;
|
|
args_info->BPfile_given = 0 ;
|
|
args_info->BPconsensus_given = 0 ;
|
|
args_info->BPonUserTree_given = 0 ;
|
|
args_info->ADVBBLEpsilinLikeToll_given = 0 ;
|
|
args_info->ADVNumOfBBLIterInBBLPlusAlpha_given = 0 ;
|
|
args_info->ADVNoPost_given = 0 ;
|
|
args_info->consurf_given = 0 ;
|
|
args_info->sequence_given = 0 ;
|
|
args_info->tree_given = 0 ;
|
|
args_info->constraint_given = 0 ;
|
|
args_info->outputfile_given = 0 ;
|
|
args_info->treeoutputfile_given = 0 ;
|
|
args_info->gaps_given = 0 ;
|
|
args_info->seed_given = 0 ;
|
|
args_info->alphabet_given = 0 ;
|
|
args_info->ratio_given = 0 ;
|
|
args_info->ACGprob_given = 0 ;
|
|
args_info->inputRate_given = 0 ;
|
|
args_info->homogeneous_given = 0 ;
|
|
args_info->alpha_given = 0 ;
|
|
args_info->optimizeAlpha_given = 0 ;
|
|
args_info->categories_given = 0 ;
|
|
args_info->laguerre_given = 0 ;
|
|
args_info->day_given = 0 ;
|
|
args_info->jtt_given = 0 ;
|
|
args_info->rev_given = 0 ;
|
|
args_info->wag_given = 0 ;
|
|
args_info->cprev_given = 0 ;
|
|
args_info->nucjc_given = 0 ;
|
|
args_info->aaJC_given = 0 ;
|
|
args_info->k2p_given = 0 ;
|
|
args_info->hky_given = 0 ;
|
|
args_info->modelfile_given = 0 ;
|
|
args_info->verbose_given = 0 ;
|
|
args_info->Logfile_given = 0 ;
|
|
args_info->Model_group_counter = 0 ;
|
|
}
|
|
|
|
static
|
|
void clear_args (struct semphy_args_info *args_info)
|
|
{
|
|
args_info->SEMPHY_flag = 0;
|
|
args_info->bbl_flag = 0;
|
|
args_info->likelihood_flag = 0;
|
|
args_info->PerPosLike_flag = 0;
|
|
args_info->PerPosPosterior_flag = 0;
|
|
args_info->NJ_flag = 0;
|
|
args_info->rate_flag = 0;
|
|
args_info->max_semphy_iter_arg = 100 ;
|
|
args_info->max_bbl_iter_arg = 1000 ;
|
|
args_info->dont_use_NJ_flag = 1;
|
|
args_info->BPfile_arg = NULL;
|
|
args_info->BPonUserTree_flag = 0;
|
|
args_info->ADVBBLEpsilinLikeToll_arg = 0.05 ;
|
|
args_info->ADVNumOfBBLIterInBBLPlusAlpha_arg = 10 ;
|
|
args_info->ADVNoPost_flag = 0;
|
|
args_info->consurf_flag = 0;
|
|
args_info->sequence_arg = gengetopt_strdup ("-");
|
|
args_info->tree_arg = NULL;
|
|
args_info->constraint_arg = NULL;
|
|
args_info->outputfile_arg = gengetopt_strdup ("-");
|
|
args_info->treeoutputfile_arg = gengetopt_strdup ("-");
|
|
args_info->gaps_flag = 0;
|
|
args_info->alphabet_arg = 20 ;
|
|
args_info->ratio_arg = 2.0 ;
|
|
args_info->ACGprob_arg = gengetopt_strdup ("0.25,0.25,0.25");
|
|
args_info->inputRate_arg = 1.0 ;
|
|
args_info->homogeneous_flag = 0;
|
|
args_info->optimizeAlpha_flag = 0;
|
|
args_info->categories_arg = 8 ;
|
|
args_info->laguerre_flag = 0;
|
|
args_info->modelfile_arg = NULL;
|
|
args_info->verbose_arg = 1 ;
|
|
args_info->Logfile_arg = gengetopt_strdup ("-");
|
|
}
|
|
|
|
void
|
|
semphy_cmdline_parser_print_version (void)
|
|
{
|
|
printf ("%s %s\n", SEMPHY_CMDLINE_PARSER_PACKAGE, SEMPHY_CMDLINE_PARSER_VERSION);
|
|
}
|
|
|
|
void
|
|
semphy_cmdline_parser_print_help (void)
|
|
{
|
|
semphy_cmdline_parser_print_version ();
|
|
printf("\n%s\n", "structural EM based Phylogeny");
|
|
printf("\nUsage: semphy [OPTIONS]...\n\n");
|
|
printf("%s\n"," -h, --help Print help and exit");
|
|
printf("%s\n"," -V, --version Print version and exit");
|
|
printf("%s\n","\nWhich algorithm to run:");
|
|
printf("%s\n"," -S, --SEMPHY Do SEMPHY step (default=off)");
|
|
printf("%s\n"," -n, --bbl Only optimize branch length (default=off)");
|
|
printf("%s\n"," -L, --likelihood Compute likelihood for fixed tree \n (default=off)");
|
|
printf("%s\n"," -P, --PerPosLike Compute likelihood per position for a fixed \n tree (default=off)");
|
|
printf("%s\n"," -B, --PerPosPosterior Compute likelihood per position and Bayesian \n posterior (default=off)");
|
|
printf("%s\n"," -J, --NJ compute NJ tree only (default=off)");
|
|
printf("%s\n"," -R, --rate optimize rate of gene (default=off)");
|
|
printf("%s\n","\nOther Algorithm Options:");
|
|
printf("%s\n"," -M, --max-semphy-iter=INT Max number of SEM iterations (default=`100')");
|
|
printf("%s\n"," -b, --max-bbl-iter=INT Max number of BBL iterations (default=`1000')");
|
|
printf("%s\n"," -N, --dont-use-NJ Do not Use NJ to break stars in treeRearrange \n (default=on)");
|
|
printf("%s\n","\nBootstrap:");
|
|
printf("%s\n"," --BPrepeats=INT Use bootstrap and set number of repeats");
|
|
printf("%s\n"," --BPfile=FILENAME Use bootstrap and read the weights from a file");
|
|
printf("%s\n"," --BPconsensus=INT Use bootstrap and compute a Consensus tree");
|
|
printf("%s\n"," --BPonUserTree Use compute support for user provided tree \n (default=off)");
|
|
printf("%s\n","\nBasic Options:");
|
|
printf("%s\n"," -s, --sequence=FILENAME Sequence file name (default=`-')");
|
|
printf("%s\n"," -t, --tree=FILENAME Tree file name");
|
|
printf("%s\n"," -c, --constraint=FILENAME Constraint Tree file name");
|
|
printf("%s\n"," -o, --outputfile=FILENAME Output file (default=`-')");
|
|
printf("%s\n"," -T, --treeoutputfile=FILENAME Tree output file (default=`-')");
|
|
printf("%s\n"," -g, --gaps Remove positions with gaps (default=off)");
|
|
printf("%s\n"," -r, --seed=LONG Seed random number generator");
|
|
printf("%s\n","\nModel Options:");
|
|
printf("%s\n"," -a, --alphabet=4|20|61|64 Alphabet Size (default=`20')");
|
|
printf("%s\n"," -z, --ratio=FLOAT Transition/Transversion ratio (default=`2.0')");
|
|
printf("%s\n"," -p, --ACGprob=A,C,G User input nucleotide frequencies. String \n separated list for A,C,G \n (default=`0.25,0.25,0.25')");
|
|
printf("%s\n"," --inputRate=FLOAT Set External globalRate (default=`1.0')");
|
|
printf("%s\n","\nAmong Site Rate Variation (ASRV):");
|
|
printf("%s\n"," -H, --homogeneous Don't use Gamma ASRV (default=off)");
|
|
printf("%s\n"," -A, --alpha=Alpha Set alpha for Gamma ASRV");
|
|
printf("%s\n"," -O, --optimizeAlpha Optimize alpha for Gamma ASRV (default=off)");
|
|
printf("%s\n"," -C, --categories=INT Number of categories to use with descrete Gamma \n ASRV (default=`8')");
|
|
printf("%s\n"," --laguerre Use Laguerre approximation of Gamma - CURRENTLY \n NOT IMPLIMENTED (default=off)");
|
|
printf("%s\n","\n Group: Model\n Model type");
|
|
printf("%s\n"," --day Use 'day' model");
|
|
printf("%s\n"," --jtt Use 'jtt' model (default)");
|
|
printf("%s\n"," --rev Use 'rev' model");
|
|
printf("%s\n"," --wag Use 'wag' model");
|
|
printf("%s\n"," --cprev Use 'cprev' model");
|
|
printf("%s\n"," --nucjc Use nucleic acid JC model");
|
|
printf("%s\n"," --aaJC Use amino acid JC model");
|
|
printf("%s\n"," --k2p Use 'k2p' model");
|
|
printf("%s\n"," --hky Use 'k2p' model");
|
|
printf("%s\n"," --modelfile=NAME Use user input file as model");
|
|
printf("%s\n","\nLog Options:");
|
|
printf("%s\n"," -v, --verbose=INT Log report level (verbose) (default=`1')");
|
|
printf("%s\n"," -l, --Logfile=FILENAME Log output file name (default=`-')");
|
|
|
|
}
|
|
|
|
void
|
|
semphy_cmdline_parser_init (struct semphy_args_info *args_info)
|
|
{
|
|
clear_given (args_info);
|
|
clear_args (args_info);
|
|
}
|
|
|
|
void
|
|
semphy_cmdline_parser_free (struct semphy_args_info *args_info)
|
|
{
|
|
|
|
if (args_info->BPfile_arg)
|
|
{
|
|
free (args_info->BPfile_arg); /* free previous argument */
|
|
args_info->BPfile_arg = 0;
|
|
}
|
|
if (args_info->sequence_arg)
|
|
{
|
|
free (args_info->sequence_arg); /* free previous argument */
|
|
args_info->sequence_arg = 0;
|
|
}
|
|
if (args_info->tree_arg)
|
|
{
|
|
free (args_info->tree_arg); /* free previous argument */
|
|
args_info->tree_arg = 0;
|
|
}
|
|
if (args_info->constraint_arg)
|
|
{
|
|
free (args_info->constraint_arg); /* free previous argument */
|
|
args_info->constraint_arg = 0;
|
|
}
|
|
if (args_info->outputfile_arg)
|
|
{
|
|
free (args_info->outputfile_arg); /* free previous argument */
|
|
args_info->outputfile_arg = 0;
|
|
}
|
|
if (args_info->treeoutputfile_arg)
|
|
{
|
|
free (args_info->treeoutputfile_arg); /* free previous argument */
|
|
args_info->treeoutputfile_arg = 0;
|
|
}
|
|
if (args_info->ACGprob_arg)
|
|
{
|
|
free (args_info->ACGprob_arg); /* free previous argument */
|
|
args_info->ACGprob_arg = 0;
|
|
}
|
|
if (args_info->modelfile_arg)
|
|
{
|
|
free (args_info->modelfile_arg); /* free previous argument */
|
|
args_info->modelfile_arg = 0;
|
|
}
|
|
if (args_info->Logfile_arg)
|
|
{
|
|
free (args_info->Logfile_arg); /* free previous argument */
|
|
args_info->Logfile_arg = 0;
|
|
}
|
|
|
|
clear_given (args_info);
|
|
}
|
|
|
|
/* gengetopt_strdup() */
|
|
/* strdup.c replacement of strdup, which is not standard */
|
|
char *
|
|
gengetopt_strdup (const char *s)
|
|
{
|
|
char *result = NULL;
|
|
if (!s)
|
|
return result;
|
|
|
|
result = (char*)malloc(strlen(s) + 1);
|
|
if (result == (char*)0)
|
|
return (char*)0;
|
|
strcpy(result, s);
|
|
return result;
|
|
}
|
|
|
|
static void
|
|
reset_group_Model(struct semphy_args_info *args_info);
|
|
|
|
static void
|
|
reset_group_Model(struct semphy_args_info *args_info)
|
|
{
|
|
if (! args_info->Model_group_counter)
|
|
return;
|
|
|
|
args_info->day_given = 0 ;
|
|
args_info->jtt_given = 0 ;
|
|
args_info->rev_given = 0 ;
|
|
args_info->wag_given = 0 ;
|
|
args_info->cprev_given = 0 ;
|
|
args_info->nucjc_given = 0 ;
|
|
args_info->aaJC_given = 0 ;
|
|
args_info->k2p_given = 0 ;
|
|
args_info->hky_given = 0 ;
|
|
|
|
args_info->Model_group_counter = 0;
|
|
}
|
|
|
|
int
|
|
semphy_cmdline_parser (int argc, char * const *argv, struct semphy_args_info *args_info)
|
|
{
|
|
return semphy_cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
|
|
}
|
|
|
|
int
|
|
semphy_cmdline_parser2 (int argc, char * const *argv, struct semphy_args_info *args_info, int override, int initialize, int check_required)
|
|
{
|
|
int result;
|
|
|
|
result = semphy_cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL);
|
|
|
|
if (result == EXIT_FAILURE)
|
|
{
|
|
semphy_cmdline_parser_free (args_info);
|
|
exit (EXIT_FAILURE);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
int
|
|
semphy_cmdline_parser_required (struct semphy_args_info *args_info, const char *prog_name)
|
|
{
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|
|
int
|
|
semphy_cmdline_parser_internal (int argc, char * const *argv, struct semphy_args_info *args_info, int override, int initialize, int check_required, const char *additional_error)
|
|
{
|
|
int c; /* Character of the parsed option. */
|
|
|
|
int error = 0;
|
|
struct semphy_args_info local_args_info;
|
|
|
|
if (initialize)
|
|
semphy_cmdline_parser_init (args_info);
|
|
|
|
semphy_cmdline_parser_init (&local_args_info);
|
|
|
|
optarg = 0;
|
|
optind = 1;
|
|
opterr = 1;
|
|
optopt = '?';
|
|
|
|
while (1)
|
|
{
|
|
int option_index = 0;
|
|
char *stop_char;
|
|
|
|
static struct option long_options[] = {
|
|
{ "help", 0, NULL, 'h' },
|
|
{ "version", 0, NULL, 'V' },
|
|
{ "SEMPHY", 0, NULL, 'S' },
|
|
{ "bbl", 0, NULL, 'n' },
|
|
{ "likelihood", 0, NULL, 'L' },
|
|
{ "PerPosLike", 0, NULL, 'P' },
|
|
{ "PerPosPosterior", 0, NULL, 'B' },
|
|
{ "NJ", 0, NULL, 'J' },
|
|
{ "rate", 0, NULL, 'R' },
|
|
{ "max-semphy-iter", 1, NULL, 'M' },
|
|
{ "max-bbl-iter", 1, NULL, 'b' },
|
|
{ "dont-use-NJ", 0, NULL, 'N' },
|
|
{ "BPrepeats", 1, NULL, 0 },
|
|
{ "BPfile", 1, NULL, 0 },
|
|
{ "BPconsensus", 1, NULL, 0 },
|
|
{ "BPonUserTree", 0, NULL, 0 },
|
|
{ "ADVBBLEpsilinLikeToll", 1, NULL, 0 },
|
|
{ "ADVNumOfBBLIterInBBLPlusAlpha", 1, NULL, 0 },
|
|
{ "ADVNoPost", 0, NULL, 0 },
|
|
{ "consurf", 0, NULL, 0 },
|
|
{ "sequence", 1, NULL, 's' },
|
|
{ "tree", 1, NULL, 't' },
|
|
{ "constraint", 1, NULL, 'c' },
|
|
{ "outputfile", 1, NULL, 'o' },
|
|
{ "treeoutputfile", 1, NULL, 'T' },
|
|
{ "gaps", 0, NULL, 'g' },
|
|
{ "seed", 1, NULL, 'r' },
|
|
{ "alphabet", 1, NULL, 'a' },
|
|
{ "ratio", 1, NULL, 'z' },
|
|
{ "ACGprob", 1, NULL, 'p' },
|
|
{ "inputRate", 1, NULL, 0 },
|
|
{ "homogeneous", 0, NULL, 'H' },
|
|
{ "alpha", 1, NULL, 'A' },
|
|
{ "optimizeAlpha", 0, NULL, 'O' },
|
|
{ "categories", 1, NULL, 'C' },
|
|
{ "laguerre", 0, NULL, 0 },
|
|
{ "day", 0, NULL, 0 },
|
|
{ "jtt", 0, NULL, 0 },
|
|
{ "rev", 0, NULL, 0 },
|
|
{ "wag", 0, NULL, 0 },
|
|
{ "cprev", 0, NULL, 0 },
|
|
{ "nucjc", 0, NULL, 0 },
|
|
{ "aaJC", 0, NULL, 0 },
|
|
{ "k2p", 0, NULL, 0 },
|
|
{ "hky", 0, NULL, 0 },
|
|
{ "modelfile", 1, NULL, 0 },
|
|
{ "verbose", 1, NULL, 'v' },
|
|
{ "Logfile", 1, NULL, 'l' },
|
|
{ NULL, 0, NULL, 0 }
|
|
};
|
|
|
|
stop_char = 0;
|
|
c = getopt_long (argc, argv, "hVSnLPBJRM:b:Ns:t:c:o:T:gr:a:z:p:HA:OC:v:l:", long_options, &option_index);
|
|
|
|
if (c == -1) break; /* Exit from `while (1)' loop. */
|
|
|
|
switch (c)
|
|
{
|
|
case 'h': /* Print help and exit. */
|
|
semphy_cmdline_parser_print_help ();
|
|
semphy_cmdline_parser_free (&local_args_info);
|
|
exit (EXIT_SUCCESS);
|
|
|
|
case 'V': /* Print version and exit. */
|
|
semphy_cmdline_parser_print_version ();
|
|
semphy_cmdline_parser_free (&local_args_info);
|
|
exit (EXIT_SUCCESS);
|
|
|
|
case 'S': /* Do SEMPHY step. */
|
|
if (local_args_info.SEMPHY_given)
|
|
{
|
|
fprintf (stderr, "%s: `--SEMPHY' (`-S') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->SEMPHY_given && ! override)
|
|
continue;
|
|
local_args_info.SEMPHY_given = 1;
|
|
args_info->SEMPHY_given = 1;
|
|
args_info->SEMPHY_flag = !(args_info->SEMPHY_flag);
|
|
break;
|
|
|
|
case 'n': /* Only optimize branch length. */
|
|
if (local_args_info.bbl_given)
|
|
{
|
|
fprintf (stderr, "%s: `--bbl' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->bbl_given && ! override)
|
|
continue;
|
|
local_args_info.bbl_given = 1;
|
|
args_info->bbl_given = 1;
|
|
args_info->bbl_flag = !(args_info->bbl_flag);
|
|
break;
|
|
|
|
case 'L': /* Compute likelihood for fixed tree. */
|
|
if (local_args_info.likelihood_given)
|
|
{
|
|
fprintf (stderr, "%s: `--likelihood' (`-L') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->likelihood_given && ! override)
|
|
continue;
|
|
local_args_info.likelihood_given = 1;
|
|
args_info->likelihood_given = 1;
|
|
args_info->likelihood_flag = !(args_info->likelihood_flag);
|
|
break;
|
|
|
|
case 'P': /* Compute likelihood per position for a fixed tree. */
|
|
if (local_args_info.PerPosLike_given)
|
|
{
|
|
fprintf (stderr, "%s: `--PerPosLike' (`-P') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->PerPosLike_given && ! override)
|
|
continue;
|
|
local_args_info.PerPosLike_given = 1;
|
|
args_info->PerPosLike_given = 1;
|
|
args_info->PerPosLike_flag = !(args_info->PerPosLike_flag);
|
|
break;
|
|
|
|
case 'B': /* Compute likelihood per position and Bayesian posterior. */
|
|
if (local_args_info.PerPosPosterior_given)
|
|
{
|
|
fprintf (stderr, "%s: `--PerPosPosterior' (`-B') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->PerPosPosterior_given && ! override)
|
|
continue;
|
|
local_args_info.PerPosPosterior_given = 1;
|
|
args_info->PerPosPosterior_given = 1;
|
|
args_info->PerPosPosterior_flag = !(args_info->PerPosPosterior_flag);
|
|
break;
|
|
|
|
case 'J': /* compute NJ tree only. */
|
|
if (local_args_info.NJ_given)
|
|
{
|
|
fprintf (stderr, "%s: `--NJ' (`-J') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->NJ_given && ! override)
|
|
continue;
|
|
local_args_info.NJ_given = 1;
|
|
args_info->NJ_given = 1;
|
|
args_info->NJ_flag = !(args_info->NJ_flag);
|
|
break;
|
|
|
|
case 'R': /* optimize rate of gene. */
|
|
if (local_args_info.rate_given)
|
|
{
|
|
fprintf (stderr, "%s: `--rate' (`-R') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->rate_given && ! override)
|
|
continue;
|
|
local_args_info.rate_given = 1;
|
|
args_info->rate_given = 1;
|
|
args_info->rate_flag = !(args_info->rate_flag);
|
|
break;
|
|
|
|
case 'M': /* Max number of SEM iterations. */
|
|
if (local_args_info.max_semphy_iter_given)
|
|
{
|
|
fprintf (stderr, "%s: `--max-semphy-iter' (`-M') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->max_semphy_iter_given && ! override)
|
|
continue;
|
|
local_args_info.max_semphy_iter_given = 1;
|
|
args_info->max_semphy_iter_given = 1;
|
|
args_info->max_semphy_iter_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'b': /* Max number of BBL iterations. */
|
|
if (local_args_info.max_bbl_iter_given)
|
|
{
|
|
fprintf (stderr, "%s: `--max-bbl-iter' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->max_bbl_iter_given && ! override)
|
|
continue;
|
|
local_args_info.max_bbl_iter_given = 1;
|
|
args_info->max_bbl_iter_given = 1;
|
|
args_info->max_bbl_iter_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'N': /* Do not Use NJ to break stars in treeRearrange. */
|
|
if (local_args_info.dont_use_NJ_given)
|
|
{
|
|
fprintf (stderr, "%s: `--dont-use-NJ' (`-N') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->dont_use_NJ_given && ! override)
|
|
continue;
|
|
local_args_info.dont_use_NJ_given = 1;
|
|
args_info->dont_use_NJ_given = 1;
|
|
args_info->dont_use_NJ_flag = !(args_info->dont_use_NJ_flag);
|
|
break;
|
|
|
|
case 's': /* Sequence file name. */
|
|
if (local_args_info.sequence_given)
|
|
{
|
|
fprintf (stderr, "%s: `--sequence' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->sequence_given && ! override)
|
|
continue;
|
|
local_args_info.sequence_given = 1;
|
|
args_info->sequence_given = 1;
|
|
if (args_info->sequence_arg)
|
|
free (args_info->sequence_arg); /* free previous string */
|
|
args_info->sequence_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 't': /* Tree file name. */
|
|
if (local_args_info.tree_given)
|
|
{
|
|
fprintf (stderr, "%s: `--tree' (`-t') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->tree_given && ! override)
|
|
continue;
|
|
local_args_info.tree_given = 1;
|
|
args_info->tree_given = 1;
|
|
if (args_info->tree_arg)
|
|
free (args_info->tree_arg); /* free previous string */
|
|
args_info->tree_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 'c': /* Constraint Tree file name. */
|
|
if (local_args_info.constraint_given)
|
|
{
|
|
fprintf (stderr, "%s: `--constraint' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->constraint_given && ! override)
|
|
continue;
|
|
local_args_info.constraint_given = 1;
|
|
args_info->constraint_given = 1;
|
|
if (args_info->constraint_arg)
|
|
free (args_info->constraint_arg); /* free previous string */
|
|
args_info->constraint_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 'o': /* Output file. */
|
|
if (local_args_info.outputfile_given)
|
|
{
|
|
fprintf (stderr, "%s: `--outputfile' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->outputfile_given && ! override)
|
|
continue;
|
|
local_args_info.outputfile_given = 1;
|
|
args_info->outputfile_given = 1;
|
|
if (args_info->outputfile_arg)
|
|
free (args_info->outputfile_arg); /* free previous string */
|
|
args_info->outputfile_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 'T': /* Tree output file. */
|
|
if (local_args_info.treeoutputfile_given)
|
|
{
|
|
fprintf (stderr, "%s: `--treeoutputfile' (`-T') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->treeoutputfile_given && ! override)
|
|
continue;
|
|
local_args_info.treeoutputfile_given = 1;
|
|
args_info->treeoutputfile_given = 1;
|
|
if (args_info->treeoutputfile_arg)
|
|
free (args_info->treeoutputfile_arg); /* free previous string */
|
|
args_info->treeoutputfile_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 'g': /* Remove positions with gaps. */
|
|
if (local_args_info.gaps_given)
|
|
{
|
|
fprintf (stderr, "%s: `--gaps' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->gaps_given && ! override)
|
|
continue;
|
|
local_args_info.gaps_given = 1;
|
|
args_info->gaps_given = 1;
|
|
args_info->gaps_flag = !(args_info->gaps_flag);
|
|
break;
|
|
|
|
case 'r': /* Seed random number generator. */
|
|
if (local_args_info.seed_given)
|
|
{
|
|
fprintf (stderr, "%s: `--seed' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->seed_given && ! override)
|
|
continue;
|
|
local_args_info.seed_given = 1;
|
|
args_info->seed_given = 1;
|
|
args_info->seed_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'a': /* Alphabet Size. */
|
|
if (local_args_info.alphabet_given)
|
|
{
|
|
fprintf (stderr, "%s: `--alphabet' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->alphabet_given && ! override)
|
|
continue;
|
|
local_args_info.alphabet_given = 1;
|
|
args_info->alphabet_given = 1;
|
|
args_info->alphabet_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'z': /* Transition/Transversion ratio. */
|
|
if (local_args_info.ratio_given)
|
|
{
|
|
fprintf (stderr, "%s: `--ratio' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->ratio_given && ! override)
|
|
continue;
|
|
local_args_info.ratio_given = 1;
|
|
args_info->ratio_given = 1;
|
|
args_info->ratio_arg = (float)strtod (optarg, NULL);
|
|
break;
|
|
|
|
case 'p': /* User input nucleotide frequencies. String separated list for A,C,G. */
|
|
if (local_args_info.ACGprob_given)
|
|
{
|
|
fprintf (stderr, "%s: `--ACGprob' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->ACGprob_given && ! override)
|
|
continue;
|
|
local_args_info.ACGprob_given = 1;
|
|
args_info->ACGprob_given = 1;
|
|
if (args_info->ACGprob_arg)
|
|
free (args_info->ACGprob_arg); /* free previous string */
|
|
args_info->ACGprob_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
case 'H': /* Don't use Gamma ASRV. */
|
|
if (local_args_info.homogeneous_given)
|
|
{
|
|
fprintf (stderr, "%s: `--homogeneous' (`-H') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->homogeneous_given && ! override)
|
|
continue;
|
|
local_args_info.homogeneous_given = 1;
|
|
args_info->homogeneous_given = 1;
|
|
args_info->homogeneous_flag = !(args_info->homogeneous_flag);
|
|
break;
|
|
|
|
case 'A': /* Set alpha for Gamma ASRV. */
|
|
if (local_args_info.alpha_given)
|
|
{
|
|
fprintf (stderr, "%s: `--alpha' (`-A') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->alpha_given && ! override)
|
|
continue;
|
|
local_args_info.alpha_given = 1;
|
|
args_info->alpha_given = 1;
|
|
args_info->alpha_arg = (float)strtod (optarg, NULL);
|
|
break;
|
|
|
|
case 'O': /* Optimize alpha for Gamma ASRV. */
|
|
if (local_args_info.optimizeAlpha_given)
|
|
{
|
|
fprintf (stderr, "%s: `--optimizeAlpha' (`-O') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->optimizeAlpha_given && ! override)
|
|
continue;
|
|
local_args_info.optimizeAlpha_given = 1;
|
|
args_info->optimizeAlpha_given = 1;
|
|
args_info->optimizeAlpha_flag = !(args_info->optimizeAlpha_flag);
|
|
break;
|
|
|
|
case 'C': /* Number of categories to use with descrete Gamma ASRV. */
|
|
if (local_args_info.categories_given)
|
|
{
|
|
fprintf (stderr, "%s: `--categories' (`-C') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->categories_given && ! override)
|
|
continue;
|
|
local_args_info.categories_given = 1;
|
|
args_info->categories_given = 1;
|
|
args_info->categories_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'v': /* Log report level (verbose). */
|
|
if (local_args_info.verbose_given)
|
|
{
|
|
fprintf (stderr, "%s: `--verbose' (`-v') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->verbose_given && ! override)
|
|
continue;
|
|
local_args_info.verbose_given = 1;
|
|
args_info->verbose_given = 1;
|
|
args_info->verbose_arg = strtol (optarg,&stop_char,0);
|
|
break;
|
|
|
|
case 'l': /* Log output file name. */
|
|
if (local_args_info.Logfile_given)
|
|
{
|
|
fprintf (stderr, "%s: `--Logfile' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->Logfile_given && ! override)
|
|
continue;
|
|
local_args_info.Logfile_given = 1;
|
|
args_info->Logfile_given = 1;
|
|
if (args_info->Logfile_arg)
|
|
free (args_info->Logfile_arg); /* free previous string */
|
|
args_info->Logfile_arg = gengetopt_strdup (optarg);
|
|
break;
|
|
|
|
|
|
case 0: /* Long option with no short option */
|
|
/* Use bootstrap and set number of repeats. */
|
|
if (strcmp (long_options[option_index].name, "BPrepeats") == 0)
|
|
{
|
|
if (local_args_info.BPrepeats_given)
|
|
{
|
|
fprintf (stderr, "%s: `--BPrepeats' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->BPrepeats_given && ! override)
|
|
continue;
|
|
local_args_info.BPrepeats_given = 1;
|
|
args_info->BPrepeats_given = 1;
|
|
args_info->BPrepeats_arg = strtol (optarg,&stop_char,0);
|
|
}
|
|
/* Use bootstrap and read the weights from a file. */
|
|
else if (strcmp (long_options[option_index].name, "BPfile") == 0)
|
|
{
|
|
if (local_args_info.BPfile_given)
|
|
{
|
|
fprintf (stderr, "%s: `--BPfile' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->BPfile_given && ! override)
|
|
continue;
|
|
local_args_info.BPfile_given = 1;
|
|
args_info->BPfile_given = 1;
|
|
if (args_info->BPfile_arg)
|
|
free (args_info->BPfile_arg); /* free previous string */
|
|
args_info->BPfile_arg = gengetopt_strdup (optarg);
|
|
}
|
|
/* Use bootstrap and compute a Consensus tree. */
|
|
else if (strcmp (long_options[option_index].name, "BPconsensus") == 0)
|
|
{
|
|
if (local_args_info.BPconsensus_given)
|
|
{
|
|
fprintf (stderr, "%s: `--BPconsensus' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->BPconsensus_given && ! override)
|
|
continue;
|
|
local_args_info.BPconsensus_given = 1;
|
|
args_info->BPconsensus_given = 1;
|
|
args_info->BPconsensus_arg = strtol (optarg,&stop_char,0);
|
|
}
|
|
/* Use compute support for user provided tree. */
|
|
else if (strcmp (long_options[option_index].name, "BPonUserTree") == 0)
|
|
{
|
|
if (local_args_info.BPonUserTree_given)
|
|
{
|
|
fprintf (stderr, "%s: `--BPonUserTree' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->BPonUserTree_given && ! override)
|
|
continue;
|
|
local_args_info.BPonUserTree_given = 1;
|
|
args_info->BPonUserTree_given = 1;
|
|
args_info->BPonUserTree_flag = !(args_info->BPonUserTree_flag);
|
|
}
|
|
else if (strcmp (long_options[option_index].name, "ADVBBLEpsilinLikeToll") == 0)
|
|
{
|
|
if (local_args_info.ADVBBLEpsilinLikeToll_given)
|
|
{
|
|
fprintf (stderr, "%s: `--ADVBBLEpsilinLikeToll' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->ADVBBLEpsilinLikeToll_given && ! override)
|
|
continue;
|
|
local_args_info.ADVBBLEpsilinLikeToll_given = 1;
|
|
args_info->ADVBBLEpsilinLikeToll_given = 1;
|
|
args_info->ADVBBLEpsilinLikeToll_arg = (float)strtod (optarg, NULL);
|
|
}
|
|
else if (strcmp (long_options[option_index].name, "ADVNumOfBBLIterInBBLPlusAlpha") == 0)
|
|
{
|
|
if (local_args_info.ADVNumOfBBLIterInBBLPlusAlpha_given)
|
|
{
|
|
fprintf (stderr, "%s: `--ADVNumOfBBLIterInBBLPlusAlpha' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->ADVNumOfBBLIterInBBLPlusAlpha_given && ! override)
|
|
continue;
|
|
local_args_info.ADVNumOfBBLIterInBBLPlusAlpha_given = 1;
|
|
args_info->ADVNumOfBBLIterInBBLPlusAlpha_given = 1;
|
|
args_info->ADVNumOfBBLIterInBBLPlusAlpha_arg = strtol (optarg,&stop_char,0);
|
|
}
|
|
else if (strcmp (long_options[option_index].name, "ADVNoPost") == 0)
|
|
{
|
|
if (local_args_info.ADVNoPost_given)
|
|
{
|
|
fprintf (stderr, "%s: `--ADVNoPost' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->ADVNoPost_given && ! override)
|
|
continue;
|
|
local_args_info.ADVNoPost_given = 1;
|
|
args_info->ADVNoPost_given = 1;
|
|
args_info->ADVNoPost_flag = !(args_info->ADVNoPost_flag);
|
|
}
|
|
else if (strcmp (long_options[option_index].name, "consurf") == 0)
|
|
{
|
|
if (local_args_info.consurf_given)
|
|
{
|
|
fprintf (stderr, "%s: `--consurf' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->consurf_given && ! override)
|
|
continue;
|
|
local_args_info.consurf_given = 1;
|
|
args_info->consurf_given = 1;
|
|
args_info->consurf_flag = !(args_info->consurf_flag);
|
|
}
|
|
/* Set External globalRate. */
|
|
else if (strcmp (long_options[option_index].name, "inputRate") == 0)
|
|
{
|
|
if (local_args_info.inputRate_given)
|
|
{
|
|
fprintf (stderr, "%s: `--inputRate' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->inputRate_given && ! override)
|
|
continue;
|
|
local_args_info.inputRate_given = 1;
|
|
args_info->inputRate_given = 1;
|
|
args_info->inputRate_arg = (float)strtod (optarg, NULL);
|
|
}
|
|
/* Use Laguerre approximation of Gamma - CURRENTLY NOT IMPLIMENTED. */
|
|
else if (strcmp (long_options[option_index].name, "laguerre") == 0)
|
|
{
|
|
if (local_args_info.laguerre_given)
|
|
{
|
|
fprintf (stderr, "%s: `--laguerre' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->laguerre_given && ! override)
|
|
continue;
|
|
local_args_info.laguerre_given = 1;
|
|
args_info->laguerre_given = 1;
|
|
args_info->laguerre_flag = !(args_info->laguerre_flag);
|
|
}
|
|
/* Use 'day' model. */
|
|
else if (strcmp (long_options[option_index].name, "day") == 0)
|
|
{
|
|
if (local_args_info.day_given)
|
|
{
|
|
fprintf (stderr, "%s: `--day' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->day_given && ! override)
|
|
continue;
|
|
local_args_info.day_given = 1;
|
|
args_info->day_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'jtt' model (default). */
|
|
else if (strcmp (long_options[option_index].name, "jtt") == 0)
|
|
{
|
|
if (local_args_info.jtt_given)
|
|
{
|
|
fprintf (stderr, "%s: `--jtt' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->jtt_given && ! override)
|
|
continue;
|
|
local_args_info.jtt_given = 1;
|
|
args_info->jtt_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'rev' model. */
|
|
else if (strcmp (long_options[option_index].name, "rev") == 0)
|
|
{
|
|
if (local_args_info.rev_given)
|
|
{
|
|
fprintf (stderr, "%s: `--rev' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->rev_given && ! override)
|
|
continue;
|
|
local_args_info.rev_given = 1;
|
|
args_info->rev_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'wag' model. */
|
|
else if (strcmp (long_options[option_index].name, "wag") == 0)
|
|
{
|
|
if (local_args_info.wag_given)
|
|
{
|
|
fprintf (stderr, "%s: `--wag' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->wag_given && ! override)
|
|
continue;
|
|
local_args_info.wag_given = 1;
|
|
args_info->wag_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'cprev' model. */
|
|
else if (strcmp (long_options[option_index].name, "cprev") == 0)
|
|
{
|
|
if (local_args_info.cprev_given)
|
|
{
|
|
fprintf (stderr, "%s: `--cprev' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->cprev_given && ! override)
|
|
continue;
|
|
local_args_info.cprev_given = 1;
|
|
args_info->cprev_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use nucleic acid JC model. */
|
|
else if (strcmp (long_options[option_index].name, "nucjc") == 0)
|
|
{
|
|
if (local_args_info.nucjc_given)
|
|
{
|
|
fprintf (stderr, "%s: `--nucjc' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->nucjc_given && ! override)
|
|
continue;
|
|
local_args_info.nucjc_given = 1;
|
|
args_info->nucjc_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use amino acid JC model. */
|
|
else if (strcmp (long_options[option_index].name, "aaJC") == 0)
|
|
{
|
|
if (local_args_info.aaJC_given)
|
|
{
|
|
fprintf (stderr, "%s: `--aaJC' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->aaJC_given && ! override)
|
|
continue;
|
|
local_args_info.aaJC_given = 1;
|
|
args_info->aaJC_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'k2p' model. */
|
|
else if (strcmp (long_options[option_index].name, "k2p") == 0)
|
|
{
|
|
if (local_args_info.k2p_given)
|
|
{
|
|
fprintf (stderr, "%s: `--k2p' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->k2p_given && ! override)
|
|
continue;
|
|
local_args_info.k2p_given = 1;
|
|
args_info->k2p_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use 'k2p' model. */
|
|
else if (strcmp (long_options[option_index].name, "hky") == 0)
|
|
{
|
|
if (local_args_info.hky_given)
|
|
{
|
|
fprintf (stderr, "%s: `--hky' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->hky_given && ! override)
|
|
continue;
|
|
local_args_info.hky_given = 1;
|
|
args_info->hky_given = 1;
|
|
if (args_info->Model_group_counter && override)
|
|
reset_group_Model (args_info);
|
|
args_info->Model_group_counter += 1;
|
|
break;
|
|
}
|
|
/* Use user input file as model. */
|
|
else if (strcmp (long_options[option_index].name, "modelfile") == 0)
|
|
{
|
|
if (local_args_info.modelfile_given)
|
|
{
|
|
fprintf (stderr, "%s: `--modelfile' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
|
|
goto failure;
|
|
}
|
|
if (args_info->modelfile_given && ! override)
|
|
continue;
|
|
local_args_info.modelfile_given = 1;
|
|
args_info->modelfile_given = 1;
|
|
if (args_info->modelfile_arg)
|
|
free (args_info->modelfile_arg); /* free previous string */
|
|
args_info->modelfile_arg = gengetopt_strdup (optarg);
|
|
}
|
|
|
|
break;
|
|
case '?': /* Invalid option. */
|
|
/* `getopt_long' already printed an error message. */
|
|
goto failure;
|
|
|
|
default: /* bug: option not considered. */
|
|
fprintf (stderr, "%s: option unknown: %c%s\n", SEMPHY_CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
|
|
abort ();
|
|
} /* switch */
|
|
} /* while */
|
|
|
|
if ( args_info->Model_group_counter > 1)
|
|
{
|
|
fprintf (stderr, "%s: %d options of group Model were given. At most one is required.%s\n", argv[0], args_info->Model_group_counter, (additional_error ? additional_error : ""));
|
|
error = 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
semphy_cmdline_parser_free (&local_args_info);
|
|
|
|
if ( error )
|
|
return (EXIT_FAILURE);
|
|
|
|
return 0;
|
|
|
|
failure:
|
|
|
|
semphy_cmdline_parser_free (&local_args_info);
|
|
return (EXIT_FAILURE);
|
|
}
|