diff specify.xml @ 27:8997f2ca8c7a

Update to Miller Lab devshed revision bae0d3306d3b
author Richard Burhans <burhans@bx.psu.edu>
date Mon, 15 Jul 2013 10:47:35 -0400
parents 248b06e86022
children
line wrap: on
line diff
--- a/specify.xml	Mon Jun 03 12:29:29 2013 -0400
+++ b/specify.xml	Mon Jul 15 10:47:35 2013 -0400
@@ -2,28 +2,37 @@
   <description>: Define a collection of individuals from a gd_snp dataset</description>
 
   <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
+    #import json
+    #import base64
+    #import zlib
+    #set $ind_names = $input.dataset.metadata.individual_names
+    #set $ind_colms = $input.dataset.metadata.individual_columns
+    #set $ind_dict = dict(zip($ind_names, $ind_colms))
+    #set $ind_json = json.dumps($ind_dict, separators=(',',':'))
+    #set $ind_comp = zlib.compress($ind_json, 9)
+    #set $ind_arg = base64.b64encode($ind_comp)
+    #set $cb_string = str($individuals).strip()
+    #if $cb_string != 'None'
+      #set $cb_dict = dict.fromkeys($cb_string.split('\t'))
+      #for $cb_name in $cb_dict:
+        #set $cb_idx = $input.dataset.metadata.individual_names.index($cb_name)
+        #set $cb_dict[$cb_name] = str($input.dataset.metadata.individual_columns[$cb_idx])
+      #end for
+    #else
+      #set $cb_dict = dict()
     #end if
-    #if str($string).strip() != ''
-      #set str_arg = 'string:%s' % ( __import__('base64').b64encode( str($string) ) )
-      "$str_arg"
-    #end if
+    #set $cb_json = json.dumps($cb_dict, separators=(',',':'))
+    #set $cb_comp = zlib.compress($cb_json, 9)
+    #set $cb_arg = base64.b64encode($cb_comp)
+    #set $str_string = str($string).strip()
+    #set $str_comp = zlib.compress($str_string, 9)
+    #set $str_arg = base64.b64encode($str_comp)
+    specify.py '$input' '$output' '$ind_arg' '$cb_arg' '$str_arg'
   </command>
 
   <inputs>
     <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">
+    <param name="individuals" type="select" display="checkboxes" multiple="true" separator="&#9;" label="Individuals to include">
       <options>
         <filter type="data_meta" ref="input" key="individual_names" />
       </options>
@@ -32,7 +41,7 @@
       <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">
+    <param name="string" type="text" area="true" size="5x40" label="Individuals to include">
       <sanitizer>
         <valid initial="string.printable"/>
       </sanitizer>