view gemini_annotate.xml @ 1:d3c4d0208bb2 draft

Uploaded
author iuc
date Wed, 27 Aug 2014 02:26:19 -0400
parents 720cbfb4190d
children 93bb0cfacefb
line wrap: on
line source

<tool id="gemini_@BINARY@" name="GEMINI @BINARY@" version="@VERSION@.0">
    <description>adding your own custom annotations</description>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <macros>
        <import>gemini_macros.xml</import>
        <token name="@BINARY@">annotate</token>
    </macros>
    <command>
<![CDATA[

bgzip -c $annotate_source > tabixed.gz;
tabix -p bed tabixed.gz;

        gemini @BINARY@
            -f tabixed.gz
            -c $column_name
            -a $a.a_selector
            #if $a.a_selector == 'extract':
                -t $a.column_type
                -e $a.column_extracts
                -o $a.operation
            #end if

            "${ infile }"
            > "${ outfile }"
]]>

    </command>
    <expand macro="stdio" />
    <inputs>
        <param name="infile" type="data" format="sqlite" label="GEMINI database" />
        <param name="annotate_source" type="data" format="bed" label="File containing the annotations in BED format" help="(-f)"/>

        <param name="column_name" size="20" type="text" value=""
            label="The name of the column to be added to the variant table" help="(-c)">
            <sanitizer invalid_char=" ">
                <valid initial="string.letters,string.digits">
                    <add value="_" /> 
                </valid>
            </sanitizer>
        </param>
        <conditional name="a">
            <param name="a_selector" type="select" label="How should the annotation file be used?" help="(-a)">
                <option value="boolean">Did a variant overlap a region or not? (boolean)</option>
                <option value="count">How many regions did a variant overlap? (count)</option>
                <option value="extract" selected="True">Extract specific values from a BED file. (extract)</option>
            </param>
            <when value="extract">

                <param name="column_extracts" label="Column to extract information from for list annotations" 
                    type="data_column" data_ref="annotate_source" force_select="true" help="(-e)"/>


                <param name="column_type" type="select" label="What data type(s) should be used to represent the new values in the database?"
                    help="(-t)">
                    <option value="float">Decimal precision number (float)</option>
                    <option value="integer">Integer number (integer)</option>
                    <option value="text">Text columns such as “valid”, “yes” (text)</option>
                </param>

                <param name="operation" type="select" label="Operation to apply to the extract column values ..."
                    help="in the event that a variant overlaps multiple annotations in your annotation file. (-o)">
                    <option value="mean">Compute the average of the (numeric) values</option>
                    <option value="median">Compute the median of the (numeric) values</option>
                    <option value="mix">Compute the minimum of the (numeric) values</option>
                    <option value="max">Compute the maximum of the (numeric) values</option>
                    <option value="mode">Compute the maximum of the (numeric) values</option>
                    <option value="first">Use the value from the first record in the annotation file</option>
                    <option value="last">Use the value from the last record in the annotation file</option>
                    <option value="list">Create a comma-separated list of the observed (text) values</option>
                    <option value="uniq_list">Create a comma-separated list of non-redundant observed (text) values</option>
                </param>

            </when>
            <when value="boolean"/>
            <when value="count"/>
        </conditional>

    </inputs>
    <outputs>
        <data name="outfile" format="tabular" label="${tool.name} on ${on_string}" />
    </outputs>
    <tests>
        <test>
        </test>
    </tests>
    <help>
**What it does**

It is inevitable that researchers will want to enhance the gemini framework with their own, custom annotations. gemini provides a sub-command called annotate for exactly this purpose.

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