<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE pise PUBLIC "pise.dtd" "pise2.dtd"  >
<pise>

  <head>
    <title>Consense</title>
    <version>Phylip 3.66</version>
    <description>Find A Consensus Tree</description>
        <authors>Felsenstein</authors>
    <reference>Felsenstein, J.  2007.  PHYLIP -- Phylogeny Inference Package (Version 3.682). Distributed by the author.  Department of Genetics, University of Washington, Seattle.</reference>
    <reference>Felsenstein, J.  1989.  PHYLIP -- Phylogeny Inference Package (Version 3.2). Cladistics  5: 164-166.</reference>
    <category>Phylogeny / Alignment</category>
    <doclink>http://bioweb.pasteur.fr/docs/gensoft-evol.html#PHYLIP</doclink>
  </head>
       
  <command>consense</command>
				
  <parameters>

    <parameter iscommand="1" ishidden="1" type="String">
      <name>consense</name>
      <attributes>
	<format>
	  <language>perl</language>
	  <code>"/expanse/projects/ngbt/opt/comet/phylip/phylip-3.697/exe/consense &lt; params"</code>
	</format>
	<group>0</group>
      </attributes>
    </parameter>

	<!-- scheduler file -->
		<parameter type="String" ishidden="1" >
			<name>scheduler_input</name>
			<attributes>
				<paramfile>scheduler.conf</paramfile>
					<format>
						<language>perl</language>
						<code>
									"ChargeFactor=1.0\\n" .
									"nodes=1\\n" .
									"node_exclusive=0\\n" .
									"threads_per_process=1\\n"
						</code>
					</format>
			</attributes>
		</parameter>
		
	<!-- <parameter ismandatory="1" issimple="1"  type="InFile"> -->
    <parameter ismandatory="1" issimple="1" isinput="1" type="InFile">
      <name>infile</name>
      <attributes>
	<prompt>Trees File</prompt>
	<format>
	  <language>perl</language>
	   <!-- <code>"ln -sf $infile intree; "</code> -->
	   <code>"ln -sf infile.phylip intree; "</code>
	</format>
	<group>-10</group>
	<pipe>
	  <pipetype>phylip_tree</pipetype>
	  <language>perl</language>
	  <code>1</code>
	</pipe>
	<filenames>infile.phylip</filenames>
      </attributes>
    </parameter>
    
    <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>1.0</value></vdef>
		<comment>
			<value>
				Estimate the maximum time your job will need to run (up to 72 hrs).  Your job will be killed if it doesn't finish within the time you specify, however jobs with shorter maximum run times are often scheduled sooner than longer jobs.
			</value>
		</comment>
		<ctrls>
			<ctrl>
				<message>Maximum Hours to Run must be between 0.1 - 72.0.</message>
				<language>perl</language>
				<code>$runtime &lt; 0.1 || $runtime &gt; 72.0</code>
			</ctrl>
			<ctrl>
				<message>Please set a value for the runtime</message>
				<language>perl</language>
				<code>!defined $runtime </code>
			</ctrl>
		</ctrls>
		<format>
			<language>perl</language>
			<code>"runhours=$value\\n"</code>
		</format>
	</attributes>
</parameter>

    <parameter type="Excl">
      	<name>type</name>
      	<attributes>
			<prompt>Consensus type</prompt>
			<vlist>
	  			<value>MRE</value>
	  			<label>Majority rule (extended)</label>
	  			<value>S</value>
	  			<label>Strict</label>
	  			<value>MR</value>
	  			<label>Majority rule</label>
	  			<value>ML</value>
	  			<label>Ml (M-sub-L)</label>
			</vlist>
			<vdef>
	  			<value>MRE</value>
			</vdef>
			<flist>
	  			<value>MRE</value>
	  			<code>""</code>
	  			<value>S</value>
	  			<code>"C\\n"</code>
	  			<value>MR</value>
	  			<code>"C\\nC\\n"</code>
	  			<value>ML</value>
	  			<code>"C\\nC\\nC\\n"</code>
			</flist>
			<paramfile>params</paramfile>
			<comment>
