#!/usr/bin/env bash


if test "$#" -eq 0; then
cat << "EOF"
START OF LOG FILE
USAGE:	fastml [-options] 
 |-------------------------------- HELP: -------------------------------------+
 | VALUES IN [] ARE DEFAULT VALUES                                            |
 |-h   help                                                                   |
 |-s sequence input file (for example use -s D:\mySequences\seq.txt )       |
 |-t tree input file                                                          |
 |   (if tree is not given, a neighbor joining tree is computed).             |
 |-g Assume among site rate variation model (Gamma) [By default the program   |
 |   will assume an homogenous model. very fast, but less accurate!]          |
|-m     model name                                                           |
|-mj    [JTT]                                                                |
|-mr    mtREV (for mitochondrial genomes)                                    |
|-md    DAY                                                                  |
|-mw    WAG                                                                  |
|-mc    cpREV (for chloroplasts genomes)                                     |
|-ma    Jukes and Cantor (JC) for amino acids                                |
|-mn    Jukes and Cantor (JC) for nucleotides                                |
 +----------------------------------------------------------------------------+
 |Controling the output options:                                              |
 |-x   tree file output in Newick format [tree.newick.txt]                    |
 |-y   tree file output in ANCESTOR format [tree.ancestor.txt]                |
 |-j   joint sequences output file [seq.joint.txt]                            |
 |-k   marginal sequences output file [seq.marginal.txt]                      |
 |-d   joint probabilities output file [prob.joint.txt]                       |
 |-e   marginal probabilities output file [prob.marginal.txt]                 |
 |-q   ancestral sequences output format.  -qc = [CLUSTAL], -qf = FASTA       |
 |     -qm = MOLPHY, -qs = MASE, -qp = PHLIYP, -qn = Nexus                    |
 +----------------------------------------------------------------------------+
 |Advances options:                                                           |
 |-a   Treshold for computing again marginal probabilities [0.9]              |
 |-b   Do not optimize branch lengths on starting tree                        |
 |     [by default branches and alpha are ML optimized from the data]         |
 |-c   number of discrete Gamma categories for the gamma distribution [8]     |
 |-f   don't compute Joint reconstruction (good if the branch and bound       |
 |     algorithm takes too much time, and the goal is to compute the          |
 |     marginal reconstruction with Gamma).                                   |
 |-z   The bound used. -zs - bound based on sum. -zm based on max. -zb [both] |
 |-p   user alpha parameter of the gamma distribution [if alpha is not given, |
 |     alpha and branches will be evaluated from the data (override -b)       |
 +----------------------------------------------------------------------------+
EOF

else

cat << "PARAMS"
START OF LOG FILE
END OF LOG FILE
Using homogenous model (no among site rate variation)
Nucleotide substitution model is General time Reversible

Error - unable to open tree file xxx
System Error: No such file or directory
Assertion failed: (0), function reportError, file errorMsg.cpp, line 41.
Abort trap: 6
PARAMS
fi