view micro_decon.xml @ 0:bd267e082f86 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/micro_decon/ commit bb37578aa61bf4a47af262e02baf0a1c1d9d02c6
author iuc
date Wed, 06 Aug 2025 08:38:24 +0000
parents
children
line wrap: on
line source

<tool name="micro_decon" id="micro_decon" version="@TOOL_VERSION@+@VERSION_SUFFIX@" profile="24.2" license="@LICENSE@">
    <description>removing contamination from metabarcoding</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="creators"/>
    <command detect_errors="exit_code"><![CDATA[
        Rscript '$__tool_directory__/decon.R'
        --mode $function_cond.function_selector
        --data_file '$input_table'
        #set mode = $function_cond.function_selector
        #if $mode != 'remove_thresh':
            --numb_blanks '$function_cond.numb_blanks'
        #end if

        #if $mode != 'remove_cont'
            --numb_ind 'c($function_cond.numb_ind)'
        #end if

        #if $mode in ['decon', 'remove_cont']:
            --runs '$function_cond.runs'
            --regression '$function_cond.regression'
            --low_threshold '$function_cond.low_threshold'
            --up_threshold '$function_cond.up_threshold'
        #end if

        #if $mode in ['decon', 'remove_thresh']:
            --thresh '$function_cond.thresh'
            --prop_thresh '$function_cond.prop_thresh'
        #end if

        #if $mode == 'decon_diff':
            --output '$function_cond.output'
        #end if
        --taxa '$taxa'
    ]]></command>
    <inputs>
        <param name="input_table" type="data" format="csv,tsv,tabular" label="Input table"/>
        <param argument="--taxa" type="boolean" label="Does the input table contains taxonomy column?" value="true" truevalue="T" falsevalue="F"/>
        <conditional name="function_cond">
            <param name="function_selector" type="select" label="Select the microDecon function to apply">
                <option value="decon">decon</option>
                <option value="remove_cont">remove.cont</option>
                <option value="remove_thresh">remove.thresh</option>
                <option value="decon_diff">decon.diff</option>
            </param>
            <when value="decon">
                <expand macro="numb_blanks_arg"/>
                <expand macro="numb_ind_arg"/>
                <expand macro="runs_and_regression_args"/>
                <expand macro="thresh_args"/>
            </when>
            <when value="remove_cont">
                <expand macro="numb_blanks_arg"/>
                <expand macro="runs_and_regression_args"/>
            </when>
            <when value="remove_thresh">
                <expand macro="numb_ind_arg"/>
                <expand macro="thresh_args"/>
            </when>
            <when value="decon_diff">
                <param argument="--output" type="data" label="The output table of remove.cont or remove.thresh" format="csv"/>
                <expand macro="numb_blanks_arg"/>
                <expand macro="numb_ind_arg"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="decon_table" format="csv" label="${function_cond.function_selector} on ${on_string}: Decontaminated table" from_work_dir="decon_table.csv"/>
        <data name="reads_removed" format="csv" label="${function_cond.function_selector} on ${on_string}: Reads removed" from_work_dir="reads_removed.csv">
            <filter>function_cond['function_selector'] != "remove_cont" and function_cond['function_selector'] != "remove_thresh"</filter>
        </data>
        <data name="difference_sum" format="csv" label="${function_cond.function_selector} on ${on_string}: Difference sum" from_work_dir="difference_sum.csv">
            <filter>function_cond['function_selector'] != "remove_cont" and function_cond['function_selector'] != "remove_thresh"</filter>
        </data>
        <data name="difference_mean" format="csv" label="${function_cond.function_selector} on ${on_string}: Difference mean" from_work_dir="difference_mean.csv">
            <filter>function_cond['function_selector'] != "remove_cont" and function_cond['function_selector'] != "remove_thresh"</filter>
        </data>
        <data name="otus_removed" format="csv" label="${function_cond.function_selector} on ${on_string}: OTUs removed" from_work_dir="OTUs_removed.csv">
            <filter>function_cond['function_selector'] != "remove_cont" and function_cond['function_selector'] != "remove_thresh"</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="5">
            <param name="input_table" value="input.csv"/>
            <param name="taxa" value="true"/>
            <conditional name="function_cond">
                <param name="function_selector" value="decon"/>
                <param name="numb_ind" value="3,2"/>
            </conditional>
            <output name="decon_table" file="decon_table.csv"/>
            <output name="reads_removed" file="reads_removed.csv"/>
            <output name="difference_sum" file="difference_sum.csv"/>
            <output name="difference_mean" file="difference_mean.csv"/>
            <output name="otus_removed" file="otus_removed.csv"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_table" value="input.csv"/>
            <param name="taxa" value="true"/>
            <conditional name="function_cond">
                <param name="function_selector" value="remove_cont"/>
            </conditional>
            <output name="decon_table" file="remove_cont_decon_table.csv"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_table" value="remove_cont_decon_table.csv"/>
            <param name="taxa" value="true"/>
            <conditional name="function_cond">
                <param name="function_selector" value="remove_thresh"/>
                <param name="numb_ind" value="3,2"/>
            </conditional>
            <output name="decon_table" file="remove_thresh_decon_table.csv"/>
        </test>
        <test expect_num_outputs="5">
            <param name="input_table" value="input.csv"/>
            <param name="taxa" value="true"/>
            <conditional name="function_cond">
                <param name="function_selector" value="decon_diff"/>
                <param name="numb_ind" value="3,2"/>
                <param name="output" value="remove_thresh_decon_table.csv"/>
            </conditional>
            <output name="decon_table" file="decon_table.csv"/>
            <output name="reads_removed" file="reads_removed.csv"/>
            <output name="difference_sum" file="difference_sum.csv"/>
            <output name="difference_mean" file="difference_mean.csv"/>
            <output name="otus_removed" file="otus_removed.csv"/>
        </test>
    </tests>
    <help><![CDATA[
microDecon
==========
The microDecon package is designed to remove contaminant reads from
metabarcoding studies (e.g., from bacterial contamination in reagents during a microbiome
study).

Input
------
A table of metabarcoding data structured as a data
frame where each row is an OTU (or ASV or other metabarcoding output), each column is an
individual sample, and each cell contains the number of reads for a given OTU for a given
individual. Additionally, the first column should contain OTU IDs (these can be numeric or
characters), and the last column should (optionally) contain taxonomic information.

Functions
---------
* **decon**: This is a wrapper function for all other microDecon functions. t first decontaminates the data using remove.cont(), then it runs remove.thresh(), then it runs decon.diff().
* **remove.cont**: This is the primary function for removing contamination. It outputs a single OTU table of decontaminated results (OTUs that were entirely contamination are still included as rows of 0s).
* **remove.thresh**: This function removes residual contamination in the output from remove.cont().
* **decon.diff**: This function takes the output of either remove.cont() or remove.thresh() as well your original, contaminated data, and it returns summary statistics of how many OTUs were removed.

Outputs
--------
* **Decontaminated table**: A table of decontaminated OTU data.
* **Reads removed**: An OTU table showing the number of removed reads form each OTU.
* **Difference sum**: The total number of removed reads from each OTU that amplified in the blank.
* **Difference mean**: The average number of removed reads from each OTU that amplified in the blank.
* **removed OTUs**: A table including the OTU identifiers which were completely removed from either particular groups or the entire data set.

For further information visit the complete `docs <https://github.com/donaldtmcknight/microDecon/blob/master/microDecon%20user's%20guide%201.0.2%20updated.pdf>`_

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