<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
	<head>
		<title>TreeAnnotator on XSEDE</title>
		<version>1.8.4-2.6.6</version>
		<description>Bayesian Evolutionary Analysis by Sampling Trees - run on XSEDE</description>
		<authors>Remco Boukaert, Alexei Drummond, Andrew Rambaut, and Marc A. Suchard</authors>
		<reference>
			Drummond, A. J. and A. Rambaut. 2007. BEAST: Bayesian evolutionary analysis by sampling trees. BMC Evolutionary Biology 7:214. 
		</reference>
		<reference>
			Suchard, M.A. and A. Rambaut. 2009. Many-Core algorithms for statistical phylogenetics. Bioinformatics XX:1-9.
		</reference>
		<category>Phylogeny / Alignment</category>
	</head>
	
	<command>treeannotator</command>
	
<!--
*****************************************************************************************************************************************
Created by Mark Miller for CSG, 9_1_2011 or thereabouts.
*****************************************************************************************************************************************
Basic setup: 
From:
  Usage: treeannotator [-heights <keep|median|mean|ca>] [-burnin <i>] [-burninTrees <i>] [-limit <r>] [-target <target_file_name>] [-help] [-forceDiscrete] [-hpd2D <r>] <input-file-name> [<output-file-name>]
    -heights an option of 'keep' (default), 'median', 'mean' or 'ca'
    -burnin the number of states to be considered as 'burn-in'
    -burninTrees the number of trees to be considered as 'burn-in'
    -limit the minimum posterior probability for a node to be annotated
    -target specifies a user target tree to be annotated
    -help option to print this message
    -forceDiscrete forces integer traits to be treated as discrete traits.
    -hpd2D the HPD interval to be used for the bivariate traits

treeannotator -burnin 100 -heights mean your.trees your.mcc.tre

Just to add a little more from my recent experience, the instructions below will work as long as the default settings in the shell script are fine.
But in my case, I needed more memory. I found you can also call the program directly,
The command line argument I used is:

 java -Xms296m -Xmx184m -Djava.library.path="/opt/beast/1.8.1/lib"-cp "/opt/beast/1.8.1/lib/beast.jar" dr.app.tools.TreeAnnotator –burnin 3000 -heights mean test2.trees.txt test2.MCC.tree 

> java -Xms296m (this sets the startup jvm space)  -Xmx16384m (this sets the maximum heap space to 16GB)


 
 -->


<parameters> 

<!-- which_beast for however many options we offer, these two invocation lines should be duplicated, and incremented, with 1.8.0 being beast0_trestles
beast 1.8.1 being beast1_trestles, etc. Note that beast is on Gordon, really -->
<!-- 
              TreeAnnotator v1.10.4, 2002-2018
                    MCMC Output analysis
                             by
           Andrew Rambaut and Alexei J. Drummond

             Institute of Evolutionary Biology
                  University of Edinburgh
                     a.rambaut@ed.ac.uk

               Department of Computer Science
                   University of Auckland
                  alexei@cs.auckland.ac.nz


  Usage: treeannotator [-heights <keep|median|mean|ca>] [-burnin] [-burninTrees <i>] [-limit <r>] [-target <target_file_name>] [-help] [-forceDiscrete] [-hpd2D <the HPD interval to be used for the bivariate traits>] <input-file-name> [<output-file-name>]
    -heights an option of 'keep' (default), 'median', 'mean' or 'ca'
    -burnin the number of states to be considered as 'burn-in'
    -burninTrees the number of trees to be considered as 'burn-in'
    -limit the minimum posterior probability for a node to be annotated
    -target specifies a user target tree to be annotated
    -help option to print this message
    -forceDiscrete forces integer traits to be treated as discrete traits.
    -hpd2D specifies a (vector of comma seperated) HPD proportion(s)

  Example: treeannotator test.trees out.txt
  Example: treeannotator -burnin 100 -heights mean test.trees out.txt
  Example: treeannotator -burnin 100 -target map.tree test.trees out.txt
 -->

