Mercurial > repos > bgruening > text_processing
diff grep.xml @ 4:56e80527c482 draft
Uploaded
author | bgruening |
---|---|
date | Wed, 07 Jan 2015 11:10:52 -0500 |
parents | 7068d1548234 |
children | 8928e6d1e7ba |
line wrap: on
line diff
--- a/grep.xml Sun Oct 06 08:22:36 2013 -0400 +++ b/grep.xml Wed Jan 07 11:10:52 2015 -0500 @@ -1,21 +1,42 @@ -<tool id="tp_grep_tool" name="Search in textfiles" version="0.1.1"> +<tool id="tp_grep_tool" name="Search in textfiles" version="@BASE_VERSION@.0"> <description>(grep)</description> - <requirements> - <requirement type="package" version="8.21">gnu_coreutils</requirement> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements"> <requirement type="package" version="2.14">gnu_grep</requirement> <requirement type="set_environment">TP_SCRIPT_PATH</requirement> - </requirements> + </expand> + <version_command>grep --version | head -n 1</version_command> <command> +<![CDATA[ #if str($color) == "COLOR": - GREP_COLOR='1;34' grep --color=always -P "$@" -- "${url_paste}" '${input}' | \$TP_SCRIPT_PATH/ansi2html.sh > "${output}" + GREP_COLOR='1;34' + grep + --color=always + -P + -A $lines_after + -B $lines_before + $invert + $case_sensitive + -- "${url_paste}" + '${infile}' | \$TP_SCRIPT_PATH/ansi2html.sh > "${output}" #else: - grep -P "$@" -- "${url_paste}" '${input}' | grep -v "^--$" > "${output}" + grep + -P + -A $lines_after + -B $lines_before + $invert + $case_sensitive + -- "${url_paste}" + '${infile}' | grep -v "^--$" > "${output}" #end if - ##grep_wrapper.sh '$input' '$output' '$url_paste' $color -A $lines_after -B $lines_before $invert $case_sensitive + ##grep_wrapper.sh '$infile' '$output' '$url_paste' $color -A $lines_after -B $lines_before $invert $case_sensitive +]]> </command> <inputs> - <param format="txt" name="input" type="data" label="Select lines from" /> + <param name="infile" format="txt" type="data" label="Select lines from" /> <param name="invert" type="select" label="that"> <option value="">Match</option> @@ -30,55 +51,54 @@ </sanitizer> </param> - <param name="case_sensitive" type="select" label="Match type"> + <param name="case_sensitive" type="select" label="Match type" help="(-i)"> <option value="-i">case insensitive</option> <option value="">case sensitive</option> </param> - - <param name="lines_before" type="integer" label="Show lines preceding the matched line (-B)" help="leave it at zero unless you know what you're doing" value="0" /> - <param name="lines_after" type="integer" label="Show lines trailing the matched line (-A)" help="leave it at zero unless you know what you're doing" value="0" /> - + <param name="lines_before" type="integer" value="0" + label="Show lines preceding the matched line" help="leave it at zero unless you know what you're doing. (-B)" /> + <param name="lines_after" type="integer" value="0" + label="Show lines trailing the matched line" help="leave it at zero unless you know what you're doing. (-A)" /> <param name="color" type="select" label="Output"> <option value="NOCOLOR">text file (for further processing)</option> <option value="COLOR">Highlighted HTML (for easier viewing)</option> </param> - </inputs> - <outputs> - <data format="input" name="output" metadata_source="input"> - <change_format> - <when input="color" value="COLOR" format="html" - /> - </change_format> - </data> - </outputs> - <tests> - <test> - <!-- grep a FASTA file for sequences with specific motif --> - <param name="input" value="unix_grep_input1.txt" /> - <output name="output" file="unix_grep_output1.txt" /> - <param name="case_sensitive" value="case sensitive" /> - <param name="invert" value="" /> - <param name="url_paste" value="AA.{2}GT" /> - <param name="lines_before" value="1" /> - <param name="lines_after" value="0" /> - <param name="color" value="NOCOLOR" /> - </test> - <test> - <!-- grep a FASTA file for sequences with specific motif - + </inputs> + <outputs> + <data format="input" name="output" metadata_source="infile"> + <change_format> + <when input="color" value="COLOR" format="html"/> + </change_format> + </data> + </outputs> + <tests> + <test> + <!-- grep a FASTA file for sequences with specific motif --> + <param name="infile" value="unix_grep_input1.txt" /> + <param name="case_sensitive" value="case sensitive" /> + <param name="invert" value="" /> + <param name="url_paste" value="AA.{2}GT" /> + <param name="lines_before" value="1" /> + <param name="lines_after" value="0" /> + <param name="color" value="NOCOLOR" /> + <output name="output" file="unix_grep_output1.txt" /> + </test> + <test> + <!-- grep a FASTA file for sequences with specific motif - show highlighed output --> - <param name="input" value="unix_grep_input1.txt" /> - <output name="output" file="unix_grep_output2.html" /> - <param name="case_sensitive" value="case sensitive" /> - <param name="invert" value="" /> - <param name="url_paste" value="AA.{2}GT" /> - <param name="lines_before" value="0" /> - <param name="lines_after" value="0" /> - <param name="color" value="COLOR" /> - </test> - </tests> -<help> - + <param name="infile" value="unix_grep_input1.txt" /> + <param name="case_sensitive" value="case sensitive" /> + <param name="invert" value="" /> + <param name="url_paste" value="AA.{2}GT" /> + <param name="lines_before" value="0" /> + <param name="lines_after" value="0" /> + <param name="color" value="COLOR" /> + <output name="output" file="unix_grep_output2.html" /> + </test> + </tests> + <help> +<![CDATA[ **What it does** This tool runs the unix **grep** command on the selected data file. @@ -139,6 +159,7 @@ - **$** matches the end of a line or string. - **\|** Separates alternate possibilities. - -</help> +@REFERENCES@ +]]> + </help> </tool>