Mercurial > repos > bgruening > text_processing
annotate recurring_lines.xml @ 27:08cdbfffce67 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
author | bgruening |
---|---|
date | Fri, 07 Mar 2025 20:43:41 +0000 |
parents | f22a309187a3 |
children | e8b38ade9b3e |
rev | line source |
---|---|
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
1 <tool id="tp_text_file_with_recurring_lines" name="Create text file" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
6 | 2 <description>with recurring lines</description> |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
6 <expand macro="creator"/> |
6 | 7 <expand macro="requirements" /> |
8 <version_command>yes --version | head -n 1</version_command> | |
9 <command> | |
10 <![CDATA[ | |
11 #for $token in $token_set: | |
12 #if str($token.repeat_select.repeat_select_opts) == 'user': | |
13 times=#echo $token.repeat_select.times#; | |
14 #else: | |
15 times=`wc -l $token.repeat_select.infile | awk '{print $1}'`; | |
16 #end if | |
26
f22a309187a3
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
bgruening
parents:
18
diff
changeset
|
17 yes -- '${token.line}' 2>/dev/null | head -n \$times >> '$outfile'; |
6 | 18 #end for |
19 ]]> | |
20 </command> | |
21 <inputs> | |
22 <repeat name="token_set" title=" selection" min="1"> | |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
7
diff
changeset
|
23 <param name="line" type="text" |
6 | 24 label="Characters to insert" help="Specify the characters that will be inserted X times in every line"/> |
25 <conditional name="repeat_select"> | |
26 <param name="repeat_select_opts" type="select" label="Specify the number of iterations by"> | |
27 <option value="file">File (for each line in file)</option> | |
28 <option value="user" selected="True">User defined number</option> | |
29 </param> | |
30 <when value="user"> | |
10
c78b1767db2b
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents:
7
diff
changeset
|
31 <param name="times" type="integer" value="10" min="1" label="How many times?"/> |
6 | 32 </when> |
33 <when value="file"> | |
7 | 34 <param name="infile" type="data" format="txt" label="Template file" |
6 | 35 help="For every line, the specified characters will be written once. That means X is the line-number from the given file."/> |
36 </when> | |
37 </conditional> | |
38 </repeat> | |
39 </inputs> | |
40 <outputs> | |
18
1e974b82380d
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 0ba37c1f33eeb1c77b4d9363d681fe522d9f7fe7
bgruening
parents:
14
diff
changeset
|
41 <data format="txt" name="outfile"/> |
6 | 42 </outputs> |
43 <tests> | |
44 <test> | |
45 <repeat name="token_set"> | |
46 <param name="line" value="freedom" /> | |
27
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
47 <conditional name="repeat_select"> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
48 <param name="repeat_select_opts" value="file" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
49 <param name="infile" value="multijoin2.txt" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
50 </conditional> |
6 | 51 </repeat> |
52 <output name="outfile" file="recurring_result1.txt" /> | |
53 </test> | |
54 <test> | |
55 <repeat name="token_set"> | |
56 <param name="line" value="freedom" /> | |
27
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
57 <conditional name="repeat_select"> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
58 <param name="repeat_select_opts" value="user" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
59 <param name="times" value="10" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
60 </conditional> |
6 | 61 </repeat> |
62 <repeat name="token_set"> | |
63 <param name="line" value="war is over" /> | |
27
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
64 <conditional name="repeat_select"> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
65 <param name="repeat_select_opts" value="user" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
66 <param name="times" value="10" /> |
08cdbfffce67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 2dc2df988bd2dde9f8d7f629b594186dbd4fdc2b
bgruening
parents:
26
diff
changeset
|
67 </conditional> |
6 | 68 </repeat> |
69 <output name="outfile" file="recurring_result2.txt" /> | |
70 </test> | |
71 </tests> | |
72 <help> | |
73 <![CDATA[ | |
74 .. class:: infomark | |
75 | |
7 | 76 **What it does** |
6 | 77 |
7 | 78 This tool creates a text file with recurring lines. You can specify a bunch of characters or entire sentences. |
6 | 79 The entire string will be printed X times separated by a line break. X can be either given by the use as a number or calculated by a given file. |
80 In case the user provides a file, the line number will be used as X. | |
81 | |
82 ]]> | |
83 </help> | |
14
7725ab6dab67
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b'e6ee273f75fff61d1e419283fa8088528cf59470\n'
bgruening
parents:
10
diff
changeset
|
84 <expand macro="citations" /> |
6 | 85 </tool> |