diff phylogenetic_tree.xml @ 24:248b06e86022

Added gd_genotype datatype. Modified tools to support new datatype.
author Richard Burhans <burhans@bx.psu.edu>
date Tue, 28 May 2013 16:24:19 -0400
parents f04f40a36cc8
children 8997f2ca8c7a
line wrap: on
line diff
--- a/phylogenetic_tree.xml	Wed May 22 15:58:18 2013 -0400
+++ b/phylogenetic_tree.xml	Tue May 28 16:24:19 2013 -0400
@@ -1,26 +1,41 @@
-<tool id="gd_phylogenetic_tree" name="Phylogenetic Tree" version="1.0.0">
+<tool id="gd_phylogenetic_tree" name="Phylogenetic Tree" version="1.1.0">
   <description>: Show genetic relationships among individuals</description>
 
   <command interpreter="python">
-    phylogenetic_tree.py "$input"
+    phylogenetic_tree.py "$input" "$output" "$output.files_path"
+
+    #if $input_type.choice == '0'
+      "gd_snp"
+      #if $input_type.data_source.choice == '0'
+        "sequence_coverage"
+        "$input_type.data_source.minimum_coverage"
+        "$input_type.data_source.minimum_quality"
+      #else if $input_type.data_source.choice == '1'
+        "estimated_genotype"
+      #end if
+    #else if $input_type.choice == '1'
+      "gd_genotype"
+    #end if
+
     #if $individuals.choice == '0'
       "all_individuals"
     #else if $individuals.choice == '1'
-      "$p1_input"
+      "$individuals.p1_input"
     #end if
-    "$output" "$output.files_path" "$minimum_coverage" "$minimum_quality"
+
 	#if ((str($input.metadata.scaffold) == str($input.metadata.ref)) and (str($input.metadata.pos) == str($input.metadata.rPos))) or (str($include_reference) == '0')
         "none"
     #else
         "$input.metadata.dbkey"
     #end if
-    "$data_source"
+
     #set $draw_tree_options = ''.join(str(x) for x in [$branch_style, $scale_style, $length_style, $layout_style])
     #if $draw_tree_options == ''
         ""
     #else
         "-$draw_tree_options"
     #end if
+
     #for $individual_name, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
         #set $arg = '%s:%s' % ($individual_col, $individual_name)
         "$arg"
@@ -28,7 +43,31 @@
   </command>
 
   <inputs>
-    <param name="input" type="data" format="gd_snp" label="SNP dataset" />
+    <conditional name="input_type">
+      <param name="choice" type="select" format="integer" label="Input format">
+        <option value="0" selected="true">gd_snp</option>
+        <option value="1">gd_genotype</option>
+      </param>
+      <when value="0">
+        <param name="input" type="data" format="gd_snp" label="SNP dataset" />
+
+        <conditional name="data_source">
+          <param name="choice" type="select" format="integer" label="Distance metric">
+            <option value="0">sequence coverage</option>
+            <option value="1" selected="true">estimated genotype</option>
+          </param>
+          <when value="0">
+            <param name="minimum_coverage" type="integer" min="0" value="0" label="Minimum SNP coverage" />
+            <param name="minimum_quality" type="integer" min="0" value="0" label="Minimum SNP quality"
+                   help="Note: minimum coverage and minimum quality cannot both be 0" />
+          </when>
+          <when value="1"/>
+        </conditional>
+      </when>
+      <when value="1">
+        <param name="input" type="data" format="gd_genotype" label="Genotype dataset" />
+      </when>
+    </conditional>
 
     <conditional name="individuals">
       <param name="choice" type="select" label="Compute for">
@@ -41,21 +80,11 @@
       </when>
     </conditional>
 
-    <param name="minimum_coverage" type="integer" min="0" value="0" label="Minimum SNP coverage" />
-
-    <param name="minimum_quality" type="integer" min="0" value="0" label="Minimum SNP quality"
-           help="Note: minimum coverage and minimum quality cannot both be 0" />
-
     <param name="include_reference" type="select" format="integer" label="Include reference sequence">
       <option value="1" selected="true">Yes</option>
       <option value="0">No</option>
     </param>
 
-    <param name="data_source" type="select" format="integer" label="Distance metric">
-      <option value="0" selected="true">sequence coverage</option>
-      <option value="1">estimated genotype</option>
-    </param>
-
     <param name="branch_style" type="select" display="radio">
       <label>Branch type</label>
       <option value="" selected="true">square</option>
@@ -110,12 +139,13 @@
 
 **Dataset formats**
 
-The input dataset is in gd_snp_ format.
+The input dataset is in gd_snp_ or gd_genotype_ format.
 The output is a composite dataset, containing the tree in both text (Newick_)
 and PostScript formats, as well as supplemental text information.
 (`Dataset missing?`_)
 
 .. _gd_snp: ./static/formatHelp.html#gd_snp
+.. _gd_genotype: ./static/formatHelp.html#gd_genotype
 .. _Newick: http://evolution.genetics.washington.edu/phylip/newicktree.html
 .. _Dataset missing?: ./static/formatHelp.html