Mercurial > repos > bgruening > text_processing
annotate grep.xml @ 24:c41d78ae5fee draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 4dd118c84ed4d6157303e71438c24446ec4b4f31
| author | bgruening |
|---|---|
| date | Wed, 04 Jun 2025 15:12:29 +0000 |
| parents | 3dc70b59608c |
| children |
| rev | line source |
|---|---|
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
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> |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
6 <expand macro="creator"/> |
|
5
20344ce0c811
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b9d202134c3c6d0e5c398c3ae75e410067fcfc52
bgruening
parents:
3
diff
changeset
|
7 <requirements> |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
8 <requirement type="package" version="3.11">grep</requirement> |
|
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
9 <requirement type="package" version="4.8">sed</requirement><!-- for ansi2html.sh --> |
|
5
20344ce0c811
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b9d202134c3c6d0e5c398c3ae75e410067fcfc52
bgruening
parents:
3
diff
changeset
|
10 </requirements> |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
11 <stdio> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
12 <exit_code range="2:" level="fatal" description="grep failed" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
13 </stdio> |
| 0 | 14 <version_command>grep --version | head -n 1</version_command> |
| 15 <command> | |
| 16 <![CDATA[ | |
| 17 #if str($color) == "COLOR": | |
| 18 GREP_COLOR='1;34' | |
| 19 grep | |
| 20 --color=always | |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
21 $regex_type |
| 0 | 22 -A $lines_after |
| 23 -B $lines_before | |
| 24 $invert | |
| 25 $case_sensitive | |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
26 -- '${url_paste}' |
|
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
27 '${infile}' | '$__tool_directory__/ansi2html.sh' > '${output}' |
| 0 | 28 #else: |
| 29 grep | |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
30 $regex_type |
| 0 | 31 -A $lines_after |
| 32 -B $lines_before | |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
33 --no-group-separator |
| 0 | 34 $invert |
| 35 $case_sensitive | |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
36 -- '${url_paste}' |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
37 '${infile}' > '${output}' |
| 0 | 38 #end if |
| 39 ]]> | |
| 40 </command> | |
| 41 <inputs> | |
| 42 <param name="infile" format="txt" type="data" label="Select lines from" /> | |
| 43 | |
| 44 <param name="invert" type="select" label="that"> | |
| 45 <option value="">Match</option> | |
| 46 <option value="-v">Don't Match</option> | |
| 47 </param> | |
|
11
74a8bef53a00
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 0ba37c1f33eeb1c77b4d9363d681fe522d9f7fe7
bgruening
parents:
6
diff
changeset
|
48 |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
49 <param name="regex_type" type="select" label="Type of regex"> |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
50 <option value="-G">Basic (-G)</option> |
|
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
51 <option value="-P" selected="true">Perl (-P)</option> |
|
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
52 <option value="-E">Extended (egrep -E)</option> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
53 </param> |
|
11
74a8bef53a00
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 0ba37c1f33eeb1c77b4d9363d681fe522d9f7fe7
bgruening
parents:
6
diff
changeset
|
54 |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
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 | |
| 63 <param name="case_sensitive" type="select" label="Match type" help="(-i)"> | |
| 64 <option value="-i">case insensitive</option> | |
| 65 <option value="">case sensitive</option> | |
| 66 </param> | |
| 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)" /> | |
| 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 | |
| 76 </inputs> | |
| 77 <outputs> | |
| 78 <data name="output" format_source="infile" metadata_source="infile"> | |
| 79 <change_format> | |
| 80 <when input="color" value="COLOR" format="html"/> | |
| 81 </change_format> | |
| 82 </data> | |
| 83 </outputs> | |
| 84 <tests> | |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
85 <!-- grep a FASTA file for sequences with specific motif --> |
| 0 | 86 <test> |
| 87 <param name="infile" value="grep1.txt" /> | |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
88 <param name="case_sensitive" value="-i" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
89 <param name="regex_type" value="-P" /> |
| 0 | 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" /> | |
| 95 <output name="output" file="grep_results1.txt" /> | |
| 96 </test> | |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
97 <!-- grep a FASTA file for sequences with specific motif - |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
98 show highlighed output --> |
| 0 | 99 <test> |
| 100 <param name="infile" value="grep1.txt" /> | |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
101 <param name="case_sensitive" value="-i" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
102 <param name="regex_type" value="-P" /> |
| 0 | 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" /> | |
| 108 <output name="output" file="grep_results2.html" /> | |
| 109 </test> | |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
110 <!-- tests egrep --> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
111 <test> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
112 <param name="infile" value="egrep1.txt" /> |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
113 <param name="case_sensitive" value="-i" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
114 <param name="regex_type" value="-E" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
115 <param name="invert" value="" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
116 <param name="url_paste" value="[^ ]+" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
117 <param name="lines_before" value="0" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
118 <param name="lines_after" value="0" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
119 <param name="color" value="NOCOLOR" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
120 <output name="output" file="egrep_results1.txt" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
121 </test> |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
122 <!-- tests basic regex; + must be backslashed to match --> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
123 <test> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
124 <param name="infile" value="egrep1.txt" /> |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
125 <param name="case_sensitive" value="-i" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
126 <param name="regex_type" value="-G" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
127 <param name="invert" value="" /> |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
128 <param name="url_paste" value="[^ ]\+" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
129 <param name="lines_before" value="0" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
130 <param name="lines_after" value="0" /> |
|
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
131 <param name="color" value="NOCOLOR" /> |
|
19
12615d397df7
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents:
11
diff
changeset
|
132 <output name="output" file="egrep_results1.txt" /> |
|
3
37e1eb05b1b4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
1
diff
changeset
|
133 </test> |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
134 <!-- tests regex;matching nothing --> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
135 <test> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
136 <param name="infile" value="egrep1.txt" /> |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
137 <param name="case_sensitive" value="-i" /> |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
138 <param name="regex_type" value="-G" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
139 <param name="invert" value="" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
140 <param name="url_paste" value="not existent pattern" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
141 <param name="lines_before" value="0" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
142 <param name="lines_after" value="0" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
143 <param name="color" value="NOCOLOR" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
144 <output name="output"> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
145 <assert_contents> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
146 <has_size value="0"/> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
147 </assert_contents> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
148 </output> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
149 </test> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
150 <!-- tests invalid regex; i.e. that we still get exit code 2 --> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
151 <test expect_failure="true" expect_exit_code="2"> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
152 <param name="infile" value="egrep1.txt" /> |
|
22
3dc70b59608c
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
20
diff
changeset
|
153 <param name="case_sensitive" value="-i" /> |
|
20
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
154 <param name="regex_type" value="-G" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
155 <param name="invert" value="" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
156 <param name="url_paste" value="\(" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
157 <param name="lines_before" value="0" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
158 <param name="lines_after" value="0" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
159 <param name="color" value="NOCOLOR" /> |
|
fbf99087e067
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
bgruening
parents:
19
diff
changeset
|
160 </test> |
| 0 | 161 </tests> |
| 162 <help> | |
| 163 <![CDATA[ | |
| 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). | |
| 189 | |
| 190 ----- | |
| 191 | |
| 192 **Regular Expression Syntax** | |
| 193 | |
| 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. | |
| 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. | |
| 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. | |
| 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: | |
| 219 - matches the beginning of a line or string. | |
| 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. | |
| 222 - **\|** Separates alternate possibilities. | |
| 223 | |
| 224 ]]> | |
| 225 </help> | |
|
6
60edf2f8c28f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b'e6ee273f75fff61d1e419283fa8088528cf59470\n'
bgruening
parents:
5
diff
changeset
|
226 <expand macro="citations" /> |
| 0 | 227 </tool> |
