Mercurial > repos > bgruening > text_processing
annotate grep.xml @ 27:08cdbfffce67 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
author | bgruening |
---|---|
date | Fri, 07 Mar 2025 20:43:41 +0000 |
parents | f22a309187a3 |
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_grep_tool" name="Search in textfiles" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
0 | 2 <description>(grep)</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"/> |
13
3c685c4106b3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b9d202134c3c6d0e5c398c3ae75e410067fcfc52
bgruening
parents:
12
diff
changeset
|
7 <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="3.11">grep</requirement> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
9 <requirement type="package" version="4.8">sed</requirement><!-- for ansi2html.sh --> |
13
3c685c4106b3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b9d202134c3c6d0e5c398c3ae75e410067fcfc52
bgruening
parents:
12
diff
changeset
|
10 </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
|
11 <stdio> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
12 <exit_code range="2:" level="fatal" description="grep failed" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
13 </stdio> |
4 | 14 <version_command>grep --version | head -n 1</version_command> |
2 | 15 <command> |
4 | 16 <![CDATA[ |
2 | 17 #if str($color) == "COLOR": |
4 | 18 GREP_COLOR='1;34' |
19 grep | |
20 --color=always | |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
21 $regex_type |
4 | 22 -A $lines_after |
23 -B $lines_before | |
24 $invert | |
25 $case_sensitive | |
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
|
26 -- '${url_paste}' |
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}' | '$__tool_directory__/ansi2html.sh' > '${output}' |
0 | 28 #else: |
4 | 29 grep |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
30 $regex_type |
4 | 31 -A $lines_after |
32 -B $lines_before | |
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
|
33 --no-group-separator |
4 | 34 $invert |
35 $case_sensitive | |
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
|
36 -- '${url_paste}' |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
37 '${infile}' > '${output}' |
0 | 38 #end if |
4 | 39 ]]> |
0 | 40 </command> |
41 <inputs> | |
4 | 42 <param name="infile" format="txt" type="data" label="Select lines from" /> |
0 | 43 |
44 <param name="invert" type="select" label="that"> | |
45 <option value="">Match</option> | |
46 <option value="-v">Don't Match</option> | |
47 </param> | |
18
1e974b82380d
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 0ba37c1f33eeb1c77b4d9363d681fe522d9f7fe7
bgruening
parents:
14
diff
changeset
|
48 |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
49 <param name="regex_type" type="select" label="Type of regex"> |
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
|
50 <option value="-G">Basic (-G)</option> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
51 <option value="-P" selected="true">Perl (-P)</option> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
52 <option value="-E">Extended (egrep -E)</option> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
53 </param> |
18
1e974b82380d
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 0ba37c1f33eeb1c77b4d9363d681fe522d9f7fe7
bgruening
parents:
14
diff
changeset
|
54 |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
55 <param name="url_paste" type="text" label="Regular Expression" help="See below for more details"> |
0 | 56 <sanitizer> |
57 <valid initial="string.printable"> | |
58 <remove value="'"/> | |
59 </valid> | |
60 </sanitizer> | |
61 </param> | |
62 | |
4 | 63 <param name="case_sensitive" type="select" label="Match type" help="(-i)"> |
0 | 64 <option value="-i">case insensitive</option> |
65 <option value="">case sensitive</option> | |
66 </param> | |
4 | 67 <param name="lines_before" type="integer" value="0" |
68 label="Show lines preceding the matched line" help="leave it at zero unless you know what you're doing. (-B)" /> | |
69 <param name="lines_after" type="integer" value="0" | |
70 label="Show lines trailing the matched line" help="leave it at zero unless you know what you're doing. (-A)" /> | |
0 | 71 <param name="color" type="select" label="Output"> |
72 <option value="NOCOLOR">text file (for further processing)</option> | |
73 <option value="COLOR">Highlighted HTML (for easier viewing)</option> | |
74 </param> | |
75 | |
4 | 76 </inputs> |
77 <outputs> | |
6 | 78 <data name="output" format_source="infile" metadata_source="infile"> |
4 | 79 <change_format> |
80 <when input="color" value="COLOR" format="html"/> | |
81 </change_format> | |
82 </data> | |
83 </outputs> | |
84 <tests> | |
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
|
85 <!-- grep a FASTA file for sequences with specific motif --> |
4 | 86 <test> |
6 | 87 <param name="infile" value="grep1.txt" /> |
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 <param name="case_sensitive" value="-i" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
89 <param name="regex_type" value="-P" /> |
4 | 90 <param name="invert" value="" /> |
91 <param name="url_paste" value="AA.{2}GT" /> | |
92 <param name="lines_before" value="1" /> | |
93 <param name="lines_after" value="0" /> | |
94 <param name="color" value="NOCOLOR" /> | |
6 | 95 <output name="output" file="grep_results1.txt" /> |
4 | 96 </test> |
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
|
97 <!-- grep a FASTA file for sequences with specific motif - |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
98 show highlighed output --> |
4 | 99 <test> |
6 | 100 <param name="infile" value="grep1.txt" /> |
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
|
101 <param name="case_sensitive" value="-i" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
102 <param name="regex_type" value="-P" /> |
4 | 103 <param name="invert" value="" /> |
104 <param name="url_paste" value="AA.{2}GT" /> | |
105 <param name="lines_before" value="0" /> | |
106 <param name="lines_after" value="0" /> | |
107 <param name="color" value="COLOR" /> | |
6 | 108 <output name="output" file="grep_results2.html" /> |
4 | 109 </test> |
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
|
110 <!-- tests egrep --> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
111 <test> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
112 <param name="infile" value="egrep1.txt" /> |
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
|
113 <param name="case_sensitive" value="-i" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
114 <param name="regex_type" value="-E" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
115 <param name="invert" value="" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
116 <param name="url_paste" value="[^ ]+" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
117 <param name="lines_before" value="0" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
118 <param name="lines_after" value="0" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
119 <param name="color" value="NOCOLOR" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
120 <output name="output" file="egrep_results1.txt" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
121 </test> |
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
|
122 <!-- tests basic regex; + must be backslashed to match --> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
123 <test> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
124 <param name="infile" value="egrep1.txt" /> |
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
|
125 <param name="case_sensitive" value="-i" /> |
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
|
126 <param name="regex_type" value="-G" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
127 <param name="invert" value="" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
128 <param name="url_paste" value="[^ ]\+" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
129 <param name="lines_before" value="0" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
130 <param name="lines_after" value="0" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
131 <param name="color" value="NOCOLOR" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
132 <output name="output" file="egrep_results1.txt" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
133 </test> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
134 <!-- tests regex;matching nothing --> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
135 <test> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
136 <param name="infile" value="egrep1.txt" /> |
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
|
137 <param name="case_sensitive" value="-i" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
138 <param name="regex_type" value="-G" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
139 <param name="invert" value="" /> |
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
|
140 <param name="url_paste" value="not existent pattern" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
141 <param name="lines_before" value="0" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
142 <param name="lines_after" value="0" /> |
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
143 <param name="color" value="NOCOLOR" /> |
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
|
144 <output name="output"> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
145 <assert_contents> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
146 <has_size value="0"/> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
147 </assert_contents> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
148 </output> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
149 </test> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
150 <!-- tests invalid regex; i.e. that we still get exit code 2 --> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
151 <test expect_failure="true" expect_exit_code="2"> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
152 <param name="infile" value="egrep1.txt" /> |
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
|
153 <param name="case_sensitive" value="-i" /> |
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
|
154 <param name="regex_type" value="-G" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
155 <param name="invert" value="" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
156 <param name="url_paste" value="\(" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
157 <param name="lines_before" value="0" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
158 <param name="lines_after" value="0" /> |
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
159 <param name="color" value="NOCOLOR" /> |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
8
diff
changeset
|
160 </test> |
4 | 161 </tests> |
162 <help> | |
163 <![CDATA[ | |
0 | 164 **What it does** |
165 | |
166 This tool runs the unix **grep** command on the selected data file. | |
167 | |
168 .. class:: infomark | |
169 | |
170 **TIP:** This tool uses the **perl** regular expression syntax (same as running 'grep -P'). This is **NOT** the POSIX or POSIX-extended syntax (unlike the awk/sed tools). | |
171 | |
172 | |
173 **Further reading** | |
174 | |
175 - Wikipedia's Regular Expression page (http://en.wikipedia.org/wiki/Regular_expression) | |
176 - Regular Expressions cheat-sheet (PDF) (http://www.addedbytes.com/cheat-sheets/download/regular-expressions-cheat-sheet-v2.pdf) | |
177 - Grep Tutorial (http://www.panix.com/~elflord/unix/grep.html) | |
178 | |
179 ----- | |
180 | |
181 **Grep Examples** | |
182 | |
183 - **AGC.AAT** would match lines with AGC followed by any character, followed by AAT (e.g. **AGCQAAT**, **AGCPAAT**, **AGCwAAT**) | |
184 - **C{2,5}AGC** would match lines with 2 to 5 consecutive Cs followed by AGC | |
185 - **TTT.{4,10}AAA** would match lines with 3 Ts, followed by 4 to 10 characters (any characeters), followed by 3 As. | |
186 - **^chr([0-9A-Za-z])+** would match lines that begin with chromsomes, such as lines in a BED format file. | |
187 - **(ACGT){1,5}** would match at least 1 "ACGT" and at most 5 "ACGT" consecutively. | |
188 - **hsa|mmu** would match lines containing "hsa" or "mmu" (or both). | |
7 | 189 |
0 | 190 ----- |
191 | |
192 **Regular Expression Syntax** | |
193 | |
7 | 194 The select tool searches the data for lines containing or not containing a match to the given pattern. A Regular Expression is a pattern descibing a certain amount of text. |
0 | 195 |
196 - **( ) { } [ ] . * ? + \ ^ $** are all special characters. **\\** can be used to "escape" a special character, allowing that special character to be searched for. | |
197 - **^** matches the beginning of a string(but not an internal line). | |
198 - **\\d** matches a digit, same as [0-9]. | |
199 - **\\D** matches a non-digit. | |
200 - **\\s** matches a whitespace character. | |
201 - **\\S** matches anything BUT a whitespace. | |
202 - **\\t** matches a tab. | |
203 - **\\w** matches an alphanumeric character ( A to Z, 0 to 9 and underscore ) | |
204 - **\\W** matches anything but an alphanumeric character. | |
205 - **(** .. **)** groups a particular pattern. | |
206 - **\\Z** matches the end of a string(but not a internal line). | |
207 - **{** n or n, or n,m **}** specifies an expected number of repetitions of the preceding pattern. | |
208 | |
209 - **{n}** The preceding item is matched exactly n times. | |
7 | 210 - **{n,}** The preceding item ismatched n or more times. |
211 - **{n,m}** The preceding item is matched at least n times but not more than m times. | |
0 | 212 |
213 - **[** ... **]** creates a character class. Within the brackets, single characters can be placed. A dash (-) may be used to indicate a range such as **a-z**. | |
214 - **.** Matches any single character except a newline. | |
215 - ***** The preceding item will be matched zero or more times. | |
216 - **?** The preceding item is optional and matched at most once. | |
217 - **+** The preceding item will be matched one or more times. | |
218 - **^** has two meaning: | |
7 | 219 - matches the beginning of a line or string. |
0 | 220 - indicates negation in a character class. For example, [^...] matches every character except the ones inside brackets. |
221 - **$** matches the end of a line or string. | |
7 | 222 - **\|** Separates alternate possibilities. |
0 | 223 |
4 | 224 ]]> |
225 </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
|
226 <expand macro="citations" /> |
0 | 227 </tool> |