view tail.xml @ 26:f22a309187a3 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
author bgruening
date Fri, 16 Aug 2024 10:41:17 +0000
parents 7725ab6dab67
children
line wrap: on
line source

<tool id="tp_tail_tool" name="Select last" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>lines from a dataset (tail)</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>
    <expand macro="requirements" />
    <version_command>tail --version | head -n 1</version_command>
    <command>
<![CDATA[
        tail
            --lines $complement$num_lines
            '$infile'
        > '$outfile'
]]>
    </command>
    <inputs>
        <param name="infile" format="txt" type="data" label="Text file" />
        <param name="complement" type="select" label="Operation">
            <option value="">Keep last lines</option>
            <option value="+">Keep everything from this line on</option>
        </param>
        <param name="num_lines" type="integer" value="10"
            label="Number of lines" help="These will be kept (depending on 'operation'). (--lines)" />
    </inputs>
    <outputs>
        <data name="outfile" format_source="infile" metadata_source="infile" />
    </outputs>
    <tests>
        <test>
            <param name="infile" value="1.bed"/>
            <param name="num_lines" value="10"/>
            <output name="outfile" file="tail_results1.bed"/>
        </test>
        <test>
            <param name="infile" value="1.bed"/>
            <param name="num_lines" value="10"/>
            <param name="complement" value="+"/>
            <output name="outfile" file="tail_results2.bed"/>
        </test>
    </tests>
    <help>
<![CDATA[
**What it does**

This tool outputs specified number of lines from the **end** of a dataset

-----

**Example**

- Input File::

    chr7    57134   57154   D17003_CTCF_R7  356     -
    chr7    57247   57267   D17003_CTCF_R4  207     +
    chr7    57314   57334   D17003_CTCF_R5  269     +
    chr7    57341   57361   D17003_CTCF_R7  375     +
    chr7    57457   57477   D17003_CTCF_R3  188     +

- Show last two lines of above file. The result is::

    chr7    57341   57361   D17003_CTCF_R7  375     +
    chr7    57457   57477   D17003_CTCF_R3  188     +

]]>
    </help>
    <expand macro="citations" />
</tool>