comparison split_file_on_column.xml @ 2:90b52d8d6f2c 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:32:06 -0400
parents 0ba6d09a71d6
children b60f2452580e
comparison
equal deleted inserted replaced
1:0ba6d09a71d6 2:90b52d8d6f2c
1 <tool id="tp_split_on_column" name="Split file" force_history_refresh="True" version="0.1.1"> 1 <tool id="tp_split_on_column" name="Split file" version="0.2">
2 <description>according to the values of a column</description> 2 <description>according to the values of a column</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="4.1.0">gnu_awk</requirement> 4 <requirement type="package" version="4.1.0">gnu_awk</requirement>
5 </requirements> 5 </requirements>
6 <command> 6 <command>
7 awk -F'\t' '{print > "primary_${outfile.id}_" \$$column "_visible_${infile.ext}" }' $infile; 7 <![CDATA[
8 echo 'Created' `ls -l | wc -l` 'files:' > $outfile; 8 awk -F'\t' '{print > \$$column ".$infile.ext" }' $infile
9 ls -1 --hide="*_stdout" --hide="*_stderr" >> $outfile; 9 ]]>
10 </command> 10 </command>
11
12 <inputs> 11 <inputs>
13 <param format="txt" name="infile" type="data" label="File to select" /> 12 <param format="tabular" name="infile" type="data" label="File to select" />
14 <param name="column" label="on column" type="data_column" data_ref="infile" accept_default="true" /> 13 <param name="column" label="on column" type="data_column" data_ref="infile" accept_default="true" />
15 </inputs> 14 </inputs>
16
17 <outputs> 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>
18 <data format="input" name="outfile" metadata_source="infile" label="${tool.name} on ${on_string}"/> 21 <data format="input" name="outfile" metadata_source="infile" label="${tool.name} on ${on_string}"/>
19 </outputs> 22 </outputs-->
20 <tests> 23 <tests>
21 <test> 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>
22 </test> 39 </test>
23 </tests> 40 </tests>
24 <help> 41 <help>
42 <![CDATA[
25 43
26 **What it does** 44 **What it does**
27 45
28 This tool splits a file into different smaller files using a specific column. 46 This tool splits a file into different smaller files using a specific column.
29 It will work like the group tool, but every group is saved to its own file. 47 It will work like the group tool, but every group is saved to its own file.
30 48
31 ----- 49 -----
32 50
33 **Example** 51 **Example**
34 52
35 Splitting on column 4 from this:: 53 Splitting on column 5 from this::
36 54
37 chr7 56632 56652 cluster 1 55 chr7 56632 56652 cluster 1
38 chr7 56736 56756 cluster 1 56 chr7 56736 56756 cluster 1
39 chr7 56761 56781 cluster 2 57 chr7 56761 56781 cluster 2
40 chr7 56772 56792 cluster 2 58 chr7 56772 56792 cluster 2
49 chr7 56761 56781 cluster 2 67 chr7 56761 56781 cluster 2
50 chr7 56772 56792 cluster 2 68 chr7 56772 56792 cluster 2
51 chr7 56775 56795 cluster 2 69 chr7 56775 56795 cluster 2
52 70
53 71
72 ]]>
54 </help> 73 </help>
55 </tool> 74 </tool>