view nl.xml @ 20:fbf99087e067 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c4f50d1ee81c1618344ede1f04a46a28d8068bcc
author bgruening
date Thu, 28 Mar 2024 13:20:16 +0000
parents 12615d397df7
children
line wrap: on
line source

<tool id="nl" name="Number lines" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description></description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator"/>
    <expand macro="requirements" />
    <version_command>nl --version | head -n 1</version_command>
    <command><![CDATA[
    nl
        --line-increment=$line_increment
        --starting-line-number=$starting_line_number
        --number-format=$number_format
        --number-width=$number_width
        '$input'
        > '$output'
    ]]></command>
    <inputs>
        <param name="input" format="txt" type="data" label="File to number" />
        <param argument="--line-increment" type="integer" value="1" label="Line number increment at each line"/>
        <param argument="--starting-line-number" type="integer" value="1" label="First line number"/>
        <param argument="--number-format" type="select" label="Line number format">
            <option value="ln">left justified, no leading zeros</option>
            <option value="rn" selected="true">right justified, no leading zeros</option>
            <option value="rz">right justified, leading zeros</option>
        </param>
        <param argument="--number-width" type="integer" min="1" value="6" label="Number of characters for line numbers"/>
    </inputs>
    <outputs>
        <data format_source="input" name="output"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="cut1.txt" ftype="tabular"/>
            <output name="output" file="nl-out.txt" ftype="tabular"/>
        </test>
        <test>
            <param name="input" value="cut1.txt" ftype="tabular"/>
            <param name="number_format" value="ln"/>
            <param name="number_width" value="1"/>
            <output name="output" file="nl-out-number-format.txt" ftype="tabular">
                <assert_contents>
                    <!-- no filling spaces -->
                    <has_text text=" " negate="true"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input" value="cut1.txt" ftype="tabular"/>
            <param name="line_increment" value="2"/>
            <param name="starting_line_number" value="10"/>
            <output name="output" file="nl-start-incr.txt" ftype="tabular"/>
        </test>
    </tests>
    <help>
<![CDATA[
**What it does**

Add line numbers to the data set.
]]>
  </help>
  <expand macro="citations" />
</tool>