<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
	<head>
		<title>FastTreeMP on XSEDE</title>
		<version>2.1.10</version>
		<description>Fast (Approximate) Maximum Likelihood tree construction - run on XSEDE</description>
		<authors>M.N. Price, P.S. Dehal, A.P. Arkin</authors>
		<reference>
			Price, M.N., Dehal, P.S., and Arkin, A.P. (2009) FastTree: Computing Large Minimum-Evolution Trees with Profiles instead of a Distance Matrix. Molecular Biology and Evolution 26:1641-1650, doi:10.1093/molbev/msp077
		</reference>
		<reference>
			Price, M.N., Dehal, P.S., and Arkin, A.P. (2010) FastTree 2 -- Approximately Maximum-Likelihood Trees for Large Alignments. PLoS ONE, 5(3):e9490. doi:10.1371/journal.pone.0009490
		</reference>
		<category>Phylogeny / Alignment</category>
	</head>
	
	<command>fasttree_xsede</command>
	

<parameters>
<!-- modified from Bryan's original version by mamiller, around 4/29/2014 -->
<!-- the following changes were made:
	add the -nt flag
	add support for -quote option
	add support for the -log option
	removed support for multiple phylip sequences, because i didnt see the value -->
<!-- command reference from the c source code-->
<!-- char *usage =
  "  FastTree protein_alignment > tree\n"
  "  FastTree < protein_alignment > tree\n"
  "  FastTree -out tree protein_alignment\n"
  "  FastTree -nt nucleotide_alignment > tree\n"
  "  FastTree -nt -gtr < nucleotide_alignment > tree\n"
  "  FastTree < nucleotide_alignment > tree\n"
  "FastTree accepts alignments in fasta or phylip interleaved formats\n"
  "\n"
  "Common options (must be before the alignment file):\n"
  "  -quiet to suppress reporting information\n"
  "  -nopr to suppress progress indicator\n"
  "  -log logfile - save intermediate trees, settings, and model details\n"
  "  -fastest - speed up the neighbor joining phase & reduce memory usage\n"
  "        (recommended for >50,000 sequences)\n"
  "  -n <number> to analyze multiple alignments (phylip format only)\n"
  "        (use for global bootstrap, with seqboot and CompareToBootstrap.pl)\n"
  "  -nosupport to not compute support values\n"
  "  -intree newick_file to set the starting tree(s)\n"
  "  -intree1 newick_file to use this starting tree for all the alignments\n"
  "        (for faster global bootstrap on huge alignments)\n"
  "  -pseudo to use pseudocounts (recommended for highly gapped sequences)\n"
  "  -gtr - generalized time-reversible model (nucleotide alignments only)\n"
  "  -wag - Whelan-And-Goldman 2001 model (amino acid alignments only)\n"
  "  -quote - allow spaces and other restricted characters (but not ' ) in\n"
  "           sequence names and quote names in the output tree (fasta input only;\n"
  "           FastTree will not be able to read these trees back in)\n"
  "  -noml to turn off maximum-likelihood\n"
  "  -nome to turn off minimum-evolution NNIs and SPRs\n"
  "        (recommended if running additional ML NNIs with -intree)\n"
  "  -nome -mllen with -intree to optimize branch lengths for a fixed topology\n"
  "  -cat # to specify the number of rate categories of sites (default 20)\n"
  "      or -nocat to use constant rates\n"
  "  -gamma - after optimizing the tree under the CAT approximation,\n"
  "      rescale the lengths to optimize the Gamma20 likelihood\n"
  "  -constraints constraintAlignment to constrain the topology search\n"
  "       constraintAlignment should have 1s or 0s to indicates splits\n"
  "  -expert - see more options\n"
  "For more information, see http://www.microbesonline.org/fasttree/\n";

char *expertUsage =
  "FastTree [-nt] [-n 100] [-quote] [-pseudo | -pseudo 1.0]\n"
  "           [-boot 1000 | -nosupport]\n"
  "           [-intree starting_trees_file | -intree1 starting_tree_file]\n"
  "           [-quiet | -nopr]\n"
  "           [-nni 10] [-spr 2] [-noml | -mllen | -mlnni 10]\n"
  "           [-mlacc 2] [-cat 20 | -nocat] [-gamma]\n"
  "           [-slow | -fastest] [-2nd | -no2nd] [-slownni] [-seed 1253] \n"
  "           [-top | -notop] [-topm 1.0 [-close 0.75] [-refresh 0.8]]\n"
  "           [-matrix Matrix | -nomatrix] [-nj | -bionj]\n"
  "           [-wag] [-nt] [-gtr] [-gtrrates ac ag at cg ct gt] [-gtrfreq A C G T]\n"
  "           [ -constraints constraintAlignment [ -constraintWeight 100.0 ] ]\n"
  "           [-log logfile]\n"
  "         [ alignment_file ]\n"
  "        [ -out output_newick_file | > newick_tree]\n"
  "\n"
  "or\n"
  "\n"
  "FastTree [-nt] [-matrix Matrix | -nomatrix] [-rawdist] -makematrix [alignment]\n"
  "    [-n 100] > phylip_distance_matrix\n"
  "\n"
  "  FastTree supports fasta or phylip interleaved alignments\n"
  "  By default FastTree expects protein alignments,  use -nt for nucleotides\n"
  "  FastTree reads standard input if no alignment file is given\n"
  "\n"
  "Input/output options:\n"