<!-- 
              TreeAnnotator v2.6.0, 2002-2019
                    MCMC Output analysis
                             by
           Andrew Rambaut and Alexei J. Drummond

             Institute of Evolutionary Biology
                  University of Edinburgh
                     a.rambaut@ed.ac.uk

               Department of Computer Science
                   University of Auckland
                  alexei@cs.auckland.ac.nz


  Usage: treeannotator [-heights <keep|median|mean|ca>] [-burnin <i>] [-b <i>] [-limit <r>] [-target <target_file_name>] [-help] [-forceDiscrete] [-lowMem] [-hpd2D <r>] [-nohpd2D] [-noSA] <input-file-name> [<output-file-name>]
    -heights an option of 'keep' (default), 'median', 'mean' or 'ca'
    -burnin the percentage of states to be considered as 'burn-in'
    -b the percentage of states to be considered as 'burn-in'
    -limit the minimum posterior probability for a node to be annotated
    -target specifies a user target tree to be annotated
    -help option to print this message
    -forceDiscrete forces integer traits to be treated as discrete traits.
    -lowMem use less memory, which is a bit slower.
    -hpd2D the HPD interval to be used for the bivariate traits
    -nohpd2D suppress calculation of HPD intervals for the bivariate traits
    -noSA interpret the tree set as begin from a not being from a sampled ancestor analysis, even if there are zero branch lengths in the tree set

  Example: treeannotator test.trees out.txt
  Example: treeannotator -burnin 10 -heights mean test.trees out.txt
  Example: treeannotator -burnin 20 -target map.tree test.trees out.txt

-->					
					
<!--  submission on comet: the invocation line and any needed thread specification  -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast4_comet</name>
						<attributes>
							<precond>
								<language>perl</language>
								<code>$which_beast eq "4"</code>		
							</precond>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[treeannotator_1.8.4_expanse]]>"</code>							
							</format>
							<group>0</group>
						</attributes>
					</parameter>						
								
<!--  submission on comet: the invocation line and any needed thread specification  -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast104_comet</name>
						<attributes>
							<precond>
								<language>perl</language>
								<code>$which_beast eq "104"</code>		
							</precond>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[treeannotator_1.10.4_expanse]]>"</code>							
							</format>
							<group>0</group>
						</attributes>
					</parameter>
					
<!-- treeannotator_2.6.0_comet -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>beast266_expanse</name>
						<attributes>
							<precond>
								<language>perl</language>
								<code>$which_beast &gt; "200"</code>		
							</precond>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[treeannotator_2.6.6_expanse]]>"</code>							
							</format>
							<group>0</group>
						</attributes>
					</parameter>
					
<!-- this section defines the file scheduler.conf that accompanies the command line to the TG resource. It instructs the machine how to run the job.  --> 
<!-- RUNS THAT USE CODON PARTITIONING
 * If the data set has codon partitioning:

- Run in the shared Slurm partition with -threads <t>, where t = min(data partitions,4),
  along with -beagle_instances 1 -beagle_SSE -beagle_scaling dynamic.

Thus, include the following in the run script.

  #SBATCH -p shared
  #SBATCH -N 1
  #SBATCH -*ntasks-per-node=<t> change -* to double dash
  ...
  module load beast/1.8.3
  beast -threads <t> ... -->

<!-- configure scheduler.conf shared queue, one thread, one core, no beagle -->									
				<parameter type="String" ishidden="1" >
					<name>number_nodes</name>
					<attributes>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$which_beast &lt; 200  &amp;&amp; !$more_memory</code>
						</precond>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=16G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</attributes>
				</parameter>
			
				<parameter type="String" ishidden="1" >
					<name>number_nodesb</name>
					<attributes>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$which_beast &lt; 200 &amp;&amp; $more_memory</code>
						</precond>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=64G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="String" ishidden="1" >
					<name>number_nodes2</name>
					<attributes>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 &amp;&amp; !$more_memory</code>
						</precond>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=16G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="String" ishidden="1" >
					<name>number_nodes2b</name>
					<attributes>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 &amp;&amp; $more_memory</code>
						</precond>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"mem=64G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</attributes>
				</parameter>
				
