view plot_corr.xml @ 1:e9268619b503 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/plot_correlation_matrix commit 8451e17775c0ffcd7fa63ef65081f442bef91496-dirty
author mvdbeek
date Fri, 27 Apr 2018 11:03:55 -0400
parents 0cee38fb62af
children
line wrap: on
line source

<tool id="plot_correlation" name="Plot correlations" version="0.1.3">
    <description>for multiple samples</description>
    <requirements>
        <requirement type="package" version="0.8.1">seaborn</requirement>
        <requirement type="package" version="6.7">click</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
python '$__tool_directory__/plot_corr.py'
#echo "".join(["'%s' " % f for f in $input_files])
-c $c
--labels '$labels'
#if $plot_type != "None"
    --plot_path output.$plot_type
#end if
--correlation_matrix_path $tab_output
--method $method
--skiprows $skiprows
#if $input_files[0].ext == 'csv'
--sep ","
#end if
#if $plot_type != "None"
    && mv output.$plot_type plot
#end if
    ]]></command>
<configfiles>
    <configfile name="labels">#for f in $input_files
$f.element_identifier
#end for</configfile>
</configfiles>
    <inputs>
        <param name="input_files" type="data" multiple="true" format="tabular,csv" label="Select the files for which to calculate the correlation"/>
        <param argument="-c" type="data_column" data_ref="input_files" value="1" label="Select the numeric column to use"/>
        <param argument="--skiprows" type="integer" min="0" value="0" label="Skip the first N rows" help="Make sure that all values are numeric"/>
        <param argument="--plot_type" type="select" label="Select the type of plot to produce">
            <option value="pdf">PDF</option>
            <option value="png">PNG</option>
            <option value="None">Don't output plot</option>
        </param>
        <param argument="--method" type="select" label="Select the correlation method">
            <option value="pearson">Pearson Correlation</option>
            <option value="spearman">Spearman Correlation</option>
            <option value="kendall">Kendall-Tau Correlation</option>
        </param>
    </inputs>
    <outputs>
        <data name="plot_output" format="pdf" from_work_dir="plot" label="${tool.name} plot on ${on_string}">
            <filter>str(plot_type) != "None"</filter>
            <change_format>
                <when input="plot_type" value="png" format="png"/>
            </change_format>
        </data>
        <data name="tab_output" format="tabular" label="${tool.name} table on ${on_string}"/>
    </outputs>
    <tests>
        <test>
            <param name="input_files" value="1.txt,2.txt,3.txt" ftype="tabular"/>
            <output name="plot_output" value="corr.pdf" ftype="pdf"/>
            <output name="tab_output" value="corr.tab" ftype="tabular"/>
        </test>
        <test>
            <param name="input_files" value="1.txt,2.txt,3.txt" ftype="tabular"/>
            <param name="plot_type" value="png"/>
            <output name="plot_output" value="corr.png" ftype="png"/>
            <output name="tab_output" value="corr.tab" ftype="tabular"/>
        </test>
    </tests>
    <help><![CDATA[
What it does
------------

This tool calculates the correlation for a selected colum across many datasets.

Example output:
---------------

.. image:: $PATH_TO_IMAGES/corr.png

        ]]></help>
</tool>