view sam_to_bam.xml @ 12:9bd1568619cd draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit c5ded4208dd70e88596ddc725795a2401773f02d"
author iuc
date Sat, 27 Nov 2021 12:31:54 +0000
parents 1e69848b596f
children
line wrap: on
line source

<tool id="sam_to_bam" name="SAM-to-BAM" version="2.1.2" profile="@PROFILE@">
    <description>convert SAM to BAM</description>

    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>

    <command><![CDATA[
        @ADDTHREADS@
        @ADDMEMORY@
        @PREPARE_FASTA_IDX@

        samtools view
            -b
            -@ \$addthreads
            -t "\$reffai"
            '$input' |

        samtools sort
            -O bam
            -@ \$addthreads -m \$addmemory"M"
            -o '$output1'
            -T "\${TMPDIR:-.}"
    ]]></command>

    <inputs>
        <param name="input" type="data" format="sam" label="SAM file to convert"/>
        <expand macro="mandatory_reference" argument="-t"/>
    </inputs>
    <outputs>
        <data name="output1" format="bam" label="${tool.name} on ${on_string}: converted BAM">
            <actions>
                <conditional name="addref_cond.addref_select">
                    <when value="cached">
                        <action name="dbkey" type="metadata">
                            <option name="input" param_attribute="dbkey" type="from_param" />
                        </action>
                    </when>
                    <when value="history">
                        <action name="dbkey" type="metadata">
                            <option name="addref_cond.ref" param_attribute="dbkey" type="from_param" />
                        </action>
                    </when>
                </conditional>
            </actions>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="addref_select" value="history" />
            <param name="ref" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
            <param name="input" ftype="sam" value="sam_to_bam_in1.sam" />
            <output name="output1" ftype="bam" file="sam_to_bam_out1.bam" lines_diff="4"/>
        </test>
        <test>
            <param name="addref_select" value="cached" />
            <param name="ref" value="equCab2chrM" />
            <param name="input" ftype="sam" dbkey="equCab2" value="sam_to_bam_in1.sam" />
            <output name="output1" ftype="bam" file="sam_to_bam_out2.bam" lines_diff="4"/>
        </test>
        <test>
            <param name="addref_select" value="history" />
            <param name="ref" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
            <param name="input" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" lines_diff="4"/>
        </test>
        <test>
            <!-- Test direct use of bgzipped reference -->
            <param name="addref_select" value="history" />
            <param name="ref" ftype="fasta.gz" dbkey="equCab2" value="chr_m.bgzipped_fasta.gz" />
            <param name="input" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" lines_diff="4"/>
        </test>
        <test>
            <!-- Test with simple gzipped reference, which requires decompression -->
            <param name="addref_select" value="history" />
            <param name="ref" ftype="fasta.gz" dbkey="equCab2" value="chr_m.fasta.gz" />
            <param name="input" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" lines_diff="4"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Converts SAM dataset into its binary, BAM, representation using the ``samtools view`` and ``sort`` commands.
    ]]></help>
    <expand macro="citations"/>
</tool>