view merge.xml @ 0:6331d804f983 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/delly commit 86ada42b811af0262618636f2d8d1788274f9884"
author iuc
date Mon, 28 Sep 2020 07:45:03 +0000
parents
children 97c7441aed0d
line wrap: on
line source

<?xml version="1.0"?>
<tool id="delly_merge" name="Delly merge" version="@TOOL_VERSION@+galaxy0" profile="18.01">
    <description>structural variants across/within VCF/BCF file(s)</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
## initialize 
#for $i, $current in enumerate($samples)
    #if $current.is_of_type('vcf')
        bcftools view -Ob '$current' > 'sample_${i}.bcf.gz' &&
        bcftools index 'sample_${i}.bcf.gz' &&
    #else
        ln -s '${current}' 'sample_${i}.bcf.gz' &&
        ln -s '${current.metadata.bcf_index}' 'sample_${i}.bcf.gz.csi' &&
    #end if
#end for

## run
delly merge
## generic options
--outfile 'result.bcf'
--chunks $generic.chunks
--vaf $generic.vaf
--coverage $generic.coverage
--minsize $generic.minsize
--maxsize $generic.maxsize
$generic.precise
$generic.pass
## overlap options
--bp-offset $overlap.bpoffset
--rec-overlap $overlap.recoverlap
## samples
#for $i, $current in enumerate($samples)
    'sample_${i}.bcf.gz'
#end for

## postprocessing
#if 'log' in $oo.out
    |& tee 'log.txt'
#end if
#if 'vcf' in $oo.out
    && test -f 'result.bcf' && bcftools view 'result.bcf' > 'result.vcf' || echo 'No results.'
#end if
    ]]></command>
    <inputs>
        <expand macro="samples" format="bcf,vcf"/>
        <section name="generic" title="Generic options" expanded="true">
            <param argument="--chunks" type="integer" value="500" label="Set maximum chunk size to merge groups of BCF files"/>
            <param argument="--vaf" type="float" value="0.15" min="0.0" max="1.0" label="Set minimum fractional ALT support"/>
            <param argument="--coverage" type="integer" value="10" label="Set minimum coverage"/>
            <param argument="--minsize" type="integer" value="0" label="Set minimum SV size"/>
            <param argument="--maxsize" type="integer" value="1000000" label="Set maximum SV size"/>
            <param argument="--precise" type="boolean" truevalue="--precise" falsevalue="" label="Filter sites for PRECISE?"/>
            <param argument="--pass" type="boolean" truevalue="--pass" falsevalue="" label="Filter sites for PASS?"/>
        </section>
        <section name="overlap" title="Overlap options" expanded="true">
            <param name="bpoffset" type="integer" value="1000" label="Set maximum breakpoint offset" help="(--bp-offset)"/>
            <param name="recoverlap" type="float" value="0.8" label="Set minimum reciprocal overlap" help="(--rec-overlap)"/>
        </section>
        <section name="oo" title="Output options">
            <param name="out" type="select" multiple="true" optional="false" label="Select output file(s)">
                <option value="bcf" selected="true">BCF</option>
                <option value="vcf">VCF</option>
                <option value="log">Log</option>
            </param>
        </section>
    </inputs>
    <outputs>
        <expand macro="vcf"/>
        <expand macro="bcf"/>
        <expand macro="log"/>
    </outputs>
    <tests>
        <!-- #1 default, bcf -->
        <test expect_num_outputs="2">
            <param name="samples" value="call_1.bcf.gz,call_2.bcf.gz"/>
            <section name="oo">
                <param name="out" value="vcf,bcf"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="1851" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="128"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO"/>
                </assert_contents>
            </output>
        </test>
        <!-- #2 bcf-->
        <test expect_num_outputs="3">
            <param name="samples" value="call_1.bcf.gz,call_2.bcf.gz"/>
            <section name="generic">
                <param name="chunks" value="500"/>
                <param name="vaf" value="0.16"/>
                <param name="coverage" value="10"/>
                <param name="minsize" value="0"/>
                <param name="maxsize" value="1000000"/>
                <param name="precise" value="true"/>
                <param name="pass" value="true"/>
            </section>
            <section name="overlap">
                <param name="bp-offset" value="1000"/>
                <param name="rec-overlap" value="0.79"/>
            </section>
            <section name="oo">
                <param name="out" value="vcf,bcf,log"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="1851" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="128"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO"/>
                    <has_text_matching expression="chr5&#009;75911568.+"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done\."/>
                </assert_contents>
            </output>
        </test>
        <!-- #3 default, vcf -->
        <test expect_num_outputs="2">
            <param name="samples" value="call_1.vcf.gz,call_2.vcf.gz"/>
            <section name="oo">
                <param name="out" value="vcf,bcf"/>
            </section>
            <output name="out_bcf">
                <assert_contents>
                    <has_size value="1851" delta="10"/>
                </assert_contents>
            </output>
            <output name="out_vcf">
                <assert_contents>
                    <has_n_lines n="128"/>
                    <has_line line="##fileformat=VCFv4.2"/>
                    <has_line line="#CHROM&#009;POS&#009;ID&#009;REF&#009;ALT&#009;QUAL&#009;FILTER&#009;INFO"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
.. class:: infomark

**What it does**

@WID@

Delly *merge* merges SV sites into a unified site list.

**Input**

BCF or VCF files.

**Output**

A single BCF file.

.. class:: infomark

**References**

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