view annotate.xml @ 5:7ca2fba4be83 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sansa commit 2b5715a0d106f6d0785ce518ec11651b1eacd032
author iuc
date Fri, 11 Oct 2024 13:13:50 +0000
parents b1ca9fce4749
children
line wrap: on
line source

<?xml version="1.0"?>
<tool id="sansa_annotate" name="sansa annotate" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.01">
    <description>structural variants</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="edam_topics"/>
    <expand macro="edam_operations"/>
    <expand macro="requirements"/>
    <expand macro="version_command"/>
    <command detect_errors="exit_code"><![CDATA[
## initialize
## file format gtf.gz is required
#if $type_cond.type_sel == 'fg' or $type_cond.type_sel == 'sfg'
    gzip -c '$type_cond.fg.gtf' > 'db.gtf.gz' &&
#end if

## run
sansa annotate
## sv annotation options
#if $type_cond.type_sel == 's' or $type_cond.type_sel == 'sfg'
    --db '$type_cond.s.db'
    --bpoffset $type_cond.s.bpoffset
    --ratio $type_cond.s.ratio
    --strategy '$type_cond.s.strategy'
    $type_cond.s.notype
    $type_cond.s.nomatch
#end if
## feature and gene annotation options
#if $type_cond.type_sel == 'fg' or $type_cond.type_sel == 'sfg'
    --gtf 'db.gtf.gz'
    --id '$type_cond.fg.id'
    --feature '$type_cond.fg.feature'
    --distance $type_cond.fg.distance
    $type_cond.fg.contained
#end if
## input
'$input'

## postprocessing
2>&1 | tee -a '$out_log'
    ]]></command>
    <inputs>
        <param name="input" type="data" format="vcf" label="Select input file"/>
        <conditional name="type_cond">
            <param name="type_sel" type="select" label="Select annotation mode(s)">
                <option value="s" selected="true">SV</option>
                <option value="fg">Feature/Gene</option>
                <option value="sfg">SV and Feature/Gene</option>
            </param>
            <when value="s">
                <expand macro="s"/>
            </when>
            <when value="fg">
                <expand macro="fg"/>
            </when>
            <when value="sfg">
                <expand macro="s"/>
                <expand macro="fg"/>
            </when>
        </conditional>
        <section name="oo" title="Output options" expanded="true">
            <param name="out" type="select" multiple="true" optional="false" label="Select output file(s)">
                <option value="anno" selected="true">Annotation</option>
                <option value="log">Log</option>
                <option value="query">Query SV</option>
            </param>
        </section>
    </inputs>
    <outputs>
        <data name="out_anno" format="bcf" from_work_dir="anno.bcf" label="${tool.name} on ${on_string}: Annotation">
            <filter>'anno' in oo['out']</filter>
        </data>
        <data name="out_query" format="tabular.gz" from_work_dir="query.tsv.gz" label="${tool.name} on ${on_string}: Query SV">
            <filter>'query' in oo['out']</filter>
        </data>
        <data name="out_log" format="txt" label="${tool.name} on ${on_string}: Log">
            <filter>'log' in oo['out']</filter>
        </data>
    </outputs>
    <tests>
        <!-- #1 s, default -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="s"/>
                <section name="s">
                    <param name="db" value="db.vcf"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="55495" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="91"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
        <!-- #2 s, custom -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="s"/>
                <section name="s">
                    <param name="db" value="db.vcf"/>
                    <param name="bpoffset" value="51"/>
                    <param name="ratio" value="0.79"/>
                    <param name="strategy" value="all"/>
                    <param name="notype" value="true"/>
                    <param name="nomatch" value="true"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="55495" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="91"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
        <!-- #3 fg, default -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="fg"/>
                <section name="fg">
                    <param name="gtf" value="db.gtf"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="2408" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="91"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
        <!-- #4 fg, custom -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="fg"/>
                <section name="fg">
                    <param name="gtf" value="db.gtf"/>
                    <param name="id" value="gene_id"/>
                    <param name="feature" value="exon"/>
                    <param name="distance" value="1001"/>
                    <param name="contained" value="true"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="2408" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="101"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
        <!-- #5 sfg, default -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="sfg"/>
                <section name="s">
                    <param name="db" value="db.vcf"/>
                </section>
                <section name="fg">
                    <param name="gtf" value="db.gtf"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="55495" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="91"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
        <!-- #6 sfg, custom -->
        <test expect_num_outputs="3">
            <param name="input" value="input.vcf"/>
            <conditional name="type_cond">
                <param name="type_sel" value="sfg"/>
                <section name="s">
                    <param name="db" value="db.vcf"/>
                    <param name="bpoffset" value="51"/>
                    <param name="ratio" value="0.79"/>
                    <param name="strategy" value="all"/>
                    <param name="notype" value="true"/>
                    <param name="nomatch" value="true"/>
                </section>
                <section name="fg">
                    <param name="gtf" value="db.gtf"/>
                    <param name="id" value="gene_id"/>
                    <param name="feature" value="exon"/>
                    <param name="distance" value="1001"/>
                    <param name="contained" value="true"/>
                </section>
            </conditional>
            <section name="oo">
                <param name="out" value="anno,log,query"/>
            </section>
            <output name="out_anno">
                <assert_contents>
                    <has_size value="55495" delta="50"/>
                </assert_contents>
            </output>
            <output name="out_query">
                <assert_contents>
                    <has_size value="101"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text_matching expression=".+Done.+"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
.. class:: infomark

**What it does**

Sansa *annotate* is a structural variant (SV) annotation tool.

**Input**

- Sample (VCF)
- Gene annotation (GTF/GFF2/GFF3)
- Annotation database, e.g. `gnomAD-SV <https://gnomad.broadinstitute.org/>`_ or `1000 Genomes phase 3 <https://www.internationalgenome.org/phase-3-structural-variant-dataset>`_

**Output**

- Anno (BCF) with annotation SVs augmented by a unique ID (INFO/ANNOID) 
- Query (TABULAR.GZ) with query SVs matched to annotation IDs

.. class:: infomark

**References**

More information are available on `GitHub <https://github.com/dellytools/sansa>`_.
    ]]></help>
    <citations>
        <citation type="doi">10.1093/bioinformatics/bts378</citation>
    </citations>
</tool>