view metaquantome_viz.xml @ 3:28180bbb8fe4 draft

planemo upload commit 3762c462ff510cccd856f4ccd7fb87c44ad9b4e7
author galaxyp
date Thu, 06 Dec 2018 08:50:19 -0500
parents a8cb3dea93a6
children 80ce9ca55697
line wrap: on
line source

<tool id="metaquantome_viz" name="MetaQuantome Visualization Plots" version="@VERSION@.0">
    <description>of taxonomic analysis, functional analysis, and function-taxonomy</description>
    <macros>
        <import>macros.xml</import>
        <xml name="img_size">
            <param argument="--width" type="float" value="" optional="true" label="Image width in inches"/>       
            <param argument="--height" type="float" value="" optional="true" label="Image height in inches"/>       
        </xml>
        <xml name="common_bar_params">
                <param argument="--target_rank" type="text" value="species" label="Taxonomic rank to restrict to in the plot"
                        help="">
                    <option value="species">species</option>
                    <option value="genus" selected="true">genus</option>
                    <option value="family">family</option>
                    <option value="order">order</option>
                    <option value="class">class</option>
                    <option value="phylum">phylum</option>
                    <option value="kingdom">kingdom</option>
                </param>
                <param argument="--meancol" type="text" label="Mean intensity column name"
                        help="Mean intensity column name for desired experimental condition">
                        <validator type="empty_field"/>
                </param>
                <param argument="--nterms" type="integer" value="5" min="1" optional="true" label="Number of taxa or functional terms to display" help="leave blank for all"/>
                <param argument="--barcol" type="integer" value="1" min="1" max="6" label="Color for the bar fill">
                    <help>
                        The color vector in R is
                        c("dodgerblue", "darkorange", "yellow2", "red2", "darkviolet", "black"), 
                        so providing a 1 will give the "dodgerblue" color. 
                        These same colors are also used in the heatmap and PCA plot, 
                        so the colors can be tweaked to match.
                    </help>
                </param>
        </xml>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        @MAKE_SAMPS_TSV@
        metaquantome viz
        @COMMON_PARAMS@
        --infile='$infile'
        --plottype=$plot.plottype
        #if $plot.plottype == 'bar':
            #if str($mode_args.mode) in ['t','ft']:
                --target_rank='$plot.target_rank'
            #end if
            --meancol='$plot.meancol'
            #if str($plot.nterms) == '':
                --nterms='all'
            #else
                --nterms=$plot.nterms
            #end if
            --barcol=$plot.barcol
        #elif $plot.plottype == 'volcano':
            --meancol='$plot.meancol'
            --fc_name='$plot.fc_name'
            #if $plot.textannot:
                --textannot='$plot.textannot'
            #end if
            $plot.flip_fc
            $plot.gosplit
        #elif $plot.plottype == 'heatmap':
            $plot.filter_to_sig
            --alpha=$plot.alpha
        #elif $plot.plottype == 'pca':
            $plot.calculate_sep
        #elif $plot.plottype == 'ft_dist':
            --meancol='$plot.meancol'
            #if str($plot.nterms) == '':
                --nterms='all'
            #else
                --nterms=$plot.nterms
            #end if
            --barcol=$plot.barcol
            --whichway=$plot.whichway
            #if $plot.term.id_or_name == 'id':
                --id='$plot.term.id'
            #else:
                --name='$plot.term.name'
            #end if
            #if str($mode_args.mode) in ['t','ft']:
                --target_rank='$plot.target_rank'
            #end if
            #if $plot.target_onto:
                --target_onto=$plot.target_onto
            #end if
        #end if
        #if $plot.width:
            --width=$plot.width
        #end if
        #if $plot.height:
            --height=$plot.height
        #end if
        --img='outfile.png'
    ]]></command>
    <inputs>
        <expand macro="common_params"/>
        <param argument="--infile" type="data" format="tabular" label="metaquantome stats or filtered file"
                    help=""/>
        <conditional name="plot">
            <param argument="--plottype" type="select" label="Plot type">
                <option value="bar">Bar Chart (bar)</option>
                <option value="volcano">Volcano Plot (volcano)</option>
                <option value="heatmap">Heatmap (heatmap)</option>
                <option value="pca">Principal Componets Analysis (pca)</option>
                <option value="ft_dist">Functional Taxonomic Distribution (ft_dist)</option>
            </param>
            <when value="bar">
                <expand macro="common_bar_params"/>
                <expand macro="img_size"/>
            </when>
            <when value="volcano">
                <param argument="--meancol" type="text" label="Mean intensity column name"
                        help="Mean intensity column name for desired experimental condition">
                        <validator type="empty_field"/>
                </param>
                <param argument="--fc_name" type="text" label="Name of the fold change column in the stat dataframe">
                        <validator type="empty_field"/>
                </param>
                <param argument="--textannot" type="text" optional="true" label="Name of the annotation column" 
                    help="Provides text annoatation for the plot.  Optional, if missing, no text will be plotted."/>
                <param argument="--flip_fc" type="boolean" truevalue="--flip_fc" falsevalue="" checked="false" 
                    label="Flip the fold change (i.e., multiply log fold change by -1)"/>
                <param argument="--gosplit" type="boolean" truevalue="--gosplit" falsevalue="" checked="false" 
                    label="Make one plot for each of BiologicalProcess, CellularComponent, and MolecularFunction"/>
                <expand macro="img_size"/>
            </when>
            <when value="heatmap">
                <param argument="--filter_to_sig" type="boolean" truevalue="--filter_to_sig" falsevalue="" checked="false" 
                    label="Only plot significant term" help="Necessitates use of results from `test`"/>
                <param argument="--alpha" type="float" value="0.05" min="0.0" max="1.0" label="If filter_to_sig, the q-value significance level"/>
                <expand macro="img_size"/>
            </when>
            <when value="pca">
                <param argument="--calculate_sep" type="boolean" truevalue="--calculate_sep" falsevalue="" checked="false" 
                    label="Calculate separation between groups and include in title"/>
                <expand macro="img_size"/>
            </when>
            <when value="ft_dist">
                <expand macro="common_bar_params"/>
                <param argument="--whichway" type="select" label="which distribution">
                    <option value="f_dist">functional distribution for a taxon (f_dist)</option>
                    <option value="t_dist">taxonomic distribution for a function (t_dist)</option>
                </param>
                <conditional name="term">
                    <param argument="id_or_name" type="select" label="">
                        <option value="id">Taxonomic or functional term ID</option>
                        <option value="name">Taxonomic or functional term name</option>
                    </param>
                    <when value="id">
                        <param argument="--id" type="text" label="Taxonomic or functional term id">
                            <help>
                                NCBI taxID or a GO term id (GO:XXXXXXX)
                            </help>
                        </param>
                    </when>
                    <when value="name">
                       <param argument="--name" type="text" label="Taxonomic or functional term name">
                           <help>
                           </help>
                       </param>
                    </when>
                </conditional>
                <param argument="--target_onto" type="select" optional="true" label="Restrict to GO category">
                    <option value="bp">Biological Process</option>
                    <option value="mf">Molecular Function</option>
                    <option value="cc">Cellular Component</option>
                </param>
                <expand macro="img_size"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="png" name="outfile" label="${tool.name} on ${on_string} ${plot.plottype}" from_work_dir="outfile.png"/>
    </outputs>
    <tests>
        <test>
             <param name="infile" value="tax_filt.tab" ftype="tabular"/>
             <param name="mode" value="t" />
             <param name="samps_src" value="history" />
             <param name="samps_file" value="samples.tab" ftype="tabular"/>
             <param name="plottype" value="bar" />
             <param name="target_rank" value="genus" />
             <param name="meancol" value="NS_mean" />
             <param name="nterms" value="3" />
             <param name="barcol" value="1" />
             <param name="width" value="3" />
             <param name="height" value="3" />
             <output name="outfile" file="tax_ns.png" ftype="png" compare="sim_size" delta="50000"/>
        </test>
    </tests>
    <help><![CDATA[
        TODO: Fill in help.
    ]]></help>
    <expand macro="citations" />
</tool>