diff nl.xml @ 19:12615d397df7 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
author bgruening
date Thu, 29 Feb 2024 22:15:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nl.xml	Thu Feb 29 22:15:20 2024 +0000
@@ -0,0 +1,63 @@
+<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>