view vardict.xml @ 3:e0734e88a104 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vardict commit 80e3742f499e8efabad1fe7627201466d0bdd190"
author iuc
date Thu, 27 Jan 2022 15:19:23 +0000
parents d262577e04b0
children
line wrap: on
line source

<tool id="vardict_java" name="VarDict" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>calls SNVs and indels for tumor-normal pairs</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="3.10.2">python</requirement>
        <requirement type="package" version="@TOOL_VERSION@">vardict-java</requirement>
        <requirement type="package" version="5.1.0">gawk</requirement>
        <requirement type="package" version="1.14">samtools</requirement>
    </requirements>
    <expand macro="stdio" />
    <command detect_errors="exit_code"><![CDATA[
        #if $select_mode.mode == "paired"
            ln -s '$select_mode.normal' ./normal.bam &&
            ln -s '$select_mode.normal.metadata.bam_index' ./normal.bam.bai &&
        #end if
        ln -s '$select_mode.tumor' ./tumor.bam &&
        ln -s '$select_mode.tumor.metadata.bam_index' ./tumor.bam.bai &&

        ## INDEX REFERENCE FASTA FILE IF FROM HISTORY
        #if $reference_source.reference_source_selector == "history":
            ln -s '$reference_source.ref_file' ./ref.fa &&
            samtools faidx ./ref.fa 2>&1 || echo 'Error running samtools faidx for indexing fasta reference for vardict' >&2 &&
        #else if $reference_source.reference_source_selector == "cached"
            ln -s '$reference_source.ref_file.fields.path' ./ref.fa &&
            ln -s '${reference_source.ref_file.fields.path}.fai' ./ref.fa.fai &&
        #end if

        ## build BED file from chromosome list
        #if $interval_file:
            grep -w -f '$interval_file' ./ref.fa.fai > ./chromosomes.fa.fai &&
        #else
            ln -s ./ref.fa.fai ./chromosomes.fa.fai &&
        #end if
        python '$__tool_directory__/split.py' ./chromosomes.fa.fai "\${VARDICT_CHUNKSIZE:-1000000}" "\${VARDICT_OVERLAP:-150}" > ./regions.bed &&

        vardict-java
        #if $select_mode.mode == "paired"
            -b "./tumor.bam|./normal.bam"
            -N 'Tumor'
        #else
            -b "./tumor.bam"
            -N 'Sample'
        #end if
        -G ./ref.fa
        -z
        -th \${GALAXY_SLOTS:-1}

        -f '$advancedsettings.f'
        -k '$advancedsettings.k'
        -r '$advancedsettings.r'
        -B '$advancedsettings.B'
        -Q '$advancedsettings.Q'
        -q '$advancedsettings.q'
        -m '$advancedsettings.m'
        -T '$advancedsettings.T'
        -X '$advancedsettings.X'
        -P '$advancedsettings.P'
        -o '$advancedsettings.o'
        -O '$advancedsettings.O'
        -V '$advancedsettings.V'

        ## construct VFC table
        -c 1 -S 2 -E 3 -g 4
        ./regions.bed

        ## postprocessing
        #if $select_mode.mode == "paired"
            | testsomatic.R
            | var2vcf_paired.pl
            -N 'Tumor|Normal'
        #else
            | teststrandbias.R
            | var2vcf_valid.pl
            -N 'Sample'
            -E
        #end if
         -f '$advancedsettings.f'

        > '$all_variants' &&

        ## Filter for PASS variants
        awk 'BEGIN {FS=OFS="\t"} substr(\$0, 1, 1) == "#" {print \$0; next} \$7 == "PASS" {print \$0}' '$all_variants' > '$passed_variants'
    ]]></command>
    <inputs>
        <conditional name="select_mode">
            <param name="mode" type="select" label="Choose run mode">
                <option value="single">Single sample mode</option>
                <option value="paired" selected="true">Paired variant calling</option>
            </param>
            <when value="single">
                <expand macro="input_default" />
            </when>
            <when value="paired">
                <param name="normal" type="data" format="bam" label="Normal file" />
                <expand macro="input_default" />
            </when>
        </conditional>
        <section name="advancedsettings" title="Advanced Settings" expanded="false">
            <param argument="-f" type="float" min="0.0" max="1.0" value="0.01" label="Minimum variant allele fraction" />
            <param argument="-k" type="boolean" truevalue="1" falsevalue="0" checked="true" label="Indicate whether to perform local realignment" />
            <param argument="-r" type="integer" min="0" value="2" label="Minimum number of reads supporting the variant" />
            <param argument="-B" type="integer" min="0" value="2" label="Minimum number of reads for determining strand bias" />
            <param argument="-Q" type="integer" min="0" value="1" label="Minimum mapping quality for reads to be considered" />
            <param argument="-m" type="integer" value="8" label="Maximum number of mismatches before a read is no longer considered (gaps are not counted as mismatches)" />
            <param argument="-T" type="integer" value="0" label="Maximum number of bases considered from 5' end (default: 0, no trimming)" />
            <param argument="-X" type="integer" value="3" label="Maximum number of extended based after indel to look for mismatches" />
            <param argument="-P" type="integer" value="5" label="Maximum average read position for a variant to be considered." />
            <param argument="-q" type="integer" value="25" label="Minimum phred score for a base to be considered a good call" />
            <param argument="-o" type="float" value="1.5" label="Minimum quality ratio [(good_quality_reads)/(bad_quality_reads+0.5)] (based on definition of a good call; see previous option)" />
            <param argument="-O" type="float" min="0" value="0" label="Minimum average mapping quality" />
            <param argument="-V" type="float" min="0.0" max="1.0" value="0.05" label="Maximum allowed variant allele fraction in the normal sample" />
        </section>
        <expand macro="ref_select" />
    </inputs>
    <outputs>
        <data name="all_variants" format="vcf" label="VarDict SNVs and Indels (All)" />
        <data name="passed_variants" format="vcf" label="VarDict SNVs and Indels (Passed)" />
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <conditional name="select_mode">
                <param name="mode" value="paired" />
                <param name="normal" ftype="bam" value="normal.bam" />
                <param name="tumor" ftype="bam" value="tumor.bam" />
            </conditional>
            <conditional name="reference_source">
                <param name="reference_source_selector" value="history"/>
                <param name="ref_file" ftype="fasta" value="genome.fasta" />
            </conditional>

            <output name="all_variants" compare="re_match_multiline" file="all_variants_paired.vcf" />
            <output name="passed_variants" compare="re_match_multiline" file="passed_variants_paired.vcf" />
        </test>
        <test expect_num_outputs="2">
            <conditional name="select_mode">
                <param name="mode" value="paired" />
                <param name="normal" ftype="bam" value="normal.bam" />
                <param name="tumor" ftype="bam" value="tumor.bam" />
            </conditional>
            <conditional name="reference_source">
                <param name="reference_source_selector" value="cached"/>
                <param name="ref_file" value="test_buildid"/>
            </conditional>

            <output name="all_variants" compare="re_match_multiline" file="all_variants_paired.vcf" />
            <output name="passed_variants" compare="re_match_multiline" file="passed_variants_paired.vcf" />
        </test>
        <test expect_num_outputs="2">
            <conditional name="select_mode">
                <param name="mode" value="single" />
                <param name="tumor" ftype="bam" value="tumor.bam" />
            </conditional>
            <conditional name="reference_source">
                <param name="reference_source_selector" value="cached"/>
                <param name="ref_file" value="test_buildid"/>
            </conditional>
            <output name="all_variants" compare="re_match_multiline" file="all_variants_single.vcf" />
            <output name="passed_variants" compare="re_match_multiline" file="passed_variants_single.vcf" />
        </test>
    </tests>
    <help>
        <![CDATA[
VarDict
=======

VarDict is a sensitive variant caller for both single and paired sample variant calling from BAM files.
VarDict implements several novel features such as amplicon bias aware variant calling from targeted sequencing experiments,
rescue of long indels by realigning bwa soft clipped reads and better scalability than many other Java based variant callers.

For more information see the VarDict documentation_.

.. _documentation: https://github.com/AstraZeneca-NGS/VarDictJava
        ]]>
    </help>
    <citations>
        <citation type="doi">10.1093/nar/gkw227</citation>
    </citations>
</tool>