<!-- 			<parameter issimple="1" ishidden="1" type="String">
					<name>set_threads</name>
					<attributes>
						<format>
							<language>perl</language>
							<code> "-threads 1"</code>
						</format>
						<group>4</group>
					</attributes>
				</parameter>  -->	
<!-- end number of nodes  -->		
				
<!-- input file specification -->
<!-- the input file to be operated on ends the command line -->
		<parameter issimple="1" ismandatory="1" isinput="1" type="Sequence">
			<name>infile</name>
			<attributes>
				<prompt>Input File (must be a tree file)</prompt>
				<format>
					<language>perl</language>
					<code>"infile.trees"</code>
				</format>
<!-- this file designator seems to come next to last in the command string, so we set if for 98 currently -->				
				<group>98</group>
				<filenames>infile.trees</filenames>
			</attributes>
		</parameter>
<!-- Results section. To start we return all results files available-->

		<parameter ishidden="1" type="Results">
			<name>all_results</name>
			<attributes>
				<filenames>*</filenames>
			</attributes>
		</parameter>
		
<!-- This section provides visible queries that help configure the interface  -->

<!-- Dont use Beagle -->
			<parameter issimple="1" ismandatory="1" type="Excl">
			<name>which_beast</name>
			<attributes>
				<prompt>Choose your beast/beast2 version</prompt>
				<vlist>
<!--				<value>0</value>
					<label>Version 1.8.0</label>
					<value>1</value>
					<label>Version 1.8.1</label>
					<value>2</value>
					<label>Version 1.8.2</label>   -->
					<value>4</value>   
					<label>Version 1.8.4</label>
					<value>104</value>   
					<label>Version 1.10.4</label>
					<value>266</value>   
					<label>Version 2.6.6</label>
				</vlist>
				<vdef>
					<value>104</value>				
				</vdef>
				<ctrls>
					<ctrl>
						<message>Please choose a BEAST version</message>
						<language>perl</language>
						<code>!defined $which_beast</code>
					</ctrl>
				</ctrls>
				<group>4</group>
				<comment>
<value>This option is offered because sometimes a bug in the interface between BEAST and BEAGLE prevents a run from completing. Use this option if you wish to run a data set that 
has failed using the normal BEAST/BEAGLE implementation. Runs made this way are always slower, so use this option as a last resort.</value>
				</comment>
			</attributes>
		</parameter>
		
<!-- 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 (up to 168 hours)</prompt>
						<vdef>
							<value>0.5</value>
						</vdef>
						<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>The maximum hours to run must be greater than 0.05</message>
								<language>perl</language>
								<code>$runtime &lt; 0.05</code>
							</ctrl>
						</ctrls>
						<format>
							<language>perl</language>
							<code>"runhours=$value\\n"</code>
						</format>
						<warns>
							<warn>
								<message>The job will run on 2 processors as configured. If it runs for the entire configured time, it will consume 2 X $runtime cpu hours</message>
								<language>perl</language>
								<code>$runtime &gt; 0</code>
							</warn>
						</warns>
						<comment>
<value>Estimate the maximum time your job will need to run. We recommend testing 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>
				
<!-- more memory -->
		<parameter issimple="1"  type="Switch">
			<name>more_memory</name>
			<attributes>
				<prompt>I need more memory</prompt> 
			</attributes>
		</parameter>
				
<!-- do burn in as the number of states or number of trees -->
		<parameter issimple="1"  ishidden="0" type="Excl">
			<name>burnin_type</name>
			<attributes>
				<prompt>Specify the burnin as</prompt> 
				<precond>
					<language>perl</language>
					<code>$which_beast &lt; 200 </code>
				</precond>
				<format>
					<language>perl</language>
					<code></code>
				</format>
 			<vlist>
 				<value>states</value>
				<label>Number of states</label>  
				<value>trees</value>
				<label>Number of trees</label>
			</vlist> 
				<vdef>
					<value>states</value>				
				</vdef>
				<group>4</group>
			</attributes>
		</parameter> 
				
