comparison datamash-ops.xml @ 6:22080cbb0e2a

datamash: improve XML tool 1. String fix suggested by Bjoern Gruening. 2. Added input validator to group text box 3. Added minimum "1" operation.
author Assaf Gordon <agordon@wi.mit.edu>
date Sat, 22 Nov 2014 20:37:38 -0500
parents f33abb72cbe3
children
comparison
equal deleted inserted replaced
5:f33abb72cbe3 6:22080cbb0e2a
10 $header_in 10 $header_in
11 $header_out 11 $header_out
12 $need_sort 12 $need_sort
13 $print_full_line 13 $print_full_line
14 $ignore_case 14 $ignore_case
15 #if str($grouping)>0 15 #if str($grouping).strip()
16 --group '$grouping' 16 --group '$grouping'
17 #end if 17 #end if
18 #for $oper in $operations 18 #for $oper in $operations
19 ${oper.op_name} 19 ${oper.op_name}
20 ${oper.op_column} 20 ${oper.op_column}
22 &lt; $in_file &gt; $out_file 22 &lt; $in_file &gt; $out_file
23 </command> 23 </command>
24 <inputs> 24 <inputs>
25 <param format="tabular" name="in_file" type="data" label="Select Input Data" help=""/> 25 <param format="tabular" name="in_file" type="data" label="Select Input Data" help=""/>
26 26
27 <param name="grouping" label="Group by fields" type="text" help="Example: 1,4 - To group by the first and fourth fields. Leave empty to perform operation on entire file as one group."/> 27 <param name="grouping" label="Group by fields" type="text" help="Example: 1,4 - To group by the first and fourth fields. Leave empty to perform operation on entire file as one group.">
28 <validator type="regex" message="invalid fields value">^[0-9, ]*$</validator>
29 </param>
28 30
29 <param name="header_in" type="boolean" truevalue="--header-in" falsevalue="" 31 <param name="header_in" type="boolean" truevalue="--header-in" falsevalue=""
30 label="Input file has a header line" help="Mark this if the input file's first line is a header line" /> 32 label="Input file has a header line" help="Mark this if the input file's first line is a header line" />
31 33
32 <param name="header_out" type="boolean" truevalue="--header-out" falsevalue="" 34 <param name="header_out" type="boolean" truevalue="--header-out" falsevalue=""
39 label="Print all fields from input file" help="If set, all input fields will be printed. If unset, only fields used for grouping will be printed." /> 41 label="Print all fields from input file" help="If set, all input fields will be printed. If unset, only fields used for grouping will be printed." />
40 42
41 <param name="ignore_case" type="boolean" truevalue="--ignore-case" falsevalue="" 43 <param name="ignore_case" type="boolean" truevalue="--ignore-case" falsevalue=""
42 label="Ignore case when grouping" help="If set, upper/lowercase differences will be ignored when grouping fields." /> 44 label="Ignore case when grouping" help="If set, upper/lowercase differences will be ignored when grouping fields." />
43 45
44 <repeat name="operations" title="Operation to perform on each group"> 46 <repeat name="operations" title="Operation to perform on each group" min="1" default="1">
45 <param name="op_name" type="select" label="Type"> 47 <param name="op_name" type="select" label="Type">
46 <option value="count">count</option> 48 <option value="count">count</option>
47 <option value="sum">sum</option> 49 <option value="sum">sum</option>
48 <option value="min">minimum</option> 50 <option value="min">minimum</option>
49 <option value="max">maximum</option> 51 <option value="max">maximum</option>