diff add_fst_column.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/add_fst_column.xml	Wed May 22 15:58:18 2013 -0400
+++ b/add_fst_column.xml	Tue May 28 16:24:19 2013 -0400
@@ -1,8 +1,19 @@
-<tool id="gd_add_fst_column" name="Per-SNP FSTs" version="1.1.0">
+<tool id="gd_add_fst_column" name="Per-SNP FSTs" version="1.2.0">
   <description>: Compute a fixation index score for each SNP</description>
 
   <command interpreter="python">
-    add_fst_column.py "$input" "$p1_input" "$p2_input" "$data_source" "$min_reads" "$min_qual" "$retain" "$discard_fixed" "$biased" "$output"
+    add_fst_column.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_reads" "$input_type.data_source.min_qual"
+      #else if $input_type.data_source.choice == '1'
+        "0" "0"
+      #end if
+    #else if $input_type.choice == '1'
+      "gd_genotype" "1" "0" "0"
+    #end if
+    "$retain" "$discard_fixed" "$biased" "$output"
     #for $individual, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
         #set $arg = '%s:%s' % ($individual_col, $individual)
         "$arg"
@@ -10,18 +21,35 @@
   </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_reads" type="integer" min="0" value="0" label="Minimum total read count for a population" />
+            <param name="min_qual" type="integer" min="0" value="0" label="Minimum individual genotype quality" />
+          </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" />
 
-    <param name="data_source" type="select" format="integer" label="Frequency metric">
-      <option value="0">sequence coverage</option>
-      <option value="1" selected="true">estimated genotype</option>
-    </param>
-
-    <param name="min_reads" type="integer" min="0" value="0" label="Minimum total read count for a population" />
-    <param name="min_qual" type="integer" min="0" value="0" label="Minimum individual genotype quality" />
-
     <param name="retain" type="select" label="If a SNP is below minimum">
       <option value="0" selected="true">skip SNP</option>
       <option value="1">set FST = -1</option>
@@ -41,7 +69,7 @@
   </inputs>
 
   <outputs>
-    <data name="output" format="gd_snp" metadata_source="input" />
+    <data name="output" format="input" format_source="input" metadata_source="input" />
   </outputs>
 
   <tests>
@@ -63,10 +91,11 @@
 
 **Dataset formats**
 
-The input datasets are in gd_snp_ and gd_indivs_ formats.
-The output dataset is in gd_snp_ format.  (`Dataset missing?`_)
+The input datasets are in gd_snp_, gd_genotype_, and gd_indivs_ formats.
+The output dataset is in gd_snp_ or gd_genotype_ format.  (`Dataset missing?`_)
 
 .. _gd_snp: ./static/formatHelp.html#gd_snp
+.. _gd_genotype: ./static/formatHelp.html#gd_genotype
 .. _gd_indivs: ./static/formatHelp.html#gd_indivs
 .. _Dataset missing?: ./static/formatHelp.html
 
@@ -76,7 +105,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.