comparison 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
comparison
equal deleted inserted replaced
26:91e835060ad2 27:8997f2ca8c7a
1 <tool id="gd_specify" name="Specify Individuals" version="1.1.0"> 1 <tool id="gd_specify" name="Specify Individuals" version="1.1.0">
2 <description>: Define a collection of individuals from a gd_snp dataset</description> 2 <description>: Define a collection of individuals from a gd_snp dataset</description>
3 3
4 <command interpreter="python"> 4 <command interpreter="python">
5 specify.py "$input" "$output" 5 #import json
6 #for $individual, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns) 6 #import base64
7 #set $individual_arg = 'individual:%s:%s' % ($individual_col, $individual) 7 #import zlib
8 "$individual_arg" 8 #set $ind_names = $input.dataset.metadata.individual_names
9 #end for 9 #set $ind_colms = $input.dataset.metadata.individual_columns
10 #if str($individuals).strip() != 'None' 10 #set $ind_dict = dict(zip($ind_names, $ind_colms))
11 #for $individual in str($individuals).split(',') 11 #set $ind_json = json.dumps($ind_dict, separators=(',',':'))
12 #set $individual_idx = $input.dataset.metadata.individual_names.index($individual) 12 #set $ind_comp = zlib.compress($ind_json, 9)
13 #set $individual_col = str( $input.dataset.metadata.individual_columns[$individual_idx] ) 13 #set $ind_arg = base64.b64encode($ind_comp)
14 #set $cb_arg = 'checkbox:%s:%s' % ($individual_col, $individual) 14 #set $cb_string = str($individuals).strip()
15 "$cb_arg" 15 #if $cb_string != 'None'
16 #end for 16 #set $cb_dict = dict.fromkeys($cb_string.split('\t'))
17 #for $cb_name in $cb_dict:
18 #set $cb_idx = $input.dataset.metadata.individual_names.index($cb_name)
19 #set $cb_dict[$cb_name] = str($input.dataset.metadata.individual_columns[$cb_idx])
20 #end for
21 #else
22 #set $cb_dict = dict()
17 #end if 23 #end if
18 #if str($string).strip() != '' 24 #set $cb_json = json.dumps($cb_dict, separators=(',',':'))
19 #set str_arg = 'string:%s' % ( __import__('base64').b64encode( str($string) ) ) 25 #set $cb_comp = zlib.compress($cb_json, 9)
20 "$str_arg" 26 #set $cb_arg = base64.b64encode($cb_comp)
21 #end if 27 #set $str_string = str($string).strip()
28 #set $str_comp = zlib.compress($str_string, 9)
29 #set $str_arg = base64.b64encode($str_comp)
30 specify.py '$input' '$output' '$ind_arg' '$cb_arg' '$str_arg'
22 </command> 31 </command>
23 32
24 <inputs> 33 <inputs>
25 <param name="input" type="data" format="gd_snp,gd_genotype" label="SNP or Genotype dataset"/> 34 <param name="input" type="data" format="gd_snp,gd_genotype" label="SNP or Genotype dataset"/>
26 <param name="individuals" type="select" display="checkboxes" multiple="true" label="Individuals to include"> 35 <param name="individuals" type="select" display="checkboxes" multiple="true" separator="&#9;" label="Individuals to include">
27 <options> 36 <options>
28 <filter type="data_meta" ref="input" key="individual_names" /> 37 <filter type="data_meta" ref="input" key="individual_names" />
29 </options> 38 </options>
30 </param> 39 </param>
31 <param name="outname" type="text" size="20" label="Label for this collection"> 40 <param name="outname" type="text" size="20" label="Label for this collection">
32 <validator type="empty_field" message="You must enter a label."/> 41 <validator type="empty_field" message="You must enter a label."/>
33 #used to be "Individuals from ${input.hid}" 42 #used to be "Individuals from ${input.hid}"
34 </param> 43 </param>
35 <param name="string" type="text" size="40" label="Individuals to include"> 44 <param name="string" type="text" area="true" size="5x40" label="Individuals to include">
36 <sanitizer> 45 <sanitizer>
37 <valid initial="string.printable"/> 46 <valid initial="string.printable"/>
38 </sanitizer> 47 </sanitizer>
39 </param> 48 </param>
40 </inputs> 49 </inputs>