view plot_taxa_summary.xml @ 4:7d1a644d1032 draft

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

<tool id="qiime_plot_taxa_summary" name="Make taxonomy summary charts" version="@WRAPPER_VERSION@.0">
    <description>based on taxonomy assignment</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <version_command>MPLBACKEND="Agg" plot_taxa_summary.py --version</version_command>
    <command detect_errors="aggressive"><![CDATA[
        #set $chosen_chart_type = str( $chart_type ).split( "," )

        ## set matplotlib backend
        export MPLBACKEND="Agg" &&
        echo "backend:agg" > matplotlibrc &&

        plot_taxa_summary.py
            --counts_fname '$counts_fname'
            --dir_path taxa_plots
            --labels '$labels'
            --num_categories '$num_categories'
            #if str($colorby) != ''
                --colorby '$colorby'
            #end if
            --background_color '$background_color'
            --dpi '$dpi'
            --x_width '$x_width'
            --y_height '$y_height'
            --bar_width '$bar_width'
            --type_of_file '$type_of_file'
            --chart_type '$chart_type'
            --resize_nth_label '$resize_nth_label'
            $include_html_legend
            --label_type '$label_type'

        #if "area" in $chosen_chart_type:
            && mkdir -p '$area_charts_html_report.files_path'
            && cp -r 'taxa_plots/area_charts.html' '$area_charts_html_report.files_path'
            && cp -r 'taxa_plots/charts' '$area_charts_html_report.files_path'
            && cp -r 'taxa_plots/css' '$area_charts_html_report.files_path'
            && cp -r 'taxa_plots/js' '$area_charts_html_report.files_path'
            && mv '$area_charts_html_report.files_path/area_charts.html' '$area_charts_html_report'
        #end if

        #if "bar" in $chosen_chart_type:
            && mkdir -p '$bar_charts_html_report.files_path'
            && cp -r 'taxa_plots/bar_charts.html' '$bar_charts_html_report.files_path'
            && cp -r 'taxa_plots/charts' '$bar_charts_html_report.files_path'
            && cp -r 'taxa_plots/css' '$bar_charts_html_report.files_path'
            && cp -r 'taxa_plots/js' '$bar_charts_html_report.files_path'
            && mv '$bar_charts_html_report.files_path/bar_charts.html' '$bar_charts_html_report'
        #end if

        #if "pie" in $chosen_chart_type:
            && mkdir -p '$pie_charts_html_report.files_path'
            && cp -r 'taxa_plots/pie_charts.html' '$pie_charts_html_report.files_path'
            && cp -r 'taxa_plots/charts' '$pie_charts_html_report.files_path'
            && cp -r 'taxa_plots/css' '$pie_charts_html_report.files_path'
            && cp -r 'taxa_plots/js' '$pie_charts_html_report.files_path'
            && mv '$pie_charts_html_report.files_path/pie_charts.html' '$pie_charts_html_report'
        #end if
    ]]></command>
    <inputs>
        <param argument="--counts_fname" type="data" format="tabular,txt" label="Summarized taxa files" multiple="True"/>
        <param argument="--labels" type="text" value="" label="Comma-separated list of taxonomic levels"/>
        <param argument="--num_categories" type="integer" value="20" label="Maximum number of taxonomies to show in each pie chart" help="All additional taxonomies are grouped into an 'other' category. This functionality only applies to the pie charts"/>
        <param argument="--colorby" type="text" value="" label="Categories to color by in the plots from the metadata mapping file" help="The categories must match the name of a column header in the mapping file exactly and multiple categories can be list by comma separating them without spaces" optional="True"/>
        <param argument="--background_color" type="select" label="Background color to
            use in the plots">
            <option value="white" selected="true">White</option>
            <option value="black">Black</option>
        </param>
        <param argument="--dpi" type="integer" value="80" label="Resolution of the plot"/>
        <param argument="--x_width" type="integer" value="12" label="Width of the x-axis to use in the plots"/>
        <param argument="--y_height" type="integer" value="12" label="Height of the y-axis to use in the plots"/>
        <param argument="--bar_width" type="float" value="0.75" min="0" max="1" label="Width of the bars in the bar graph"/>
        <param argument="--type_of_file" type="select" label="Type of image to produce">
            <option value="pdf">PDF</option>
            <option value="png" selected="true">PNG</option>
            <option value="svg">SVG</option>
        </param>
        <param argument="--chart_type" type="select" label="Type of chart to plot" multiple="True">
            <option value="area" selected="true">Area</option>
            <option value="bar" selected="true">Bar</option>
            <option value="pie">Pie</option>
        </param>
        <param argument="--resize_nth_label" type="integer" value="0" label="Make every nth label larger than the other lables" help="This is for large area and bar charts where the font on the x-axis is small. This requires an integer value greater than 0"/>
        <param argument="--include_html_legend" type="boolean" label="Include HTML legend?" truevalue="--include_html_legend" falsevalue="" checked="False" help="If checked, the writing of the legend in the html page is included"/>
        <param argument="--label_type" type="select" label="Label type" help="If the label type is defined as numeric, the x-axis will be scaled accordingly. Otherwise the x-values will treated categorically and be evenly spaced">
            <option value="categorical" selected="true">Categorical</option>
            <option value="numeric">Numeric</option>
        </param>
    </inputs>
    <outputs>
        <data name="bar_charts_html_report" format="html" label="${tool.name} on ${on_string}: Bar charts">
            <filter>'bar' in chart_type</filter>
        </data>
        <data name="pie_charts_html_report" format="html" label="${tool.name} on ${on_string}: Pie charts">
            <filter>'pie' in chart_type</filter>
        </data>
        <data name="area_charts_html_report" format="html" label="${tool.name} on ${on_string}: Area charts">
            <filter>'area' in chart_type</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="counts_fname" value="plot_taxa_summary/phylum.txt"/>
            <param name="labels" value="phylum"/>
            <param name="num_categories" value="20"/>
            <param name="background_color" value="white"/>
            <param name="dpi" value="80"/>
            <param name="x_width" value="12"/>
            <param name="y_height" value="12"/>
            <param name="bar_width" value="0.75"/>
            <param name="type_of_file" value="png"/>
            <param name="chart_type" value="area,bar,pie"/>
            <param name="include_html_legend" value="" />
            <param name="resize_nth_label" value="0"/>
            <param name="label_type" value="categorical" />
            <output name="bar_charts_html_report" value="plot_taxa_summary/phylum/bar_charts.html" compare="sim_size"/>
            <output name="pie_charts_html_report" value="plot_taxa_summary/phylum/pie_charts.html" compare="sim_size"/>
            <output name="area_charts_html_report" value="plot_taxa_summary/phylum/area_charts.html" compare="sim_size"/>
        </test>
        <test>
            <param name="counts_fname" value="plot_taxa_summary/phylum.txt,plot_taxa_summary/class.txt,plot_taxa_summary/genus.txt"/>
            <param name="labels" value="Phylum,Class,Genus"/>
            <param name="num_categories" value="20"/>
            <param name="background_color" value="white"/>
            <param name="dpi" value="80"/>
            <param name="x_width" value="12"/>
            <param name="y_height" value="12"/>
            <param name="bar_width" value="0.75"/>
            <param name="type_of_file" value="png"/>
            <param name="chart_type" value="area,bar,pie"/>
            <param name="include_html_legend" value="" />
            <param name="resize_nth_label" value="0"/>
            <param name="label_type" value="categorical" />
            <output name="bar_charts_html_report" value="plot_taxa_summary/phylum_class_genus/bar_charts.html" compare="sim_size"/>
            <output name="pie_charts_html_report" value="plot_taxa_summary/phylum_class_genus/pie_charts.html" compare="sim_size"/>
            <output name="area_charts_html_report" value="plot_taxa_summary/phylum_class_genus/area_charts.html" compare="sim_size"/>
        </test>
        <test>
            <param name="counts_fname" value="plot_taxa_summary/class.txt"/>
            <param name="labels" value="Class"/>
            <param name="num_categories" value="10"/>
            <param name="background_color" value="white"/>
            <param name="dpi" value="80"/>
            <param name="x_width" value="12"/>
            <param name="y_height" value="12"/>
            <param name="bar_width" value="0.75"/>
            <param name="chart_type" value="pie"/>
            <param name="type_of_file" value="svg"/>
            <param name="include_html_legend" value="--include_html_legend" />
            <param name="resize_nth_label" value="0"/>
            <param name="label_type" value="categorical" />
            <output name="pie_charts_html_report" value="plot_taxa_summary/class/pie_charts.html" compare="sim_size"/>
        </test>
        <test>
            <param name="counts_fname" value="plot_taxa_summary/class.txt"/>
            <param name="labels" value="Class"/>
            <param name="num_categories" value="20"/>
            <param name="colorby" value="PC.636,PC.635"/>
            <param name="background_color" value="white"/>
            <param name="dpi" value="80"/>
            <param name="x_width" value="12"/>
            <param name="y_height" value="12"/>
            <param name="bar_width" value="0.75"/>
            <param name="type_of_file" value="pdf"/>
            <param name="chart_type" value="area,bar,pie"/>
            <param name="include_html_legend" value="" />
            <param name="resize_nth_label" value="0"/>
            <param name="label_type" value="categorical" />
            <output name="bar_charts_html_report" value="plot_taxa_summary/class_colorby/bar_charts.html" compare="sim_size"/>
            <output name="pie_charts_html_report" value="plot_taxa_summary/class_colorby/pie_charts.html" compare="sim_size"/>
            <output name="area_charts_html_report" value="plot_taxa_summary/class_colorby/area_charts.html" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

This script automates the construction of pie, bar and area charts showing the breakdown of taxonomy by given levels.

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