<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
	<head>
		<title>FastML on XSEDE</title>
		<version>3.1.1</version>
		<description>Fast (Approximate) Maximum Likelihood tree construction - run on XSEDE</description>
		<authors>H. Ashkenazy, O. Penn, O. et al.</authors>
		<reference>
Ashkenazy, H., Penn, O., Doron-Faigenboim, A., Cohen, O., Cannarozzi, G., Zomer, O., and Pupko, T. (2012) FastML: a web server for probabilistic reconstruction of ancestral sequences. Nucleic Acids Res 40, W580-W584
		</reference>
		<category>Phylogeny / Alignment</category>
	</head>
	
	<command>fastml_xsede</command>	

<parameters>
<!-- USAGE:FastML_Wrapper.pl 

-*MSA_File <MSA_File> 
-*seqType <aa|nuc|codon> 
-*outDir <FULL_PATH_outDir>

Optional parameters:
  -*Tree <phylogenetic tree>
  -*TreeAlg <NJ | RAxML> - How to build tree when tree not provided by user; default=NJ
  -*SubMatrix <JTT | LG | mtREV | cpREV | WAG | DAYHOFF > amino acid options, the default is JTT.
              <JC_Nuc | T92 | HKY | GTR> nucleotide options, the default is JC_Nuc.
              <yang | empiriCodon> codon options, the default is yang.
  -*OptimizeBL <yes | no> default: yes
  -*UseGamma   <yes | no> default: yes
# -*OptAlpha   <yes | no> default: no (relevant only when UseGamma==yes)
  -*Alpha      <User provide alpha>   (relevant only when UseGamma==yes) 
                                       user alpha parameter of the gamma distribution [if alpha is not given, alpha and branches will be evaluated from the data]
  -*jointReconstruction <yes | no> default: yes
  -*indelReconstruction <PARSIMONY|ML|BOTH> - which method is used for indel reconstruction
  -*indelCutOff <Cutoff for indel vs Char> deafult =0.5
 -->
	
<!--  submission on trestles: the invocation line and any needed thread specification  -->
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>fastml_comet</name>
						<attributes>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[fastml_wrapper_3.11_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>
						<group>2</group>
						<precond>
							<language>perl</language>
							<code>!$more_memory</code>
						</precond>
						<paramfile>scheduler.conf</paramfile>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\n" .
									"mem=8G\\n" .
									"threads_per_process=1\\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>
						<group>2</group>
						<paramfile>scheduler.conf</paramfile>
						<precond>
							<language>perl</language>
							<code>$more_memory</code>
						</precond>
						<format>
							<language>perl</language>
							<code>
									"nodes=1\\n" .
									"node_exclusive=0\n" .
									"mem=128G\\n" .
									"threads_per_process=1\\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>
					<filenames>infile</filenames>
				<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>
		
<!-- 		<parameter ishidden="1" type="String">
			<name>input_file</name>
			<attributes>
				<format>
					<language>perl</language>
					<code>"-*MSA_file infile"</code>
				</format>
			</attributes>
		</parameter>  -->
		
<!-- -*outDir <FULL_PATH_outDir> 	
		<parameter ishidden="0" type="String">
			<name>output_file</name>
			<attributes>
				<format>
					<language>perl</language>
					<code>(defined $value) ? "-outDir $value":""</code>
				</format>
			</attributes>
		</parameter> -->		
		
<!-- test -->
<!--  submission on comet: the invocation line and any needed thread specification  
					<parameter ismandatory="1" ishidden="1" type="String">
						<name>fastml_comet</name>
						<attributes>
							<format>
								<language>perl</language>		
								<code>"<![CDATA[-*outDir 'pwd'/test]]>"</code>
							</format>
							<group>0</group>
						</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>!$more_memory</code>
							</warn>
							<warn>
								<message>The job will run on 64 processors as configured. If it runs for the entire configured time, it will consume 64 x $runtime cpu hours</message>
								<language>perl</language>
								<code>$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>
				
<!-- more memory -->
				<parameter issimple="1" ismandatory="1" type="Switch">
					<name>more_memory</name>
					<attributes>
						<group>5</group>
						<prompt>I need more memory</prompt>
					</attributes>
				</parameter>				

<!-- USAGE:FastML_Wrapper.pl 

-*seqType <aa|nuc|codon> 

 -->
<!-- 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>nuc</value>
							<label>Nucleotide</label>
							<value>aa</value>
							<label>Amino acid</label>
							<value>codon</value>
							<label>codon</label>
						</vlist>
						<vdef>
							<value>nuc</value>
						</vdef>
						<format>
							<language>perl</language>
							<code>"--seqType $value "</code>
						</format>
						<comment>
							<value>This option will help the application determine how to run the job</value>
						</comment>
					</attributes>
				</parameter>

<!-- Optional parameters:
 
 
  -*SubMatrix <JTT | LG | mtREV | cpREV | WAG | DAYHOFF > amino acid options, the default is JTT.
              <JC_Nuc | T92 | HKY | GTR> nucleotide options, the default is JC_Nuc.
              <yang | empiriCodon> codon options, the default is yang.
  -*OptimizeBL <yes | no> default: yes
  -*UseGamma   <yes | no> default: yes
# -*OptAlpha   <yes | no> default: no (relevant only when UseGamma==yes)
  -*Alpha      <User provide alpha>   (relevant only when UseGamma==yes) 
                                       user alpha parameter of the gamma distribution [if alpha is not given, alpha and branches will be evaluated from the data]
  -*jointReconstruction <yes | no> default: yes
  -*indelReconstruction <PARSIMONY|ML|BOTH> - which method is used for indel reconstruction
  -*indelCutOff <Cutoff for indel vs Char> deafult =0.5 -->
				
<!--  -*Tree <phylogenetic tree>-->
				<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) ? "--Tree 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>

