view filter.xml @ 3:d2590fe6793f draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/delly commit d76130cdcb21f0390b4e68e733d38575fd5cc6c7"
author iuc
date Tue, 14 Dec 2021 19:06:53 +0000
parents 6184cfc70e28
children
line wrap: on
line source

<?xml version="1.0"?>
<tool id="delly_filter" name="Delly filter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="18.01">
    <description>somatic or germline structural variants</description>
    <expand macro="bio_tools"/>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
## initialize
#if $input.is_of_type('vcf')
    bcftools view -Ob '$input' > 'input.bcf.gz' &&
    bcftools index 'input.bcf.gz' &&
#else
    ln -s '${input}' 'input.bcf.gz' &&
    ln -s '${input.metadata.bcf_index}' 'input.bcf.gz.csi' &&
#end if

## run
delly filter
## generic options
--filter $sv.mode_cond.mode_sel
--outfile 'result.bcf'
--altaf $generic.altaf
--minsize $generic.minsize
--maxsize $generic.maxsize
--ratiogeno $generic.ratiogeno
$generic.pass
## somatic options
#if $sv.mode_cond.mode_sel == 'somatic'
    --samples '$sv.mode_cond.samples'
    --coverage $sv.mode_cond.coverage
    --controlcontamination $sv.mode_cond.controlcontamination
## germline options
#else if $sv.mode_cond.mode_sel == 'germline'
    --gq $sv.mode_cond.gq
    --rddel $sv.mode_cond.rddel
    --rddup $sv.mode_cond.rddup
#end if
## input
'input.bcf.gz'

## postprocessing
@LOG@
@VCF@
    ]]></command>
    <inputs>
        <expand macro="input" format="bcf,vcf" label="Select input file"/>
        <section name="generic" title="Generic options" expanded="true">
            <param argument="--altaf" type="float" value="0.2" min="0.0" max="1.0" label="Set minimum fractional ALT support"/>
            <expand macro="minsize" default="0" label="Set minimum SV size"/>
            <expand macro="maxsize" default="500000000" label="Set maximum SV size"/>
            <param argument="--ratiogeno" type="float" value="0.75" min="0.0" max="1.0" label="Set minimum fraction of genotyped samples"/>
            <param argument="--pass" type="boolean" truevalue="--pass" falsevalue="" label="Filter sites for PASS?"/>
        </section>
        <section name="sv" title="SV calling options" expanded="true">
            <conditional name="mode_cond">
                <param name="mode_sel" type="select" label="Select filter mode" help="(--filter)">
                    <option value="somatic" selected="true">Somatic</option>
                    <option value="germline">Germline</option>
                </param>
                <when value="somatic">
                    <expand macro="samples"/>
                    <expand macro="coverage" label="Set minimum coverage in tumor"/>
                    <param argument="--controlcontamination" type="float" value="0.0" min="0.0" max="1.0" label="Set maximum fractional ALT support in control"/>
                </when>
                <when value="germline">
                    <param argument="--gq" type="integer" value="15" label="Set minimum median GQ for carriers and non-carriers"/>
                    <param argument="--rddel" type="float" value="0.8" label="Set maximum read-depth ratio of carrier vs. non-carrier for a deletion"/>
                    <param argument="--rddup" type="float" value="1.2" label="Set minimum read-depth ratio of carrier vs. non-carrier for a duplication"/>
                </when>
            </conditional>
        </section>
        <section name="oo" title="Output options" expanded="true">
            <param name="out" type="select" multiple="true" optional="false" label="Select output file(s)">
                <option value="bcf" selected="true">BCF</option>
                <option value="log">Log</option>
                <option value="vcf">VCF</option>
            </param>
        </section>
    </inputs>
    <outputs>
        <expand macro="bcf"/>
        <expand macro="log"/>
        <expand macro="vcf"/>
    </outputs>
    <tests>
        <!-- #1 default, somatic, bcf -->
        <test expect_num_outputs="2">
            <param name="input" value="call_1.bcf.gz"/>
            <section name="sv">
                <conditional name="mode_cond">
                    <param name="mode_sel" value="somatic"/>
                    <param name="samples" value="samples.tsv"/>
                </conditional>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="2281" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="140"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO&#009;FORMAT&#009;NORMAL&#009;TUMOR"/>
                </assert_contents>
            </output>
        </test>
        <!-- #2 somatic, bcf -->
        <test expect_num_outputs="3">
            <param name="input" value="call_1.bcf.gz"/>
            <section name="generic">
                <param name="altaf" value="0.3"/>
                <param name="minsize" value="1"/>
                <param name="maxsize" value="500000001"/>
                <param name="ratiogeno" value="0.76"/>
                <param name="pass" value="true"/>
            </section>
            <section name="sv">
                <conditional name="mode_cond">
                    <param name="mode_sel" value="somatic"/>
                    <param name="samples" value="samples.tsv"/>
                    <param name="coverage" value="11"/>
                    <param name="controlcontamination" value="0.1"/>
                </conditional>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf,log"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="2281" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done\."/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="140"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO&#009;FORMAT&#009;NORMAL&#009;TUMOR"/>
                </assert_contents>
            </output>
        </test>
       <!-- #3 default, germline, bcf -->
        <test expect_num_outputs="2">
            <param name="input" value="call_1.bcf.gz"/>
            <section name="sv">
                <conditional name="mode_cond">
                    <param name="mode_sel" value="germline"/>
                </conditional>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="2264" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="139"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO&#009;FORMAT&#009;NORMAL&#009;TUMOR"/>
                </assert_contents>
            </output>
        </test>
        <!-- #4 germline, bcf -->
        <test expect_num_outputs="3">
            <param name="input" value="call_1.bcf.gz"/>
            <section name="generic">
                <param name="altaf" value="0.1"/>
                <param name="minsize" value="1"/>
                <param name="maxsize" value="500000001"/>
                <param name="ratiogeno" value="0.76"/>
                <param name="pass" value="true"/>
            </section>
            <section name="sv">
                <conditional name="mode_cond">
                    <param name="mode_sel" value="germline"/>
                    <param name="gq" value="14"/>
                    <param name="rddel" value="0.7"/>
                    <param name="rddup" value="1.3"/>
                </conditional>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf,log"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="2264" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done\."/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="139"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO&#009;FORMAT&#009;NORMAL&#009;TUMOR"/>
                </assert_contents>
            </output>
        </test>
        <!-- #5 default, somatic, vcf -->
        <test expect_num_outputs="2">
            <param name="input" value="call_1.vcf.gz"/>
            <section name="sv">
                <conditional name="mode_cond">
                    <param name="mode_sel" value="somatic"/>
                    <param name="samples" value="samples.tsv"/>
                </conditional>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="2451" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="143"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO&#009;FORMAT&#009;NORMAL&#009;TUMOR"/>
                </assert_contents>
            </output>
        </test>
    </tests>
   <help><![CDATA[
.. class:: infomark

**What it does**

@WID@

**Input**

*Somatic* filtering requires a called SV input with at least one tumor sample and a matched control sample. In addition, a tab-delimited sample description needs to be provided, in which the first column holds the sample ids (as found in the VCF/BCF input) and the second column specifies either tumor or control.

*Germline* SV calling is done by sample for high-coverage genomes or in small batches for low-coverage genomes.

**Output**

The output is available in BCF and VCF format. Additionally a log file is provided.

.. class:: infomark

**References**

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