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