Mercurial > repos > saket-choudhary > merge_columns_with_delimiter
comparison merge_columns_with_delimiter/merge_columns_with_delimiter.xml @ 0:eaf7c9b0a1a4 draft default tip
Uploaded
author | saket-choudhary |
---|---|
date | Tue, 07 Oct 2014 19:38:23 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:eaf7c9b0a1a4 |
---|---|
1 <tool id="merge_cols_with_delimiter1" name="Merge Columns with Delimiters" version="1.0.1"> | |
2 <description>together</description> | |
3 <command interpreter="python"> | |
4 merge_columns_with_delimiter.py | |
5 $input1 | |
6 $out_file1 | |
7 $delimiter | |
8 $col1 | |
9 $col2 | |
10 #for $col in $columns | |
11 ${col.datacol} | |
12 #end for | |
13 | |
14 </command> | |
15 <inputs> | |
16 <param format="tabular" name="input1" type="data" label="Select data" help="Dataset missing? See TIP below."/> | |
17 <param name="delimiter" type="select" label="Delimiter"> | |
18 <option value="s">Whitespaces</option> | |
19 <option value="T">Tabs</option> | |
20 <option value="Ep">EmptyString</option> | |
21 <option value="Dt">Dots</option> | |
22 <option value="C">Commas</option> | |
23 <option value="D">Dashes</option> | |
24 <option value="Sl">Left Slashes</option> | |
25 <option value="Sr">Right Slashes</option> | |
26 <option value="U">Underscores</option> | |
27 <option value="P">Pipes</option> | |
28 <option value="Co">Colons</option> | |
29 <option value="Sc">Semicolons</option> | |
30 </param> | |
31 <param name="col1" label="Merge column" type="data_column" data_ref="input1" /> | |
32 <param name="col2" label="with column" type="data_column" data_ref="input1" help="Need to add more columns? Use controls below."/> | |
33 | |
34 <repeat name="columns" title="Columns"> | |
35 <param name="datacol" label="Add column" type="data_column" data_ref="input1" /> | |
36 </repeat> | |
37 </inputs> | |
38 <outputs> | |
39 <data format="tabular" name="out_file1" /> | |
40 </outputs> | |
41 <tests> | |
42 <test> | |
43 <param name="input1" value="merge_columns_with_delimiter_input.tsv"/> | |
44 <param name="delimiter" value="D" /> | |
45 <param name="col1" value="5" /> | |
46 <param name="col2" value="1" /> | |
47 <param name="datacol" value="3" /> | |
48 <output name="out_file1" file="merge_columns_with_delimiter_output.tsv"/> | |
49 </test> | |
50 </tests> | |
51 <help> | |
52 | |
53 .. class:: infomark | |
54 | |
55 **TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* | |
56 | |
57 ----- | |
58 | |
59 **What it does** | |
60 | |
61 This tool merges columns together separating them with the specified delimiter. | |
62 Any number of valid columns can be merged in any order. | |
63 Tool and code inspired from 'merge_columns' tool distributed with Galaxy. | |
64 | |
65 ----- | |
66 | |
67 **Example** | |
68 | |
69 Input dataset (five columns: c1, c2, c3, c4, and c5):: | |
70 | |
71 1 10 1000 gene1 chr | |
72 2 100 1500 gene2 chr | |
73 | |
74 merging columns "**c5,c1**" with "-"(dash) will return:: | |
75 | |
76 1 10 1000 gene1 chr chr-1 | |
77 2 100 1500 gene2 chr chr-2 | |
78 | |
79 .. class:: warningmark | |
80 | |
81 Note that all original columns are preserved and the result of merge is added as the rightmost column. | |
82 </help> | |
83 </tool> |