view samtools_ampliconclip.xml @ 0:a941babb9268 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_ampliconclip commit 4596e7b08744df85b48d106cf4d44ebdd90dd554
author iuc
date Mon, 27 Jun 2022 20:07:59 +0000
parents
children 5f3ea90dc6ae
line wrap: on
line source

<tool id="samtools_ampliconclip" name="Samtools ampliconclip" version="@TOOL_VERSION@" profile="@PROFILE@">
    <description>clip primer bases from bam files</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        @ADDTHREADS@
        samtools ampliconclip
            $hard_clip_mode
            #if $min_length:
                --fail-len $min_length
            #end if
            --tolerance $tolerance
            $strand
            -b '${input_bed}'
            -u 
            $both_ends 
            $no_excluded
            -@ \$addthreads
            '${input_bam}'
            | samtools collate -@ \$addthreads -O -u -
            | samtools fixmate -@ \$addthreads -u - - 
            | samtools sort -@ \$addthreads -m \${GALAXY_MEMORY_MB:-768}M -T "\${TMPDIR:-.}" -o '${output_bam}'
    ]]></command>
    <inputs>
        <param name="input_bed" type="data" format="bed" label="Genetic intervals (in BED format)" />
        <param name="input_bam" type="data" format="bam" label="BAM file" />
        <param name="hard_clip_mode" argument="--hard-clip" type="boolean" checked="false" truevalue="--hard-clip" falsevalue="--soft-clip" label="hard clip" help="hard clip (remove bases), unchekced = default soft-clipping" />
        <param name="strand" argument="--strand" type="boolean" checked="false" truevalue="--strand" falsevalue="" label="only clip reads that match bed file strand annotation" />
        <param name="both_ends" argument="--both-ends" type="boolean" checked="false" truevalue="--both-ends" falsevalue="" label="clip both ends of reads (false = 5' only)" />
        <param name="no_excluded" argument="--no-excluded" type="boolean" checked="false" truevalue="--no-excluded" falsevalue="" label="don't write excluded reads to output (default = write all)" />
        <param name="min_length" argument="--fail-len" type="integer" min="0" optional="true" label="Min Read length" help="mark reads QCFAIL at this length or shorter after clipping" />
        <param name="tolerance" argument="--tolerance" type="integer" value="5" min="0"  label="Tolerance" help="match region within this number of bases, default 5." />
    
    </inputs>
    <outputs>
        <data name="output_bam" format="bam" />
    </outputs>
    <tests>
        <!-- 1) -->
        <test>
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <output name="output_bam" file="eboVir3.clipped.bam" ftype="bam" lines_diff="22" />
        </test>
        <!-- 2) testing strand -->
        <test>
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <param name="strand" value="--strand" />
            <output name="output_bam" file="eboVir3.clipped.strand.bam" ftype="bam" lines_diff="16" />
        </test>
        <!-- 3) testing hard clip-->
        <test>
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <param name="hard_clip_mode" value="--hard-clip" />
            <output name="output_bam" file="eboVir3.hardclipped.bam" ftype="bam" lines_diff="14" />
        </test>
        <!-- 4) testing strand and min length-->
        <test>
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <param name="min_length" value="30" />
            <param name="strand" value="--strand" />
            <param name="tolerance" value="6" />
            <param name="both_ends" value="--both-ends" />
            <param name="no_excluded" value="--no-excluded" />
            <output name="output_bam" file="eboVir3.clipped.strand_gt30.bam" ftype="bam" lines_diff="13" />
        </test>
        
    </tests>
    <help>
**What it does**
 Clips read alignments where they match BED file defined regions (e.g. for amplicon sequencing).

 samtools ampliconclip -b [INPUT BED] [INPUT BAM1] -o [OUTPUT]
    </help>
    <expand macro="citations"/>
</tool>