<!-- fixc the tree algortihm as NJ  -->
				<parameter ishidden="1" type="String" >
					<name>tree_algorithm</name>
					<attributes>
						<precond>
							<language>perl</language>
							<code>!defined $intree</code>
						</precond>
						<format>
							<language>perl</language>
							<code>"--TreeAlg NJ"</code>
						</format>
					</attributes>
				</parameter> 
				
<!--  -*TreeAlg <NJ | RAxML> - How to build tree when tree not provided by user; default=NJ -->			
<!--  comment in to give a choice of raxml			<parameter type="Excl">
					<name>tree_algorithm</name>
					<attributes>
						<prompt>What Algorithm to build the tree? (-*TreeAlg)</prompt>
						<vlist>
							<value>NJ</value>
							<label>Neighbor Joining</label>
							<value>RAxML</value>
							<label>RAxML</label>
						</vlist>
						<format>
							<language>perl</language>
							<code>"-*TreeAlg $value"</code>
						</format>
						<comment>
							<value> -intree newick_file to set the starting tree(s)</value>
						</comment>
					</attributes>
				</parameter> -->	

<!-- Optional parameters:
  -*SubMatrix <JTT | LG | mtREV | cpREV | WAG | DAYHOFF > amino acid options, the default is JTT.
              <JC_Nuc | T92 | HKY | GTR> nucleotide options, the default is JC_Nuc.
              <yang | empiriCodon> codon options, the default is yang.
 -->
  			
				<parameter type="Excl">
					<name>dna_matrix</name>
					<attributes>
						<prompt>Choose a DNA matrix(--SubMatrix)</prompt>
						<precond>
							<language>perl</language>
							<code>$datatype eq "nuc"</code>
						</precond>
						<vlist>
							<value>JC_Nuc</value>
							<label>JC_Nuc</label>
							<value>T92</value>
							<label>T92</label>
							<value>HKY</value>
							<label>HKY</label>
							<value>GTR</value>
							<label>GTR</label>
						</vlist>
						<vdef>
							<value>JC_Nuc</value>
						</vdef>
						<format>
							<language>perl</language>
							<code>"--SubMatrix $value"</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="Excl">
					<name>protein_matrix</name>
					<attributes>
						<prompt>Choose a Protein matrix(--SubMatrix)</prompt>
						<precond>
							<language>perl</language>
							<code>$datatype eq "aa"</code>
						</precond>
<!-- <JTT | LG | mtREV | cpREV | WAG | DAYHOFF > -->
						<vlist>
							<value>JTT</value>
							<label>JTT</label>
							<value>LG</value>
							<label>LG</label>
							<value>mtREV</value>
							<label>mtREV</label>
							<value>cpREV</value>
							<label>cpREV</label>
							<value>WAG</value>
							<label>WAG</label>
							<value>DAYHOFF</value>
							<label>DAYHOFF</label>
						</vlist>
						<vdef>
							<value>JTT</value>
						</vdef>
						<format>
							<language>perl</language>
							<code>"--SubMatrix $value"</code>
						</format>
					</attributes>
				</parameter>
				
				<parameter type="Excl">
					<name>codon_matrix</name>
					<attributes>
						<prompt>Choose a Codon matrix(--SubMatrix)</prompt>
						<precond>
							<language>perl</language>
							<code>$datatype eq "codon"</code>
						</precond>
