Source code

Download source archive ↓

upstream-extended/community/tools/text_processing/text_processing/tac.xml

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