Mercurial > repos > bgruening > text_processing
annotate sorted_uniq.xml @ 28:e8b38ade9b3e draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 7cdafed6c6a1387395e5a869186518f129aa3132
author | bgruening |
---|---|
date | Tue, 25 Mar 2025 14:33:35 +0000 |
parents | 08cdbfffce67 |
children |
rev | line source |
---|---|
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
1 <tool id="tp_uniq_tool" name="Unique lines" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
1 | 2 <description>assuming sorted input file</description> |
4 | 3 <macros> |
4 <import>macros.xml</import> | |
5 </macros> | |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
6 <expand macro="creator"/> |
4 | 7 <expand macro="requirements"> |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
8 <requirement type="package" version="4.8">sed</requirement> |
4 | 9 </expand> |
10 <version_command>uniq --version | head -n 1</version_command> | |
0 | 11 <command> |
4 | 12 <![CDATA[ |
13 uniq | |
14 #if $skipfields: | |
15 -f $skipfields | |
16 #end if | |
17 $ignorecase | |
18 | |
19 #if $grouping.grouping_select == 'yes': | |
20 --group=$grouping.group | |
21 #else: | |
22 $grouping.count | |
23 $grouping.repeated | |
24 $grouping.uniqueonly | |
25 #end if | |
26 | |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
27 '$infile' |
4 | 28 |
29 #if $grouping.grouping_select == 'no' and $grouping.count: | |
30 ## count will print the count with spaces in front of the line and | |
31 ## with a space (not a tab) after the number, we need to cahnge that | |
32 | sed -e 's/ *//' -e 's/ /\t/' | |
1 | 33 #end if |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
34 > '$outfile' |
4 | 35 ]]> |
0 | 36 </command> |
37 <inputs> | |
4 | 38 <param name="infile" format="tabular" type="data" |
39 label="File to scan for unique values" help="Make sure you have sorted this file" /> | |
0 | 40 |
4 | 41 <conditional name="grouping"> |
42 <param name="grouping_select" type="select" label="Do you want to group each unique group?"> | |
43 <option value="no">No</option> | |
44 <option value="yes">Yes</option> | |
45 </param> | |
46 <when value="no"> | |
7 | 47 <param name="count" type="boolean" truevalue="-c" falsevalue="" |
4 | 48 label="Counting number of occurrences" help="Prefix lines by the number of occurrences. (-c)" /> |
7 | 49 <param name="repeated" type="boolean" truevalue="-d" falsevalue="" |
4 | 50 label="Only print duplicate lines" help="(-d)"/> |
51 <param name="uniqueonly" type="boolean" checked="True" truevalue="-u" falsevalue="" | |
52 label="Only print unique lines" help="(-u)" /> | |
53 </when> | |
54 <when value="yes"> | |
6 | 55 <param name="group" type="select" |
4 | 56 label="Output all lines, and delimit each unique group" help="(--group)"> |
57 <option value="">No grouping at all</option> | |
58 <option value="separate">Separate unique groups with a single delimiter</option> | |
59 <option value="prepend">Output a delimiter before each group of unique items</option> | |
60 <option value="append">Output a delimiter after each group of unique items</option> | |
61 <option value="both">Output a delimiter around each group of unique items</option> | |
62 </param> | |
63 </when> | |
64 </conditional> | |
65 | |
7 | 66 <param name="ignorecase" type="boolean" truevalue="-i" falsevalue="" |
4 | 67 label="Ignore differences in case when comparing" help="(-i)"/> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
7
diff
changeset
|
68 <param name="skipfields" type="integer" value="0" |
4 | 69 label="Avoid comparing the first N fields" help="Use zero to start from the first field. (-f)" /> |
0 | 70 </inputs> |
71 <outputs> | |
6 | 72 <data name="outfile" format_source="infile" metadata_source="infile"/> |
0 | 73 </outputs> |
4 | 74 <tests> |
75 <test> | |
76 <param name="infile" value="sorted_uniq1.tabular" /> | |
27
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
77 <conditional name="grouping"> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
78 <param name="grouping_select" value="no"/> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
79 <param name="count" value="True"/> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
80 <param name="uniqueonly" value="True"/> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
81 </conditional> |
4 | 82 <param name="ignorecase" value="True"/> |
83 <output name="outfile" file="sorted_uniq_results1.tabular" /> | |
84 </test> | |
85 <test> | |
86 <param name="infile" value="sorted_uniq1.tabular" /> | |
87 <param name="ignorecase" value="True"/> | |
27
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
88 <conditional name="grouping"> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
89 <param name="grouping_select" value="yes"/> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
90 <param name="group" value="separate"/> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
91 </conditional> |
4 | 92 <output name="outfile" file="sorted_uniq_results2.tabular" /> |
93 </test> | |
94 </tests> | |
0 | 95 <help> |
4 | 96 <![CDATA[ |
0 | 97 This tool takes a sorted file and look for lines that are unique. |
98 | |
99 .. class:: warningmark | |
100 | |
101 Please make sure your file is sorted, or else this tool will give you an erroneous output. | |
102 | |
103 .. class:: infomark | |
104 | |
105 You can sort your file using either the "Sort" tool in "Filter and Sort", or the "Sort" tool in "Unix Tools". | |
106 | |
4 | 107 ]]> |
0 | 108 </help> |
14
7725ab6dab67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b'e6ee273f75fff61d1e419283fa8088528cf59470\n'
bgruening
parents:
13
diff
changeset
|
109 <expand macro="citations" /> |
0 | 110 </tool> |