view humann_barplot.xml @ 7:5fea25ee6275 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/humann commit cb7dc8ff1810f6d335b5dd6615651f32a3ea7447
author iuc
date Fri, 27 Sep 2024 09:58:35 +0000
parents d76a22ed5e5b
children
line wrap: on
line source

<tool id="humann_barplot" name="Barplot" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>stratified HUMAnN features</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="edam_ontology"/>
    <expand macro="requirements"/>
    <expand macro="version"/>
    <command detect_errors="exit_code"><![CDATA[
humann_barplot
    --input '$input'
#if str($last_metadata) != ''
    --last-metadata '$last_metadata'
#end if
    --focal-feature '$focal_feature'
    --top-taxa $species.top_taxa
    $species.as_genera 
    $species.exclude_unclassified
    $species.remove_zeros
    --sort $species.sort
#if str($species.taxa_colormap) != ''
    --taxa-colormap '$species.taxa_colormap'
#end if

#if str($sample.focal_metadata) != ''
    --focal-metadata '$sample.focal_metadata'
#end if
#if str($sample.meta_colormap) != ''
    --meta-colormap '$sample.meta_colormap'
#end if
    --max-metalevels $sample.max_metalevels
    --scaling '$graphical.scaling'
    #if str($graphical.ymin)  and str($graphical.ymax) != ''
    --ylims $graphical.ymin $graphical.ymax
#end if
    $graphical.no_grid
    --dimensions $graphical.height $graphical.width
#if str($graphical.units) != ''
    --units '$graphical.units'
#end if
    --legend-cols $legend.legend_cols
    --legend-rows $legend.legend_rows
    --legend-height $legend.legend_height
#if $out.format == 'png'
    --output 'output.png'
#elif $out.format == 'pdf'
    --output 'output.pdf'
#elif $out.format == 'svg'
    --output 'output.svg'
#end if
    ]]></command>
    <inputs>
        <param argument="--input" type="data" format="tsv,tabular" label="HUMAnN table with optional metadata"/>
        <param argument="--last-metadata" type="text" value="" optional="true" label="The name (header) of the last row containing metadata, if any">
            <sanitizer invalid_char="">
                <valid initial="string.ascii_letters,string.digits">
                    <add value="_" />
                    <add value="-" />
                </valid>
            </sanitizer>
        </param>
        <param argument="--focal-feature" type="text" value="" label="Feature ID of interest" help="Give ID not full name">
            <sanitizer invalid_char="">
                <valid initial="string.ascii_letters,string.digits">
                    <add value="_" />
                    <add value="-" />
                </valid>
            </sanitizer>
            <validator type="empty_field" />
        </param>
        <section name="species" title="Manipulation of species contributions" expanded="true">
            <param argument="--top-taxa" type="integer" value="18" min="0" label="Max taxon stratifications"/>
            <param argument="--as-genera" type="boolean" truevalue="--as-genera" falsevalue="" checked="false" label="Collapse species to genera?"/>
            <param argument="--exclude-unclassified" type="boolean" truevalue="--exclude-unclassified" falsevalue="" checked="false" label="Do not include the 'unclassified' stratum?"/>
            <param argument="--remove-zeros" type="boolean" truevalue="--remove-zeros" falsevalue="" checked="false" label="Do not plot samples with zero sum for this feature?"/>
            <param argument="--sort" type="select" multiple="true" label="Sample sorting methods">
                <option value="none">Default</option>
                <option value="sum">Sum of stratified values</option>
                <option value="dominant">Value of the most dominant stratification</option>
                <option value="brawcurtis">Bray-Curtis agreement of relative stratifications</option>
                <option value="braycurtis_w">Bray-Curtis agreement of raw stratifications</option>
                <option value="metadata">Given metadata label</option>
            </param>
            <param argument="--taxa-colormap" type="text" value="" optional="true" label="Color space for taxa" help="Automatic if not provided">
                <sanitizer invalid_char="">
                    <valid initial="string.ascii_letters,string.digits">
                        <add value="_" />
                        <add value="-" />
                    </valid>
                </sanitizer>
            </param>
        </section>
        <section name="sample" title="Sample metadata" expanded="true">
            <param argument="--focal-metadata" type="text" value="" optional="true" label="Metadata to highlight">
                <sanitizer invalid_char="">
                    <valid initial="string.ascii_letters,string.digits">
                        <add value="_" />
                        <add value="-" />
                    </valid>
                </sanitizer>
            </param>
            <param argument="--max-metalevels" type="integer" value="7" min="0" label="Number of most frequent metadata to keep" help="Others will be collapsed"/>
            <param argument="--meta-colormap" type="text" value="" optional="true" label="Color space for metadata levels" help="Automatic if not provided">
                <sanitizer invalid_char="">
                    <valid initial="string.ascii_letters,string.digits">
                        <add value="_" />
                        <add value="-" />
                    </valid>
                </sanitizer>
            </param>
        </section>
        <section name="graphical" title="Graphical tweaks" expanded="true">
            <param argument="--scaling" type="select" optional="true" label="Scaling options for total bar heights" help="Taxa are always proportional to height">
                <option value="original">Plot original units</option>
                <option value="logstack">Community totals (stacked bar peaks) are log10-scaled</option>
                <option value="totalsum">Community totals (stacked bar peaks) are fixed at 1.0</option>
            </param>
            <param name="ymin" type="float" value="" optional="true" label="Minimum for y-axis"/>
            <param name="ymax" type="float" value="" optional="true" label="Minimum for y-axis"/>
            <param argument="--no-grid" type="boolean" truevalue="--no-grid" falsevalue="" checked="true" label="Don't plot y-axis grid lines?"/>
            <param name="height" argument="--dimensions" type="float" value="11" label="Image height in inches"/>
            <param name="width" argument="--dimensions" type="float" value="6" label="Image width in inches"/>
            <param argument="--units" type="text" value="" label="Name of y-axis abundance units" help="Automatic if not provided">
                <sanitizer invalid_char="">
                    <valid initial="string.ascii_letters,string.digits">
                        <add value="_" />
                    </valid>
                </sanitizer>
            </param>
        </section>
        <section name="legend" title="Legend layout" expanded="true">
            <param argument="--legend-cols" type="integer" value="3" min="0" label="Number of legend columns"/>
            <param argument="--legend-rows" type="integer" value="10" min="0" label="Number of legend rows"/>
            <param argument="--legend-height" type="float" value="1.0" min="0" label="Ratio of legend to data axis height"/>
        </section>
        <section name="out" title="Outputs" expanded="true">
            <param name="format" type="select" label="Format">
                <option value="pdf">PDF</option>
                <option value="png">PNG</option>
                <option value="svg">SVG</option>
            </param>
        </section>
    </inputs>
    <outputs>
        <data name="barplot_png" format="png" from_work_dir="output.png" label="png figure from ${tool.name} on ${on_string}">
            <filter>out['format'] == 'png'</filter>
        </data>
        <data name="barplot_pdf" format="pdf" from_work_dir="output.pdf" label="${tool.name} on ${on_string}: pdf">
            <filter>out['format'] == 'pdf'</filter>
        </data>
        <data name="barplot_svg" format="svg" from_work_dir="output.svg" label="${tool.name} on ${on_string}: svg">
            <filter>out['format'] == 'svg'</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input" value="hmp_pathabund.txt"/>
            <param name="last_metadata" value="STSite"/>
            <param name="focal_feature" value="ANAGLYCOLYSIS-PWY"/>
            <section name="species">
                <param name="top_taxa" value="18"/>
                <param name="as_genera" value="false"/>
                <param name="exclude_unclassified" value="false"/>
                <param name="remove_zeros" value="false"/>
                <param name="sort" value="none"/>
            </section>
            <section name="sample">
                <param name="focal_metadata" value="STSite"/>
                <param name="max_metalevels" value="7"/>
            </section>
            <section name="graphical">
                <param name="scaling" value="original"/>
                <param name="no_grid" value="true"/>
                <param name="height" value="8"/>
                <param name="width" value="4"/>
            </section>
            <section name="legend">
                <param name="legend_cols" value="3"/>
                <param name="legend_rows" value="10"/>
                <param name="legend_height" value="1.0"/>
            </section>
            <section name="out">
                <param name="format" value="png"/>
            </section>
            <output name="barplot_png" file="barplot1.png" ftype="png" compare="sim_size"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input" value="hmp_pathabund.txt"/>
            <param name="last_metadata" value="STSite"/>
            <param name="focal_feature" value="ANAGLYCOLYSIS-PWY"/>
            <section name="species">
                <param name="top_taxa" value="18"/>
                <param name="as_genera" value="false"/>
                <param name="exclude_unclassified" value="false"/>
                <param name="remove_zeros" value="false"/>
                <param name="sort" value="sum"/>
            </section>
            <section name="sample">
                <param name="focal_metadata" value="STSite"/>
                <param name="max_metalevels" value="7"/>
            </section>
            <section name="graphical">
                <param name="scaling" value="original"/>
                <param name="no_grid" value="true"/>
                <param name="height" value="8"/>
                <param name="width" value="4"/>
            </section>
            <section name="legend">
                <param name="legend_cols" value="3"/>
                <param name="legend_rows" value="10"/>
                <param name="legend_height" value="1.0"/>
            </section>
            <section name="out">
                <param name="format" value="pdf"/>
            </section>
            <output name="barplot_pdf" file="barplot2.pdf" ftype="pdf" compare="sim_size"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input" value="hmp_pathabund.txt"/>
            <param name="last_metadata" value="STSite"/>
            <param name="focal_feature" value="ANAGLYCOLYSIS-PWY"/>
            <section name="species">
                <param name="top_taxa" value="18"/>
                <param name="as_genera" value="true"/>
                <param name="exclude_unclassified" value="true"/>
                <param name="remove_zeros" value="true"/>
                <param name="sort" value="sum"/>
            </section>
            <section name="sample">
                <param name="focal_metadata" value="STSite"/>
                <param name="max_metalevels" value="7"/>
            </section>
            <section name="graphical">
                <param name="scaling" value="original"/>
                <param name="no_grid" value="false"/>
                <param name="height" value="8"/>
                <param name="width" value="4"/>
            </section>
            <section name="legend">
                <param name="legend_cols" value="3"/>
                <param name="legend_rows" value="10"/>
                <param name="legend_height" value="1.0"/>
            </section>
            <section name="out">
                <param name="format" value="svg"/>
            </section>
            <output name="barplot_svg" file="barplot3.svg" ftype="svg" compare="sim_size"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input" value="hmp_pathabund.txt"/>
            <param name="last_metadata" value="STSite"/>
            <param name="focal_feature" value="ANAGLYCOLYSIS-PWY"/>
            <section name="species">
                <param name="top_taxa" value="12"/>
                <param name="as_genera" value="false"/>
                <param name="exclude_unclassified" value="false"/>
                <param name="remove_zeros" value="false"/>
                <param name="sort" value="sum"/>
            </section>
            <section name="sample">
                <param name="focal_metadata" value="STSite"/>
                <param name="max_metalevels" value="7"/>
            </section>
            <section name="graphical">
                <param name="scaling" value="original"/>
                <param name="no_grid" value="true"/>
                <param name="height" value="8"/>
                <param name="width" value="4"/>
            </section>
            <section name="legend">
                <param name="legend_cols" value="3"/>
                <param name="legend_rows" value="10"/>
                <param name="legend_height" value="1.0"/>
            </section>
            <section name="out">
                <param name="format" value="png"/>
            </section>
            <output name="barplot_png" file="barplot4.png" ftype="png" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
@HELP_HEADER@

This tool produces plots of stratified HUMAnN features and includes many options for sorting and scaling data

Here is an example of a HUMAnN barplot for a pathway (denitrification) that was preferentially enriched in Human Microbiome Project oral samples relative to other body sites.
This figure uses many options from humann_barplot, including regrouping by genus, pseudolog scaling, and sorting samples by similarity and metadata:

.. image:: $PATH_TO_IMAGES/731303924-page_DENITRIFICATION-PWY.png
   :width: 800
    ]]></help>
    <expand macro="citations"/>
</tool>