view samtools_coverage.xml @ 1:ae36fab06bc2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 5cb103832529f17e5c72e7f122758c13519fbe5e
author iuc
date Mon, 15 Aug 2022 09:15:40 +0000
parents 90f2dd176d80
children 8a477224dfee
line wrap: on
line source

<tool id="samtools_coverage" name="Samtools coverage" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
    <description>computes the depth at each position or region</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        @PREPARE_IDX@
        samtools coverage

            #if $condition_input.input_pooling == "Yes":
                ${ ' '.join( [ "'%s'" %  $x for $x in $condition_input.input] ) }
            #else
                '$condition_input.input'
            #end if

            -l $additional_options.min_read_length
            -q $additional_options.min_mq
            -Q $additional_options.min_bq

            #set $filter = $additional_options.required_flags
            @FLAGS@
            -rf $flags

            #set $filter = $additional_options.skipped_flags
            @FLAGS@
            -ff $flags

            #if $condition_histogram.histogram_select == "yes"
                -m
                -w $condition_histogram.n_bins
                #if $condition_histogram.region != "":
                    -r '$condition_histogram.region'
                #end if
            #end if

            -o '$output'
    ]]></command>
    <inputs>
        <conditional name="condition_input">
            <param name="input_pooling" type="select" label="Are you pooling bam files?" help="Calculate the coverage for multiple bam files" >
                <option value="No" selected="True">No</option>
                <option value="Yes">Yes</option>
            </param>
            <when value="No" >
                <param name="input" type="data" format="bam" multiple="true" label="BAM file"/>
            </when>
            <when value="Yes">
                <param name="input" type="data" format="bam" multiple="true" label="BAM files to be pooled"/>
            </when>
        </conditional>

        <section name="additional_options" title="Additional Options" expanded="true">
            <param name="min_read_length" argument="-l" type="integer" min="0" value="0" label="Minimum read length" help="Ignore reads shorter than INT base pairs (Default = 0)" />
            <param name="min_mq" argument="-q" type="integer" min="0" value="0" label="Minimum mapping quality" help="Minimum mapping quality for an alignment to be used (Default = 0)" />
            <param name="min_bq" argument="-Q" type="integer" min="0" value="0" label="Minimum base quality" help="Minimum base quality for a base to be considered (Default = 0)" />

            <param name="required_flags" argument="--rf" type="select" multiple="True" label="Require that these flags are set">
                <expand macro="flag_options" />
            </param>

            <param name="skipped_flags" argument="--ff" type="select" multiple="True" label="Exclude reads with any of the following flags set">
                <expand macro="flag_options" s4="true" s256="true" s512="true" s1024="true"/>
            </param>
        </section>

        <conditional name="condition_histogram">
            <param name="histogram_select" argument="-m" type="select" label="Histogram" help="Show histogram instead of tabular output">
                <option value="no" selected="true">No</option>
                <option value="yes">Yes</option>
            </param>
            <when value="yes">
                <param name="n_bins" argument="-w" type="integer" min="1" value="100" label="Number of bins in histogram" help="Number of bins in histogram" />
                <param name="region" argument="-r" type="text" value="" label="Show specified region" help="Show specified region. Format: chr:start-end." />
            </when>
            <when value="no" />
        </conditional>
    </inputs>

    <outputs>
        <data name="output" format="tabular" from_work_dir="outfile" label="${tool.name} on ${on_string}" />
    </outputs>

    <tests>
        <test>
            <param name="input" value="test_1.bam" ftype="bam" />
            <output name="output" file="results_1.tabular" ftype="tabular" />
        </test>
        <test>
            <param name="input" value="test_1.bam" ftype="bam" />
            <param name="histogram_select" value="yes" />
            <param name="n_bins" value="50" />
            <output name="output" file="results_2.txt" ftype="tabular" />
        </test>
        <test>
            <param name="input_pooling" value="Yes" />
            <param name="input" value="test_1.bam,test_2.bam" ftype="bam" />
            <param name="histogram_select" value="yes" />
            <param name="n_bins" value="100" />
            <output name="output" file="results_3.txt" ftype="tabular" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

This tool runs the ``samtools coverage`` command.

Computes the depth at each position or region and draws an ASCII-art histogram or tabulated text. If you select to pool the bam files, then it calculates coverage for the combined files.

The tabulated form uses the following headings:

- rname	Reference name / chromosome
- startpos	Start position
- endpos	End position (or sequence length)
- numreads	Number reads aligned to the region (after filtering)
- covbases	Number of covered bases with depth >= 1
- coverage	Proportion of covered bases [0..1]
- meandepth	Mean depth of coverage
- meanbaseq	Mean baseQ in covered region
- meanmapq	Mean mapQ of selected reads

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