<!-- -burnin the number of states to be considered as 'burn-in'   -->
				<parameter issimple="1"  type="Integer">
					<name>set_burnin</name>
					<attributes>
						<group>5</group>
						<prompt>Burnin (as states) (-burnin)</prompt>
						<precond>
							<language>perl</language>
							<code>$burnin_type eq "states" &amp;&amp; $which_beast &lt; 200 </code>
						</precond>
						<format>
							<language>perl</language>
							<code> "-burnin $value"</code>
						</format>
						<vdef>
							<value>200</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter an integer for burnin states</message>
								<language>perl</language>
								<code>!defined $set_burnin</code>
							</ctrl>
						</ctrls>
					</attributes>
				</parameter>
				
<!-- -burnin the number of trees to be considered as 'burn-in'   -->
				<parameter issimple="1"  type="Integer">
					<name>set_burnintrees</name>
					<attributes>
						<group>5</group>
						<prompt>Burnin (as trees) (-burnintrees)</prompt>
						<precond>
							<language>perl</language>
							<code>$burnin_type eq "trees" &amp;&amp; $which_beast &lt; 200</code>
						</precond>
						<format>
							<language>perl</language>
							<code> "-burnintrees $value"</code>
						</format>
						<vdef>
							<value>200</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter an integer for burnin trees</message>
								<language>perl</language>
								<code>!defined $set_burnintrees</code>
							</ctrl> 
						</ctrls>
					</attributes>
				</parameter>
				
				<!-- -burnin the perentage of states to be considered as 'burn-in' for beast2  -->
				<parameter issimple="1"  type="Integer">
					<name>set_burnin2</name>
					<attributes>
						<group>5</group>
						<prompt>Burnin as percentage of states (-b)</prompt>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 </code>
						</precond>
						<format>
							<language>perl</language>
							<code> "-b $value"</code>
						</format>
						<ctrls>
							<ctrl>
								<message>Please enter an integer for percentage of burnin states</message>
								<language>perl</language>
								<code>!defined $set_burnin2</code>
							</ctrl>
							<ctrl>
								<message>Please enter an integer for burnin between 1 and  100</message>
								<language>perl</language>
								<code>$set_burnin2 &gt; 100</code>
							</ctrl>
							<ctrl>
								<message>Please enter an integer for burnin between 1 and  100</message>
								<language>perl</language>
								<code>$set_burnin2 &lt; 1</code>
							</ctrl>
						</ctrls>
					</attributes>
				</parameter>
<!-- -lowMem  -->
				<parameter issimple="1"  type="Switch">
					<name>use_lowmem</name>
					<attributes>
						<group>5</group>
						<prompt>Use the low memory option (-lowMem)</prompt>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 </code>
						</precond>
						<format>
							<language>perl</language>
							<code> "-lowMem"</code>
						</format>
					</attributes>
				</parameter>
								
<!--  -limit the minimum posterior probability for a node to be annotated  -->
				<parameter issimple="1"  type="Float">
					<name>set_limit</name>
					<attributes>
						<prompt>Posterior probability limit (-limit)</prompt>
						<format>
							<language>perl</language>
							<code> (defined $value) ? "-limit $value":""</code>
						</format>
						<ctrls>
							<ctrl>
								<message>Sorry, the value for minimum posterior probability must be less than 1</message>
								<language>perl</language>
								<code>$set_limit &gt; 1</code>
							</ctrl>
						</ctrls>
						<group>6</group>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>

<!--  Target Tree type -->
		<parameter issimple="1"  ishidden="0" type="Excl">
			<name>tree_type</name>
			<attributes>
				<prompt>Target tree type (-heights)</prompt>
 			<vlist>
 				<value>MCC</value>
				<label>Maximum clade credibility</label>  
  				<value>UTT</value>
				<label>User target tree</label> 
			</vlist> 
				<vdef>
					<value>keep</value>				
				</vdef>
				<group>4</group>
			</attributes>
		</parameter> 
				
