<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
	<head>
		<title>Phylobayes MPI on ACCESS (Restart)</title>
		<version>1.8c</version>
		<description>Restart a PhyloBayes MPI run on XSEDE</description>
		<authors>Nicolas Lartillot, Thomas Lepage, and Samuel Blanquart</authors>
		<reference>
Nicolas Lartillot, Thomas Lepage, and Samuel Blanquart. 2009. PhyloBayes 3: a Bayesian software package for phylogenetic
reconstruction and molecular dating. Bioinformatics 25(17) 2286–2288. 
		</reference>
		<reference>Lartillot, N., Rodrigue, N., Stubbs, D., Richer, J. 2013. PhyloBayes MPI. Phylogenetic reconstruction
			with infinite mixtures of profiles in a parallel environment. Systematic Biology.</reference>
		<category>Phylogeny / Alignment</category>
	</head>
	<command>phylobayes_xsede_restart</command>
<!--
*****************************************************************************************************************************************
Created by Mark Miller for CSG, 7/3/2013 or thereabouts
***************************************************************************************************************************************** -->
<!-- The Phylobayes mpi program does not have a convergence criterion stop, so Bryan ceated a wrapper to introduce this notion.-->
<!-- Bryan's wrapper 
PHYLOBAYES MULTI-CHAIN AND CONVERGENCE CHECKING RUN SCRIPTS


****WARNING********WARNING*********WARNING*********WARNING*****WARNING*********WARNING*********WARNING*****
	(I had to separate double dashes with a space, because it breaks XML comments to have a double dash. However, do not be fooled
	by this notation, these are really double dashes!!)
****WARNING*********WARNING*********WARNING*********WARNING*****WARNING*********WARNING*********WARNING*****
	
1. Example Invocation	
PBMultiRun.bash - -seed 1024 -N 2 - -checkinterval 3600 - -burnin 500
- -acceptdiff 0.3 - -acceptsize 50 - -giveup 10000 - - -d INFILE.phy -cat
-gtr
	
2. Command Line Options of the Wrapper Script

	The command line is :

PBMultiRun.bash [wrapper options] - - <PB Flags, no -rnd and no chain-name>
The - - is required to tell the wrapper to stop interpreting flags and start seeing
uninterpreted PB flags. It is always required, even if no wrapper flags are provided.

