view add_input_name_as_column.xml @ 6:3284b72eef56 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/add_input_name_as_column commit 9292c57c34283543e86ecc65f805977224f6fc7b"
author iuc
date Wed, 25 Mar 2020 07:11:05 -0400
parents 06061aa49527
children
line wrap: on
line source

<tool id="addName" name="Add input name as column" version="0.2.0" profile="17.09">
    <description>to an existing tabular file</description>
    <requirements>
        <requirement type="package" version="3.7">python</requirement>
    </requirements>
    <command><![CDATA[
python '$__tool_directory__/'add_input_name_as_column.py
--input '$input'
--label '$input.element_identifier'
--output '$output'
#if $header.contains_header=="yes":
  --header "$header.colname"
#end if
$prepend 
    ]]></command>
    <inputs>
        <param format="txt" name="input" type="data" label="to Dataset" help="Dataset missing? See TIP below" />
        <conditional name="header">
            <param name="contains_header" type="select" label="input contains a header line?" >
                <option value="yes" selected="true">Yes</option>
                <option value="no">No</option>
            </param>
            <when value="yes">
                <param name="colname" type="text" value="sample" help="select a column header to be added in the first line">
                    <validator type="empty_field" message="please add a column header"/>
                </param>
            </when>
            <when value="no"/>
        </conditional>
        <param name="prepend" type="boolean" truevalue="--prepend" falsevalue="" checked="false" label="Prepend the colum" />
    </inputs>
    <outputs>
        <data name="output" format="tabular" />
    </outputs>
    <tests>
        <test>
            <param name="input" value="signature.tab" ftype="tabular" />
            <param name="contains_header" value="yes" />
            <param name="colname" value="sample" />
            <output name="output" file="signature_with_header.tab" ftype="tabular"/>
        </test>
        <test>
            <param name="input" value="signature.tab" ftype="tabular" />
            <param name="contains_header" value="no" />
            <param name="prepend" value="true" />
            <output name="output" file="signature_without_header.tab" ftype="tabular"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Adds a new column with the name of the input file as it appears in the history.
By default the column is appended.

-----

.. class:: infomark

**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert*

    ]]></help>
</tool>