diff average_fst.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 95a05c1ef5d5
children 8997f2ca8c7a
line wrap: on
line diff
--- a/average_fst.xml	Wed May 22 15:58:18 2013 -0400
+++ b/average_fst.xml	Tue May 28 16:24:19 2013 -0400
@@ -1,12 +1,23 @@
-<tool id="gd_average_fst" name="Overall FST" version="1.2.0">
+<tool id="gd_average_fst" name="Overall FST" version="1.3.0">
   <description>: Estimate the relative fixation index between two populations</description>
 
   <command interpreter="python">
-    average_fst.py "$input" "$p1_input" "$p2_input" "$data_source.ds_choice" "$data_source.min_value" "$discard_fixed" "$output"
-    #if $use_randomization.ur_choice == '1'
+    average_fst.py "$input" "$p1_input" "$p2_input"
+    #if $input_type.choice == '0'
+      "gd_snp" "$input_type.data_source.choice"
+      #if $input_type.data_source.choice == '0'
+        "$input_type.data_source.min_value"
+      #else if $input_type.data_source.choice == '1'
+        "1"
+      #end if
+    #else if $input_type.choice == '1'
+      "gd_genotype" "1" "1"
+    #end if
+    "$discard_fixed" "$output"
+    #if $use_randomization.choice == '0'
+      "0" "/dev/null"
+    #else if $use_randomization.choice == '1'
       "$use_randomization.shuffles" "$use_randomization.p0_input"
-    #else
-      "0" "/dev/null"
     #end if
     #for $individual, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
         #set $arg = '%s:%s' % ($individual_col, $individual)
@@ -15,30 +26,44 @@
   </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="Frequency metric">
+            <option value="0">sequence coverage</option>
+            <option value="1" selected="true">estimated genotype</option>
+          </param>
+
+          <when value="0">
+            <param name="min_value" type="integer" min="1" value="1" label="Minimum total read count for a population" />
+          </when>
+
+          <when value="1"/>
+        </conditional>
+      </when>
+
+      <when value="1">
+        <param name="input" type="data" format="gd_genotype" label="Genotype dataset" />
+      </when>
+    </conditional>
+
     <param name="p1_input" type="data" format="gd_indivs" label="Population 1 individuals" />
     <param name="p2_input" type="data" format="gd_indivs" label="Population 2 individuals" />
 
-    <conditional name="data_source">
-      <param name="ds_choice" type="select" format="integer" label="Frequency metric">
-          <option value="0">sequence coverage</option>
-          <option value="1" selected="true">estimated genotype</option>
-      </param>
-      <when value="0">
-        <param name="min_value" type="integer" min="1" value="1" label="Minimum total read count for a population" />
-      </when>
-      <when value="1">
-        <param name="min_value" type="integer" min="1" value="1" label="Minimum individual genotype quality" />
-      </when>
-    </conditional>
-
     <param name="discard_fixed" type="select" label="For SNPs that appear to be fixed across both populations">
       <option value="0">retain</option>
       <option value="1" selected="true">delete</option>
     </param>
 
     <conditional name="use_randomization">
-      <param name="ur_choice" type="select" format="integer" label="Use randomization">
+      <param name="choice" type="select" format="integer" label="Use randomization">
         <option value="0" selected="true">no</option>
         <option value="1">yes</option>
       </param>
@@ -62,7 +87,7 @@
       <param name="ds_choice" value="0" />
       <param name="min_value" value="3" />
       <param name="discard_fixed" value="1" />
-      <param name="ur_choice" value="0" />
+      <param name="choice" value="0" />
       <output name="output" file="test_out/average_fst/average_fst.txt" />
     </test>
   </tests>
@@ -71,10 +96,11 @@
 
 **Dataset formats**
 
-The input datasets are in gd_snp_ and gd_indivs_ formats.
+The input datasets are in gd_snp_, gd_genotype_, and gd_indivs_ formats.
 The output dataset is in text_ format.  (`Dataset missing?`_)
 
 .. _gd_snp: ./static/formatHelp.html#gd_snp
+.. _gd_genotype: ./static/formatHelp.html#gd_genotype
 .. _gd_indivs: ./static/formatHelp.html#gd_indivs
 .. _text: ./static/formatHelp.html#text
 .. _Dataset missing?: ./static/formatHelp.html
@@ -85,7 +111,7 @@
 
 The user specifies a SNP table and two "populations" of individuals, both previously defined using the Galaxy tool to specify individuals from a SNP table. No individual can be in both populations. Other choices are as follows.
 
-Frequency metric. The allele frequencies of a SNP in the two populations can be estimated either by the total number of reads of each allele, or by adding the frequencies inferred from genotypes of individuals in the populations.
+Frequency metric. The allele frequencies of a SNP in the two populations can be estimated either by the total number of reads of each allele (if the table is in gd_snp format, but not with gd_genotype), or by adding the frequencies inferred from genotypes of individuals in the populations.
 
 After specifying the frequency metric, the user sets lower bounds on amount of data required at a SNP. For estimating the FST using read counts, the bound is the minimum count of reads of the two alleles in a population. For estimations based on genotype, the bound is the minimum reported genotype quality per individual. SNPs not meeting these lower bounds are ignored.