comparison pandas_pivot_table.xml @ 3:4b65133e0722 draft

"planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/pandas_pivot_table/ commit e0560d99fd88685476e4b65235b89edeb20e8426-dirty"
author jjohnson
date Thu, 17 Dec 2020 22:23:11 +0000
parents 6f05390deffa
children eaf2444a2a50
comparison
equal deleted inserted replaced
2:6f05390deffa 3:4b65133e0722
1 <tool id="pandas_pivot_table" name="Pivot Table" version="@VERSION@.0" python_template_version="3.5"> 1 <tool id="pandas_pivot_table" name="Pivot Table" version="@VERSION@.1" python_template_version="3.5">
2 <description>transform tabular data</description> 2 <description>transform tabular data</description>
3 <macros> 3 <macros>
4 <token name="@VERSION@">1.1.4</token> 4 <token name="@VERSION@">1.1.4</token>
5 <token name="@AGGFUNC@">'(min|max|sum|size|count|mean|std|var|prod|all|any)'</token>
6 <token name="@AGGFUNCS@">(@AGGFUNC@|[[]\s*@AGGFUNC@(,\s*@AGGFUNC@)*])</token>
7 <token name="@AGGITEM@">'\S+'\s*:\s*@AGGFUNCS@</token>
8 <token name="@AGGDICT@">{@AGGITEM@(,\s*@AGGITEM@)*}</token>
9 <token name="@AGGF@">(@AGGFUNCS@|@AGGDICT@)</token>
5 </macros> 10 </macros>
6 <requirements> 11 <requirements>
7 <requirement type="package" version="@VERSION@">pandas</requirement> 12 <requirement type="package" version="@VERSION@">pandas</requirement>
8 </requirements> 13 </requirements>
9 <command detect_errors="exit_code"><![CDATA[ 14 <command detect_errors="exit_code"><![CDATA[
17 --header $header.names 22 --header $header.names
18 #end if 23 #end if
19 --index '$pvt_index' 24 --index '$pvt_index'
20 --columns '$pvt_columns' 25 --columns '$pvt_columns'
21 --values '$pvt_values' 26 --values '$pvt_values'
22 --aggfunc='$aggfunc' 27 --aggfunc="$aggfunc"
23 #if $fill_value 28 #if $fill_value
24 --fill_value '$fill_value' 29 --fill_value '$fill_value'
25 #end if 30 #end if
26 #if $float_format 31 #if $float_format
27 --float_format '$float_format' 32 --float_format '$float_format'
58 </param> 63 </param>
59 <param name="pvt_values" type="text" value="" label="Pivot table value columns"> 64 <param name="pvt_values" type="text" value="" label="Pivot table value columns">
60 <validator type="regex" message="Column names separated by commas">^\S+(,\S+)*$</validator> 65 <validator type="regex" message="Column names separated by commas">^\S+(,\S+)*$</validator>
61 </param> 66 </param>
62 <param name="aggfunc" type="text" value="" label="Pivot table aggregate function"> 67 <param name="aggfunc" type="text" value="" label="Pivot table aggregate function">
63 <help><![CDATA[A valid JSON string, e.g.: 68 <help><![CDATA[
64 <ul> 69 <ul>
65 <li>A single function applied to each <i>value</i> column: <b>"min"</b></li> 70 <li>Available Number Functions: @AGGFUNC@</li>
66 <li>An array of functions applied to each <i>value</i> column: <b>["min", "max", "mean", "std"]</b></li> 71 <li>Specify functions as (remember the single quotes):</li>
67 <li>A dictionary of <i>value column : function(s)</i>: <b>{"A" : "sum", "B" : ["min", "max"]}</b></li> 72 <ul>
68 </ul> 73 <li> - A single function applied to each <i>value</i> column: <b>'min'</b></li>
74 <li> - An array of functions applied to each <i>value</i> column: <b>['min', 'max', 'mean', 'std']</b></li>
75 <li> - A dictionary of <i>value column : function(s)</i>: <b>{'A' : 'sum', 'B' : ['min', 'max']}</b></li>
76 </ul>
77 </ul>
69 ]]></help> 78 ]]></help>
70 <validator type="regex" message="Do not forget the double quotes">.*".+".*</validator> 79 <validator type="regex" message="Do not forget the single quotes">@AGGF@</validator>
71 <sanitizer> 80 <sanitizer>
72 <valid initial="string.printable"> 81 <valid initial="string.printable">
73 <remove value="&apos;"/>
74 </valid> 82 </valid>
75 <mapping initial="none">
76 <add source="&apos;" target="__sq__"/>
77 </mapping>
78 </sanitizer> 83 </sanitizer>
79 </param> 84 </param>
80 <param name="fill_value" type="text" value="" optional="true" label="Fill value (optional)" 85 <param name="fill_value" type="text" value="" optional="true" label="Fill value (optional)"
81 help="Value to replace missing values with (in the resulting pivot table, after aggregation) default is an empty field"/> 86 help="Value to replace missing values with (in the resulting pivot table, after aggregation) default is an empty field"/>
82 <param name="float_format" type="text" value="" optional="true" label="Output floating point format (optional)"> 87 <param name="float_format" type="text" value="" optional="true" label="Output floating point format (optional)">
83 <help>Default is six decimal places: %0.6f</help> 88 <help><![CDATA[Default is six decimal places: <i>%0.<b>6</b>f</i> For scientific: <i>%0.6<b>e</b></i>]]></help>
84 <validator type="regex" message="">^%\d+.\d+[fFeEgGn]$</validator> 89 <validator type="regex" message="%0.6f">^%\d+.\d+[fFeEgGn]$</validator>
85 <sanitizer> 90 <sanitizer>
86 <valid initial="string.digits"> 91 <valid initial="string.digits">
87 <add value="%" /> 92 <add value="%" />
88 <add value="." /> 93 <add value="." />
89 <add value="f" /> 94 <add value="f" />
107 <param name="header_choice" value="first_line"/> 112 <param name="header_choice" value="first_line"/>
108 </conditional> 113 </conditional>
109 <param name="pvt_index" value="A" /> 114 <param name="pvt_index" value="A" />
110 <param name="pvt_columns" value="C"/> 115 <param name="pvt_columns" value="C"/>
111 <param name="pvt_values" value="D"/> 116 <param name="pvt_values" value="D"/>
112 <param name="aggfunc" value="&quot;max&quot;"/> 117 <param name="aggfunc" value="'max'"/>
113 <output name="output"> 118 <output name="output">
114 <assert_contents> 119 <assert_contents>
115 <has_text_matching expression="bar\t7\t6" /> 120 <has_text_matching expression="bar\t7\t6" />
116 </assert_contents> 121 </assert_contents>
117 </output> 122 </output>
122 <param name="header_choice" value="first_line"/> 127 <param name="header_choice" value="first_line"/>
123 </conditional> 128 </conditional>
124 <param name="pvt_index" value="A" /> 129 <param name="pvt_index" value="A" />
125 <param name="pvt_columns" value="C"/> 130 <param name="pvt_columns" value="C"/>
126 <param name="pvt_values" value="D"/> 131 <param name="pvt_values" value="D"/>
127 <param name="aggfunc" value="[&quot;min&quot;,&quot;max&quot;]"/> 132 <param name="aggfunc" value="['min','max']"/>
128 <output name="output"> 133 <output name="output">
129 <assert_contents> 134 <assert_contents>
130 <has_text_matching expression="bar\t4\t5\t7\t6" /> 135 <has_text_matching expression="bar\t4\t5\t7\t6" />
131 </assert_contents> 136 </assert_contents>
132 </output> 137 </output>
137 <param name="header_choice" value="first_line"/> 142 <param name="header_choice" value="first_line"/>
138 </conditional> 143 </conditional>
139 <param name="pvt_index" value="C,B" /> 144 <param name="pvt_index" value="C,B" />
140 <param name="pvt_columns" value="A"/> 145 <param name="pvt_columns" value="A"/>
141 <param name="pvt_values" value="D,E"/> 146 <param name="pvt_values" value="D,E"/>
142 <param name="aggfunc" value="{&quot;D&quot; : [&quot;min&quot;,&quot;sum&quot;], &quot;E&quot; : &quot;mean&quot;}"/> 147 <param name="aggfunc" value="{'D' : ['min','sum'], 'E' : 'mean'}"/>
143 <output name="output"> 148 <output name="output">
144 <assert_contents> 149 <assert_contents>
145 <has_text_matching expression="C\tB\tbar_min_D\tfoo_min_D\tbar_sum_D\tfoo_sum_D\tbar_mean_E\tfoo_mean_E"/> 150 <has_text_matching expression="C\tB\tbar_min_D\tfoo_min_D\tbar_sum_D\tfoo_sum_D\tbar_mean_E\tfoo_mean_E"/>
146 <has_text_matching expression="large\tone\t4[.]\d+\t2[.]\d+\t4[.]\d+\t4[.]\d+\t6[.]\d+\t4[.]5\d+"/> 151 <has_text_matching expression="large\tone\t4[.]\d+\t2[.]\d+\t4[.]\d+\t4[.]\d+\t6[.]\d+\t4[.]5\d+"/>
147 </assert_contents> 152 </assert_contents>