0
|
1 <tool id="tp_tac" name="tac" version="@BASE_VERSION@.0">
|
|
2 <description>reverse a file (reverse cat)</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7 <version_command>tac --version | head -n 1</version_command>
|
|
8 <command>
|
|
9 <![CDATA[
|
|
10 tac
|
|
11 #if str($separator.separator_select) == "yes":
|
|
12 $separator.before
|
|
13 $separator.regex
|
|
14 #if $separator.separator_string:
|
|
15 "$separator.separator_string"
|
|
16 #end if
|
|
17 #end if
|
|
18 "$infile"
|
|
19 > "$outfile"
|
|
20 ]]>
|
|
21 </command>
|
|
22 <inputs>
|
|
23 <param name="infile" type="data" format="txt" label="Input file"/>
|
|
24 <conditional name="separator">
|
|
25 <param name="separator_select" type="select" label="Do you want to use a separator other than newline?">
|
|
26 <option value="no">No</option>
|
|
27 <option value="yes">Yes</option>
|
|
28 </param>
|
|
29 <when value="no" />
|
|
30 <when value="yes">
|
|
31 <param name="before" type="boolean" truevalue="-b" falsevalue="" checked="True"
|
|
32 label="Attach the separator before instead of after" help="(--before)"/>
|
|
33 <param name="regex" type="boolean" truevalue="-r" falsevalue="" checked="True"
|
|
34 label="Interpret the separator as a regular expression" help="(--regex)"/>
|
|
35 <param name="separator_string" size="5" type="text" value=""
|
|
36 label="Separator to use" help="(--separator)" />
|
|
37 </when>
|
|
38 </conditional>
|
|
39 </inputs>
|
|
40 <outputs>
|
|
41 <data name="outfile" format_source="infile" metadata_source="infile"/>
|
|
42 </outputs>
|
|
43 <tests>
|
|
44 <test>
|
|
45 <param name="infile" value="1.bed"/>
|
|
46 <output name="outfile" file="tac_result1.txt"/>
|
|
47 </test>
|
|
48 <test>
|
|
49 <param name="infile" value="1.bed"/>
|
|
50 <param name="separator_select" value="yes"/>
|
|
51 <param name="before" value="True"/>
|
|
52 <output name="outfile" file="tac_result2.txt"/>
|
|
53 </test>
|
|
54 </tests>
|
|
55 <help>
|
|
56 <![CDATA[
|
|
57 **What it does**
|
|
58
|
|
59 tac is a Linux command that allows you to see a file line-by-line backwards. It is named by analogy with cat.
|
|
60
|
|
61 Mandatory arguments to long options are mandatory for short options too:
|
|
62
|
|
63 -b, --before attach the separator before instead of after
|
|
64 -r, --regex interpret the separator as a regular expression
|
|
65 -s, --separator=STRING use STRING as the separator instead of newline
|
|
66
|
|
67 -----
|
|
68
|
|
69 **Example**
|
|
70
|
|
71 Input file:
|
|
72
|
|
73 0 1 2 3 4 5 # 6 7 8 9
|
|
74
|
|
75
|
|
76 default settings:
|
|
77
|
|
78 9 8 7 6 # 5 4 3 2 1 0
|
|
79
|
|
80 with option -s 5:
|
|
81 # 6 7 8 9 0 1 2 3 4 5
|
|
82
|
|
83 with option -b and -s 5:
|
|
84
|
|
85 5 # 6 7 8 9 0 1 2 3 4
|
|
86
|
|
87 @REFERENCES@
|
|
88 ]]>
|
|
89 </help>
|
|
90 </tool>
|