view bamToBed.xml @ 45:a1a923cd89e8 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit d1ee301a39e9830693eedb6ca089456081540f28
author iuc
date Thu, 02 Mar 2023 08:52:08 +0000
parents 7ab85ac5f64b
children
line wrap: on
line source

<tool id="bedtools_bamtobed" name="bedtools BAM to BED" version="@TOOL_VERSION@+galaxy2" profile="@PROFILE@">
    <description>converter</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools" />
    <expand macro="requirements">
        <requirement type="package" version="@SAMTOOLS_VERSION@">samtools</requirement>
    </expand>
    <expand macro="stdio" />
    <command><![CDATA[
#if $input.extension in ['bam', 'unsorted.bam', 'qname_input_sorted.bam'] and $option == "-bedpe":
    samtools sort -n -@ "\${GALAXY_SLOTS:-4}" -T "\${TMPDIR:-.}" '${input}' > ./input.bam &&
#else
    ln -s '${input}' ./input.bam &&
#end if

bedtools bamtobed
$option
$ed_score
$split
#if $tag and str($tag).strip():
    -tag '${tag}'
#end if
-i ./input.bam
> '${output}'
    ]]></command>
    <inputs>
        <param name="input" type="data" format="unsorted.bam" label="Convert the following BAM file to BED"/>
        <param name="option" type="select" label="What type of BED output would you like">
            <option value="">Create a 6-column BED file</option>
            <option value="-bed12">Create a full, 12-column "blocked" BED file</option>
            <option value="-bedpe">Create a paired-end, BEDPE format</option>
        </param>
        <expand macro="split" />
        <param name="ed_score" argument="-ed" type="boolean" truevalue="-ed" falsevalue="" checked="false"
            label="Use alignment's edit-distance for BED score" />
        <param argument="-tag" type="text" optional="true"
            label="Use other NUMERIC BAM alignment tag as the BED score" />
    </inputs>
    <outputs>
        <data name="output" format="bed" metadata_source="input" label="${input.name} (as BED)"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="srma_in3.bam" ftype="bam" />
            <param name="option" value="" />
            <param name="tag" value="" />
            <output name="output" file="bamToBed_result1.bed" ftype="bed" />
        </test>
        <test>
            <param name="input" value="srma_in3.bam" ftype="bam" />
            <param name="option" value="" />
            <param name="tag" value="NM" />
            <output name="output" file="bamToBed_result2.bed" ftype="bed" />
        </test>
        <test>
            <param name="input" value="bedpeToBam_result1.bam" ftype="bam" />
            <param name="option" value="-bedpe" />
            <param name="tag" value="" />
            <output name="output" file="bamToBed_result3.bed" ftype="bed" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

bedtools bamtobed is a conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records.

.. class:: infomark

The "Report spliced BAM alignment..." option breaks BAM alignments with the "N" (splice) operator into distinct BED entries.
For example, using this option on a CIGAR such as 50M1000N50M would, by default, produce a single BED record that spans 1100bp.
However, using this option, it would create two separate BED records that are each 50bp in size and are separated by 1000bp (the size of the N operation).
This is important for RNA-seq and structural variation experiments.


.. class:: warningmark

If using a custom BAM alignment TAG as the BED score, note that this must be a numeric tag (e.g., type "i" as in NM:i:0).


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