comparison columnArrange.xml @ 1:6c6d26ff01ff draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/column_arrange_by_header commit b6e0b2de32ddb91085235397728623a35ad13f42
author bgruening
date Fri, 15 Feb 2019 07:45:03 -0500
parents f18f67056946
children
comparison
equal deleted inserted replaced
0:f18f67056946 1:6c6d26ff01ff
1 <tool id="bg_column_arrange_by_header" name="Column arrange" version="0.1"> 1 <tool id="bg_column_arrange_by_header" name="Column arrange" version="0.2">
2 <description>by header name</description> 2 <description>by header name</description>
3 <requirements>
4 <requirement type="package" version="0.14.1">pandas</requirement>
5 </requirements>
6 <command interpreter="python"> 3 <command interpreter="python">
7 <![CDATA[ 4 <![CDATA[
8 column_arrange.py 5 column_arrange.py
9 --columns 6 --columns
10 #for token in $rep_param_columns: 7 #for token in $rep_param_columns:
11 "$token.param_column" 8 '$token.param_column'
12 #end for 9 #end for
13 --in $param_input 10 --in '$param_input'
14 --out $output 11 --out '$output'
12 $discard_remaining
15 ]]> 13 ]]>
16 </command> 14 </command>
17 <inputs> 15 <inputs>
18 <param format="tabular" name="param_input" type="data" label="file to rearrange" /> 16 <param format="tabular" name="param_input" type="data" label="file to rearrange" />
19 <repeat name ="rep_param_columns" min="1" title="Specify the first few columns by name"> 17 <repeat name ="rep_param_columns" min="1" title="Specify the first few columns by name">
20 <param name="param_column" type="text" value="" label="column"> 18 <param name="param_column" type="text" value="" label="column">
21 <sanitizer> 19 <sanitizer>
22 <valid initial="string.printable"> 20 <valid initial="string.printable">
23 <remove value="&apos;"/> 21 <remove value="&apos;"/>
24 </valid> 22 </valid>
23 <mapping initial="none">
24 <add source="&apos;" target="&apos;&quot;&apos;&quot;&apos;" />
25 </mapping>
25 </sanitizer> 26 </sanitizer>
26 </param> 27 </param>
27 </repeat> 28 </repeat>
29 <param name="discard_remaining" type="boolean" truevalue="--discard" falsevalue="" checked="false"
30 label="Discard unspecified columns?"
31 help="Columns not explicitly specified above for rearrangement can be appended after the last specified column in their original order (the default) or be discarded from the output." />
28 </inputs> 32 </inputs>
29 <outputs> 33 <outputs>
30 <data format="tabular" name="output" /> 34 <data format="tabular" name="output" />
31 </outputs> 35 </outputs>
32 <tests> 36 <tests>
36 <param name="param_column" value="fname"/> 40 <param name="param_column" value="fname"/>
37 </repeat> 41 </repeat>
38 <repeat name="rep_param_columns"> 42 <repeat name="rep_param_columns">
39 <param name="param_column" value="age"/> 43 <param name="param_column" value="age"/>
40 </repeat> 44 </repeat>
41 <output name="out" file="columnarrange_result1.tab"/> 45 <output name="output" file="columnarrange_result1.tab"/>
46 </test>
47 <test>
48 <param name="param_input" value="columnarrange_input1.tab"/>
49 <repeat name="rep_param_columns">
50 <param name="param_column" value="fname"/>
51 </repeat>
52 <param name="discard_remaining" value="true" />
53 <output name="output">
54 <assert_contents>
55 <has_n_columns n="1" />
56 <has_line line="fname" />
57 </assert_contents>
58 </output>
59 </test>
60 <test>
61 <param name="param_input" value="columnarrange_input1.tab"/>
62 <repeat name="rep_param_columns">
63 <param name="param_column" value="fname"/>
64 </repeat>
65 <repeat name="rep_param_columns">
66 <param name="param_column" value="age"/>
67 </repeat>
68 <param name="discard_remaining" value="true" />
69 <output name="output">
70 <assert_contents>
71 <has_n_columns n="2" />
72 <has_line line="fname&#009;age" />
73 </assert_contents>
74 </output>
42 </test> 75 </test>
43 <test> 76 <test>
44 <param name="param_input" value="columnarrange_input2.tab"/> 77 <param name="param_input" value="columnarrange_input2.tab"/>
45 <repeat name="rep_param_columns"> 78 <repeat name="rep_param_columns">
46 <param name="param_column" value="first name"/> 79 <param name="param_column" value="first name"/>
47 </repeat> 80 </repeat>
48 <repeat name="rep_param_columns"> 81 <repeat name="rep_param_columns">
49 <param name="param_column" value="nationality"/> 82 <param name="param_column" value="nationality"/>
50 </repeat> 83 </repeat>
51 <output name="out" file="columnarrange_result2.tab"/> 84 <output name="output" file="columnarrange_result2.tab"/>
52 </test> 85 </test>
53 </tests> 86 </tests>
54 <help> 87 <help>
55 **What it does** 88 **What it does**
56 89
57 With this tool you can specify (by naming the header) which columns need to be leftmost. 90 With this tool you can specify - by name - the order of columns for tabular
58 The columns which are not specified will be ordered as before, right of the columns which were specified. 91 data.
92 Columns not specified will remain ordered as before and be moved to the right
93 of the specified columns, as shown in the following example.
59 94
60 Input file:: 95 Input file::
61 96
62 AHeader BHeader CHeader DHeader 97 AHeader BHeader CHeader DHeader
63 a b c d 98 a b c d
64 a b c d 99 a b c d
65 100
66 Specifying **CHeader** and **BHeader**, as the columns that should be leftmost, generates:: 101 Specifying **CHeader** and **BHeader**, as the columns that should be leftmost,
102 generates::
67 103
68 CHeader BHeader AHeader DHeader 104 CHeader BHeader AHeader DHeader
69 c b a d 105 c b a d
70 c b a d 106 c b a d
71 107
108 Alternatively, you can choose to retain *only* the specified columns in their
109 new arrangement and discard all other columns.
72 </help> 110 </help>
73 <citations> 111 <citations>
74 <citation type="bibtex"> 112 <citation type="bibtex">
75 @ARTICLE{bgruening_galaxytools, 113 @ARTICLE{bgruening_galaxytools,
76 Author = {Björn Grüning, Cameron Smith, Torsten Houwaart, Nicola Soranzo, Eric Rasche}, 114 Author = {Björn Grüning, Cameron Smith, Torsten Houwaart, Nicola Soranzo, Eric Rasche},