view Sambamba_sort.xml @ 1:6aa99e436263 draft default tip

planemo upload for repository https://github.com/biod/sambamba commit 99bb4ed496a9cce79ab0a7e613230cf63a44d9f9
author bgruening
date Mon, 10 Feb 2025 19:12:35 +0000
parents 87c1b543c4c4
children
line wrap: on
line source

<tool id="sambamba_sort" name="Sambamba sort" version="@TOOL_VERSION@+galaxy@SUFFIX_VERSION@" profile="23.2" license="MIT">
    <description>Tool to sort BAM files</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        sambamba sort 
            -o '${output}'
            $sort_order
            #if $filter
                -F '${filter}'
            #end if 
            -l $compression_level
            '${input_bam}'
            --tmpdir '\${TMPDIR:-.}'
            --nthreads \${GALAXY_SLOTS:-4}
    ]]></command>
    <inputs>
        <param name="input_bam" type="data" format="qname_input_sorted.bam,qname_sorted.bam,bam" label="Input BAM file"/>
        <param name="sort_order" type="select" label="Select sorting mode">
            <option value="" selected="true">Coordinate based</option>
            <option value="-n">Sort by read name lexicographically</option>
        </param>
        <param argument="--compression-level" type="integer" value="5" min="0" max="9" label="Level of compression for merged BAM file, number from 0 to 9"/>
        <param argument="--filter" type="text" optional="true" label="Keep only reads that satisfy this filter" help="You could select reads spanning a targeted region, by using the following filter: chr6:1000-5000"/>
    </inputs>
    <outputs>
        <data name="output" format="bam">
            <change_format>
                <when input="sort_order" value="-n" format="qname_sorted.bam"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <!--Test case of QNAME sorted BAM file-->
        <test expect_num_outputs="1">
            <param name="input_bam" value="1.bam" ftype="bam"/>
            <param name="compression_level" value="5"/>   
            <param name="sort_order" value="-n"/> 
            <output name="output" file="1.qname.sorted.bam" ftype="qname_sorted.bam" lines_diff="4"/>
        </test>
        <!--Test case of Coordinate sorted BAM file-->
        <test expect_num_outputs="1">
            <param name="input_bam" value="1.bam" ftype="bam"/>
            <param name="compression_level" value="5"/>   
            <param name="sort_order" value=""/> 
            <output name="output" file="1.coord.sorted.bam" ftype="bam" lines_diff="4"/>
        </test>
    </tests>
    <help>
<![CDATA[

Sambamba sort performs sorting of BAM files.

BAM files can have either 'coordinate' or 'qname' sort order.
  - 'coordinate' sorting order : Sorts Reads by (integer) reference ID, and for each reference sort corresponding reads by start coordinate.
  - 'qname' sorting order : Reads are sorted lexicographically by their names.

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