view compare_biom.xml @ 4:8e2ac1b8f70a draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/picrust commit 899e24f2aecad79c80667fb6c938dd4573a98820
author iuc
date Fri, 09 Feb 2024 21:41:50 +0000
parents 9168545e09df
children
line wrap: on
line source

<tool id="picrust_compare_biom" name="Compare BIOM tables" version="@TOOL_VERSION@.1">
    <description>Compare the accuracy of biom files (expected and observed) either by observations (default) or by samples.</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools"/>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
        compare_biom.py
            -e '$expected'
            -o '$outfile'
            $not_relative_abundance_scores
            $advanced.compare_observations
            $advanced.normalize
            $advanced.limit_to_observed_observations
            $advanced.limit_to_expected_observations
            $advanced.shuffle_samples
            '$observed'
    ]]></command>
    <inputs>
        <param argument="-o" name="observed" type="data" format="biom1" label="Observed table" help="The observed table of either relative abundance or real counts"/>
        <param argument="-e" name="expected" type="data" format="biom1" label="Expected table" help="The expected table of either relative abundance or real counts"/>
        <param argument="--not_relative_abundance_scores" type="boolean" truevalue="--not_relative_abundance_scores" falsevalue="" checked="false" label="Real counts instead of relative abundances?"
               help="Round numbers (instead of taking ceil() which is used for RA) before calculating TP,FP,FN,TN"/>
        <section name="advanced" title="Advanced parameters" expanded="false">
            <param argument="--compare_observations" type="boolean" truevalue="--compare_observations" falsevalue="" checked="false" label="Compare observations"
                help="Calculate accuracy values by comparing between observations (instead of between samples)."/>
            <param argument="--normalize" type="boolean" truevalue="--normalize" falsevalue="" checked="false" label="Normalize?"
                help="Convert both expected and observed tables to relative abundances (instead of observations)."/>
            <param argument="--limit_to_observed_observations" type="boolean" truevalue="--limit_to_observed_observations" falsevalue="" checked="false" label="Limit to observed observations?"
                help="Ignore observations that are not in the observed table."/>
            <param argument="--limit_to_expected_observations" type="boolean" truevalue="--limit_to_expected_observations" falsevalue="" checked="false" label="Limit to expected observations?"
                help="Ignore observations that are not in the expected table."/>
            <param argument="--shuffle_samples" type="boolean" truevalue="--shuffle_samples" falsevalue="" checked="false" label="Shuffle samples?"
                help="Shuffle samples ids randomly before measuring accuracy."/>
        </section>
    </inputs>
    <outputs>
        <data format="tabular" name="outfile" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test><!-- relative abundance test -->
            <param name="observed" value="observed_ra.biom" ftype="biom1"/>
            <param name="expected" value="expected_ra.biom" ftype="biom1"/>
            <output name="outfile" ftype="tabular">
                <assert_contents>
                    <has_text_matching expression="file\tlabel\taccuracy"/>
                    <has_text text="sample1"/>
                    <has_text text="sample3"/>
                    <has_text text="sample2"/>
                    <has_n_lines n="4"/>
                    <has_n_columns n="16"/>
                </assert_contents>
            </output>
            <assert_command>
                <not_has_text text="--not_relative_abundance_scores"/>
                <not_has_text text="--compare_observations"/>
                <not_has_text text="--normalize"/>
                <not_has_text text="--limit_to_observed_observations"/>
                <not_has_text text="--limit_to_expected_observations"/>
                <not_has_text text="--shuffle_samples"/>
            </assert_command>
        </test>
        <test><!-- real counts test -->
            <param name="observed" value="observed.biom" ftype="biom1"/>
            <param name="expected" value="expected.biom" ftype="biom1"/>
            <param name="not_relative_abundance_scores" value="true"/>
            <output name="outfile" ftype="tabular">
                <assert_contents>
                    <has_text_matching expression="file\tlabel\taccuracy"/>
                    <has_text text="sample1"/>
                    <has_text text="sample3"/>
                    <has_text text="sample2"/>
                    <has_n_lines n="4"/>
                    <has_n_columns n="16"/>
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--not_relative_abundance_scores"/>
                <not_has_text text="--compare_observations"/>
                <not_has_text text="--normalize"/>
                <not_has_text text="--limit_to_observed_observations"/>
                <not_has_text text="--limit_to_expected_observations"/>
                <not_has_text text="--shuffle_samples"/>
            </assert_command>
        </test>
        <test><!-- all other switches test -->
            <param name="observed" value="observed.biom" ftype="biom1"/>
            <param name="expected" value="expected.biom" ftype="biom1"/>
            <param name="not_relative_abundance_scores" value="true"/>
            <section name="advanced">
                <param name="compare_observations" value="true"/>
                <param name="normalize" value="true"/>
                <param name="limit_to_observed_observations" value="true"/>
                <param name="limit_to_expected_observations" value="true"/>
                <param name="shuffle_samples" value="true"/>
            </section>
            <output name="outfile" ftype="tabular">
                <assert_contents>
                    <has_text_matching expression="file\tlabel\taccuracy"/>
                    <has_text text="K00005"/>
                    <has_text text="K00004"/>
                    <has_text text="K00003"/>
                    <has_n_lines n="6"/>
                    <has_n_columns n="16"/>
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--not_relative_abundance_scores"/>
                <has_text text="--compare_observations"/>
                <has_text text="--normalize"/>
                <has_text text="--limit_to_observed_observations"/>
                <has_text text="--limit_to_expected_observations"/>
                <has_text text="--shuffle_samples"/>
            </assert_command>
        </test>
    </tests>
    <help>
<![CDATA[
@PICRUST_OVERVIEW@

**Command Documentation**

Compare an observed table to an expected table using either relative abundance or real counts.

**Input files:**

**Observed table:** A table of observed relative abundances or real counts in .biom format.

**Expected table:** The expected table of relative abundances or real counts in .biom format.

**Output file:** Tab delimited file with various accuracy metrics.

**Optional Parameters:**

*compare observations*

    Calculate accuracy values by comparing between observations (instead of between samples) [default: False]

*normalize*

    Convert both expected and observed tables to relative abundances (instead of observations) [default: False]

*limit to expected observations*

    Ignore observations that are not in the expected table[default: False]

*limit to observed observations*

    Ignore observations that are not in the observed table[default: False]

*shuffle samples*

    Shuffle samples ids randomly before measuring accuracy[default: False]

*not relative abundance scores*

    Round numbers (instead of taking ceil() which is used for RA) before calculating TP,FP,FN,TN [default: False]

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