view plot_coverage.xml @ 78:6178c24ddd5a draft

"planemo upload for repository https://github.com/bardin-lab/readtagger/tree/master/galaxy commit a1ef57aa402ca6a3cfc75a9652a02372b8b2c013"
author mvdbeek
date Tue, 07 Apr 2020 08:57:47 -0400
parents b9b76f9a816c
children c42dd2551c9c
line wrap: on
line source

<tool id="plot_coverage" name="Plot coverage" version="0.5.24">
    <description>as area plot between BAM files</description>
    <requirements>
        <requirement type="package" version="0.5.24">readtagger</requirement>
    </requirements>
    <command detect_errors="aggressive"><![CDATA[
#import re
plot_coverage
#for $r in $input_files
    #set identifier = re.sub('[^\w\-_\.\,]', '_', str( $r.input.element_identifier))
    --file '$r.input' '$identifier' $r.total_reads
#end for
output.pdf --cores \${GALAXY_SLOTS:-4} --regions '$regions' --plot_kind $plot_kind
    ]]></command>
    <inputs>
        <repeat name="input_files" title="Add input files to coverage plot" min="1">
            <param name="input" type="data" format="bam,cram" label="Select a BAM file to plot"/>
            <param name="total_reads" type="integer" value="0" min="0" label="Total number of (mapped) reads. If given plot scale will be reads per million"/>
        </repeat>
        <param name="regions" type="text" label="Select regions to plot" optional="true" help="e.g X:1200000-1250000,X1250000-1300000. If left blank will plot all contigs/chromosomes.">
            <sanitizer>
                <valid initial="string.letters,string.digits">
                    <add value="-" />
                    <add value="," />
                    <add value=":" />
                    <add value="." />
                </valid>
            </sanitizer>
        </param>
        <param name="plot_kind" type="select" label="Select the plot type">
            <option value="area">Area plot</option>
            <option value="line">Line plot</option>
        </param>
    </inputs>
    <outputs>
        <data name="output" format="pdf" label="Coverage plot on $on_string" from_work_dir="output.pdf"/>
    </outputs>
    <tests>
        <test>
            <param name="input_files_0|input" value="three_cluster_out.bam" ftype="bam"/>
            <param name="input_files_1|input" value="three_cluster_out.bam" ftype="bam"/>
            <param name="input_files_0|total_reads" value="1000000" ftype="bam"/>
            <param name="input_files_1|total_reads" value="1000000" ftype="bam"/>
            <param name="regions" value="3R:13373525-13373615"/>
            <output name="output" file="three_cluster_plot.pdf" ftype="pdf" compare="sim_size"/>
        </test>
        <test>
            <param name="input_files_0|input" value="three_cluster_out.bam" ftype="bam"/>
            <param name="input_files_1|input" value="three_cluster_out.bam" ftype="bam"/>
            <param name="input_files_0|total_reads" value="1000000" ftype="bam"/>
            <param name="input_files_1|total_reads" value="1000000" ftype="bam"/>
            <param name="regions" value="3R:13373525-13373615"/>
            <param name="plot_kind" value="line"/>
            <output name="output" file="three_cluster_plot_line.pdf" ftype="pdf" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[

This tool plots the coverage over a specified region (by default all chromosomes/contigs).

    ]]></help>
</tool>