view collapse_samples.xml @ 0:242462fc608b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/qiime/ commit d41cdeeec9fd0eb5612df0d5af63a979d1c9ec87
author iuc
date Mon, 10 Jul 2017 16:38:55 -0400
parents
children
line wrap: on
line source

<tool id="qiime_collapse_samples" name="Collapse samples" version="@WRAPPER_VERSION@.0">
    <description>Collapse samples in a BIOM table and mapping file</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <version_command>collapse_samples.py --version</version_command>
    <command detect_errors="aggressive"><![CDATA[
        collapse_samples.py
            --input_biom_fp '$input_biom_fp'
            --mapping_fp '$mapping_fp'
            --collapse_mode '$collapse_mode'
            $normalize
            #set allCollapseFields = ''
            #for $repeat in ( $collapse_fields_repeat )
                #if $allCollapseFields == ''
                    #set allCollapseFields += str($repeat.collapse_fields)
                #else:
                    #set allCollapseFields += ',' + str($repeat.collapse_fields)
                #end if
            #end for
            --collapse_fields $allCollapseFields
            --output_biom_fp '$output_biom_fp'
            --output_mapping_fp '$output_mapping_fp'
    ]]></command>
    <inputs>
        <param argument="--input_biom_fp" type="data" format="biom1" label="Input biom table" help="The biom table containing the samples to be collapsed" />
        <param argument="--mapping_fp" type="data" format="tabular" label="Input mapping file" help="The sample metadata mapping file" />
        <param argument="--collapse_mode" type="select" label="Collapse mode to use" help="The mechanism for collapsing counts within groups">
            <option value="sum" selected="true">sum</option>
            <option value="mean">mean</option>
            <option value="random">random</option>
            <option value="median">median</option>
            <option value="first">first</option>
        </param>
        <param argument="--normalize" type="boolean" label="Do you want to normalize observation counts to relative abundances ?" truevalue="--normalize" falsevalue="" checked="False" help="When this option is used the counts within each sample sum to 1.0" />
        <repeat name="collapse_fields_repeat" title="New field to collapse data on" help="You must specify at least one field to collapse data on" min="1" >
            <param argument="--collapse_fields" type="text" label="Name of the field" value="" help="Enter the name of one of the column of your mapping file" />
        </repeat>
    </inputs>
    <outputs>
        <data name="output_biom_fp" format="biom1" label="${tool.name} on ${on_string}: Collapsed biom table"/>
        <data name="output_mapping_fp" format="tabular" label="${tool.name} on ${on_string}: Collapsed mapping file"/>
    </outputs>
    <tests>
        <!-- Qiime collapse_samples.py generates a binary file (Collapsed biom file) that can't be directly compared to the sample biom file using diff -->
        <!-- The following tests on output biom files are then based on a comparison of file sizes with a maximum delta of 0 bytes instead of the classic diff-based comparison -->
        <test>
            <param name="input_biom_fp" value="collapse_samples/table.biom" />
            <param name="mapping_fp" value="collapse_samples/map.txt" />
            <param name="collapse_mode" value="sum" />
            <repeat name="collapse_fields_repeat">
                <param name="collapse_fields" value="SampleType" />
            </repeat>
            <output name="output_biom_fp" file="collapse_samples/collapsed_sum_SampleType_table.biom" compare="sim_size"/>
            <output name="output_mapping_fp" file="collapse_samples/collapsed_sum_SampleType_map.txt" ftype="tabular" />
        </test>
        <test>
            <param name="input_biom_fp" value="collapse_samples/table.biom" />
            <param name="mapping_fp" value="collapse_samples/map.txt" />
            <param name="collapse_mode" value="first" />
            <param name="normalize" value="True" />
            <repeat name="collapse_fields_repeat">
                <param name="collapse_fields" value="subject" />
            </repeat>
            <repeat name="collapse_fields_repeat">
                <param name="collapse_fields" value="year" />
            </repeat>
            <output name="output_biom_fp" file="collapse_samples/collapsed_first_2fields_table.biom" compare="sim_size"/>
            <output name="output_mapping_fp" file="collapse_samples/collapsed_first_2fields_map.txt" ftype="tabular" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

The script `collapse_samples.py <http://qiime.org/scripts/collapse_samples.html>`_ collapse samples in a BIOM table and mapping file.

The values in the BIOM table are collapsed in one of several different ways (see possible values of the --collapse_mode parameter).

The values in the mapping file are collapsed by grouping the values if they differ for the grouped samples, and by providing the single value if they don’t differ for the grouped samples.

The output of `collapse_samples.py <http://qiime.org/scripts/collapse_samples.html>`_ are a collapsed `biom file <http://biom-format.org/>`_ and a collapsed mapping file.

More information about this tool is available on
`QIIME documentation <http://qiime.org/scripts/collapse_samples.html>`_.
    ]]></help>
    <citations>
        <expand macro="citations"/>
    </citations>
</tool>