comparison editColumnHeadings.xml @ 1:ce206587d42f draft default tip

"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/rearrange_columns commit 3289c1f97444f45f946ff92d47c490c9d58f3d94"
author azomics
date Thu, 16 Jul 2020 07:22:06 -0400
parents
children
comparison
equal deleted inserted replaced
0:d2cdffd27293 1:ce206587d42f
1 <tool id="edit_rearrange_columns" name="Remove, rearrange and/or rename columns" version="2.0+galaxy0" profile="18.01">
2 <description>in txt-converted FCS files</description>
3 <requirements>
4 <requirement type="package" version="1.0.5">pandas</requirement>
5 </requirements>
6 <stdio>
7 <exit_code range="1" level="fatal" description="Please pick something for the tool to do =)" />
8 <exit_code range="2" level="fatal" description="Please provide column headers to replace." />
9 <exit_code range="3" level="fatal" description="Please provide column headers to use as replacement." />
10 <exit_code range="4" level="fatal" description="Column headers provided were not found in the input file." />
11 <exit_code range="5" level="fatal" description="More headers provided than columns in the input file." />
12 <exit_code range="6" level="fatal" description="New column headings and column headings must be provided together." />
13 <exit_code range="7" level="fatal" description="Please provide a new column order or subset." />
14 <exit_code range="8" level="fatal" description="Columns provided for subsetting/re-ordering are not in the input file" />
15 <exit_code range="9:" level="fatal"/>
16 </stdio>
17 <command><![CDATA[
18 python3 '$__tool_directory__/editColumnHeadings.py' -o '${output_file}' -i '${input}'
19 #if $rename.nn:
20 #for $add in $rename.more_replacements:
21 -r '${add.to_rep}' -w '${add.replace_with}'
22 #end for
23 #end if
24 #if $reorder.order_col:
25 -n '${reorder.order}'
26 #end if
27 ]]>
28 </command>
29 <inputs>
30 <param format="flowtext" name="input" type="data" label="Text file"/>
31
32 <conditional name="rename">
33 <param name="nn" type="boolean" label="Edit column headings?" help="By default, column headings are not changed." checked="false" truevalue="TRUE" falsevalue="FALSE">
34 </param>
35 <when value="TRUE">
36 <repeat name="more_replacements" title="Column to edit">
37 <param name="to_rep" type="text" label="Column headings to replace:" value="i.e.:TLR 6, TLR6PE" help="Please indicate which column heading to replace. If there are more than one heading to replace with the SAME replacement, enter a comma-separated list. See below for examples."/>
38 <param name="replace_with" type="text" label="Replace with:" value="i.e.:TLR6" help="Please indicate what to use for replacement." />
39 </repeat>
40 </when>
41 </conditional>
42
43 <conditional name="reorder">
44 <param name="order_col" type="boolean" label="Re-order or select column?" help="By default, column order is not changed." checked="false" truevalue="TRUE" falsevalue="FALSE">
45 </param>
46 <when value="TRUE">
47 <param name="order" type="text" label="New order:" value="i.e.:1,2,5 or CD3,CD4,CCR3" help="Please indicate columns to keep in the order they should be in. This operation happens after renaming. If subsetting/re-ordering and renaming columns, indicate new column heading names or numerical order."/>
48 </when>
49 </conditional>
50 </inputs>
51 <outputs>
52 <data format="flowtext" name="output_file" label="Rearranged ${input.name} on ${on_string}"/>
53 </outputs>
54 <tests>
55 <test>
56 <param name="input" value="input1.txt"/>
57 <conditional name="reorder">
58 <param name="order_col" value="True"/>
59 <param name="order" value="CD4,CCR3,CD8,CCR7"/>
60 </conditional>
61 <conditional name="rename">
62 <param name="nn" value="True"/>
63 <repeat name="more_replacements">
64 <param name="to_rep" value="FITC CD4"/>
65 <param name="replace_with" value="CD4"/>
66 </repeat>
67 <repeat name="more_replacements">
68 <param name="to_rep" value="PE CCR3"/>
69 <param name="replace_with" value="CCR3"/>
70 </repeat>
71 <repeat name="more_replacements">
72 <param name="to_rep" value="PP CD8"/>
73 <param name="replace_with" value="CD8"/>
74 </repeat>
75 <repeat name="more_replacements">
76 <param name="to_rep" value="APC CCR4"/>
77 <param name="replace_with" value="CCR7"/>
78 </repeat>
79 </conditional>
80 <output name="output_file" value="output1.flowtext"/>
81 </test>
82 <test>
83 <param name="input" value="input2.txt"/>
84 <conditional name="reorder">
85 <param name="order_col" value="True"/>
86 <param name="order" value="Side Scatter,FITC CD4,APC CCR5,Forward Scatter"/>
87 </conditional>
88 <output name="output_file" value="output2.flowtext"/>
89 </test>
90 <test>
91 <param name="input" value="input3.txt"/>
92 <conditional name="rename">
93 <param name="nn" value="True"/>
94 <repeat name="more_replacements">
95 <param name="to_rep" value="Forward Scatter"/>
96 <param name="replace_with" value="M1"/>
97 </repeat>
98 <repeat name="more_replacements">
99 <param name="to_rep" value="Side Scatter"/>
100 <param name="replace_with" value="M2"/>
101 </repeat>
102 <repeat name="more_replacements">
103 <param name="to_rep" value="FITC CD4"/>
104 <param name="replace_with" value="M3"/>
105 </repeat>
106 <repeat name="more_replacements">
107 <param name="to_rep" value="PE CD25"/>
108 <param name="replace_with" value="M4"/>
109 </repeat>
110 <repeat name="more_replacements">
111 <param name="to_rep" value="PP CD3"/>
112 <param name="replace_with" value="M5"/>
113 </repeat>
114 <repeat name="more_replacements">
115 <param name="to_rep" value="APC CD45RA"/>
116 <param name="replace_with" value="M6"/>
117 </repeat>
118 </conditional>
119 <output name="output_file" value="output3.flowtext"/>
120 </test>
121 </tests>
122 <help><![CDATA[
123 This tool enables the removal, rearrangement and/or renaming of text file columns.
124 -----
125 **Input files**
126 This tool requires txt, flowtext or tabular files as input.
127 **Column headings**
128 This field is optional. Please indicate the column headers that need to be replaced. If one marker exists under several names in different files, run the tool in batch mode and include all names to harmonize as a comma-separated list.
129 .. class:: warningmark
130 Column headings provided have to match file content.
131 .. class:: infomark
132 Tip: One of the tools in the Text File Tools section can help check headers in the files to edit:
133 - Check headers of any set of flowtext files.
134 **Replace with**
135 Please indicate what to replace the headers indicated in the previous field with. If the previous field contains a comma-separated list, each of these items will be replaced.
136 ..class:: infomark
137 Tip: Add more headings to modify by clicking on 'Insert Column to edit'
138 **New order**
139 This field is optional. Please indicate which subset of columns (or all) in which order should be output.
140 **Output file**
141 The output flowtext file is a copy of the input file with rearranged and/or renamed columns.
142 -----
143 **Examples**
144 **Input file**::
145 Marker1 Marker2 Marker3 Marker4 Marker5
146 4 45 123 1956 62534
147 3 65 104 1254 36576
148 7 26 767 4124 42235
149 4 56 323 7623 74634
150 5 83 532 6256 34763
151 4 15 877 9312 21265
152 ... ... ... ... ...
153 *Example 1*
154 - Column order: 5,3,2,4
155 - Column names: Default
156 *Output1*::
157 Marker5 Marker3 Marker2 Marker4
158 62534 123 45 1956
159 36576 104 65 1254
160 42235 767 26 4124
161 74634 323 56 7623
162 34763 532 83 6256
163 21265 877 15 9312
164 ... ... ... ...
165 *Example 2*
166 - Column order: 5,3,2,4
167 - Column names: Mar34,,Mar7,
168 *Output2*::
169 Mar34 Marker3 Mar7 Marker4
170 62534 123 45 1956
171 36576 104 65 1254
172 42235 767 26 4124
173 74634 323 56 7623
174 34763 532 83 6256
175 21265 877 15 9312
176 ... ... ... ...
177 *Example 3*
178 - Column order: Default
179 - Column names: Mar23,,,Mar7,Mar8
180 *Output3*::
181 Mar23 Marker2 Marker3 Mar7 Mar8
182 4 45 123 1956 62534
183 3 65 104 1254 36576
184 7 26 767 4124 42235
185 4 56 323 7623 74634
186 5 83 532 6256 34763
187 4 15 877 9312 21265
188 ... ... ... ... ...
189 ]]>
190 </help>
191 </tool>