view bamtools_split_tag.xml @ 3:e9b9c489aacc draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/bamtools/bamtools_split commit 5ebe920838ab3c36e93d620c479df17f43f8e336
author iuc
date Fri, 15 Mar 2024 13:49:45 +0000
parents e30af4e78cd3
children
line wrap: on
line source

<tool id="bamtools_split_tag" name="Split BAM by read tag value" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>into a dataset list collection</description>
    <macros>
          <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <expand macro="requirements" />
    <command>
        <![CDATA[
            #import re
            #set $name = 'split_bam' + $re.sub('\W','_',$re.sub('\.bam$','',$input_bam.name))
            ln -s '${input_bam}' 'localbam.bam' &&
            ln -s '${input_bam.metadata.bam_index}' 'localbam.bam.bai' &&
            bamtools split -tag $tag_name
            -in 'localbam.bam'
            -stub '$name'
        ]]>
    </command>
    <inputs>
        <param name="input_bam" type="data" format="bam" label="BAM dataset to split by tag value"/>
        <param name="tag_name" type="text" value="NM" label="Enter tag name here" help="For example, to split on NM tag enter &quot;NM&quot;"/>
    </inputs>
    <outputs>
        <collection name="output_bams" type="list" label="${input_bam.name} Split List">
            <discover_datasets pattern="split_bam(?P&lt;designation&gt;.+)\.bam" ext="bam" visible="false"/>
        </collection>
    </outputs>
    <tests>
        <test>
            <param name="input_bam" ftype="bam" value="bamtools-input-tags.bam"/>
            <param name="tag_name" value="XG"/>
            <output_collection name="output_bams"  type="list">
                <element name="bamtools_input_tags.TAG_XG_V"  file="bamtools_input_tags.TAG_XG_V.bam" compare="sim_size" delta="500" />
            </output_collection>
        </test>

    </tests>
    <help>
**What is does**

BAMTools split is a utility for splitting BAM files. It is based on the BAMtools suite of tools by Derek Barnett (https://github.com/pezmaster31/bamtools).

-----

**How it works**

Split alignments by tag name into a dataset list collection.

.. class:: warningmark

This can generate a collection with a huge number of elements depending on the number of distinct values of the TAG.

-----

.. class:: infomark

**More information**

Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki

    </help>
    <citations>
        <citation type="doi">10.1093/bioinformatics/btr174</citation>
    </citations>
</tool>