comparison grep.xml @ 20:fbf99087e067 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
author bgruening
date Thu, 28 Mar 2024 13:20:16 +0000
parents 12615d397df7
children
comparison
equal deleted inserted replaced
19:12615d397df7 20:fbf99087e067
6 <expand macro="creator"/> 6 <expand macro="creator"/>
7 <requirements> 7 <requirements>
8 <requirement type="package" version="3.11">grep</requirement> 8 <requirement type="package" version="3.11">grep</requirement>
9 <requirement type="package" version="4.8">sed</requirement><!-- for ansi2html.sh --> 9 <requirement type="package" version="4.8">sed</requirement><!-- for ansi2html.sh -->
10 </requirements> 10 </requirements>
11 <stdio>
12 <exit_code range="2:" level="fatal" description="grep failed" />
13 </stdio>
11 <version_command>grep --version | head -n 1</version_command> 14 <version_command>grep --version | head -n 1</version_command>
12 <command> 15 <command>
13 <![CDATA[ 16 <![CDATA[
14 #if str($color) == "COLOR": 17 #if str($color) == "COLOR":
15 GREP_COLOR='1;34' 18 GREP_COLOR='1;34'
25 #else: 28 #else:
26 grep 29 grep
27 $regex_type 30 $regex_type
28 -A $lines_after 31 -A $lines_after
29 -B $lines_before 32 -B $lines_before
33 --no-group-separator
30 $invert 34 $invert
31 $case_sensitive 35 $case_sensitive
32 -- '${url_paste}' 36 -- '${url_paste}'
33 '${infile}' | grep -v "^--$" > '${output}' 37 '${infile}' > '${output}'
34 #end if 38 #end if
35 ]]> 39 ]]>
36 </command> 40 </command>
37 <inputs> 41 <inputs>
38 <param name="infile" format="txt" type="data" label="Select lines from" /> 42 <param name="infile" format="txt" type="data" label="Select lines from" />
76 <when input="color" value="COLOR" format="html"/> 80 <when input="color" value="COLOR" format="html"/>
77 </change_format> 81 </change_format>
78 </data> 82 </data>
79 </outputs> 83 </outputs>
80 <tests> 84 <tests>
81 <test> 85 <!-- grep a FASTA file for sequences with specific motif -->
82 <!-- grep a FASTA file for sequences with specific motif --> 86 <test>
83 <param name="infile" value="grep1.txt" /> 87 <param name="infile" value="grep1.txt" />
84 <param name="case_sensitive" value="case sensitive" /> 88 <param name="case_sensitive" value="case sensitive" />
85 <param name="regex_type" value="-P" /> 89 <param name="regex_type" value="-P" />
86 <param name="invert" value="" /> 90 <param name="invert" value="" />
87 <param name="url_paste" value="AA.{2}GT" /> 91 <param name="url_paste" value="AA.{2}GT" />
88 <param name="lines_before" value="1" /> 92 <param name="lines_before" value="1" />
89 <param name="lines_after" value="0" /> 93 <param name="lines_after" value="0" />
90 <param name="color" value="NOCOLOR" /> 94 <param name="color" value="NOCOLOR" />
91 <output name="output" file="grep_results1.txt" /> 95 <output name="output" file="grep_results1.txt" />
92 </test> 96 </test>
93 <test> 97 <!-- grep a FASTA file for sequences with specific motif -
94 <!-- grep a FASTA file for sequences with specific motif -
95 show highlighed output --> 98 show highlighed output -->
99 <test>
96 <param name="infile" value="grep1.txt" /> 100 <param name="infile" value="grep1.txt" />
97 <param name="case_sensitive" value="case sensitive" /> 101 <param name="case_sensitive" value="case sensitive" />
98 <param name="regex_type" value="-P" /> 102 <param name="regex_type" value="-P" />
99 <param name="invert" value="" /> 103 <param name="invert" value="" />
100 <param name="url_paste" value="AA.{2}GT" /> 104 <param name="url_paste" value="AA.{2}GT" />
101 <param name="lines_before" value="0" /> 105 <param name="lines_before" value="0" />
102 <param name="lines_after" value="0" /> 106 <param name="lines_after" value="0" />
103 <param name="color" value="COLOR" /> 107 <param name="color" value="COLOR" />
104 <output name="output" file="grep_results2.html" /> 108 <output name="output" file="grep_results2.html" />
105 </test> 109 </test>
106 <test><!-- tests egrep --> 110 <!-- tests egrep -->
111 <test>
107 <param name="infile" value="egrep1.txt" /> 112 <param name="infile" value="egrep1.txt" />
108 <param name="case_sensitive" value="case sensitive" /> 113 <param name="case_sensitive" value="case sensitive" />
109 <param name="regex_type" value="-E" /> 114 <param name="regex_type" value="-E" />
110 <param name="invert" value="" /> 115 <param name="invert" value="" />
111 <param name="url_paste" value="[^ ]+" /> 116 <param name="url_paste" value="[^ ]+" />
112 <param name="lines_before" value="0" /> 117 <param name="lines_before" value="0" />
113 <param name="lines_after" value="0" /> 118 <param name="lines_after" value="0" />
114 <param name="color" value="NOCOLOR" /> 119 <param name="color" value="NOCOLOR" />
115 <output name="output" file="egrep_results1.txt" /> 120 <output name="output" file="egrep_results1.txt" />
116 </test> 121 </test>
117 <test><!-- tests basic regex; + must be backslashed to match --> 122 <!-- tests basic regex; + must be backslashed to match -->
123 <test>
118 <param name="infile" value="egrep1.txt" /> 124 <param name="infile" value="egrep1.txt" />
119 <param name="case_sensitive" value="case sensitive" /> 125 <param name="case_sensitive" value="case sensitive" />
120 <param name="regex_type" value="-G" /> 126 <param name="regex_type" value="-G" />
121 <param name="invert" value="" /> 127 <param name="invert" value="" />
122 <param name="url_paste" value="[^ ]\+" /> 128 <param name="url_paste" value="[^ ]\+" />
123 <param name="lines_before" value="0" /> 129 <param name="lines_before" value="0" />
124 <param name="lines_after" value="0" /> 130 <param name="lines_after" value="0" />
125 <param name="color" value="NOCOLOR" /> 131 <param name="color" value="NOCOLOR" />
126 <output name="output" file="egrep_results1.txt" /> 132 <output name="output" file="egrep_results1.txt" />
133 </test>
134 <!-- tests regex;matching nothing -->
135 <test>
136 <param name="infile" value="egrep1.txt" />
137 <param name="case_sensitive" value="case sensitive" />
138 <param name="regex_type" value="-G" />
139 <param name="invert" value="" />
140 <param name="url_paste" value="not existent pattern" />
141 <param name="lines_before" value="0" />
142 <param name="lines_after" value="0" />
143 <param name="color" value="NOCOLOR" />
144 <output name="output">
145 <assert_contents>
146 <has_size value="0"/>
147 </assert_contents>
148 </output>
149 </test>
150 <!-- tests invalid regex; i.e. that we still get exit code 2 -->
151 <test expect_failure="true" expect_exit_code="2">
152 <param name="infile" value="egrep1.txt" />
153 <param name="case_sensitive" value="case sensitive" />
154 <param name="regex_type" value="-G" />
155 <param name="invert" value="" />
156 <param name="url_paste" value="\(" />
157 <param name="lines_before" value="0" />
158 <param name="lines_after" value="0" />
159 <param name="color" value="NOCOLOR" />
127 </test> 160 </test>
128 </tests> 161 </tests>
129 <help> 162 <help>
130 <![CDATA[ 163 <![CDATA[
131 **What it does** 164 **What it does**