comparison recurring_lines.xml @ 0:f034a9d33aca draft default tip

Uploaded
author bgruening
date Thu, 15 May 2014 11:50:30 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f034a9d33aca
1 <tool id="bg_text_file_with_recurring_lines" name="Create text file" version="0.1">
2 <description>with recurring lines</description>
3 <command>
4
5 #for $token in $token_set:
6 #if str($token.repeat_select.repeat_select_opts) == 'user':
7 times=#echo $token.repeat_select.times#;
8 #else:
9 times=`wc -l $token.repeat_select.infile | awk '{print $1}'`;
10 #end if
11
12 yes -- "${token.line}" 2>/dev/null | head -n \$times >> $outfile;
13 #end for
14
15 </command>
16 <inputs>
17
18 <repeat name="token_set" title=" selection" min="1">
19
20 <param name="line" type="text" size="30" label="Characters to insert" help="Specify the characters that will be inserted X times in every line"/>
21
22 <conditional name="repeat_select">
23 <param name="repeat_select_opts" type="select" label="Specify the number of iterations by">
24 <option value="file">File (for each line in file)</option>
25 <option value="user" selected="True">User defined number</option>
26 </param>
27 <when value="user">
28 <param name="times" size="10" type="integer" value="10" min="1" label="How many times?"/>
29 </when>
30 <when value="file">
31 <param name="infile" type="data" format="txt" label="Template file"
32 help="For every line, the specified characters will be written once. That means X is the line-number from the given file."/>
33 </when>
34 </conditional>
35 </repeat>
36
37 </inputs>
38 <outputs>
39 <data format="txt" name="outfile" from_work_dir="prediction" label="Generated text file"/>
40 </outputs>
41 <tests>
42 <test>
43 </test>
44 </tests>
45 <help>
46
47 .. class:: infomark
48
49 **What it does**
50
51 This tool creates a text file with recurring lines. You can specify a bunch of characters or entire sentences.
52 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.
53 In case the user provides a file, the line number will be used as X.
54
55
56 **References**
57
58 Bjoern A. Gruening: https://github.com/bgruening/galaxytools/
59
60 </help>
61 </tool>