view callvariants.xml @ 10:7e041c120b96 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bbtools commit cd59ba2c349865259b92302a1d70e103b8a5e3cb
author iuc
date Tue, 27 Aug 2024 10:14:45 +0000
parents 66b138a2e74c
children
line wrap: on
line source

<tool id="bbtools_callvariants" name="BBTools: call variants" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>in aligned Bam files</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio.tools"/>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
#import os

#if str($ref_source_cond.ref_source) == 'cached'
    #set ref = str($ref_source_cond.reference.fields.path)
#else:
    #set ref = $ref_source_cond.reference
#end if

## callvariants uses the file extension to determine the input format.
#set input_name = str($os.path.basename($input.file_name)) + '.bam'
ln -s '${input}' '${input_name}' &&

callvariants.sh in='${input_name}' threads=\${GALAXY_SLOTS:-4} ref='${ref}' ploidy=$ploidy
#if $output_variant_score_hist:
    shist='$output_scorehist'
#end if
#if $output_zygosity_hist:
    zhist='$output_zygosityhist'
#end if
#if $output_quality_hist:
    qhist='$output_qualityhist'
#end if
#if str($output_format) == 'vcf':
    vcf='out.vcf' && mv 'out.vcf' '$output'
#elif str($output_format) == 'gff':
    outgff='out.gff' && mv 'out.gff' '$output'
#else:
    out='output.txt' && mv 'output.txt' '$output'
#end if
]]></command>
    <inputs>
        <param name="input" type="data" format="bam" label="Bam file" help="Bam files produced by BBMap are recommended"/>
        <expand macro="reference_source_cond"/>
        <param name="ploidy" type="integer" min="1" value="1" label="Ploidy" help="See help section below"/>
        <param name="output_format" type="select" label="Select output format">
            <option value="vcf" selected="true">vcf</option>
            <option value="gff">gff</option>
            <option value="txt">txt</option>
        </param>
        <param name="output_variant_score_hist" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Output variant score histogram?"/>
        <param name="output_zygosity_hist" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Output zygosity histogram?"/>
        <param name="output_quality_hist" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Output quality histogram?"/>
    </inputs>
    <outputs>
        <data name="output" format="vcf">
            <change_format>
                <when input="output_format" value="gff" format="gff"/>
                <when input="output_format" value="txt" format="txt"/>
            </change_format>
        </data>
        <data name="output_scorehist" format="tabular" label="${tool.name} on ${on_string} (scorehist)">
            <filter>output_variant_score_hist</filter>
        </data>
        <data name="output_zygosityhist" format="tabular" label="${tool.name} on ${on_string} (zygosityhist)">
            <filter>output_zygosity_hist</filter>
        </data>
        <data name="output_qualityhist" format="tabular" label="${tool.name} on ${on_string} (qualityhist)">
            <filter>output_quality_hist</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="4">
            <param name="input" value="cv_input.bam" ftype="bam"/>
            <param name="ploidy" value="2"/>
            <param name="output_variant_score_hist" value="yes"/>
            <param name="output_zygosity_hist" value="yes"/>
            <param name="output_quality_hist" value="yes"/>
            <output name="output" file="cv_output.vcf" ftype="vcf" compare="diff" lines_diff="4"/>
            <output name="output_scorehist" file="cv_scorehist_output.tabular" ftype="tabular" compare="contains"/>
            <output name="output_zygosityhist" file="cv_zygosityhist_output.tabular" ftype="tabular" compare="contains"/>
            <output name="output_qualityhist" file="cv_qualityhist_output.tabular" ftype="tabular" compare="contains"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input" value="cv_input.bam" ftype="bam"/>
            <param name="ploidy" value="2"/>
            <param name="output_format" value="gff"/>
            <output name="output" file="cv_output.gff" ftype="gff" compare="contains" lines_diff="2"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input" value="cv_input.bam" ftype="bam"/>
            <param name="ploidy" value="2"/>
            <param name="output_format" value="txt"/>
            <output name="output" file="cv_output.txt" ftype="txt" compare="contains" lines_diff="2"/>
        </test>
    </tests>
    <help>
**What it does**

CallVariants is a high-speed, multithreaded variant caller that accepts bam files, and output VCF files.  It is capable
of indel realignment, multi-sample variant-calling, and processing samples with arbitrary ploidy.

BBMap is the recommended mapping program for CallVariants, but output from any aligner is acceptable.  Reads can be
realigned with the "realign" flag.  This is slower, but is highly recommended if the input is from any mapping tool
other than BBMap. Output from BBMap should not be realigned.

**Options**

 * **Ploidy** - Arbitrary ploidy is supported - the default is 1 which works for haploid organisms.  Allele fractions lower than those expected for the ploidy (for example, anything below 0.5 for a diploid, or 0.25 for a tetraploid) will incur a score penalty. When calling variants on non-haploid organisms, it is crucial to set the ploidy.

    </help>
    <expand macro="citations"/>
</tool>