<value>The Consensus method input selects which of four methods the program uses.
	 Extended Majority Rule, Strict, Majority Rule, and Ml are all allowed methods.
	 In each case the fraction of times a set appears among the input trees is counted by weighting by the weights
	 of the trees (the numbers like [0.6000] that appear at the ends of trees in some cases).</value>
<value>Majority Rule, extended (Default Method): Any set of species that appears in more than 50% of the trees is included.
The program then considers the other sets of species in order of the frequency of their appearance.
 These are added to the consensus tree if they are compatible with it, until the tree is fully resolved.
</value>
<value>Strict: A set of species must appear in all input trees to be included in the strict consensus tree.</value>
<value>Ml: The user is asked for a threshold fraction (between 0.5 and 1), and any set of species that occurs among
the input trees more than the specified fraction of the time is included in the consensus tree. The Strict consensus
and the Majority Rule consensus are extreme cases of the Ml consensus, being for fractions of 1 and 0.5 respectively.</value>
<value>Majority Rule: A set of species is included in the consensus tree if it is present in more than 0.5 of all input trees.</value>
			</comment>
	<!-- Group is needed to know where in the paramfile -->
			<group>1</group>
	<!-- -->
      	</attributes>
    </parameter>

 <parameter type="Paragraph">
    <paragraph>
		<name>output</name>
		<prompt>Output options</prompt>
	
		<parameters>
	  		<parameter type="Switch">
	    		<name>print_tree</name>
	    		<attributes>
	      			<prompt>Print out tree (3)</prompt>
	      			<format>
						<language>perl</language>
						<code>($value)? "" : "3\\n"</code>
	      			</format>
	      			<vdef>
	      				<value>1</value>
	      			</vdef>
	      			<group>1</group>
					<comment>
<value>Tells the program to print a semi-graphical picture of the tree in the outfile.</value>
	     			 </comment>
	      			<paramfile>params</paramfile>
	    		</attributes>
	  	</parameter>

	  <parameter type="Switch">
	    	<name>print_treefile</name>
	    	<attributes>
	     		 <prompt>Write best tree into a tree file (4)</prompt>
	      		<format>
					<language>perl</language>
					<code>($value)? "" : "4\\n"</code>
	      		</format>
	      		<vdef>
	      			<value>1</value>
	      		</vdef>
	      		<group>1</group>
	      		<comment>
<value>Tells the program to save the tree in Newick format.</value>
	     		 </comment>
	      		<paramfile>params</paramfile>
	    	</attributes>
	  </parameter>

	  <parameter type="Switch">
	    <name>printdata</name>
	    <attributes>
	      <prompt>Print out the data at start of run (1)</prompt>
	      <format>
				<language>perl</language>
				<code>($value)? "1\\n" : ""</code>
	      </format>
	      <vdef>
	      		<value>0</value>
	      </vdef>
	      <group>1</group>
	      <paramfile>params</paramfile>
	    </attributes>
	  </parameter>

	</parameters>
      </paragraph>
    </parameter>

   <parameter type="Switch">
      	<name>indent_tree</name>
      	<attributes>
			<prompt>Indent treefile</prompt>
			<format>
	  			<language>perl</language>
	  			<code> ($value) ? " &amp;&amp; indenttree -o outtree.indent outtree" : "" </code>
			</format>
			<vdef>
				<value>0</value>
			</vdef>
			<group>99</group>
      	</attributes>
    </parameter>

   <parameter type="Paragraph">
      	<paragraph>
			<name>other_options</name>
			<prompt>Other options</prompt>

	<parameters>
	  
	  <parameter type="Integer">
	    	<name>outgroup</name>
	    	<attributes>
	      		<prompt>Outgroup (default, use as outgroup species 1) (O)</prompt>
	      		<format>
					<language>perl</language>
					<code>($value &amp;&amp; $value != $vdef)? "O\\n$value\\n" : "" </code>
	      		</format>
	      		<vdef>
	      			<value>1</value>
	      		</vdef>
	      		<group>1</group>
	     		 <paramfile>params</paramfile>
