comparison split_file_on_column.xml @ 0:f30aca50efbb draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/split_file_on_column commit 36d05738e78c68091b45779624734e6a47829856-dirty
author bgruening
date Wed, 26 Aug 2015 07:31:55 -0400
parents
children b1914e537f3e
comparison
equal deleted inserted replaced
-1:000000000000 0:f30aca50efbb
1 <tool id="tp_split_on_column" name="Split file" version="0.2">
2 <description>according to the values of a column</description>
3 <requirements>
4 <requirement type="package" version="4.1.0">gnu_awk</requirement>
5 </requirements>
6 <command>
7 <![CDATA[
8 awk -F'\t' '{print > \$$column ".$infile.ext" }' $infile
9 ]]>
10 </command>
11 <inputs>
12 <param format="tabular" name="infile" type="data" label="File to select" />
13 <param name="column" label="on column" type="data_column" data_ref="infile" accept_default="true" />
14 </inputs>
15 <outputs>
16 <collection name="split_output" type="list" label="Table split on first column">
17 <discover_datasets pattern="__name_and_ext__" directory="." />
18 </collection>
19 </outputs>
20 <!--outputs>
21 <data format="input" name="outfile" metadata_source="infile" label="${tool.name} on ${on_string}"/>
22 </outputs-->
23 <tests>
24 <test>
25 <param name="infile" value="5cols.tabular" ftype="tabular"/>
26 <param name="column" value="5" />
27 <output_collection name="split_output" type="list">
28 <element name="1">
29 <assert_contents>
30 <has_text_matching expression="chr7\t56632\t56652\tcluster\t1" />
31 </assert_contents>
32 </element>
33 <element name="2">
34 <assert_contents>
35 <has_text_matching expression="chr7\t56761\t56781\tcluster\t2" />
36 </assert_contents>
37 </element>
38 </output_collection>
39 </test>
40 </tests>
41 <help>
42 <![CDATA[
43
44 **What it does**
45
46 This tool splits a file into different smaller files using a specific column.
47 It will work like the group tool, but every group is saved to its own file.
48
49 -----
50
51 **Example**
52
53 Splitting on column 5 from this::
54
55 chr7 56632 56652 cluster 1
56 chr7 56736 56756 cluster 1
57 chr7 56761 56781 cluster 2
58 chr7 56772 56792 cluster 2
59 chr7 56775 56795 cluster 2
60
61 will produce 2 files with different clusters::
62
63 chr7 56632 56652 cluster 1
64 chr7 56736 56756 cluster 1
65
66
67 chr7 56761 56781 cluster 2
68 chr7 56772 56792 cluster 2
69 chr7 56775 56795 cluster 2
70
71
72 ]]>
73 </help>
74 </tool>