comparison sort.xml @ 0:4a1ea249955e draft default tip

"planemo upload for repository https://github.com/shenwei356/csvtk commit 3a97e1b79bf0c6cdd37d5c8fb497b85531a563ab"
author nml
date Tue, 19 May 2020 17:20:19 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4a1ea249955e
1 <tool id="csvtk_sort" name="csvtk-sort" version="@VERSION@+@GALAXY_VERSION@">
2 <description> column(s) </description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements" />
7 <expand macro="version_cmd" />
8 <command detect_errors="exit_code"><![CDATA[
9
10 ###################
11 ## Start Command ##
12 ###################
13 csvtk sort --num-cpus "\${GALAXY_SLOTS:-1}"
14
15 ## Add additional flags as specified ##
16 #######################################
17 $ignore_case
18 $global_param.illegal_rows
19 $global_param.empty_rows
20 $global_param.header
21 $global_param.lazy_quotes
22
23 ## Set Tabular input/output flag if first input is tabular ##
24 #############################################################
25 #if $in_1.is_of_type("tabular"):
26 -t -T
27 #end if
28
29 ## Set input files ##
30 #####################
31 $in_1
32
33 ## Set up Sort Repeats ##
34 ##########################
35 #for $repeat in $field
36 -k '$repeat.column_text.in_text':${repeat.sort.sort_type}${repeat.reverse_order}
37
38 #if $repeat.sort.sort_type == 'u'
39 -L '$repeat.column_text.in_text':'$repeat.sort.levels_file'
40 #end if
41 #end for
42
43 ## To output ##
44 ###############
45 > sorted
46
47 ]]></command>
48 <inputs>
49 <expand macro="singular_input"/>
50 <repeat name="field" title="Select Column and Sorting method" min="1" >
51 <expand macro="singular_fields_input" />
52 <conditional name="sort">
53 <param name="sort_type" type="select" label="Sort Type" help="Select how to sort data">
54 <option value="N">Natural</option>
55 <option value="n">Numerical</option>
56 <option value="u">User-Defined (Specify File)</option>
57 </param>
58 <when value="N" />
59 <when value="n" />
60 <when value="u" >
61 <param name="levels_file" type="data" format="txt" argument="-L"
62 optional="false"
63 label="User defined levels file"
64 help="If using user defined sorting, specift input text file with one level per line. Example can be found in the help section below."
65 />
66 </when>
67 </conditional>
68 <param name="reverse_order" type="boolean" argument="r" checked="false"
69 truevalue="r"
70 falsevalue=""
71 label="Reverse Sort"
72 />
73 </repeat>
74 <expand macro="ignore_case" />
75 <expand macro="global_parameters" />
76 </inputs>
77 <outputs>
78 <data format_source="in_1" from_work_dir="sorted" name="sorted" label="${in_1.name} sorted" />
79 </outputs>
80 <tests>
81 <test>
82 <param name="in_1" value="Animals_More.csv" />
83 <repeat name="field">
84 <conditional name="column_text">
85 <param name="select" value="string" />
86 <param name="in_text" value="2" />
87 </conditional>
88 <conditional name="sort">
89 <param name="sort_type" value="u" />
90 <param name="levels_file" value="sort_order.txt" />
91 </conditional>
92 </repeat>
93 <repeat name="field">
94 <conditional name="column_text">
95 <param name="select" value="string" />
96 <param name="in_text" value="3" />
97 </conditional>
98 <conditional name="sort">
99 <param name="sort_type" value="n" />
100 </conditional>
101 <param name="reverse_order" value="true" />
102 </repeat>
103 <repeat name="field">
104 <conditional name="column_text">
105 <param name="select" value="string" />
106 <param name="in_text" value="1" />
107 </conditional>
108 <conditional name="sort">
109 <param name="sort_type" value="N" />
110 </conditional>
111 </repeat>
112 <output name="sorted" value="sorted_1.csv" />
113 </test>
114 </tests>
115 <help><![CDATA[
116
117 Csvtk - Sort Help
118 -----------------
119
120 Info
121 ####
122
123 Csvtk-sort sorts columns
124
125
126 .. class:: warningmark
127
128 Single quotes are not allowed in text inputs!
129
130 ----
131
132
133 @HELP_INPUT_DATA@
134
135
136 Usage
137 #####
138
139 **Ex. Separate with Dropping Data**
140
141
142
143 ----
144
145
146 @HELP_COLUMNS@
147
148
149 @HELP_END_STATEMENT@
150
151
152 ]]></help>
153 <expand macro="citations" />
154 </tool>