<comment>
		    <value> The O (Outgroup) option is valid only if the tree is not rooted by the Ancestral States option.
		    It specifies which species is on the line leading to the root of the tree. 
		    For example, if the outgroup is a species "Mouse" then the root of the tree will be placed in the middle of the
		    branch connected to this species, with Mouse branching off on one side of the root and the lineage leading
		    to the rest of the tree on the other. When selected, the number of the outgroup must be identified (the species are
		    numbered in the order they occur in the input file). Entering 6 causes the sixth species in the data set
		    to be taken as the outgroup (the sixth in the first data set if there are multiple data sets).
		    Outgroup-rooting will not be attempted if the data have already established a root for the
		    tree, such as from a user-defined tree. The inferred tree as printed out is still an unrooted tree,
		    though the outgroup is connected to the bottommost node so that it is easy to visually convert the tree
		    into rooted form.</value>
</comment> 
 <comment> 
 	<value>&#169;Copyright 1980-2007. University of Washington.</value>
 </comment>
	      <ctrls>
				<ctrl>
		 			 <message>Please enter a value greater than 0</message>
		  			<language>perl</language>
		  			<code>$value &lt; 1</code>
				</ctrl>
	      </ctrls>
	    </attributes>
	  </parameter>

	  <parameter type="Switch">
		    <name>rooted</name>
	    	<attributes>
	      		<prompt>Trees to be treated as rooted</prompt>
	      		<format>
					<language>perl</language>
					<code>($value)? "R\\n" : "" </code>
	      		</format>
	      		<vdef>
	      			<value>0</value>
	      		</vdef>
	      		<group>1</group>
	      		<paramfile>params</paramfile>
	      		<comment>
<value>The rooted option specifies that the tree is to be treated as a rooted tree and not re-rooted. Otherwise the tree will be treated as outgroup-rooted and will be re-rooted automatically at the first species encountered on the first tree (or at a species designated by the Outgroup option).</value>
				</comment>
	    	</attributes>
	  </parameter>

	</parameters>
      </paragraph>

    </parameter>

    <parameter ishidden="1" type="String">
      		<name>confirm</name>
      		<attributes>
				<format>
	  				<language>perl</language>
	  				<code>"Y\\n"</code>
				</format>
				<group>99</group>
				<paramfile>params</paramfile>
      		</attributes>
    </parameter>

    <parameter ishidden="1" type="String">
      		<name>terminal_type</name>
      		<attributes>
				<format>
	  				<language>perl</language>
	  				<code>"T\\n"</code>
				</format>
				<group>0</group>
				<paramfile>params</paramfile>
      		</attributes>
    </parameter>
    
    <parameter type="Results">
    	<name>all-outfiles</name>
   		<attributes>
			<filenames>*</filenames>
      	</attributes>
    </parameter>

   <!-- <parameter type="Results">
      <name>treefile</name>
      <attributes>
	<precond>
	  <language>perl</language>
	  <code>$print_treefile</code>
	</precond>
	<filenames>outtree</filenames>
	<pipe>
	  <pipetype>phylip_tree</pipetype>
	  <language>perl</language>
	  <code>1</code>
	</pipe>
      </attributes>
    </parameter>
    
    <parameter type="Results">
      <name>indented_treefile</name>
      <attributes>
	<precond>
	  <language>perl</language>
	  <code>$print_treefile &amp;&amp; $indent_tree</code>
	</precond>
	<filenames>outtree.indent</filenames>
      </attributes>
    </parameter>

    <parameter type="Results">
      <name>params</name>
      <attributes>
	<filenames>params</filenames>
      </attributes>
    </parameter>

    <parameter type="Results">
      <name>tmp_params</name>
      <attributes>
	<filenames>*.params</filenames>
      </attributes>
    </parameter>  -->
    
  </parameters>

</pise>