<!--               <yang | empiriCodon> codon options, the default is yang. -->
						<vlist>
							<value>yang</value>
							<label>Yang</label>
							<value>empiriCodon</value>
							<label>EmpiriCodon</label>
						</vlist>
						<vdef>
							<value>yang</value>
						</vdef>
						<format>
							<language>perl</language>
							<code>"--SubMatrix $value"</code>
						</format>
					</attributes>
				</parameter>
			
<!-- -*OptimizeBL <yes | no> default: yes -->
					<parameter type="Switch">
					<name>optimize_branchlengths</name>
					<attributes>
						<prompt>Optimize Branch Lengths (--OptimizeBL)</prompt>
						<group>5</group>
						<format>
							<language>perl</language>
							<code>($value) ? "--OptimizeBL":""</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
					</attributes>
				</parameter>

<!-- -*UseGamma   <yes | no> default: yes -->
				<parameter type="Switch">
					<name>use_gamma</name>
					<attributes>
						<prompt>Use Gamma (--UseGamma)</prompt>
						<group>5</group>
						<format>
							<language>perl</language>
							<code>($value) ? "--UseGamma":""</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
					</attributes>
				</parameter>

  <!-- # -*OptAlpha   <yes | no> default: no (relevant only when UseGamma==yes)
				<parameter type="Switch">
					<name>opt_alpha</name>
					<attributes>
						<prompt>Optimize Alpha (-*OptAlpha)</prompt>
						<precond>
							<language>perl</language>
							<code>$use_gamma</code>
						</precond>
						<format>
							<language>perl</language>
							<code>($value) ? "-*OptAlpha":""</code>
						</format>
						<vdef>
							<value>1</value>
						</vdef>
					</attributes>
				</parameter> -->
				
<!-- -*Alpha      <User provide alpha>   (relevant only when UseGamma==yes) 
                                       user alpha parameter of the gamma distribution [if alpha is not given, alpha and branches will be evaluated from the data] -->
				<parameter type="Float">
					<name>specify_alpha</name>
					<attributes>
						<prompt>Specify Alpha (--Alpha)</prompt>
						<precond>
							<language>perl</language>
							<code>$use_gamma</code>
						</precond>
						<format>
							<language>perl</language>
							<code>(defined $value) ? "--Alpha $value":""</code>
						</format>
						<comment>
<value>User specifies the alpha parameter of the gamma distribution [if alpha is not given, alpha and branches will be evaluated from the data]</value>
						</comment>
					</attributes>
				</parameter>
  
<!--  -*jointReconstruction <yes | no> default: yes -->  
 				<parameter type="Switch">
					<name>joint_reconstruction</name>
					<attributes>
						<prompt>Joint_reconstruction (--jointReconstruction)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "--jointReconstruction":""</code>
						</format>
						<comment>
<value>User specifies the alpha parameter of the gamma distribution [if alpha is not given, alpha and branches will be evaluated from the data]</value>
						</comment>
					</attributes>
				</parameter> 
				
<!--   -*indelReconstruction <PARSIMONY|ML|BOTH> - which method is used for indel reconstruction -->
 				<parameter type="Excl">
					<name>indel_reconstruction</name>
					<attributes>
						<prompt>Method for Indel_reconstruction (--indelReconstruction)</prompt>
						<vlist>
							<value>PARSIMONY</value>
							<label>Parsimony</label>
							<value>ML</value>
							<label>ML</label>
							<value>BOTH</value>
							<label>Both</label>
						</vlist>
						<format>
							<language>perl</language>
							<code>(defined $value) ? "--indelReconstruction $value":""</code>
						</format>
					</attributes>
				</parameter> 

<!--   -*indelCutOff <Cutoff for indel vs Char> deafult =0.5> -->

 				<parameter type="Float">
					<name>indel_cutoff</name>
					<attributes>
						<prompt>Cutoff for Indel vs Char (--indelCutoff)</prompt>
						<format>
							<language>perl</language>
							<code>($value) ? "--indelCutoff $value":""</code>
						</format>
					</attributes>
				</parameter> 

</parameters>
</pise>


