comparison freq.xml @ 0:a288e0146c2e draft default tip

"planemo upload for repository https://github.com/shenwei356/csvtk commit 3a97e1b79bf0c6cdd37d5c8fb497b85531a563ab"
author nml
date Tue, 19 May 2020 17:13:18 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a288e0146c2e
1 <tool id="csvtk_freq" name="csvtk-freq" version="@VERSION@+@GALAXY_VERSION@">
2 <description>of value in 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
14 csvtk freq --num-cpus "\${GALAXY_SLOTS:-1}"
15
16 ## Add additional flags as specified ##
17 #######################################
18 $ignore_case
19 $global_param.illegal_rows
20 $global_param.empty_rows
21 $global_param.header
22 $global_param.lazy_quotes
23
24 ## Set Tabular input/output flag if input is tabular ##
25 #######################################################
26 #if $in_1.is_of_type("tabular"):
27 -t -T
28 #end if
29
30 ## Set Input ##
31 ###############
32 '$in_1'
33
34 ## Specify fields for freq ##
35 #############################
36 -F -f '$column_text.in_text'
37
38 ## Sorting? ##
39 ##############
40 #if $sorting.want_sort == 'yes_sort'
41
42 #if $sorting.how_sort == 'frequency'
43 -n
44 #elif $sorting.how_sort == 'alphabetical'
45 -k
46 #end if
47
48 #if $sorting.reverse_sort == 'yes_reverse'
49 -r
50 #end if
51 #end if
52
53 ## To output ##
54 ###############
55 > freq
56
57 ]]></command>
58 <inputs>
59 <expand macro="singular_input" />
60 <expand macro="fields_input" />
61 <expand macro="ignore_case" />
62 <expand macro="global_parameters" />
63 <conditional name="sorting" >
64 <param type="select" name="want_sort"
65 label="Sort Output Columns?"
66 help="Change the order of output column(s)">
67 <option value="no_sort">No</option>
68 <option value="yes_sort">Yes</option>
69 </param>
70 <when value="no_sort" />
71 <when value="yes_sort">
72 <param type="select" name="how_sort" label="How to Sort Output">
73 <option value="frequency">Frequency (Low -> High)</option>
74 <option value="alphabetical">Alphabetical</option>
75 </param>
76 <param type="select" name="reverse_sort" label="Reverse Sort" help="Sort in reverse order. IE. highest to lowest or reverse alphabetical" >
77 <option value="no_reverse">No</option>
78 <option value="yes_reverse">Yes</option>
79 </param>
80 </when>
81 </conditional>
82 </inputs>
83 <outputs>
84 <data format_source="in_1" name="freq" from_work_dir="freq" label="${in_1.name} frequency of column(s) ${column_text.in_text}" />
85 </outputs>
86 <tests>
87 <test>
88 <param name="in_1" value="blood_type.tsv" />
89 <conditional name="column_text">
90 <param name="select" value="string" />
91 <param name="in_text" value="2,3" />
92 </conditional>
93 <conditional name="sorting" >
94 <param name="want_sort" value="no_sort" />
95 </conditional>
96 <output name="freq" file="frequency.tsv" ftype="tabular" />
97 </test>
98 </tests>
99 <help><![CDATA[
100
101 Csvtk - Freq Help
102 -----------------
103
104 Info
105 ####
106 Find the frequency of the data based on the selected column(s).
107
108 If one column is selected, the frequency will be the number of times each value is found in the column. These can further be sorted if so desired.
109
110 Examples can be found in the usage section below!
111
112 .. class:: warningmark
113
114 Single quotes are not allowed in text inputs!
115
116 @HELP_INPUT_DATA@
117
118
119 Usage
120 #####
121
122 To run csvtk-freq, all you need is a valid (as defined above) CSV or TSV and the column(s) that you want the frequency of.
123
124 **Ex. of frequency with one column:**
125
126 +------------+-----------+
127 | Blood Type | Frequency |
128 +============+===========+
129 | A | 31 |
130 +------------+-----------+
131 | B | 103 |
132 +------------+-----------+
133 | etc. | etc. |
134 +------------+-----------+
135
136 ----
137
138 **Ex. of frequency with more than one column for frequency:**
139
140 +---------+------------+-----------+
141 | Name | Blood Type | Frequency |
142 +=========+============+===========+
143 | Bob | A | 4 |
144 +---------+------------+-----------+
145 | Jacob | B | 5 |
146 +---------+------------+-----------+
147 | Matthew | O | 12 |
148 +---------+------------+-----------+
149 | Darian | AB | 1 |
150 +---------+------------+-----------+
151
152 With multiple columns, you end up getting the frequency of how many times the values from each column
153 are found together. In this example from an input dataset of names and bloodtypes, we can find the frequency that
154 each name in our database is a certain bloodtype.
155
156 Here, we can note that there are 4 people named bob with blood type A.
157
158 ----
159
160 @HELP_COLUMNS@
161
162
163 @HELP_END_STATEMENT@
164
165
166 ]]></help>
167 <expand macro="citations" />
168 </tool>