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