comparison awk.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
comparison
equal deleted inserted replaced
23:6073bb457ec0 24:c41d78ae5fee
13 env -i 13 env -i
14 \$(which awk) 14 \$(which awk)
15 --sandbox 15 --sandbox
16 -v FS=' ' 16 -v FS=' '
17 -v OFS=' ' 17 -v OFS=' '
18 #for $i, $r in enumerate($variables, start=1)
19 -v VAR$i='$r.value'
20 #end for
18 --re-interval 21 --re-interval
19 -f '$awk_script' 22 -f '$awk_script'
20 '$infile' 23 '$infile'
21 > '$outfile' 24 > '$outfile'
22 ]]> 25 ]]>
31 <valid initial="string.printable"> 34 <valid initial="string.printable">
32 <remove value="&apos;"/> 35 <remove value="&apos;"/>
33 </valid> 36 </valid>
34 </sanitizer> 37 </sanitizer>
35 </param> 38 </param>
39 <repeat name="variables" min="0" default="0" title="Variables">
40 <param name="value" type="text" label="Value">
41 <validator type="regex">[a-zA-Z0-9 .]+</validator>
42 </param>
43 </repeat>
36 </inputs> 44 </inputs>
37 <outputs> 45 <outputs>
38 <data name="outfile" format_source="infile" metadata_source="infile"/> 46 <data name="outfile" format_source="infile" metadata_source="infile"/>
39 </outputs> 47 </outputs>
40 <tests> 48 <tests>
41 <test> 49 <test>
42 <param name="infile" value="awk1.txt" /> 50 <param name="infile" value="awk1.txt"/>
43 <!-- commas are not allowed in a value field. Values with comma will be splitted --> 51 <!-- commas are not allowed in a value field. Values with comma will be splitted -->
44 <param name="code" value='$2>0.5 { print $2*9"\t"$1 }' /> 52 <param name="code" value='$2>0.5 { print $2*9"\t"$1 }' />
45 <output name="outfile" file="awk_results1.txt" /> 53 <output name="outfile" file="awk_results1.txt" />
54 </test>
55 <test>
56 <param name="infile" value="awk1.txt"/>
57 <!-- commas are not allowed in a value field. Values with comma will be splitted -->
58 <param name="code" value='$2>VAR2 { print VAR1"\t"$2*9"\t"$1 }' />
59 <repeat name="variables">
60 <param name="value" value="xyz"/>
61 </repeat>
62 <repeat name="variables">
63 <param name="value" value="0.1"/>
64 </repeat>
65 <output name="outfile">
66 <assert_contents>
67 <has_line_matching expression="^xyz.*" n="6"/>
68 </assert_contents>
69 </output>
46 </test> 70 </test>
47 </tests> 71 </tests>
48 <help> 72 <help>
49 <![CDATA[ 73 <![CDATA[
50 **What it does** 74 **What it does**
71 Most AWK programs consist of **patterns** (i.e. rules that match lines of text) and **actions** (i.e. commands to execute when a pattern matches a line). 95 Most AWK programs consist of **patterns** (i.e. rules that match lines of text) and **actions** (i.e. commands to execute when a pattern matches a line).
72 96
73 The basic form of AWK program is:: 97 The basic form of AWK program is::
74 98
75 pattern { action 1; action 2; action 3; } 99 pattern { action 1; action 2; action 3; }
100
101 **Variables**
102
103 In order to allow parametrization in workflows, the tool allows to specify values for variables that can be used in AWK program.
104 that will be named **VAR1**, **VAR2**, ...
76 105
77 106
78 **Pattern Examples** 107 **Pattern Examples**
79 108
80 - **$2 == "chr3"** will match lines whose second column is the string 'chr3' 109 - **$2 == "chr3"** will match lines whose second column is the string 'chr3'