not currently supported  "  -n - read in multiple alignments in. This only\n"
  "    works with phylip interleaved format. For example, you can\n"
  "    use it with the output from phylip's seqboot. If you use -n, FastTree\n"
  "    will write 1 tree per line to standard output.\n"
	
Supported   "  -intree newickfile - read the starting tree in from newickfile.\n"
  "     Any branch lengths in the starting trees are ignored.\n"

Not supported currently	    -intree with -n will read a separate starting tree for each alignment.
Not supported currently     -intree1 newickfile - read the same starting tree for each alignment
Not supported currently   -quiet - do not write to standard error during normal operation (no progressindicator, no options summary, no likelihood values, etc.
Not supported currently   -nopr - do not write the progress indicator to stderr\n"
Supported:                -log logfile - save intermediate trees so you can extract the trees and restart long-running jobs if they crash; -log also reports the per-site rates (1 means slowest category)\n"
Supported                 -quote - quote sequence names in the output and allow spaces,parentheses, and colons in them but not ' characters (fasta files only)\n"

  "Distances:\n"
  "  Default: 
	For protein sequences: log-corrected distances and an amino acid dissimilarity matrix derived from BLOSUM45
    For nucleotide sequences: Jukes-Cantor distances
  
supported	To specify a different matrix, use -matrix FilePrefix or -nomatrix
supported 	Use -rawdist to turn the log-correction off or to use %different instead of Jukes-Cantor\n"
supported  -pseudo [weight] - Use pseudocounts to estimate distances between sequences with little or no overlap. (Off by default.) Recommended if analyzing the alignment 
	has sequences with little or no overlap. If the weight is not specified, it is 1.0\n"
 
  "Topology refinement:
	
By default, FastTree tries to improve the tree with up to 4*log2(N)rounds of minimum-evolution nearest-neighbor interchanges (NNI), 
where N is the number of unique sequences, 2 rounds of subtree-prune-regraft (SPR) moves (also min. evo.), and up to 2*log(N) rounds of maximum-likelihood NNIs.

supported	Use -nni to set the number of rounds of min. evo. NNIs,
supported 	Use -spr to set the rounds of SPRs.
	
supported  Use -noml to turn off both min-evo NNIs and SPRs (useful if refiningan approximately maximum-likelihood tree with further NNIs)\n"
supported  Use -sprlength set the maximum length of a SPR move (default 10)
supported  Use -mlnni to set the number of rounds of maximum-likelihood NNIs
supported  Use -mlacc 2 or -mlacc 3 to always optimize all 5 branches at each NNI and to optimize all 5 branches in 2 or 3 rounds\n"
supported  Use -mllen to optimize branch lengths without ML NNIs
supported  Use -mllen -nome with -intree to optimize branch lengths on a fixed topology
supported  Use -slownni to turn off heuristics to avoid constant subtrees (affects both ML and ME NNIs)
 
Maximum likelihood model options:
	(supported)
  -wag - Whelan-And-Goldman 2001 model instead of (default) Jones-Taylor-Thorton 1992 model (a.a. only)\n"
  -gtr - generalized time-reversible instead of (default) Jukes-Cantor (nt only)\n"
  -cat # - specify the number of rate categories of sites (default 20)\n"
  -nocat - no CAT model (just 1 category)\n"
  -gamma - after the final round of optimizing branch lengths with the CAT model, report the likelihood under the discrete gamma model with the same
	number of categories. FastTree uses the same branch lengths but optimizes the gamma shape parameter and the scale of the lengths. The final tree will 
	have rescaled lengths. Used with -log, this also generates per-site likelihoods for use with CONSEL, see GammaLogToPaup.pl and documentation on the 
	FastTree web site.
 
Support value options:
(supported)
  By default, FastTree computes local support values by resampling the site likelihoods 1,000 times and the Shimodaira Hasegawa test. If you specify -nome,
	it will compute minimum-evolution bootstrap supports instead. In either case, the support values are proportions ranging from 0 to 1. Use -nosupport to
	turn off support values or -boot 100 to use just 100 resamples. Use -seed to initialize the random number generator.
  
Searching for the best join:
(supported)
  By default, FastTree combines the 'visible set' of fast neighbor-joining with local hill-climbing as in relaxed neighbor-joining.
	-slow - exhaustive search (like NJ or BIONJ, but different gap handling); takes half an hour instead of 8 seconds for 1,250 proteins
	-fastest - search the visible set (the top hit for each node) only
	Unlike the original fast neighbor-joining, -fastest updates visible(C)after joining A and B if join(AB,C) is better than join(C,visible(C)
	 -fastest also updates out-distances in a very lazy way,\n"
     -fastest sets -2nd on as well, use -fastest -no2nd to avoid this\n"

Top-hit heuristics:
	(supported)
By default, FastTree uses a top-hit list to speed up search
	Use -notop (or -slow) to turn this feature off and compare all leaves to each other, and all new joined nodes to each other.
		-topm 1.0 sets the top-hit list size to parameter*sqrt(N).
	
FastTree estimates the top m hits of a leaf from the top 2*m hits of a 'close' neighbor, where close is
defined as d(seed,close) < 0.75 * d(seed, hit of rank 2*m) and updates the top-hits as joins proceed
 -close 0.75 - modify the close heuristic, lower is more conservative
 -refresh 0.8 - compare a joined node to all other nodes if its top-hit list is less than 80% of the desired length or if the age of the
	 top-hit list is log2(m) or greater\n"
 -2nd or -no2nd to turn 2nd-level top hits heuristic on or off. This reduces memory usage and running time but may lead to marginal reductions in tree quality.
(By default, -fastest turns on -2nd.)

Join options:
  -nj: regular (unweighted) neighbor-joining (default)\n"
  -bionj: weighted joins as in BIONJ, FastTree will also weight joins during NNIs
	
Constrained topology search options:
 -constraints alignmentfile - select an alignment file with values of 0, 1, and -. Not all sequences need be present. A column of 0s and 1s defines a 
	constrained split. Some constraints may be violated.(see 'violating constraints:' in standard error).\n"
 -constraintWeight - how strongly to weight the constraints. A value of 1 means a penalty of 1 in tree length for violating a constraint. Default: 100.0.

new option
Added the -trans option to read a transition matrix (and					
        stationary distribution) from a file. This is for amino acid					
        alignments only.					

-->
<!-- Rules for running FastTree on Expanse via the CIPRES gateway

All runs use 4 OpenMP threads on 4 cores in the shared partition of Expanse.
However, the charged usage in cores is based on the Slurm memory command.
Runs with mem=15G are charged for 8 cores, while runs with mem=60G are
charged for 32 cores.

- Ask the user whether more than 15 GB of memory is needed for the run.

- Specify the run parameters according to the following table.

  Maximum             Slurm
   memory  Threads   memory

  <=15 GB        4      15G
   >15 GB        4      60G

- Include the following in the run script.

  #SBATCH -p shared
  #SBATCH -*qos=shared-cipres
  #SBATCH -N 1
  #SBATCH -*per-node=1
  #SBATCH -*cpus-per-task=4
  #SBATCH -*mem=<memory>
  ...
  srun ... <wrapper> …
 -->
	
<!--  submission on trestles: the invocation line and any needed thread specification  -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>fasttree_trestles</name>
						<attributes>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[fasttree_2.1.10_expanse]]>"</code>
							</format>
							<group>0</group>
						</attributes>
					</parameter>							
					
<!--					<parameter ismandatory="1" ishidden="1" type="String">
						<name>fasttree_output</name>
						<attributes>
							<format>
								<language>perl</language>		
								<code>"&gt; fastree_result.tre"</code>
							</format>
							<group>99</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.  --> 
	
<!-- 1 shared node and 2 threads for all jobs  -->									
				<parameter type="String" ishidden="1" >
					<name>number_nodes</name>
					<attributes>
						<precond>
							<language>perl</language>
							<code>!$more_memory</code>
						</precond>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\n" .
									"request_mem=15G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</attributes>
				</parameter>
<!-- end number of nodes  -->	

<!-- 1 shared node and 2 threads for all jobs  -->									
				<parameter type="String" ishidden="1" >
					<name>number_nodes2</name>
					<attributes>
						<precond>
							<language>perl</language>
							<code>$more_memory</code>
						</precond>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\n" .
									"request_mem=60G\\n" .
									"threads_per_process=4\\n"
							</code>
						</format>
					</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 (Fasta or interleaved PHYLIP format.)</prompt>
				<format>
					<language>perl</language>
					<code>"infile"</code>
				</format>
				<group>99</group>
<!-- this file designator seems to come at the end of the command string, so we set if for 99 currently -->
				<filenames>infile</filenames>
			</attributes>
		</parameter>
<!-- Results section. To start we return all results files available-->

<!--		<parameter ismandatory="1" ishidden="1" type="Results">
                	<name>out_file</name>
			<attributes>
				<filenames>fasttree_result.tre</filenames>
			</attributes>
		</parameter> -->
	
		<parameter ishidden="1" type="Results">
			<name>all_results</name>
			<attributes>
				<filenames>*</filenames>
			</attributes>
		</parameter>
		
<!-- 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>
						<prompt>Maximum Hours to Run (up to 168 hours)</prompt>
						<paramfile>scheduler.conf</paramfile>
						<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>
						<!-- provide feedback on number of cpu hrs to be consumed; all runs are the same, but this must be keyed to a visible param, so here we make it conditional on a non-zero run time. -->
						<warns>
						 <warn>
								<message>The job will run on 4 processors as configured. If it runs for the entire configured time, it will consume 4 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$runtime ne 0 &amp;&amp; !$more_memory </code>
							</warn>
							 <warn>
								<message>The job will run on 16 processors as configured. If it runs for the entire configured time, it will consume 16 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$runtime ne 0 &amp;&amp; $more_memory </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>

<!-- Determine whether the data set is partitioned, this will determine how the job is run. -->
				<parameter issimple="1" ismandatory="1" type="Excl">
					<name>datatype</name>
					<attributes>
						<group>5</group>
						<prompt>Please Specify your data type</prompt>
						<vlist>
							<value>DNA</value>
							<label>Nucleotide</label>
							<value>PROTEIN</value>
							<label>Amino acid</label>
						</vlist>
						<flist>
							<value>DNA</value>
							<code>"-nt"</code>
							<value>PROTEIN</value>
							<code>""</code>
						</flist>
						<vdef>
							<value>DNA</value>
						</vdef>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>
				
<!-- More memory -->
				<parameter issimple="1" ismandatory="1" type="Switch">
					<name>more_memory</name>
					<attributes>
						<prompt>I need more memory</prompt>
						<comment>
							<value>This option will help when more memory is needed</value>
						</comment>
					</attributes>
				</parameter>
	
<!--	<parameter type="Paragraph">
		<paragraph>
			<name>input_output</name>
			<prompt>Input/Output options</prompt>
			<parameters> -->
<!-- we dont have any obvious way to support this -->				
<!--				<parameter type="Integer">
					<name>num_aligns</name>
					<attributes>
						<prompt>Read in multiple alignments in. (Only works for Phylip.) (-n)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? " -n $value" : ""</code>
						</format>
					</attributes>
				</parameter> -->
				
<!-- simplified to not support the second option -->
				<parameter issimple="1" type="InFile">
					<name>intree</name>
					<attributes>
						<prompt>Starting Tree in Newick Format (-intree)</prompt>
						<group>5</group>
						<format>
							<language>perl</language>
							<code>(defined $value) ? "-intree starting_tree": "" </code>
						</format>
						<filenames>starting_tree</filenames>
						<comment>
							<value> -intree newick_file to set the starting tree. Tree must be in Newick format</value>
						</comment>
					</attributes>
				</parameter>
				
<!--		this is cute
			<parameter type="InFile">
					<name>intree</name>
					<attributes>
						<prompt>Starting Tree in Newick Format (-intree)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? ( ($intree1) ? " -intree1 $starting_tree " : " -intree starting_tree" ) : "" </code>
						</format>
						<filenames>starting_tree</filenames>
						<comment>
							<value> -intree newick_file to set the starting tree(s)</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>intree1</name>
					<attributes>
						<prompt>read the same starting tree for each alignment (-intree1)</prompt>
						<precond>
							<language>perl</language>
							<code>(defined $intree) &amp;&amp; ($num_aligns > 1)</code>
						</precond>
					</attributes>
				</parameter> -->
			
<!--			</parameters>
		</paragraph>
	</parameter> -->
	
					<parameter type="Switch">
					<name>write_log</name>
					<attributes>
						<prompt>Write intermediate trees to a log file (-log)</prompt>
						<group>5</group>
						<format>
							<language>perl</language>
							<code>($value) ? "-log logfile.txt":""</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
						<comment>
							<value>Save intermediate trees so you can extract the trees and restart long-running jobs if they crash; -log also reports
								 the per-site rates (1 means slowest category)</value>
						</comment>
					</attributes>
				</parameter>
	
				<parameter type="Switch">
					<name>write_quoted</name>
					<attributes>
						<prompt>Quote sequence names in output (-quote)</prompt>
						<group>5</group>
						<format>
							<language>perl</language>
							<code>($value) ? "-quote":""</code>
						</format>
						<comment>
							<value>Quote sequence names in the output and allow spaces, commas, and colons in them but not ' characters (fasta files only)\</value>
						</comment>
					</attributes>
				</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>distances</name>
			<prompt>Distances</prompt>
			<comment>
				<value>Default: For protein sequences, log-corrected distances and an amino acid dissimilarity matrix derived from BLOSUM45 or for nucleotide sequences, Jukes-Cantor distances</value>
			</comment>
			<parameters>
				
				<parameter type="Excl"  issimple="0">
					<name>dist_choice</name>
					<attributes>
						<prompt>Use non-default distances?</prompt>
						<vdef>
							<value>usedefault</value>
						</vdef>
						<vlist>
							<value>usedefault</value>
							<label>Use Default</label>
							<value>rawdist</value>
							<label>Raw Distances</label>
							<value>matrix</value>
							<label>User Specified Matrix</label>
							<value>nomatrix</value>
							<label>No Matrix</label>
						</vlist>
						<flist>
							<value>usedefault</value>
							<code>""</code>
							<value>rawdist</value>
							<code>" -rawdist "</code>
							<value>matrix</value>
							<code>" -matrix user_matrix"</code><!-- we'll set this name someplace else. -->
							<value>nomatrix</value>
							<code>" -nomatrix "</code>
						</flist>
						<comment>
							<value>Use -rawdist to turn the log-correction off or to use %different instead of Jukes-Cantor</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="InFile">
					<name>my_matrix</name>
					<attributes>
						<prompt>Substitution matrix file for (-matrix)</prompt>
						<precond>
							<language>perl</language>
							<code>$dist_choice == "matrix"</code>
						</precond>
						<filenames>user_matrix.distances</filenames>
						<ctrls>
							<ctrl>
								<message>Please select a substitution matrix file</message>
								<language>perl</language>
								<code>$dist_choice eq "matrix" &amp;&amp; !defined $my_matrix</code>
							</ctrl>
						</ctrls>
					</attributes>
				</parameter>
				
<!-- Added the -trans option to read a transition matrix (andstationary distribution) from a file; for amino acid alignments only.	-->
				<parameter type="InFile">
					<name>transition_matrix</name>
 					<attributes>
						<prompt>Read a transition matrix (and stationary distribution) from a file (-trans)</prompt>
						 <precond>
							 <language>perl</language>
							 <code>$datatype eq "PROTEIN"</code>
						 </precond>
						<format>
							<language>perl</language>
							<code>defined $value ? "-trans transmatrix.txt":"" </code>
						</format>
						<filenames>transmatrix.txt</filenames>
					</attributes>	
				</parameter>        
				
				<parameter type="Switch">
					<name>pseudo</name>
 					<attributes>
						<prompt>Use pseudocounts to estimate distances between sequences with little or no overlap. (-pseudo weight)</prompt>
						<comment>
							<value>Use pseudocounts to estimate distances between sequences with little or no overlap. (Off by default.) Recommended if analyzing
								 the alignment has sequences with little or no overlap. If the weight is not specified, it is 1.0</value>
						</comment>	
					</attributes>	
				</parameter>
				
				
				<parameter type="Float">
					<name>pseudo_value</name>
 					<attributes>
						<prompt>Weight value for pseudocounts</prompt>
						 <precond>
							 <language>perl</language>
							 <code>$pseudo</code>
						 </precond>
						<format>
							<language>perl</language>
							<code>" -pseudo $value"</code>
						</format>
						<vdef>
							<value>1.0</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter a weight for pseudocounts</message>
								<language>perl</language>
								<code>!defined $pseudo_value</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>If the weight is not specified, it is 1.0</value>
						</comment>	
					</attributes>	
				</parameter>
        		
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>topology_refinement</name>
			<prompt>Topology Refinement</prompt>
			<comment>
				<value>By default, FastTree tries to improve the tree with up to 4*log2(N) rounds of minimum-evolution nearest-neighbor interchanges (NNI), where N is the number of unique sequences, 2 rounds of subtree-prune-regraft (SPR) moves (also min. evo.), and up to 2*log(N) rounds of maximum-likelihood NNIs.
				</value>
			</comment>
			<parameters>

				<parameter type="Integer">
					<name>nni</name>
					<attributes>
						<group>40</group>
						<precond>
							<language>perl</language>
							<code>!$noml</code>
						</precond>
						<prompt>Number of rounds of nearest-neighbor interchanges (-nni)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? " -nni $value" : ""</code>
						</format>
						<vdef>
							<value>10</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter the number of nearest neighbor interchanges</message>
								<language>perl</language>
								<code>!defined $nni</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>Use -nni to set the number of rounds of min. evo. minimum-evolution nearest-neighbor interchanges.</value>
						</comment>
					</attributes>
				</parameter>

				<parameter type="Integer">
					<name>spr</name>
					<attributes>
						<group>40</group>
						<precond>
							<language>perl</language>
							<code>!$noml</code>
						</precond>
						<prompt>Rounds of subtree-prune-regraft (SPR) moves (-spr)</prompt>
						<format>
							<language>perl</language>
							<code>" -spr $value"</code>
						</format>
						<vdef>
							<value>2</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter the number of nearest neighbor interchanges (default = 2)</message>
								<language>perl</language>
								<code>!defined $spr</code>
							</ctrl>
						</ctrls>
						<comment>
							<value>By default, there are 2 rounds of subtree-prune-regraft (SPR) moves (also min. evo.)</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>noml</name>
					<attributes>
						<group>40</group>
						<prompt>Turn off both min-evo NNIs and SPRs (-noml)</prompt>
						<vdef><value>0</value></vdef>
						<format>
							<language>perl</language>
							<code>($value) ? " -noml" : ""</code>
						</format>
						<comment>
							<value>Use -noml to turn off both min-evo NNIs and SPRs (useful if refining an approximately maximum-likelihood tree with further NNIs)</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Float">
					<name>sprlength</name>
					<attributes>
						<group>40</group>
						<prompt>Maximum length of a SPR move (-sprlength)</prompt>
						<format>
							<language>perl</language>
							<code>" -sprlength $value "</code>
						</format>
						<vdef>
							<value>10</value>
						</vdef>
					</attributes>
				</parameter>
				
				<parameter type="Integer">
					<name>mlnni</name>
					<attributes>
						<group>40</group>
						<prompt>Set the number of rounds of maximum-likelihood NNIs. (-mlnni)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? " -mlnni $value " : ""</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter ismandatory="1" type="Excl">
					<name>mlacc</name>
					<attributes>
						<prompt>Number of rounds of optimization for NNIs (-mlacc)</prompt>
						<vlist>
							<value>default</value>
							<label>default</label>
							<value>2</value>
							<label>2</label>
							<value>3</value>
							<label>3</label>
						</vlist>
						<flist>
							<value>default</value>
							<code>""</code>
							<value>2</value>
							<code>" -mlacc 2 "</code>
							<value>3</value>
							<code>" -mlacc 3 "</code>
						</flist>
						<vdef>
							<value>default</value>
						</vdef>
						<comment>
							<value>Use -mlacc 2 or -mlacc 3 to always optimize all 5 branches at each NNI, and to optimize all 5 branches in 2 or 3 rounds.</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>mllen</name>
					<attributes>

						<prompt>Optimize branch lengths without ML NNIs. (-mllen)</prompt>
						<precond>
							<language>perl</language>
							<code>!defined $intree</code>
						</precond>
						<format>
							<language>perl</language>
							<code>($value) ? " -mllen " : ""</code>
						</format>
						<comment>
							<value>Use -mllen to optimize branch lengths without ML NNIs</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>mllen_fixedtopo</name>
					<attributes>
						<prompt>Optimize branch lengths on a fixed topology (-mllen with a Newick tree)</prompt>
						<precond>
							<language>perl</language>
							<code>defined $intree &amp;&amp; !$mllen</code>
						</precond>
						<format>
							<language>perl</language>
							<code>($value) ? " -mllen " : ""</code>
						</format>
						<comment>
							<value>Use -mllen with -intree to optimize branch lengths on  a tree of fixed topolgy </value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>slownni</name>
					<attributes>
						<prompt>Turn off heuristics to avoid constant subtrees. (-slownni)</prompt>
						<comment><value>Use -slownni to turn off heuristics to avoid constant subtrees (affects both
       ML and ME NNIs)</value></comment>
						<format>
							<language>perl</language>
							<code>($value) ? " -slownni" : ""</code>
						</format>
					</attributes>
				</parameter>
				
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>evolutionary_models</name>
			<prompt>Evolutionary Models</prompt>
				<parameters>
					
					<parameter type="Excl" ismandatory="1" issimple="0" >
						<name>protein_models</name>
						<attributes>
							<group>50</group>
							<prompt>Substitution Model (AA)</prompt>
							<precond>
								<language>perl</language>
								<code>$datatype eq "PROTEIN"</code>
							</precond>
							<vlist>
								<!-- the default for protein, results in no flag -->
								<value>jtt</value>
								<label>JTT+CAT Model (Default)</label>
								<!-- Whelan-And-Goldman 2001 model (amino acid alignments only) -->
								<value>wag</value>
								<label>WAG+CAT Model</label>
							</vlist>
							<flist>
								<value>jtt</value>
								<code>""</code>
								<value>wag</value>
								<code>"-wag"</code>
							</flist>
							<vdef>
								<value>jtt</value>
							</vdef>
							<comment>
								<value>  -wag - Whelan-And-Goldman 2001 model instead of (default) Jones-Taylor-Thorton 1992 model (a.a. only). -gtr - generalized time-reversible
instead of (default) Jukes-Cantor (nt only); -cat # - specify the number of rate categories of sites (default 20). -nocat - no CAT model (just 1 category);
 -gamma - after the final round of optimizing branch lengths with the CAT model, report the likelihood under the discrete gamma model with the same number of categories.
FastTree uses the same branch lengths but optimizes the gamma shape parameter and the scale of the lengths. The final tree will have rescaled lengths. 
Used with -log, this also generates per-site likelihoods for use with CONSEL, see GammaLogToPaup.pl and documentation on the FastTree web site.</value>
							</comment>
						</attributes>
					</parameter>
					
					<parameter type="Excl" ismandatory="1" issimple="0">
						<name>nucleotide_models</name>
						<attributes>
							<group>50</group>
							<prompt>Substitution Model (NT)</prompt>
							<precond>
								<language>perl</language>
								<code>$datatype eq "DNA"</code>
							</precond>
							<vlist>
								<value>jk</value>
								<label>Jukes-Cantor + CAT Model (Default)</label>
								<value>gtr</value>
								<label>Generalized Time-Reversable</label>
							</vlist>
							<flist>
								<value>jk</value>
								<code>""</code>
								<value>gtr</value>
								<code>"-gtr"</code>
							</flist>
							<vdef>
								<value>jk</value>
							</vdef>
						</attributes>
					</parameter>
					
					<parameter type="Integer">
						<name>cat</name>
						<attributes>
							<group>50</group>
							<precond>
								<language>perl</language>
								<code>!$nocat</code>
							</precond>
							<prompt>The number of rate categories of sites. (-cat)</prompt>
							<!-- What about nocat? -->
							<vdef>
								<value>20</value>
							</vdef>
							<format>
								<language>perl</language>
								<code>(defined $value) ? " -cat $value" : ""</code>
							</format>
							<comment>
								<value>The number of rate categories of sites (default 20)</value>
							</comment>
						</attributes>
					</parameter>
					
					<parameter type="Switch">
						<name>nocat</name>
						<attributes>
							<group>50</group>
							<prompt>No CAT model (just 1 category) (-nocat)</prompt>
							<vdef>
								<value>0</value>
							</vdef>
							<format>
								<language>perl</language>
								<code>($value) ? " -nocat" : ""</code>
							</format>
						</attributes>
					</parameter>
					
					<parameter type="Switch">
						<name>optimize_gamma</name>
						<attributes>
							<group>50</group>
							<prompt>After optimizing the tree under the CAT approximation, rescale the lengths to optimize the Gamma20 likelihood. (-gamma)</prompt>
							<format>
								<language>perl</language>
								<code>($optimize_gamma) ? " -gamma" : ""</code>
							</format>
						</attributes>
					</parameter>
			
				</parameters>
		</paragraph>
	</parameter>
	<parameter type="Paragraph">
		<paragraph>
			<name>support_value_options</name>
			<prompt>Support value options</prompt>
				<comment>
					<value>By default, FastTree computes local support values by resampling the site likelihoods 1,000 times and the
Shimodaira Hasegawa test. If you specify -nome,it will compute minimum-evolution bootstrap supports instead. In either case, the support
values are proportions ranging from 0 to 1. Use -nosupport to turn off support values or -boot 100 to use just 100 resamples. Use -seed to
initialize the random number generator</value>
				</comment>
			<parameters>
				
				<parameter type="Switch">
					<name>nosupport</name>
					<attributes>
						<prompt>Turn off support values. (-nosupport)</prompt>
						<format>
							<language>perl</language>
							<code>($nosupport) ? " -nosupport" : ""</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="Integer">
					<name>boot</name>
					<attributes>
						<group>60</group>
						<prompt>Number of bootstraps for a Shimodaira-Hasegawa test. (Default 1000) (-boot)</prompt>
						<precond>
							<language>perl</language>
							<code>!$nosupport</code>
						</precond>
						<format>
							<language>perl</language>
							<code>(defined $value)? " -boot $value " : "" </code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>nome</name>
					<attributes>
						<prompt>Compute minimum-evolution bootstrap supports (-nome)</prompt>
						<comment><value>Compute minimum-evolution bootstrap supports instead of performing the Shimodaira-Hasegawa test.</value></comment>
						<format>
							<language>perl</language>
							<code>($value) ? " -nome " : ""</code>
						</format>
					</attributes>
				</parameter>
			
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>searching_for_the_best_join</name>
			<prompt>Searching for the best join</prompt>

			<parameters>
				
				<parameter ismandatory="1" type="Excl">
					<name>search_speed</name>
					<attributes>
						<prompt>Search Speed (-slow) and (-fastest)</prompt>
						<vlist>
							<value>default</value>
							<label>default</label>
							<value>slow</value>
							<label>-slow</label>
							<value>fastest</value>
							<label>-fastest</label>
						</vlist>
						<flist>
							<value>default</value>
							<code>""</code>
							<value>slow</value>
							<code>" -slow "</code>
							<value>fastest</value>
							<code>" -fastest "</code>
						</flist>
						<vdef>
							<value>default</value>
						</vdef>
						<comment>
							<value>  -slow -- exhaustive search (like NJ or BIONJ, but different gap handling); takes half an hour instead of 8 seconds for 1,250 
proteins; -fastest -- search the visible set (the top hit for each node) only; Unlike the original fast neighbor-joining, -fastest updates visible(C)after joining
A and B if join(AB,C) is better than join(C,visible(C))-fastest also updates out-distances in a very lazy way, -fastest sets -2nd on as well, use -fastest -no2nd
to avoid this</value>
						</comment>
					</attributes>
				</parameter>
			
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>top_hit_heuristics</name>
			<prompt>Top-hit Heuristics</prompt>
			<comment><value>By default, FastTree combines the 'visible set' of fast neighbor-joining with
      local hill-climbing as in relaxed neighbor-joining</value></comment>
			<parameters>
				
				<parameter type="Switch">
					<name>notop</name>
					<attributes>
						<prompt>Turn off top-hit list. (-notop)</prompt>
						<comment>
							<value>By default, FastTree uses a top-hit list to speed up search. Use -notop (or -slow) to turn this feature off and compare all
								 leaves to each other, and all new joined nodes to each other</value>
						</comment>
						<format>
							<language>perl</language>
							<code>($value) ? " -notop " : ""</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="Float">
					<name>topm</name>
					<attributes>
						<prompt>Top-Hit list size, as a proportion of sqrt(N) (-topm)</prompt>
						<precond>
							<language>perl</language>
							<code>!$notop</code>
						</precond>
						<format>
							<language>perl</language>
							<code>(defined $value) ? " -topm $value " : ""</code>
						</format>
						<vdef>
							<value>1.0</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Sorry, the value for -topm must be greater than 0</message>
								<language>perl</language>
								<code>$topm &lt;= 0 </code>
							</ctrl>
						</ctrls>
						<comment>
							<value>Set the top-hit list size to parameter*sqrt(N)FastTree estimates the top m hits of a leaf from the
								top 2*m hits of a 'close' neighbor, where close is defined as d(seed,close) &lt; 0.75 * d(seed, hit of rank 2*m),
								and updates the top-hits as joins proceed</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Float">
					<name>close</name>
					<attributes>
						<prompt>Enter a value to modify the close heuristic (default = 0.75) (-close)</prompt>
						<format>
							<language>perl</language>
							<code>(defined $value) ? " -close $value " : ""</code>
						</format>
						<vdef>
							<value>0.75</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Sorry, the -close value must be greater than 0 and less than 1</message>
								<language>perl</language>
								<code>$close &lt;= 0 || $close &gt;= 1 </code>
							</ctrl>
						</ctrls>
						<comment>
							<value>-close 0.75 -- modify the close heuristic, lower is more conservative.</value>
						</comment>
					</attributes>
				</parameter>
				
				<parameter type="Float">
					<name>refresh</name>
					<attributes>
						<prompt>Enter a value to modify the refresh value (default = 0.8) (-refresh)</prompt>
						<precond>
							<language>perl</language>
							<code>!$notop</code>
						</precond>
						<format>
							<language>perl</language>
							<code>(defined $value) ? " -refresh $value" : ""</code>
						</format>
						<vdef>
							<value>0.8</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Sorry, the value for -refresh must be greater than 0 and less than 1</message>
								<language>perl</language>
								<code>$refresh &lt;= 0 || $refresh &gt;= 1</code>
							</ctrl>
						</ctrls>
						<comment><value>-refresh 0.8 -- compare a joined node to all other nodes if its top-hit list is less than 80% of the desired length,
							or if the age of the top-hit list is log2(m) or greater.</value></comment>
					</attributes>
				</parameter>
				
				<parameter type="Switch">
					<name>use_second</name>
					<attributes>
						<prompt>Use 2nd-level top hits (-2nd) uncheck for (-no2nd)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "-2nd":"-no2nd"</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
						<comment>
							<value>-2nd or -no2nd to turn 2nd-level top hits heuristic on or off. This reduces memory usage and running time but may lead to
							marginal reductions in tree quality. (By default, -fastest turns on -2nd.)
							</value>
						</comment>
					</attributes>
				</parameter>
			
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>join_options</name>
			<prompt>Join Options</prompt>
				<comment>
					<value>  -nj: regular (unweighted) neighbor-joining (default). -bionj: weighted joins as in BIONJ. FastTree will also weight joins during NNIs
					</value>
				</comment>
			<parameters>
				
				<parameter type="Switch">
					<name>bionj</name>
					<attributes>
						<group>90</group>
						<prompt>Weighted joins as in BIONJ. FastTree will also weight joins during NNIs. (default is -nj) (-bionj)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? " -bionj " : ""</code>
						</format>
					</attributes>
				</parameter>
			</parameters>
		</paragraph>
	</parameter>
	
	<parameter type="Paragraph">
		<paragraph>
			<name>constrained_topology</name>
			<prompt>Constrained topology search options</prompt>
			<parameters>
				
				<parameter type="InFile">
					<name>constraints</name>
					<attributes>
						<prompt>Select a split constraints alignment file(-constraints)</prompt>
						<comment><value>-constraints alignmentfile -- an alignment with values of 0, 1, and -. Not all sequences need be present. A column of 0s and 1s defines a
       constrained split. Some constraints may be violated (see 'violating constraints:' in standard error).</value>
						</comment>
						<format>
							<language>perl</language>
							<code>" -constraints constraints_file "</code>
						</format>
						<filenames>constraints_file</filenames>
					</attributes>
				</parameter>
				
				<parameter type="Float">
					<name>constraint_weight</name>
					<attributes>
						<prompt>Constraint weight (-constraintWeight)</prompt>
						<precond>
							<language>perl</language>
							<code>(defined $constraints)</code>
						</precond>
						<format>
							<language>perl</language>
							<code>"-constraintWeight $value "</code>
						</format>
						<vdef>
							<value>100</value>
						</vdef>
						<ctrls>
							<ctrl>
								<message>Please enter a weight for the constraints file</message>
								<language>perl</language>
								<code>!defined $constraint_weight</code>
							</ctrl>
						</ctrls>
						<comment>
<value>-constraintWeight -- how strongly to weight the constraints. A value of 1 means a penalty of 1 in tree length for violating
a constraint. Default: 100.0</value>
						</comment>
					</attributes>
				</parameter>
			
			</parameters>
		</paragraph>
	</parameter>
</parameters>
</pise>


