diff specify.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 fdb4240fb565
children 8997f2ca8c7a
line wrap: on
line diff
--- a/specify.xml	Wed May 22 15:58:18 2013 -0400
+++ b/specify.xml	Tue May 28 16:24:19 2013 -0400
@@ -1,28 +1,42 @@
-<tool id="gd_specify" name="Specify Individuals" version="1.0.0">
+<tool id="gd_specify" name="Specify Individuals" version="1.1.0">
   <description>: Define a collection of individuals from a gd_snp dataset</description>
 
-  <command interpreter="bash">
-    echo.bash "$input" "$output"
-    #for $individual in str($individuals).split(',')
-        #set $individual_idx = $input.dataset.metadata.individual_names.index($individual)
-        #set $individual_col = str( $input.dataset.metadata.individual_columns[$individual_idx] )
-        #set $arg = '\t'.join([$individual_col, $individual, ''])
-        "$arg"
+  <command interpreter="python">
+    specify.py "$input" "$output"
+    #for $individual, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
+      #set $individual_arg = 'individual:%s:%s' % ($individual_col, $individual)
+      "$individual_arg"
     #end for
+    #if str($individuals).strip() != 'None'
+        #for $individual in str($individuals).split(',')
+          #set $individual_idx = $input.dataset.metadata.individual_names.index($individual)
+          #set $individual_col = str( $input.dataset.metadata.individual_columns[$individual_idx] )
+          #set $cb_arg = 'checkbox:%s:%s' % ($individual_col, $individual)
+          "$cb_arg"
+        #end for
+    #end if
+    #if str($string).strip() != ''
+      #set str_arg = 'string:%s' % ( __import__('base64').b64encode( str($string) ) )
+      "$str_arg"
+    #end if
   </command>
 
   <inputs>
-    <param name="input" type="data" format="gd_snp" label="SNP dataset"/>
+    <param name="input" type="data" format="gd_snp,gd_genotype" label="SNP or Genotype dataset"/>
     <param name="individuals" type="select" display="checkboxes" multiple="true" label="Individuals to include">
       <options>
         <filter type="data_meta" ref="input" key="individual_names" />
       </options>
-      <validator type="no_options" message="You must select at least one individual."/>
     </param>
     <param name="outname" type="text" size="20" label="Label for this collection">
       <validator type="empty_field" message="You must enter a label."/>
       #used to be "Individuals from ${input.hid}"
     </param>
+    <param name="string" type="text" size="40" label="Individuals to include">
+      <sanitizer>
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
   </inputs>
 
   <outputs>
@@ -41,10 +55,11 @@
 
 **Dataset formats**
 
-The input dataset is in gd_snp_ format;
+The input dataset is in gd_snp_ or gd_genotype_ format;
 the output is in gd_indivs_ 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
 
@@ -52,12 +67,17 @@
 
 **What it does**
 
-This tool makes a list of selected entities (the sets of four columns
-representing individuals or groups) from a gd_snp dataset.  It does not copy
-the SNP data; it just records which entities should be considered as belonging
-to some collection or population.  The label you specify is used to name the
-output dataset in your history.  This list can then be used to instruct other
-tools to work on just part of the original gd_snp dataset.
+This tool makes a list of selected entities, i.e., the sets of four
+columns representing individuals or groups from a gd_snp dataset, or
+sets of single columns in a gd_genotype file.  It does not copy the
+data; it just records which entities should be considered as belonging
+to some collection or population.  The label you specify is used to
+name the output dataset in your history.  This list can then be used
+to instruct other tools to work on just part of the original gd_snp or
+gd_genotype dataset.  The entities can be specified with the checklist
+and/or by pasting their names (possibly with extraneous characters, as
+in a portion of the Newick-format output of the Phylogenetic Tree tool)
+into the box provided at the bottom of the page.
 
 -----