Mercurial > repos > bgruening > text_processing
changeset 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 | 6073bb457ec0 |
children | |
files | awk.xml macros.xml recurring_lines.xml sort.xml |
diffstat | 4 files changed, 33 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/awk.xml Tue Mar 25 14:34:17 2025 +0000 +++ b/awk.xml Wed Jun 04 15:12:29 2025 +0000 @@ -15,6 +15,9 @@ --sandbox -v FS=' ' -v OFS=' ' + #for $i, $r in enumerate($variables, start=1) + -v VAR$i='$r.value' + #end for --re-interval -f '$awk_script' '$infile' @@ -33,17 +36,38 @@ </valid> </sanitizer> </param> + <repeat name="variables" min="0" default="0" title="Variables"> + <param name="value" type="text" label="Value"> + <validator type="regex">[a-zA-Z0-9 .]+</validator> + </param> + </repeat> </inputs> <outputs> <data name="outfile" format_source="infile" metadata_source="infile"/> </outputs> <tests> <test> - <param name="infile" value="awk1.txt" /> + <param name="infile" value="awk1.txt"/> <!-- commas are not allowed in a value field. Values with comma will be splitted --> <param name="code" value='$2>0.5 { print $2*9"\t"$1 }' /> <output name="outfile" file="awk_results1.txt" /> </test> + <test> + <param name="infile" value="awk1.txt"/> + <!-- commas are not allowed in a value field. Values with comma will be splitted --> + <param name="code" value='$2>VAR2 { print VAR1"\t"$2*9"\t"$1 }' /> + <repeat name="variables"> + <param name="value" value="xyz"/> + </repeat> + <repeat name="variables"> + <param name="value" value="0.1"/> + </repeat> + <output name="outfile"> + <assert_contents> + <has_line_matching expression="^xyz.*" n="6"/> + </assert_contents> + </output> + </test> </tests> <help> <![CDATA[ @@ -74,6 +98,11 @@ pattern { action 1; action 2; action 3; } +**Variables** + +In order to allow parametrization in workflows, the tool allows to specify values for variables that can be used in AWK program. +that will be named **VAR1**, **VAR2**, ... + **Pattern Examples**
--- a/macros.xml Tue Mar 25 14:34:17 2025 +0000 +++ b/macros.xml Wed Jun 04 15:12:29 2025 +0000 @@ -6,7 +6,7 @@ </requirements> </xml> <token name="@TOOL_VERSION@">9.5</token> - <token name="@VERSION_SUFFIX@">0</token> + <token name="@VERSION_SUFFIX@">2</token> <token name="@PROFILE@">23.1</token> <xml name="stdio"> <stdio>
--- a/recurring_lines.xml Tue Mar 25 14:34:17 2025 +0000 +++ b/recurring_lines.xml Wed Jun 04 15:12:29 2025 +0000 @@ -1,4 +1,4 @@ -<tool id="tp_text_file_with_recurring_lines" name="Create text file" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@"> +<tool id="tp_text_file_with_recurring_lines" name="Create text file" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> <description>with recurring lines</description> <macros> <import>macros.xml</import>