<!--  [-heights <keep|median|mean>] -->
		<parameter issimple="1"  ishidden="0" type="Excl">
			<name>tree_heights</name>
			<attributes>
				<prompt>Set the tree heights (-heights)</prompt>
				<format>
					<language>perl</language>
					<code> "-heights $value"</code>
				</format>
 			<vlist>
 				<value>keep</value>
				<label>Keep Target Heights</label>  
				<value>median</value>
				<label>Median Heights</label>
  				<value>mean</value>
				<label>Mean Heights</label> 
				<value>ca</value>
				<label>Common Ancestor Heights</label>
			</vlist> 
				<vdef>
					<value>keep</value>				
				</vdef>
				<group>4</group>
			</attributes>
		</parameter> 
	
<!-- -target specifies a user target tree to be annotated  -->
		<parameter type="InFile" issimple = "1">
			<name>tree_file</name>
			<attributes>
				<prompt>Specify a target tree file </prompt>
					<precond>
						<language>perl</language>
						<code>$tree_type eq "UTT"</code>
					</precond>
					<format>
						<language>perl</language>
						<code> "-target target.trees"</code>
					</format>
					<ctrls>
						<ctrl>
							<message>Please supply a target tree</message>
							<language>perl</language>
							<code>$tree_type eq "UTT" &amp;&amp; !$tree_file</code>
						</ctrl>
					</ctrls>
				<filenames>target.trees</filenames>
			<group>7</group>
			</attributes>
		</parameter>
		
<!--     -forceDiscrete forces integer traits to be treated as discrete traits. -->
				<parameter issimple="1"  type="Switch">
					<name>force_discrete</name>
					<attributes>
						<prompt>Force integer traits to be treated as discrete traits (-forceDiscrete)</prompt>
						<format>
							<language>perl</language>
							<code> ($value) ? "-forceDiscrete":""</code>
						</format>
						<vdef>
							<value>0</value>
						</vdef>
						<group>10</group>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>  
				
<!--    -hpd2D the HPD interval to be used for the bivariate traits -->
				<parameter issimple="1"  type="Float">
					<name>hpd_interval</name>
					<attributes>
						<prompt>HPD interval to be used for the bivariate traits (-hpd2D)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $hpd_interval) ? "-hpd2D $value" : "" </code>
						</format>
						<vdef>
							<value>0.95</value>
						</vdef>
						<group>10</group>
						<ctrls>
							<ctrl>
								<message>Please specify an HPD interval less than 1</message>
								<language>perl</language>
								<code>$hpd_interval &gt; 1</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>If this value is left blank, the default  (0.80) will apply. </value>
						</comment>
					</attributes>
				</parameter>			  
    
 <!--     -nohpd2D suppress calculation of HPD intervals for the bivariate traits -->
 				<parameter issimple="1"  type="Switch">
					<name>no_hpd2D</name>
					<attributes>
						<prompt>Suppress calculation of HPD intervals for the bivariate traits (-nohpd2D)</prompt>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 </code>
						</precond>
						<format>
							<language>perl</language>
							<code>($value) ? "-nohpd2D" : "" </code>
						</format>
						<group>10</group>
					</attributes>
				</parameter>
  
<!--     -noSA interpret the tree set as begin from a not being from a sampled ancestor analysis, even if there are zero branch lengths in the tree set -->
				<parameter issimple="1"  type="Float">
					<name>not_ancestral</name>
					<attributes>
						<prompt>Interpret tree set as not being from a sampled ancestor analysis (-noSA)</prompt>
						<precond>
							<language>perl</language>
							<code>$which_beast &gt; 200 </code>
						</precond>
						<format>
							<language>perl</language>
							<code>($value) ? "-noSA" : "" </code>
						</format>
						<group>10</group>
					</attributes>
				</parameter>
				
<!--  specify the output file name  -->
				<parameter issimple="1" ismandatory="1" type="String">
					<name>set_output</name>
					<attributes>
						<prompt>Specify the name of the output file</prompt>
						<format>
							<language>perl</language>
							<code> "$value"</code>
						</format>
						<vdef>
							<value>out.txt</value>
						</vdef>
	<!-- this file designator seems to come last in the command string, so we set if for 99 currently -->
						<group>99</group>	
						<ctrls>
							<ctrl>
								<message>Please specify an output name</message>
								<language>perl</language>
								<code>!$set_output</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>
</parameters>
</pise>


