view samtools_ampliconclip.xml @ 6:77889ed49dbc draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/samtools/samtools_ampliconclip commit bfe97d9abaf5d56412b48b5a011f1c4337fa5118-dirty
author iuc
date Wed, 12 Nov 2025 12:57:39 +0000
parents f20b704ba069
children
line wrap: on
line source

<tool id="samtools_ampliconclip" name="Samtools ampliconclip" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" 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
            #if $write_primer_counts:
                --primer-counts '${primer_counts}'
            #end if
            -@ \$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), unchecked = default soft-clipping" />
        <param argument="--strand" type="boolean" checked="false" truevalue="--strand" falsevalue="" label="only clip reads that match bed file strand annotation" />
        <param argument="--both-ends" type="boolean" checked="false" truevalue="--both-ends" falsevalue="" label="clip both ends of reads (false = 5' only)" />
        <param 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 argument="--tolerance" type="integer" value="5" min="0"  label="Tolerance" help="match region within this number of bases, default 5." />
        <param name="write_primer_counts" type="boolean" checked="false" truevalue="true" falsevalue="false" label="Write primer counts" help="If enabled, write primer counts to output file." />
    </inputs>
    <outputs>
        <data name="output_bam" format="bam" />
        <data name="primer_counts" format="bedgraph" label="${tool.name} on ${on_string}: Primer counts">
            <filter>write_primer_counts</filter>
        </data>
    </outputs>
    <tests>
        <!-- 1) -->
        <test expect_num_outputs="1">
            <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 expect_num_outputs="1">
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <param name="strand" value="true" />
            <output name="output_bam" file="eboVir3.clipped.strand.bam" ftype="bam" lines_diff="16" />
        </test>
        <!-- 3) testing hard clip-->
        <test expect_num_outputs="1">
            <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="true" />
            <output name="output_bam" file="eboVir3.hardclipped.bam" ftype="bam" lines_diff="14" />
        </test>
        <!-- 4) testing strand and min length-->
        <test expect_num_outputs="1">
            <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="true" />
            <param name="tolerance" value="6" />
            <param name="both_ends" value="true" />
            <param name="no_excluded" value="true" />
            <output name="output_bam" file="eboVir3.clipped.strand_gt30.bam" ftype="bam" lines_diff="13" />
        </test>
        <!-- 5) testing write_primer_counts -->
        <test expect_num_outputs="2">
            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
            <param name="input_bam" value="eboVir3.bam" ftype="bam" />
            <param name="write_primer_counts" value="true" />
            <output name="output_bam" file="eboVir3.clipped.bam" ftype="bam" lines_diff="22" />
            <output name="primer_counts" file="eboVir3.primer_counts.txt" ftype="bedgraph" />
        </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>