view ribowaltz_plot.xml @ 1:e25d81465c23 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ribowaltz commit 416063685092b818a398e00d5027f7fe742230f1
author iuc
date Mon, 23 Oct 2023 12:10:37 +0000
parents 8e903cb3f919
children
line wrap: on
line source

<tool id="ribowaltz_plot" name="riboWaltz-plot" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>visual inspection of ribosome profiling data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro='edam_ontology' />
    <expand macro='xrefs'/>
    <expand macro='requirements'/>
    <command detect_errors="exit_code"><![CDATA[
        Rscript '${__tool_directory__}/ribowaltz_plot.R' -i '$input_rdata'
        #import json
        #if $rlength_distr.plot == 'yes':
            #set params_rlength_distr = []
            #silent $params_rlength_distr.append(
                {"cl": int($rlength_distr.plot_options.cl), "multisamples": str($rlength_distr.plot_options.multisamples),
                "plot_style": str($rlength_distr.plot_options.plot_style)})
            --params_rlength_distr '#echo json.dumps($params_rlength_distr)#'
        #end if
        #if $rends_heat.plot == 'yes':
            #set params_rends_heat = []
            #silent $params_rends_heat.append(
                {"cl": int($rends_heat.plot_options.cl), "utr5l": int($rends_heat.plot_options.utr5l),
                "cdsl": int($rends_heat.plot_options.cdsl), "utr3l": int($rends_heat.plot_options.utr3l)})
            --params_rends_heat '#echo json.dumps($params_rends_heat)#'
        #end if
        #if $region_psite:
            --region_psite_plot
        #end if
        #if $trint_periodicity.plot == 'yes':
            #set length_range = 'all' 
            #if $trint_periodicity.plot_options.length_range.filter == 'range':
                #$length_range = str($trint_periodicity.plot_options.length_range.length_range_min) + ':' + str($trint_periodicity.plot_options.length_range.length_range_max)
            #end if
            #set params_trint_periodicity = []
            #silent $params_trint_periodicity.append(
                {"cl": int($trint_periodicity.plot_options.cl), "region": str($trint_periodicity.plot_options.region), 
                "length_range": $length_range})
            --params_trint_periodicity '#echo json.dumps($params_trint_periodicity)#'
        #end if
        #if $metaplots.plot == 'yes':
            #set length_range = 'all' 
            #if $metaplots.plot_options.length_range.filter == 'range':
                #$length_range = str($metaplots.plot_options.length_range.length_range_min) + ':' +  str($metaplots.plot_options.length_range.length_range_max)
            #end if
            #set params_metaplots = []
            #silent $params_metaplots.append(
                {"multisamples": str($metaplots.plot_options.multisamples), "plot_style": str($metaplots.plot_options.plot_style),
                "length_range": $length_range, "frequency": bool($metaplots.plot_options.frequency),
                "utr5l": int($metaplots.plot_options.utr5l), "cdsl": int($metaplots.plot_options.cdsl),
                "utr3l": int($metaplots.plot_options.utr3l)})
            --params_metaplots '#echo json.dumps($params_metaplots)#'
        #end if
        #if $codon_usage_psite.plot == 'yes':
            #set params_codon_usage_psite = []
            #silent $params_codon_usage_psite.append(
                {"fastapath": str($codon_usage_psite.plot_options.fastapath), "frequency": bool($codon_usage_psite.plot_options.frequency),
                "label_scatter": bool($codon_usage_psite.plot_options.label_scatter),
                "label_number": int($codon_usage_psite.plot_options.label_number)})
            --params_codon_usage_psite '#echo json.dumps($params_codon_usage_psite)#'
        #end if
    ]]></command>
    <inputs>
        <param name="input_rdata" type="data" format="rdata" label="RDATA file generated by riboWaltz tool"/>
        <conditional name="rlength_distr">
            <param name="plot" type="select" label="Include read length distribution plots?">
                <option value="no">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <section name="plot_options" title="Plot options">
                    <param name="cl" type="integer" value="100" min="1" max="100" label="Confidence level"/>
                    <param name="multisamples" type="select" label="How to handle multiple samples and replicates?">
                        <option value="separated">Separate plots</option>
                        <option value="average">Sinlge plot with mean signal</option>
                    </param>
                    <param name="plot_style" type="select" label="How to organize and display multiple bar plots??">
                        <option value="split">Separate plots</option>
                        <option value="dodged">Sinlge plot with mean signal</option>
                    </param>
                </section>
            </when>
            <when value="no"/>
        </conditional>
        <conditional name="rends_heat">
            <param name="plot" type="select" label="Inlcude plots about abundance reads extremities around start and stop codons?">
                <option value="no">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <section name="plot_options" title="Plot options">
                    <param name="cl" type="integer" value="95" min="1" max="100" label="Confidence level"/>
                    <param name="utr5l" type="integer" value="50" min="0" label="5' UTR region flanking the start codon"/>
                    <param name="cdsl" type="integer" value="50" min="0" label="CDS region flanking both the start and stop codon"/>
                    <param name="utr3l" type="integer" value="50" min="0" label="3' UTR region flanking the stop codon"/>
                </section>
            </when>
            <when value="no"/>
        </conditional>
        <param name="region_psite" type="boolean" truevalue="1" falsevalue="0" checked="false"
            label="Inlcude plots that show P-sites per region?"/>
        <conditional name="trint_periodicity">
            <param name="plot" type="select" label="Inlcude plots with Trinucleotide periodicity?">
                <option value="no">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <section name="plot_options" title="Plot options">
                    <param name="cl" type="integer" value="95" min="1" max="100" label="Confidence level"/>
                    <param name="region" type="select" label="Region(s) of the apartment to be analyzed">
                        <option value="all" selected="true">All</option>
                        <option value="5end">5' UTR</option>
                        <option value="3end">3' UTR</option>
                    </param>
                    <conditional name="length_range">
                        <param name="filter" type="select" label="Read length(s) to be included in the analysis">
                            <option value="all" selected="true">All</option>
                            <option value="range">based on read length ranges</option>
                        </param>
                        <when value="all" />
                        <when value="range">
                            <param name="length_range_min" value="1" type="integer" min="1"
                                label="Read lengths ranging from"/>
                            <param name="length_range_max" value="100" type="integer" min="1"
                                label="Read lengths ranging to"/>
                        </when>
                    </conditional>
                </section>
            </when>
            <when value="no"/>
        </conditional>
        <conditional name="metaplots">
            <param name="plot" type="select" label="Inlcude metaplots?">
                <option value="no">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <section name="plot_options" title="Plot options">
                    <param name="multisamples" type="select" label="How to handle multiple samples and replicates?">
                        <option value="separated">Separate plots</option>
                        <option value="average">Sinlge plot with mean signal</option>
                        <option value="sum">Sinlge plot with sum of the signal</option>
                    </param>
                    <param name="plot_style" type="select" label="How to organize and display multiple bar plots??">
                        <option value="split">Separate plots</option>
                        <option value="dodged">Sinlge plot with mean signal</option>
                    </param>
                    <conditional name="length_range">
                        <param name="filter" type="select" label="Read length(s) to be included in the analysis">
                            <option value="all" selected="true">All</option>
                            <option value="range">based on read length ranges</option>
                        </param>
                        <when value="all" />
                        <when value="range">
                            <param name="length_range_min" value="1" type="integer" min="1"
                                label="Read lengths ranging from"/>
                            <param name="length_range_max" value="100" type="integer" min="1"
                                label="Read lengths ranging to"/>
                        </when>
                    </conditional>
                    <param name="frequency" type="boolean" truevalue="1" falsevalue="0" checked="false"
                        label="Normalize the metaprofile(s) such that the area under the curve(s) is 1?"
                        help="If checked and if multisamples is set to average or sum, normalization is performed 
                        before combining the signal from multiple samples"/>
                    <param name="utr5l" type="integer" value="50" min="0" label="5' UTR region flanking the start codon"/>
                    <param name="cdsl" type="integer" value="50" min="0" label="CDS region flanking both the start and stop codon"/>
                    <param name="utr3l" type="integer" value="25" min="0" label="3' UTR region flanking the stop codon"/>
                </section>
            </when>
            <when value="no"/>
        </conditional>
        <conditional name="codon_usage_psite">
            <param name="plot" type="select" label="Inlcude plots with codon usage?">
                <option value="no">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <section name="plot_options" title="Plot options">
                    <param name="fastapath" type="data" format="fasta" />
                    <param name="frequency" type="boolean" truevalue="1" falsevalue="0" checked="true"
                        label="normalize the 64 codon usage indexes for the corresponding codon frequencies in coding sequences?"/>
                    <param name="label_scatter" type="boolean" truevalue="1" falsevalue="0" checked="false"
                        label="Label the dots in the scatter plot?"
                        help=" This parameter is considered only if there exatcly two input samples"/>
                    <param name="label_number" type="integer" value="64" min="1" max="64" label="how many dots in the scatter plot should be labeled?"/>
                </section>
            </when>
            <when value="no"/>
        </conditional>
    </inputs>
    <outputs>
        <collection name="out_plots" type="list" label="riboWaltz plots on ${on_string}">
            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.pdf" format="pdf" directory="." visible="false"/>
        </collection>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_rdata" value="rep1.rdata"/>
            <param name="region_psite" value="1"/>
            <conditional name="rlength_distr">
                <param name="plot" value="yes"/>
            </conditional>
            <conditional name="rends_heat">
                <param name="plot" value="yes"/>
            </conditional>
            <conditional name="trint_periodicity">
                <param name="plot" value="yes"/>
            </conditional>
            <conditional name="metaplots">
                <param name="plot" value="yes"/>
            </conditional>
            <output_collection name="out_plots" type="list">
                <element name="metaplots">
                    <assert_contents>
                        <has_size value="9180" delta="100"/>
                    </assert_contents>
                </element>
                <element name="psites_per_region">
                    <assert_contents>
                        <has_size value="5187" delta="100"/>
                    </assert_contents>
                </element>
                <element name="read_ends_heatmap">
                    <assert_contents>
                        <has_size value="26327" delta="500"/>
                    </assert_contents>
                </element>
                <element name="read_lengths">
                    <assert_contents>
                        <has_size value="4877" delta="100"/>
                    </assert_contents>
                </element>
                <element name="trinucleotide_periodicity">
                    <assert_contents>
                        <has_size value="7730" delta="100"/>
                    </assert_contents>
                </element>
            </output_collection>
        </test>
    </tests>
    <help><![CDATA[
Visual inspection of ribosome profiling data. More information can be found here: https://github.com/LabTranslationalArchitectomics/riboWaltz

**Inputs**

RDATA file generated by rioWaltz tool.

**Outputs**

Generates various plots to visualize P-site offsets, codon usage etc.

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