comparison rearrange_columns/editColumnHeadings.xml @ 0:d2cdffd27293 draft

Uploaded
author immport-devteam
date Mon, 27 Feb 2017 13:05:18 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d2cdffd27293
1 <tool id="edit_rearrange_columns" name="Remove, rearrange and/or rename columns" version="1.1">
2 <description>in txt-converted FCS files.</description>
3 <stdio>
4 <exit_code range="2" level="fatal" description="Please provide a comma separated list of integers for columns you want to keep." />
5 <exit_code range="3" level="fatal" description="Please provide integers for columns you want to keep." />
6 <exit_code range="4" level="fatal" description="List of column headings and list of selected columns must match. For instance for columns 1,3,4: Marker1,,Marker3." />
7 </stdio>
8 <command><![CDATA[
9 python $__tool_directory__/editColumnHeadings.py -o "${output_file}" -i "${input}"
10 #if $columns
11 -c "${columns}"
12 #end if
13 #if $colnames
14 -n "${colnames}"
15 #end if
16 ]]>
17 </command>
18 <inputs>
19 <param format="flowtext" name="input" type="data" label="Text file"/>
20 <param name="columns" type="text" label="Column order:" value="i.e.:1,5,2" optional="true" help="By default, will keep all columns in the same order."/>
21 <param name="colnames" type="text" label="New column headings:" value="i.e.:Marker1,,Marker4" optional="true" help="By default, will not change the column headings. Check below for more details.">
22 </param>
23 </inputs>
24 <outputs>
25 <data format="flowtext" name="output_file" label="Rearranged ${input.name}"/>
26 </outputs>
27 <tests>
28 <test>
29 <param name="input" value="input1.txt"/>
30 <param name="columns" value="3,4,5,6"/>
31 <param name="colnames" value="CD4,CCR3,CD8,CCR7"/>
32 <output name="output_file" file="output1.flowtext"/>
33 </test>
34 <test>
35 <param name="input" value="input2.txt"/>
36 <param name="columns" value="2,3,6,1"/>
37 <param name="colnames" value="i.e.:Marker1,,Marker4"/>
38 <output name="output_file" file="output2.flowtext"/>
39 </test>
40 <test>
41 <param name="input" value="input3.txt"/>
42 <param name="columns" value="i.e.:1,5,2"/>
43 <param name="colnames" value="M1,M2,M3,M4,M5,M6"/>
44 <output name="output_file" file="output3.flowtext"/>
45 </test>
46 </tests>
47 <help><![CDATA[
48 This tool enables the removal, rearrangement and/or renaming of text file columns.
49
50 -----
51
52 **Input files**
53
54 This tool requires txt, flowtext or tabular files as input.
55
56 **Column order**
57
58 Please indicate columns to keep in the order in which they should be (comma-separated list).
59 This field is optional.
60
61 **Column names**
62
63 Please indicate the new columns headings in the order in which they should appear in the ouptut file (comma-separated list). The number of headings should match the number of columns in the output.
64 This field is optional.
65
66 .. class: warningmark
67
68 When providing column order AND new column headings the column count for each must match. See below for an example.
69
70 **Output file**
71
72 The output flowtext file is a copy of the input file with rearranged and/or renamed columns.
73
74 -----
75
76 **Examples**
77
78 **Input file**::
79
80 Marker1 Marker2 Marker3 Marker4 Marker5
81 4 45 123 1956 62534
82 3 65 104 1254 36576
83 7 26 767 4124 42235
84 4 56 323 7623 74634
85 5 83 532 6256 34763
86 4 15 877 9312 21265
87
88 *Example 1*
89
90 - Column order: 5,3,2,4
91 - Column names: Default
92
93 *Output1*::
94
95 Marker5 Marker3 Marker2 Marker4
96 62534 123 45 1956
97 36576 104 65 1254
98 42235 767 26 4124
99 74634 323 56 7623
100 34763 532 83 6256
101 21265 877 15 9312
102
103 *Example 2*
104
105 - Column order: 5,3,2,4
106 - Column names: Mar34,,Mar7,
107
108 *Output2*::
109
110 Mar34 Marker3 Mar7 Marker4
111 62534 123 45 1956
112 36576 104 65 1254
113 42235 767 26 4124
114 74634 323 56 7623
115 34763 532 83 6256
116 21265 877 15 9312
117
118 *Example 3*
119
120 - Column order: Default
121 - Column names: Mar23,,,Mar7,Mar8
122
123 *Output3*::
124
125 Mar23 Marker2 Marker3 Mar7 Mar8
126 4 45 123 1956 62534
127 3 65 104 1254 36576
128 7 26 767 4124 42235
129 4 56 323 7623 74634
130 5 83 532 6256 34763
131 4 15 877 9312 21265
132 ]]>
133 </help>
134 </tool>