All wrapper options must have a space separating the flag and the provided
value. (IE, - -*N2" will break things.)

Wrapper options are as follows:
- -seed: <INT> Base random seed to use. Each of the N chains will add its
id to that.

-N: <INT> The number of separate chains to run.

- -CHECKINTERVAL: <INT> The number of seconds to wait between
checks for convergence. Defaults to 30 minutes .

- -BURNIN: <INT> The number of cycles to exclude from convergence
checks. Default = 500.

- -ACCEPTDIFF: <FLOAT> The maximum \maxdiff" value to accept.
Default = 0.3, which is \acceptable" according to the PB Manual. (0.1 for
\very good".)
	
- -ACCEPTSIZE: <INT> The minimum number of effective samples re-
quired before convergence. Defaults to 50, which is \acceptable". (300 for
\very good".)
	
- -GIVEUP: <INT> The Minimum number of cycles before giving up if
\maxdiff" is still 1. (Indicating being stuck.) Defaults to 10000
	-->
<!-- Instructions for phylobayes mpi:
mpirun -np <n> pb_mpi -d <dataset> <chainname>
Here, <n> is the number of processes running in parallel. You could also use mpiexec instead
of mpirun. You cannot run pb_mpi with less than 2 processes (the parallelization scheme
involves a master and n1 slaves.)
	
Most clusters use Sun Grid Engine. In that case, you might need to write a script that
would probably look like the following:
	
#!/bin/bash
#
#PBS -l walltime=120:00:00
#PBS -l nodes=1:ppn=8
#PBS -o out
#PBS -e err
#PBS -j oe
#PBS -W umask=022
#PBS -r n
mpirun -n 8 pb_mpi -d datafile -cat -gtr chainname
and then send the script to the queue using qsub.

	
The -d option is for specifying the dataset. There are many other options for specifying
the model (see below). The default options are the CAT-GTR model with discrete gamma
(4 categories). Before starting, the chain will output a summary of the settings.
A series of files will be produced with a variety of extensions. The most important are:
<name>.treelist: list of sampled trees;
<name>.trace: the trace file, containing a few relevant summary statistics (log-likelihood,
total length of the tree, number of components in the mixture, etc).
<name>.chain (only if the -s option is used): this file contains the detailed parameter
configurations visited during the run and is used by readpb_mpi for computing poste-
rior averages. If the -s option is not used, then only posterior consensus trees can be
computed.

	4.1 pb mpi
	4.1.1 General options

	-d <datafile>
	option for specifying the multiple sequence alignment to be analyzed (see: Input Data Format
	section).
	
	-dc
	constant sites are removed.
	
	-t <treefile> (starting tree)
	forces the chain to start from the specified tree.
	
	-T <treefile> (constraint tree)
forces the chain to run under a fixed topology (as specified in the given file). In other words,
the chain only samples from the posterior distribution over all other parameters (branch
lengths, alpha parameter, etc.), conditional on the specified topology. This should be a
bifurcating tree (see Input Data Format section).
	
	-s
By default, the sampler only saves the trees explored during MCMC in the treelist file
(and the summary statistics in the trace file). This is enough for computing the consensus
tree but insufficient for estimating the continuous parameters of the model (e.g. site-specific
equilibrium frequency profiles) or for conducting posterior predictive tests or cross-validation
analyses. For this, you should save the detailed model configuration for each point visited
during the run using this -s option.
	
	-f
forces the program to overwrite an already existing chain with same name.
	
	-x <every> [<until>]
	14

	specifies the saving frequency and (optional) the number of points after which the chain
should stop. If this number is not specified, the chain runs \forever". By definition, -x
1 corresponds to the default saving frequency. In some cases, samples may be strongly
correlated, in which case, if disk space or access is limiting, it would make sense to save
points less frequently, say 10 times less often: to do this, you can use the -x 10 option.

4.1.2 Evolutionary models
	4.1.2.1 Rates across sites
	-dgam <n>
specifies n categories for the discrete gamma distribution. Setting n = 1 amounts to a model
without across-site variation in substitution rate.

	4.1.2.2 Relative exchangeabilities (exchange rates)

	-poisson
exchange rates are all equal to 1. The model is then a mixture of Poisson (F81) processes.

	-lg, -wag, -jtt, -mtrev, -mtzoa, -mtart
specify empirical exchangeabilities.

	-gtr
specifies a general time reversible matrix: exchangeabilities are free parameters, with prior
distribution a product of independent exponential distributions of mean 1.

	-rr <filename>
exchangeabilities are fixed to the values given in the specified file. The file should be for-
matted as follows:
[<ALPHABET>]
<rr1_2> <rr1_3> ... <rr1_20>
<rr2_3> <rr2_4> ... <rr2_20>
...
<rr18_19> <rr18_20>
<rr19_20>

You have to specify the order in which amino acids should be considered on the first line ([<ALPHABET>]),
with letters separated by spaces or tabs. This header should then be followed by the exchangeabilities in
the order specified (spaces, tabs or returns are equivalent: only the order matters).
	
4.1.2.3 Profile mixture

	-dp (or -cat)

	activates the Dirichlet process.

	-ncat <n>

	specifies a mixture of n components; the number of components is fixed whereas the
weights and profiles are treated as random variables. Fixing the number of components of
the mixture most often results in a poor mixing of the MCMC. The Dirichlet process usually
has a much better mixing behavior.

	-catfix <predef>
	
specifies a mixture of a set of pre-defined profiles (the weights are reestimated). <predef>
can be either one of the following keywords: C20, C30, C40, C50, C60, which correspond
to empirical profile mixture models (Quang et al., 2008); or WLSR5, which correspond to
the model of Wang et al. (2008). Note that this latter model actually defines 4 empirical
profiles, which are then combined with a fifth component made of the empirical frequencies
of the dataset.
	
	-catfix <filename>
	
specifies a mixture of a set of user-pre-defined profiles, where <filename> is the name of a
file containing a set of profiles specified as follows:
[<ALPHABET>]
<ncat>
<weight> <freq1> <freq2> ... <freq20>
<weight> <freq1> <freq2> ... <freq20>
...
where <ncat> is the number of profiles, and each line following this number should be a set of
21 real numbers, defining a weight, and then a profile of equilibrium frequencies (separated
by spaces or tabs). You should specify the order in which amino acids should be considered
on the first line ([<ALPHABET>]), with letters separated by spaces or tabs. Note that the
weights are there only for historical reasons { they are re-estimated anyway.

	4.1.2.4 Combining profiles and exchange rates Any set of exchange rates can be combined with any of the three settings for the mixture. But the same set of exchange rates
will be used by all components of the mixture.
	
For instance, -cat -gtr makes an infinite mixture model whose components differ by
their equilibrium frequencies but otherwise share the same set of relative exchange rates
(themselves considered as free parameters). As another example, -catfix WLSR5 -jtt defines
the Wang et al. (2008) model: a model with 5 components, each of which is a matrix
made from the relative exchange rates of the JTT matrix, combined with one of the 4
vectors of equilibrium frequencies defined by Wang et al. (2008), plus one vector of empirical
frequencies.
	
The default model is -cat -gtr.
	
	4.1.2.5 Mutation-selection models

	-mutsel
activates the mutation-selection model as described in Rodrigue et al. (2010) (codon align-
ments only).

	-mtvert
specifies the vertebrate mitochondrial code (the universal genetic code is the default).

*****************************************************************************************
	the wrapper takes care all the bpcomp and readpb options
*****************************************************************************************
4.2 bpcomp

	-x <burn-in> [<every> <until>]
Defines the burn-in, the sub-sampling frequency, and the size of the samples of trees to be
taken from the chains under comparison. By default, <burn-in> = 0, <every> = 1 and
<until> is equal to the size of the chain. Thus, for instance:

	-x 1000
defines a burn-in of 1000,

	-x 1000 10
a burn-in of 1000, taking one every 10 trees, up to the end of each chain, and

	-x 1000 10 11000
a burn-in of 1000, taking one every 10 trees, up to the 11 000th point of the chains (or less,
if the chains are shorter). If the chain is long enough, this implies a sample size of 1000.

	-o <basename>
outputs the results of the comparison in files with the specified basename combined with
several extensions:
 <basename>.bpcomp: summary of the comparison;
 <basename>.bplist: tabulated list of bipartitions (splits) sorted by decreasing dis-
crepancy between the chains;
 <basename>.con.tre: consensus tree based on the merged bipartition list.
	
	-c <cutoff>
tunes the cutoff for the majority rule consensus (posterior probability support under which
nodes are collapsed in the final consensus tree). By default, the cutoff is equal to 0.5.
	
*****************************************************************************************
	the wrapper takes care all the bpcomp and readpb options
*****************************************************************************************
4.3 readpb mpi
	
	-x <burn-in> [<every> <until>]
Defines the burn-in, the sub-sampling frequency, and the size of the samples of trees to be
taken from the chains under comparison. By default, <burn-in> = 0, <every> = 1 and
<until> is equal to the size of the chain (see bpcomp).

	-rr
computes the mean posterior relative exchangeabilities (only if those are free parameters of
the model).

	-ss
computes the mean posterior site-specific state equilibrium frequencies (only under infinite
mixture models).

	-ppred
for each point of the chain (after burn-in), produces a data replicate simulated from the
posterior predictive distribution.

	-div
performs a posterior predictive diversity test: the test statistic is the mean diversity per
site (mean number of distinct amino-acid per sites); the observed value of this statistic is
computed on the true data, and compared with its null (posterior predictive) distribution
(see Lartillot et al., 2007)

	-comp
performs a posterior predictive test of compositional homogeneity: the test statistic is the
maximum square deviation between global and taxon-specific empirical frequencies; the ob-
served value of this statistic is computed on the true data, and compared with its null
(posterior predictive) distribution (see Blanquart and Lartillot, 2006)

	-cv [test_dataset]
computes a posterior mean cross-validation score. If D1 is the dataset used for running the
chain (the training set), D2 is the dataset specified after -cv (the test set) and M is the
model under which the chain was run, then what the program outputs is a Monte Carlo
estimate of ln p(D2 j D1;M) = Z p(D2 j ;M) p( j D1)d
where is the set of (global) parameters of the model. The cross-validation likelihood is a
measure of how well the model 'predicts' site patterns of D2 after it has 'learnt' its parameters
on D1. This measure can be computed for alternative models Mi, i = 1::K, and models
with higher score should in principle be preferred.

Cross validation needs to be replicated (cross-validation scores typically have a large
variability, depending on the exact columns that have been included in D1 and D2). If your
original data set is D, then you should produce random pairs D1 and D2, by randomly
sampling columns of D (without replacement), running pb_mpi separately on each replicate
of D1, and then running readpb_mpi with the -cv option (followed by the name of the
corresponding D2 test set) on each resulting chain (and all this for each model Mi).
The cross-validation score can then be averaged over the replicates for a given model.
Then, supposing that a model M1 has a higher average score than M2, the number of
replicates for which the score of M1 is indeed higher than the score of M2 can be considered
as a measure of the 'significance' of this preference for M1 over M2.
Typically, 10-fold cross-validation (such that D2 represents 10% and D1 90% of the
original dataset) has been used (e.g. Philippe et al., 2011), and ten replicates have been run
(although ideally, 100 replicates would certainly be more adequate). However, alternative
schemes are possible. In particular, for faster computation in the case of very large datasets,
cross-validation schemes in which the size of D1 and D2 combined together is smaller than
the size of D could be useful (as long as D1 is large enough for the parameters to be correctly
estimated).
		
*****************************************************************************************************************************************
-->


<parameters>
		
<!--  to run the program:

	mpirun -np <n> pb_mpi -d <dataset> <chainname>

Here, <n> is the number of processes running in parallel. You could also use mpiexec instead
of mpirun. You cannot run pb_mpi with less than 2 processes (the parallelization scheme
involves a master and n1 slaves.) -->
<!--begin the wrapper code
	PBMultiRun.bash [wrapper options] - - <PB Flags, no -rnd and no chain-name>
The - - is required to tell the wrapper to stop interpreting flags and start seeing
uninterpreted PB flags. It is always required, even if no wrapper flags are provided.
-->
<!--


My scripts will restart, but you must not copy over the "hidden" directory, which contains a reworked PBS_NODEFILE that must change from run to run.

You MUST copy over all files named "chain*" and "INPUT.phy" .

After that, just run my wrapper script with no arguments after the "-*" (but you still need the "-*") (you might be able to restart with a different -x option though.)

You MUST specify the same "-N" option to the wrapper script. (I guess for re-start I could make it autodetect this.)

Maybe I was thinking ahead when I wrote it? (I can't remember, generally I try to do the job right the first time, specifically because I know I won't remember how to fix it later.)

-Bryan -->
<!-- We should ask the user for the number of sites rather than the number of patterns, because the latter is not obvious from the code output.

  the number of patterns = the number of sites (in stderr.txt) - the number of positions eliminated (in stdout.txt).]

* Please make PhyloBayes available to users on Expanse.

* Also, please change the default value for CHECKINTERVAL (i.e, Number of seconds to wait between checks for convergence in the interface) from 1800 to 600. This will speed up short runs.

- Ask the user

  whether the data set has amino acids (AAs) and
  how many sites are in the data set.

  If the data set does not contain AAs, assume that it is DNA.

- Specify the number of MPI processes and Slurm memory according
  to the following table.

                             
    Data                MPI    Slurm
    type      Sites   procs   memory

     DNA     <2,000      48      92G
     DNA    >=2,000      64     123G

      AA     <1,000      64     123G
      AA    >=1,000      96     186G

- Include the following in the run script.

  #!/bin/bash
  #SBATCH -p shared
  #SBATCH -*qos=shared-cipres
  #SBATCH -N 1
  #SBATCH -*ntasks-per-node=<processes>
  #SBATCH -*mem=<memory>
  ...
  srun -N 1 -n 1 /expanse/projects/ngbt/home/cipres/ngbw/contrib/scripts/PBMultiRun_expanse.bash -N 2 ...

 -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>invocation1</name>
						<attributes>
							<format>
								<language>perl</language>	
								<code>"PBMultiRun_expanse.bash"</code>
							</format>
							<group>0</group>
						</attributes>
					</parameter>
<!--                              
    Data                MPI    Slurm
    type      Sites   procs   memory

     DNA     <2,000      48      92G
     DNA    >=2,000      64     123G

      AA     <1,000      64     123G
      AA    >=1,000      96     186G
 -->					
<!--  scheduler.conf options -->				
<!--  scheduler.conf options -->				
<!--  scheduler.conf options -->				
				<parameter type="String" ishidden="1" >
					<name>dna_conf1</name>
					<attributes>
						<group>3</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$datatype ne "PROTEIN" &amp;&amp; $num_sites &lt; 2000</code>
						</precond>
						<format>
							<language>perl</language>
							<code>	"jobtype=mpi\\n" .
									"workflow_type=mpi_complex\\n" .
									"cpus-per-task=1\\n" .
									"nodes=1\\n" .
									"mem=92G\\n" .
									"node_exclusive=0\\n" .
									"mpi_processes=48\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="String" ishidden="1" >
					<name>dna_conf2</name>
					<attributes>
						<group>3</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$datatype ne "PROTEIN" &amp;&amp; $num_sites &gt; 1999</code>
						</precond>
						<format>
							<language>perl</language>
							<code>	"jobtype=mpi\\n" .
									"workflow_type=mpi_complex\\n" .
									"cpus-per-task=1\\n" .
									"nodes=1\\n" .
									"mem=123G\\n" .
									"node_exclusive=0\\n" .
									"mpi_processes=64\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="String" ishidden="1" >
					<name>prot_conf1</name>
					<attributes>
						<group>3</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$datatype eq "PROTEIN" &amp;&amp; $num_sites &lt; 1000</code>
						</precond>
						<format>
							<language>perl</language>
							<code>	"jobtype=mpi\\n" .
									"workflow_type=mpi_complex\\n" .
									"cpus-per-task=1\\n" .
									"nodes=1\\n" .
									"mem=123G\\n" .
									"node_exclusive=0\\n" .
									"mpi_processes=64\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="String" ishidden="1" >
					<name>prot_conf2</name>
					<attributes>
						<group>3</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$datatype eq "PROTEIN" &amp;&amp; $num_sites &gt; 999</code>
						</precond>
						<format>
							<language>perl</language>
							<code>	"jobtype=mpi\\n" .
									"workflow_type=mpi_complex\\n" .
									"cpus-per-task=1\\n" .
									"mem=186G\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mpi_processes=96\\n"
							</code>
						</format>
					</attributes>
				</parameter>


<!-- This section defines a file scheduler.conf that accompanies the command line to the XSEDE resource. 
	It instructs the machine how to run the job. --> 


<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. -->	
		<parameter ismandatory="1" isinput="1" issimple="1" type="Sequence">
			<name>infile</name>
			<attributes>
				<prompt>Input Data (relaxed phylip format)</prompt>

<!--  this is removed for restarting
					<format>
					<language>perl</language>
					<code>"-d infile.phy"</code>
				</format> -->

				<group>41</group>
				<filenames>infile.phy</filenames>
			</attributes>
		</parameter>
	
<!-- return all output files -->		
		<parameter type="Results">
			<name>ALL_FILES</name>
			<attributes>
				<filenames>*</filenames>
			</attributes>
		</parameter> 

	
<!-- ****WARNING********WARNING*********WARNING*********WARNING*****WARNING*********WARNING*********WARNING*****
	(I had to separate double dashes with a space, because it breaks XML commants to have a double dash. However, do not be fooled
	by this notation, these are really double dashes!!)
****WARNING*********WARNING*********WARNING*********WARNING*****WARNING*********WARNING*********WARNING***** -->
	
<!-- This section provides visible queries that help configure the interface  -->
	<!-- this sets the run time -->
				<parameter type="Float" issimple="1" ismandatory="1">
					<name>runtime</name> 
					<attributes>
						<group>1</group>
						<paramfile>scheduler.conf</paramfile>
						<prompt>Maximum Hours to Run (click here for help setting this correctly)</prompt>
						<vdef>
							<value>0.5</value>
						</vdef>
						<format>
							<language>perl</language>
							<code>								
									"remove_mv2_param=1\\n" .
									"runhours=$value\\n"
							</code>
						</format>
 					<ctrls>
							<ctrl>
								<message>The maximum hours to run must be less than 168</message>
								<language>perl</language>
								<code>$runtime &gt; 168.0</code>
							</ctrl>
							<ctrl>
								<message>Please enter a positive number for the maximum runtime</message>
								<language>perl</language>
								<code>$runtime &lt; 0</code>
							</ctrl>
							<ctrl>
								<message>Please specify a maximum runtime</message>
								<language>perl</language>
								<code>!defined $runtime </code>
							</ctrl>
						</ctrls>
						<warns>
							<warn>
								<message>The job will run on 48 cores as configured. If it runs for the entire configured time, it will consume 48 x $runtime core (cpu) hours</message>
								<language>perl</language>
								<code>$datatype ne "PROTEIN" &amp;&amp; $num_sites &lt; 2000</code>
							</warn>							
							<warn>
								<message>The job will run on 64 cores as configured. If it runs for the entire configured time, it will consume 64 x $runtime core (cpu) hours</message>
								<language>perl</language>
								<code>$datatype ne "PROTEIN" &amp;&amp; $num_sites &gt; 1999</code>
							</warn>							
							<warn>
								<message>The job will run on 64 cores as configured. If it runs for the entire configured time, it will consume 64 x $runtime core (cpu) hours</message>
								<language>perl</language>
								<code>$datatype eq "PROTEIN" &amp;&amp; $num_sites &lt; 1000</code>
							</warn>
							<warn>
								<message>The job will run on 96 cores as configured. If it runs for the entire configured time, it will consume 96 x $runtime core (cpu) hours</message>
								<language>perl</language>
								<code>$datatype eq "PROTEIN" &amp;&amp; $num_sites &gt; 999</code>
							</warn>
						</warns>  
						<comment>
<value>Estimate the maximum time your job will need to run. We recommend testimg initially with a &lt; 0.5hr test run because Jobs set for 0.5 h or less depedendably run immediately in the "debug" queue. 
Once you are sure the configuration is correct, you then increase the time. The reason is that jobs &gt; 0.5 h are submitted to the "normal" queue, where jobs configured for 1 or a few hours times may
run sooner than jobs configured for the full 168 hours. 
</value>
						</comment>
					</attributes>
				</parameter>

<!-- <parameter type="Paragraph">
	<paragraph>
		<name>bryan_script</name>
		<prompt>Convergence Parameters</prompt>
			<parameters> -->

<!-- Part 1. Visible parameters that configure the Wrapper script -->
<!-- 
	
Command Line Options of the Wrapper Script

PBMultiRun.bash [wrapper options] - - <PB Flags, no -rnd and no chain-name>
The - - is required to tell the wrapper to stop interpreting flags and start seeing
uninterpreted PB flags. It is always required, even if no wrapper flags are provided.

All wrapper options must have a space separating the flag and the provided
value. (IE, - -*N2" will break things.)

	Example Invocation	
PBMultiRun.bash - -seed 1024 -N 2 - -checkinterval 3600 - -burnin 500
- -acceptdiff 0.3 - -acceptsize 50 - -giveup 10000 - - -d INFILE.phy -cat
-gtr-->
	
<!-- ***********WARNING***************WARNING***************WARNING***************WARNING*************** 
	
	Wrapper groups are numbered sequentially with even numbers.
	Commands that go to the wrapper must have group numbers less than 40; those that go directly to the
	code must have a group greater than 40. 
	***********WARNING***************WARNING***************WARNING***************WARNING*************** -->

<!--	- -seed: <INT> Base random seed to use. Each of the N chains will add its
id to that.-->
<!--				<parameter issimple="0"  type="Integer">
					<name>set_seed</name>
					<attributes>
						<group>2</group>
						<prompt>Enter seed value</prompt>
						<format>
							<language>perl</language>
							<code>defined $set_seed ? "- -seed $value":""</code>
						</format>	
						<vdef>
							<value>12345</value>
						</vdef>
						<comment>
							<value>Base random seed to use. Each of the N chains will add its
id to that. Setting a seed value allows the user to reproduce specific runs. 
							</value>
						</comment>
					</attributes>
				</parameter> -->

<!-- -N: <INT> The number of separate chains to run.-->
		
				<parameter issimple="0" ishidden="1" ismandatory="1" type="String">
					<name>set_chains</name>
					<attributes>
						<group>4</group>
						<format>
							<language>perl</language>
							<code>"-N 2"</code>
						</format>
					</attributes>
				</parameter> 

<!-- - -CHECKINTERVAL: <INT> The number of seconds to wait between
checks for convergence. Defaults to 30 minutes .-->
<!-- remove all options 			<parameter type="Integer" issimple="0" >
					<name>checkinterval</name>
					<attributes>
						<group>6</group>
						<prompt>Number of seconds to wait between checks for convergence.</prompt>
						<format>
							<language>perl</language>
							<code>"- - CHECKINTERVAL $value"</code>
						</format>
						<vdef>
							<value>1800</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the number of seconds to wait between checks for convergence.</message>
								<language>perl</language>
								<code>!defined $checkinterval</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>
							</value> 
						</comment> 
					</attributes>
				</parameter> -->	
	
<!--  - -BURNIN: <INT> The number of cycles to exclude from convergence
checks. Default = 500.-->
<!--				<parameter type="Integer" issimple="0" >
					<name>burninval</name>
					<attributes>
						<group>8</group>
						<prompt>Number of cycles to exclude from convergence checks.</prompt>
						<format>
							<language>perl</language>
							<code>"- -BURNIN $value"</code>
						</format>
						<vdef>
							<value>500</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the number of cycles to exclude from convergence checks.</message>
								<language>perl</language>
								<code>!defined $burninval</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>
							</value> 
						</comment> 
					</attributes>
				</parameter> -->
				      
				<parameter issimple="1"  type="Integer">
					<name>num_sites</name>
					<attributes>
						<prompt>Number of sites in the data set</prompt>
						<ctrls>
							<ctrl>
								<message>Please specify the number of sites (columns) in your data set.</message>
								<language>perl</language>
								<code>!defined $num_sites</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>You can make a quick run and find this value in the stderr file. 
							</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter issimple="1" ismandatory="1" type="Excl">
					<name>datatype</name>
					<attributes>
						<prompt>My data set contains</prompt>
						<vlist>
							<value>DNA</value>
							<label>DNA</label>
							<value>PROTEIN</value>
							<label>Amino acids</label>
							<value>unk</value>
							<label>other</label>
						</vlist>
 						<ctrls>
							<ctrl>
								<message>Please specify the type of data.</message>
								<language>perl</language>
								<code>!defined $datatype</code>
							</ctrl>
						</ctrls>	
					</attributes>
				</parameter>

<!--- -ACCEPTDIFF: <FLOAT> The maximum \maxdiff" value to accept. Default = 0.3, which is \acceptable" according to the PB Manual. (0.1 for
\very good".) -->	
				<parameter type="Float" issimple="0" >
					<name>acceptdiffval</name>
					<attributes>
						<group>10</group>
						<prompt>Maximum \maxdiff" value to accept.</prompt>
						<format>
							<language>perl</language>
							<code>"--ACCEPTDIFF $value"</code>
						</format>
						<vdef>
							<value>0.1</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the Maximum "maxdiff" value to accept. The manual says 0.3 is "acceptable" and 0.1 is "very good."</message>
								<language>perl</language>
								<code>!defined $acceptdiffval</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>
							</value> 
						</comment> 
					</attributes>
				</parameter>
	
<!-- - -ACCEPTSIZE: <INT> The minimum number of effective samples re-
quired before convergence. Defaults to 50, which is \acceptable". (300 for
\very good".) -->	
<!--				<parameter type="Integer" issimple="0" >
					<name>acceptsizeval</name>
					<attributes>
						<group>12</group>
						<prompt>Maximum \maxdiff" value to accept.</prompt>
						<format>
							<language>perl</language>
							<code>"- -ACCEPTSIZE $value"</code>
						</format>
						<vdef>
							<value>50</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the minimum number of effective samples required before convergence. Default = 50</message>
								<language>perl</language>
								<code>!defined $acceptsizeval</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>
							</value> 
						</comment> 
					</attributes>
				</parameter> -->

<!-- - -GIVEUP: <INT> The Minimum number of cycles before giving up if
\maxdiff" is still 1. (Indicating being stuck.) Defaults to 10000 -->	
<!--				<parameter type="Integer" issimple="0" >
					<name>giveupval</name>
					<attributes>
						<group>14</group>
						<prompt>Minimum number of cycles before giving up if "maxdiff" is still 1 (Analysis is stuck)</prompt>
						<format>
							<language>perl</language>
							<code>"- -GIVEUP $value"</code>
						</format>
						<vdef>
							<value>10000</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the minimum number of cycles before giving up if "maxdiff" is still 1 (Analysis is stuck). Default = 10000</message>
								<language>perl</language>
								<code>!defined $giveupval</code>
							</ctrl>
						</ctrls>	
						<comment>
							<value>
							</value> 
						</comment> 
					</attributes>
				</parameter> 
			</parameters>
	</paragraph>
</parameter> -->

<!-- End of Bryan's wrapper. -->
<!-- now we insert a mandatory double dash to signal the end of the wrapper input, 
	remaining input goes directly to the PB MPI code. This is in group 40, so there is plenty of room to add more commands before and after.
	We also add the input file command here  -->
				<parameter type="String" ishidden="1" ismandatory="1">
					<name>end_of_wrapper</name>
					<attributes>
						<group>40</group>
						<format>
							<language>perl</language>
							<code>"<![CDATA[ -- ]]>"</code>
						</format>
					</attributes>
				</parameter>

<!-- now upload the .chain files -->
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. 	
 		<parameter isinput="0" type="InFile">
			<name>chainfile1</name>
			<attributes>
				<prompt>Select the first chain file to restart</prompt>
				<group>41</group>
				<filenames>chain0.chain</filenames>
 				<ctrls>
					<ctrl>
						<message>Please select a chain file</message>
						<language>perl</language>
						<code>!defined $chainfile1</code>
					</ctrl>
				</ctrls> 
			</attributes>
		</parameter> 
	
		<parameter isinput="0" type="InFile">
				<name>chainfile2</name>
			<attributes>
				<prompt>Select the second chain file to restart</prompt>
				<group>41</group>]
				<filenames>chain1.chain</filenames>
 				<ctrls>
					<ctrl>
						<message>Please select a second chain file</message>
						<language>perl</language>
						<code>!defined $chainfile2</code>
					</ctrl>
				</ctrls> 
			</attributes>
		</parameter> -->
	
<!--		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chainfile3</name>
			<attributes>
				<prompt>Select the third chain file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 2</code>
				</precond>
				<filenames>chain2.chain</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a third chain file</message>
						<language>perl</language>
						<code>!defined $chainfile3</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chainfile4</name>
			<attributes>
				<prompt>Select the fourth chain file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 4</code>
				</precond>
				<filenames>chain3.chain</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a fourth chain file</message>
						<language>perl</language>
						<code>!defined $chainfile4</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter> -->
	
	<!-- now upload the .param files -->
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. -->	
		<parameter ismandatory="1" isinput="0" type="InFile">
			<name>chainparamfile1</name>
			<attributes>
				<prompt>Select the first chain.param file to restart</prompt>
				<group>41</group>
				<filenames>chain0.param</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the first chain.param file</message>
						<language>perl</language>
						<code>!defined $chainparamfile1</code>
					</ctrl>
				</ctrls>
				<comment>
<value>If you used the -s option during your first run, please do not select your chain.chain files here, these will fail.</value>
				</comment>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
				<name>chainparamfile2</name>
			<attributes>
				<prompt>Select the second chain.param file</prompt>
				<group>41</group>
<!--				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 1</code>
				</precond> -->
				<filenames>chain1.param</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the second chain.param file</message>
						<language>perl</language>
						<code>!defined $chainparamfile2</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
<!--		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chainparamfile3</name>
			<attributes>
				<prompt>Select the third chain.param file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 2</code>
				</precond>
				<filenames>chain2.param</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a third chain.param file</message>
						<language>perl</language>
						<code>!defined $chainparamfile3</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chainparamfile4</name>
			<attributes>
				<prompt>Select the fourth chain.param file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 3</code>
				</precond>
				<filenames>chain3.param</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a fourth chain.param file</message>
						<language>perl</language>
						<code>!defined $chainparamfile4</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter> -->
	
	<!-- now upload the .treelist files -->
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. -->	
		<parameter ismandatory="1" isinput="0" type="InFile">
			<name>chaintreefile1</name>
			<attributes>
				<prompt>Select the first chain.treelist file to restart</prompt>
				<group>41</group>
				<filenames>chain0.treelist</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the first chain.treelist file</message>
						<language>perl</language>
						<code>!defined $chaintreefile1</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
				<name>chaintreefile2</name>
			<attributes>
				<prompt>Select the second chain.treelist file</prompt>
				<group>41</group>
<!--				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 1</code>
				</precond> -->
				<filenames>chain1.treelist</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the second chain.treelist file</message>
						<language>perl</language>
						<code>!defined $chaintreefile2</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
<!--		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chaintreefile3</name>
			<attributes>
				<prompt>Select the third chain.treelist file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 2</code>
				</precond>
				<filenames>chain2.treelist</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a third chain.treelist file</message>
						<language>perl</language>
						<code>!defined $chaintreefile3</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chaintreefile4</name>
			<attributes>
				<prompt>Select the fourth chain.treelist file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 3</code>
				</precond>
				<filenames>chain3.treelist</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a fourth chain.treelist file</message>
						<language>perl</language>
						<code>!defined $chaintreefile4</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter> -->
	
	<!-- now upload the .trace files -->
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. -->	
		<parameter ismandatory="1" isinput="0" type="InFile">
			<name>chaintracefile1</name>
			<attributes>
				<prompt>Select the first chain.trace file to restart</prompt>
				<group>41</group>
				<filenames>chain0.trace</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the first chain.trace file</message>
						<language>perl</language>
						<code>!defined $chaintracefile1</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
				<name>chaintracefile2</name>
			<attributes>
				<prompt>Select the second chain.trace file</prompt>
				<group>41</group>
<!--				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 1</code>
				</precond> -->
				<filenames>chain1.trace</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the second chain.trace file</message>
						<language>perl</language>
						<code>!defined $chaintracefile2</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
<!--		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chaintracefile3</name>
			<attributes>
				<prompt>Select the third chain.trace file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 2</code>
				</precond>
				<filenames>chain2.trace</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a third chain.trace file</message>
						<language>perl</language>
						<code>!defined $chaintracefile3</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chaintracefile4</name>
			<attributes>
				<prompt>Select the fourth chain.trace file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 3</code>
				</precond>
				<filenames>chain3.trace</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a fourth chain.trace file</message>
						<language>perl</language>
						<code>!defined $chaintracefile4</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter> -->
	
	<!-- now upload the .monitor files -->
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. -->	
		<parameter ismandatory="1" isinput="0" type="InFile">
			<name>chainmonfile1</name>
			<attributes>
				<prompt>Select the first chain.monitor file to restart</prompt>
				<group>41</group>
				<filenames>chain0.monitor</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the first chain.monitor file</message>
						<language>perl</language>
						<code>!defined $chainmonfile1</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
				<name>chainmonfile2</name>
			<attributes>
				<prompt>Select the second chain.monitor file</prompt>
				<group>41</group>
<!--				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 1</code>
				</precond> -->
				<filenames>chain1.monitor</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the second chain.monitor file</message>
						<language>perl</language>
						<code>!defined $chainmonfile2</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
<!--		<parameter  isinput="1" type="InFile">
		<name>chainmonfile3</name>
			<attributes>
				<prompt>Select the third chain.monitor file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 2</code>
				</precond>
				<filenames>chain2.monitor</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a third chain.monitor file</message>
						<language>perl</language>
						<code>!defined $chainmonfile3</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
		<name>chainmonfile4</name>
			<attributes>
				<prompt>Select the fourth chain.monitor file to restart</prompt>
				<group>41</group>
				<precond>
					<language>perl</language>
					<code>$set_chains &gt; 3</code>
				</precond>
				<filenames>chain3.monitor</filenames>
				<ctrls>
					<ctrl>
						<message>Please select a fourth chain.monitor file</message>
						<language>perl</language>
						<code>!defined $chainmonfile4</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter> -->
		
	<!-- specify the input file. This has to be group 41, right after the double dashes showing that the wrapper input has completed. 	
		<parameter ismandatory="1" isinput="0" type="InFile">
			<name>chainrunfile1</name>
			<attributes>
				<prompt>Select the first chain.run file to restart</prompt>
				<group>41</group>
				<filenames>chain0.run</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the first chain.run file</message>
						<language>perl</language>
						<code>!defined $chainrunfile1</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>
	
		<parameter ismandatory="1" isinput="0" type="InFile">
				<name>chainrunfile2</name>
			<attributes>
				<prompt>Select the second chain.run file</prompt>
				<group>41</group>
				<filenames>chain1.run</filenames>
				<ctrls>
					<ctrl>
						<message>Please select the second chain.run file</message>
						<language>perl</language>
						<code>!defined $chainrunfile2</code>
					</ctrl>
				</ctrls>
			</attributes>
		</parameter>-->
	
<!--	4.1.1 General options -->

<!-- <parameter type="Paragraph">
	<paragraph>
		<name>bryan_script</name>
		<prompt>Convergence Parameters</prompt>
			<parameters> -->
				
<!--	-dc constant sites are removed. -->
				
<!--				<parameter type="Switch" issimple="0" >
					<name>constant_sitesr</name>
					<attributes>
						<group>42</group>
						<prompt>Remove Constant Sites (-dc)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? " -dc":""</code>
						</format>
						<vdef>
							<value>0</value>
						</vdef>
						<comment>
<value></value>
						</comment>
					</attributes>
				</parameter> -->
				
<!-- -t <treefile> (starting tree)forces the chain to start from the specified tree. -->
<!--				<parameter type="InFile" issimple="0" >
					<name>starting_tree</name>
					<attributes>
						<group>44</group>
						<prompt>Specify a Newick Starting Tree (-tree)</prompt>
						<format>
							<language>perl</language>
							<code>"-t treefile.phy"</code>
						</format>
						<paramfile>treefile.phy</paramfile>
						<comment>
<value>The -t (starting tree)option forces the chain to start from the specified tree.</value>
						</comment>
					</attributes>
				</parameter> -->

	<!-- -	-T <treefile> (constraint tree)
forces the chain to run under a fixed topology (as specified in the given file). In other words,
the chain only samples from the posterior distribution over all other parameters (branch
lengths, alpha parameter, etc.), conditional on the specified topology. This should be a
bifurcating tree (see Input Data Format section of the PB MPI manual). -->
				
<!--				<parameter type="InFile" issimple="0" >
					<name>constraint_tree</name>
					<attributes>
						<group>46</group>
						<prompt>Specify a fixed topology (in the selected file)(-T)</prompt>
						<format>
							<language>perl</language>
							<code>"-T contsrfile.phy"</code>
						</format>
						<paramfile>contsrfile.phy</paramfile>
						<comment>
<value>This option forces the chain to run under a fixed topology (as specified in the given file). In other words,
the chain only samples from the posterior distribution over all other parameters (branch lengths, alpha parameter, 
etc.), conditional on the specified topology. This should be a bifurcating tree (see Input Data Format section of the PB MPI manual).</value>
						</comment>
					</attributes>
				</parameter> -->

<!--	-x <every> [<until>]
specifies the saving frequency. By definition, -x 1 corresponds to the default saving frequency. 
In some cases, samples may be strongly correlated, in which case, if disk space or access is limiting, it would make sense to save
points less frequently, say 10 times less often: to do this, you can use the -x 10 option. -->
<!--				<parameter type="Integer" issimple="0" >
					<name>saving_freq</name>
					<attributes>
						<group>50</group>
						<prompt>Save every (-x)</prompt>
						<format>
							<language>perl</language>
							<code>"-x $value $stop_at"</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the saving frequency</message>
								<language>perl</language>
								<code>!$saving_freq</code>
							</ctrl>
						</ctrls>
						<comment>
<value>This option specifies the saving frequency and (optional) the number of points after which the chain
should stop. If this number is not specified, the chain runs \forever". By definition, -x
1 corresponds to the default saving frequency. In some cases, samples may be strongly
correlated, in which case, if disk space or access is limiting, it would make sense to save
points less frequently, say 10 times less often: to do this, you can use the -x 10 option..</value>
						</comment>
					</attributes>
				</parameter> -->
				
<!--				<parameter type="Integer" issimple="0" >
					<name>stop_at</name>
					<attributes>
						<group>51</group>
						<prompt>Number of points after which the chain should stop (-1 = forever)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? "$value":""</code>
						</format> 
						<vdef>
							<value>-1</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please specify the numnber of points after which a chain should stop</message>
								<language>perl</language>
								<code>!$stop_at</code>
							</ctrl>
						</ctrls>
						<comment>
<value>This option specifies the number of points after which the chain
should stop. If this number is not specified, the chain runs \forever".</value>
						</comment>
					</attributes>
				</parameter> -->
				
<!--	-s
By default, the sampler only saves the trees explored during MCMC in the treelist file
(and the summary statistics in the trace file). This is enough for computing the consensus
tree but insufficient for estimating the continuous parameters of the model (e.g. site-specific
equilibrium frequency profiles) or for conducting posterior predictive tests or cross-validation
analyses. For this, you should save the detailed model configuration for each point visited
during the run using this -s option. -->
<!--				<parameter type="Switch" issimple="0" >
					<name>save_detmodelconf</name>
					<attributes>
						<group>54</group>
						<prompt>Save detailed model configuration for each point(-s)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "-s":""</code>
						</format>
						<comment>
<value>By default, the sampler only saves the trees explored during MCMC in the treelist file
(and the summary statistics in the trace file). This is enough for computing the consensus
tree but insufficient for estimating the continuous parameters of the model (e.g. site-specific
equilibrium frequency profiles) or for conducting posterior predictive tests or cross-validation
analyses. For this, you should save the detailed model configuration for each point visited
during the run using this -s option.</value>
						</comment>
					</attributes>
				</parameter> -->

<!--	-f forces the program to overwrite an already existing chain with same name.  -->
<!--				<parameter type="Switch" issimple="0" >
					<name>overwrite_existing</name>
					<attributes>
						<group>56</group>
						<prompt>Overwrite an already existing chain with same name(-f)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "-f":""</code>
						</format>
						<comment>
<value>The -f option forces the program to overwrite an already existing chain with same name.</value>
						</comment>
					</attributes>
				</parameter> -->
	
	
<!--End general parameters -->
								
<!-- 4.1.2 Evolutionary models -->
<!--
<parameter type="Paragraph">
	<paragraph>
		<name>evolutionary_models</name>
		<prompt>Evolutionary Models</prompt>
			<parameters> -->
<!--	4.1.2.1 Rates across sites -->
<!--	-dgam <n>
specifies n categories for the discrete gamma distribution. Setting n = 1 amounts to a model
without across-site variation in substitution rate. -->
				
<!--				<parameter type="Integer" issimple="0" >
					<name>num_gammacats</name>
					<attributes>
						<group>58</group>
						<prompt>Number of Categories for the discrete gamma distribution (-dgam)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? "-dgam $value":""</code>
						</format>
						<comment>
<value>This specifies n categories for the discrete gamma distribution. Setting n = 1 amounts to a model
without across-site variation in substitution rate</value>
						</comment>
					</attributes>
				</parameter> -->
				
<!-- 	4.1.2.2 Relative exchangeabilities (exchange rates)-->

<!--	-poisson exchange rates are all equal to 1. The model is then a mixture of Poisson (F81) 
	processes; -lg, -wag, -jtt, -mtrev, -mtzoa, -mtart specify empirical exchangeabilities; -gtr specifies a general time reversible matrix: exchangeabilities are free parameters, with prior
distribution a product of independent exponential distributions of mean 1.
-->	
				
<!--				<parameter type="Excl" ismandatory="1" issimple="0" >
					<name>exchange_rates</name>
					<attributes>
						<group>64</group>
						<prompt>Exchange Rates</prompt>
						<format>
							<language>perl</language>
							<code>"$value"</code>
						</format>
						<vlist>
							<value>-gtr</value>
							<label>GTR</label>
							<value>-poisson</value>
							<label>Poisson</label>
							<value>-lg</value>
							<label>LG</label>
							<value>-wag</value>
							<label>WAG</label>
							<value>-jtt</value>
							<label>JTT</label>
							<value>-mtrev</value>
							<label>MTREV</label>
							<value>-mtzoa</value>
							<label>MTZOA</label>
							<value>-mtart</value>
							<label>MTART</label>
						</vlist>
						<vdef>
							<value>-poisson</value>
						</vdef>
						<comment>
<value>This specifies n categories for the discrete gamma distribution. Setting n = 1 amounts to a model
without across-site variation in substitution rate</value>
						</comment>
					</attributes>
				</parameter>		-->

<!-- Custom exchange rate file -rr <filename>
exchangeabilities are fixed to the values given in the specified file. The file should be for-
matted as follows:
[<ALPHABET>]
<rr1_2> <rr1_3> ... <rr1_20>
<rr2_3> <rr2_4> ... <rr2_20>
...
<rr18_19> <rr18_20>
<rr19_20>

You have to specify the order in which amino acids should be considered on the first line ([<ALPHABET>]),
with letters separated by spaces or tabs. This header should then be followed by the exchangeabilities in
the order specified (spaces, tabs or returns are equivalent: only the order matters).-->
<!--				<parameter type="Switch" issimple="0" >
					<name>custom_exch</name>
					<attributes>
						<group>65</group>
						<prompt>Provide a custom exchange rate file</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "-rr exchange_rate.txt":""</code>
						</format>
						<comment>
<value>This option allows a custom exchange rate file. Exchangabilities are fixed to the values given
in the specified file. The file should be formatted as follows:

[ALPHABET]
rr1_2 rr1_3 ... rr1_20
rr2_3 rr2_4 ... rr2_20
...
rr18_19 rr18_20
rr19_20

You have to specify the order in which amino acids should be considered on the first line 
([ALPHABET]), with letters separated by spaces or tabs. This header should then be followed by 
the exchangeabilities in the order specified (spaces, tabs or returns are equivalent: 
only the order matters).</value>
						</comment>
					</attributes>
				</parameter> -->

<!-- custom exchangability file upload-->
<!--	  			<parameter type="InFile" >
						<name>custom_exch_file</name>
						<attributes>
							<prompt>Select the Custom Exchangabilities File</prompt>
							<precond>
								<language>perl</language>
								<code>$custom_exch</code>
							</precond>
							<filenames>exchange_rate.txt</filenames>
							<ctrls>
								<ctrl>
									<message>Please select a Custom Exchange Rate File</message>
									<language>perl</language>
									<code>$custom_exch</code>
								</ctrl>
							</ctrls>
							<comment>
<value>This option allows the user to upload a seed alignment</value>
							</comment> 
						</attributes>
					</parameter> -->
				
	
<!-- 4.1.2.3 Profile mixture -->
<!--				<parameter type="Excl" ismandatory="1" issimple="0" >
					<name>profile_mixture</name>
					<attributes>
						<group>60</group>
						<prompt>Profile Mixture</prompt>
						<vlist> -->
<!--	-dp (or -cat) activates the Dirichlet process.
							<value>-dp</value>
							<label>CAT (Dirichlet Process)</label>-->
<!--	-ncat <n>

specifies a mixture of n components; the number of components is fixed whereas the
weights and profiles are treated as random variables. Fixing the number of components of
the mixture most often results in a poor mixing of the MCMC. The Dirichlet process usually
has a much better mixing behavior
							<value>ncatn</value>
							<label>Mixture of N components</label> -->
<!--	-catfix <predef>
	
specifies a mixture of a set of pre-defined profiles (the weights are reestimated). 
<predef> can be either one of the following keywords: C20, C30, C40, C50, C60, which correspond
to empirical profile mixture models (Quang et al., 2008); or WLSR5, which correspond to
the model of Wang et al. (2008). Note that this latter model actually defines 4 empirical
profiles, which are then combined with a fifth component made of the empirical frequencies
of the dataset.
							<value>catfix</value>
							<label>Pre-defined profiles</label> -->
<!-- 	-catfix <filename>
	
specifies a mixture of a set of user-pre-defined profiles, where <filename> is the name of a custom file
 -->
<!--							<value>custom</value>
							<label>Custom Profile</label>
						</vlist>
						<flist>
							<value>-dp</value>
							<code>"-cat"</code>
							<value>ncatn</value>
							<code>"-ncat $categories</code>
							<value>catfix</value>
							<code>"-catfix $predefined_profiles"</code>
							<value>custom</value>
							<code>"catfix userprofiles.txt"</code>
						</flist>
						<vdef>
							<value>-dp</value>
						</vdef>
						<warns>
							<warn>
								<message>Fixing the number of components of the mixture most often results in a poor mixing of the MCMC</message>
								<language>perl</language>
								<code>$profile_mixture eq "ncatn"</code>
							</warn> -->
<!--							<warn>
								<message>Choosing a non-Poisson exchange rate deactivates the mixture model is automatically
deactivated by default: you only have one such matrix, conditioning all the sites</message>
								<language>perl</language>
								<code>$profile_mixture eq ncatn &amp;&amp; $exchange_rates ne "-poisson"</code>
							</warn>	 
						</warns>
						<comment>
<value>-dp (or -cat) activates the Dirichlet process. Mixture of N Componenets (-ncat n)
specifies a mixture of n components; the number of components is fixed whereas the
weights and profiles are treated as random variables. Fixing the number of components of
the mixture most often results in a poor mixing of the MCMC. The Dirichlet process usually
has a much better mixing behavior.</value>
						</comment>
					</attributes> -->
	
<!--				</parameter>	
						<parameter type="Excl" issimple="0" >
					<name>predefined_profiles</name>
					<attributes>
						<prompt>Choose a Predefined Profile</prompt>
						<precond>
							<language>perl</language>
							<code>$profile_mixture eq "catfix"</code>
						</precond> -->
<!--specifies a mixture of a set of pre-defined profiles (the weights are reestimated). 
<predef> can be either one of the following keywords: C20, C30, C40, C50, C60, which correspond
to empirical profile mixture models (Quang et al., 2008); or WLSR5, which corresponds to
the model of Wang et al. (2008). Note that this latter model actually defines 4 empirical
profiles, which are then combined with a fifth component made of the empirical frequencies
of the dataset.
						<vlist>
							<value>WLSR5</value>
							<label>WLSR5</label>
							<value>C20</value>
							<label>C20</label>
							<value>C30</value>
							<label>C30</label>
							<value>C40</value>
							<label>C40</label>
							<value>C50</value>
							<label>C50</label>
							<value>C60</value>
							<label>C60</label>
						</vlist>
						<ctrls>
							<ctrl>
								<message>Please select a pre-defined profile</message>
								<language>perl</language>
								<code>$profile_mixture eq "catfix" &amp;&amp; !defined $value</code>
							</ctrl>
						</ctrls>
						<comment>
<value>The selected value specifies a mixture of a set of pre-defined profiles (the weights are reestimated). 
predef can be either one of the following keywords: C20, C30, C40, C50, C60, which correspond
to empirical profile mixture models (Quang et al., 2008); or WLSR5, which correspond to
the model of Wang et al. (2008). Note that this latter model actually defines 4 empirical
profiles, which are then combined with a fifth component made of the empirical frequencies
of the dataset</value>
						</comment>
					</attributes>
				</parameter> -->

<!-- File containing a set of profiles specified as follows:
[<ALPHABET>]
<ncat>
<weight> <freq1> <freq2> ... <freq20>
<weight> <freq1> <freq2> ... <freq20>
...
where <ncat> is the number of profiles, and each line following this number should be a set of
21 real numbers, defining a weight, and then a profile of equilibrium frequencies (separated
by spaces or tabs). You should specify the order in which amino acids should be considered
on the first line ([<ALPHABET>]), with letters separated by spaces or tabs. Note that the
weights are there only for historical reasons { they are re-estimated anyway-->
				
<!--	  			<parameter type="InFile" >
						<name>custom_profile</name>
						<attributes>
							<prompt>Select the Custom Exchangabilities File</prompt>
							<precond>
								<language>perl</language>
								<code>$profile_mixture eq "custom"</code>
							</precond>
							<filenames>userprofiles.txt</filenames>
							<ctrls>
								<ctrl>
									<message>Please select a Custom Exchange Rate File</message>
									<language>perl</language>
									<code>$profile_mixture eq "custom"</code>
								</ctrl>
							</ctrls>
							<comment>
<value>This option allows the user to upload a seed alignment</value>
							</comment> 						</attributes>
					</parameter> -->

<!--		</parameters>
	</paragraph>
</parameter> -->

<!--	4.1.2.4 Combining profiles and exchange rates Any set of exchange rates can be combined with any of the three settings for the mixture. But the same set of exchange rates
will be used by all components of the mixture.
	
For instance, -cat -gtr makes an infinite mixture model whose components differ by
their equilibrium frequencies but otherwise share the same set of relative exchange rates
(themselves considered as free parameters). As another example, -catfix WLSR5 -jtt defines
the Wang et al. (2008) model: a model with 5 components, each of which is a matrix
made from the relative exchange rates of the JTT matrix, combined with one of the 4
vectors of equilibrium frequencies defined by Wang et al. (2008), plus one vector of empirical
frequencies. 
	
The default model is -cat -gtr. -->
	
<!--	4.1.2.5 Mutation-selection models -->

<!--	-mutsel
activates the mutation-selection model as described in Rodrigue et al. (2010) (codon align-
ments only). -->
<!--				<parameter type="Switch" issimple="0" >
					<name>mutsel_model</name>
					<attributes>
						<group>70</group>
						<prompt>Use Codon Alignments Only</prompt>
						<format>
							<language>perl</language>
							<code>($value)? "-mutsel":""</code>
						</format>
						<vdef>
							<value>0</value>
						</vdef>
						<comment>
							<value>This option activates the mutation-selection model as described in Rodrigue et al. (2010) (codon align-
ments only.
							</value> 
						</comment>
					</attributes>
				</parameter>	-->	

<!--	-mtvert
specifies the vertebrate mitochondrial code (the universal genetic code is the default). 	
				<parameter type="Switch" issimple="0" >
					<name>mtvert_codons</name>
					<attributes>
						<group>72</group>
						<prompt>Use Vertebrate Mitochondrial Genetic Code</prompt>
						<format>
							<language>perl</language>
							<code>($value)? "-mtvert":""</code>
						</format>
						<vdef>
							<value>0</value>
						</vdef>	
						<comment>
							<value>This option activates the mutation-selection model as described in Rodrigue et al. (2010) (codon align-ments only.
							</value> 
						</comment>
					</attributes>
				</parameter>	 -->	
<!--			</parameters>
	</paragraph> 
</parameter> -->
</parameters>
</pise>



