view bcftools_annotate.xml @ 22:d48904783c1d draft

Uploaded
author wrtz
date Fri, 15 Jan 2016 11:47:43 -0500
parents e32ce96a0e30
children
line wrap: on
line source

<tool id="bcftools_annotate" name="BCFtools annotate" version="1.0.0">
    <description>Add or remove annotations</description>
    <requirements>
        <requirement type="package" version="1.3">bcftools</requirement>
    </requirements>
    <command>
        #if str( $input_file_index ) != "None":
            ln -s -f $input input_file.${input.ext} &amp;&amp;
            ln -s -f $input_file_index input_file.${input.ext}.tbi &amp;&amp;
        #end if
        #if str( $annotations_cond.set_annotations ) == "True":
            ln -s -f $annotations_cond.annotations annot_file.${annotations_cond.annotations.ext} &amp;&amp;
            ln -s -f $annotations_cond.annotations_index annot_file.${annotations_cond.annotations.ext}.tbi &amp;&amp;
        #end if
        bcftools annotate
        --output "${output_file}"
        --output-type "${output_type}"
        #if str( $regions_file ) != "None":
            --regions-file "${regions_file}"
        #end if
        #if str( $annotations_cond.set_annotations ) == "True":
            --annotations annot_file.${annotations_cond.annotations.ext}
            #if str( $annotations_cond.columns ) != "":
                --columns "${annotations_cond.columns}"
            #end if
            #if str( $annotations_cond.mark_sites_cond.set_mark_sites ) == "True":
                --mark-sites
                #if str( $annotations_cond.mark_sites_cond.present_or_absent ) == "present":
                    "+${annotations_cond.mark_sites_cond.new_tag}"
                #else
                    "-${annotations_cond.mark_sites_cond.new_tag}"
                #end if
            #end if
        #end if
        #if str( $regions ) != "":
            --regions "${regions}"
        #end if
       #if str( $samples_file ) != "None":
            --samples-file "${samples_file}"
        #end if
        #if str( $samples ) != "":
            --samples "${samples}"
        #end if
        #if str( $header_lines ) != "None":
            --header-lines "${header_lines}"
        #end if
        #if str( $expr_cond.set_expr ) == "True":
            #if str( $expr_cond.include_or_exclude ) == "include":
                --include "${expr_cond.expr}"
            #else
                --exclude "${expr_cond.expr}"
            #end if
        #end if
        #if str( $rename_chrs ) != "None":
            --rename-chrs "${rename_chrs}"
        #end if
        #if str( $remove ) != "":
            --remove "${remove}"
        #end if

        #if str( $input_file_index ) != "None":
            input_file.${input.ext}
        #else
            $input
        #end if
    </command>
    <inputs>
        <param name="input" type="data" format="vcf,bcf,bgzip" label="VCF or BCF input file" help="Input file can optionally be compressed and indexed using Bgzip and Tabix Galaxy tools. In this case, select bgzipped file here and index below."/>
        <param name="input_file_index" type="data" optional="true" label="Input file index" help="Tabix-generated index for input file. Run Tabix Galaxy tool on bgzipped input file to create index."/>
        <param name="output_type" type="select" label="Output data type" help="-O">
            <option value="v" selected="true">VCF</option>
            <option value="b">BCF</option>
        </param>
        <conditional name="annotations_cond">
            <param name="set_annotations" type="boolean" checked="False" label="Set annotation file" help="-a, -c, -m"/>
            <when value="true">
                <param name="annotations" type="data" label="Compressed annotation file" help="-a. Bgzip-compressed VCF/ BED/ tab-delimited file with annotations. Run Bgzip Galaxy tool to compress annotation file."/>
                <param name="annotations_index" type="data" label="Compressed annotation file index" help="Tabix-generated index for annotation file. Run Tabix Galaxy tool on bgzipped annotation file to create index."/>
                <param name="columns" type="text" size="80" label="Annotation file columns" help="-c. Comma-separated list of columns or tags to carry over from the annotation file." />

                <conditional name="mark_sites_cond">
                    <param name="set_mark_sites" type="boolean" checked="False" label="Mark present/absent sites" help="-m. Annotate sites which are present or absent in the annotation file with a new INFO/TAG flag. Note: BCFtools has not implemented this yet for VCF files."/>
                    <when value="true">
                        <param name="present_or_absent" type="select" label="Mark present or absent sites">
                            <option value="present">Present</option>
                            <option value="absent">Absent</option>
                        </param>
                        <param name="new_tag" type="text" size="80" label="New INFO/TAG flag" />
                    </when>
                </conditional>

            </when>
        </conditional>

        <param name="regions_file" type="data" optional="true" label="Regions file" help="-R. Regions specified in a VCF, BED, or tab-delimited file with columns CHROM, POS, and, optionally, POS_TO."/>
        <param name="regions" type="text" size="80" optional="True" label="Regions list" help="-r. Comma-separated list of regions. Format: chr|chr:pos|chr:from-to|chr:from-[,...]">
            <sanitizer invalid_char="">
                <valid initial="string.digits"><add value="CHRchr-:,"/> </valid>
            </sanitizer>
        </param>
        <param name="samples_file" type="data" optional="true" label="Samples file" help="-S. File of sample names to include. One sample per line."/>
        <param name="samples" type="text" size="80" optional="True" label="Samples list" help="-s. Comma-separated list of samples to include or exclude. (Excludes if prefixed with ^)" />
        <param name="header_lines" type="data" optional="true" label="Header lines" help="-h. File containing lines to append to VCF header."/>
        <conditional name="expr_cond">
            <param name="set_expr" type="boolean" checked="False" label="Filter by expression" help="-i, -e. Include/ exclude sites for which expression is true. Must use valid expression."/>
            <when value="true">
                <param name="include_or_exclude" type="select" label="Include or exclude by expression">
                    <option value="include">Include</option>
                    <option value="exclude">Exclude</option>
                </param>
                <param name="expr" type="text" size="80" label="Expression">
                    <sanitizer invalid_char="">
                        <valid initial="string.letters,string.digits"><add value="~`!@#$%^&amp;*()-_=+[{]}\|;:'&quot;,&lt;.&gt;?/ " /> </valid>
                    </sanitizer>
                </param>
            </when>
        </conditional>
        <param name="rename_chrs" type="data" optional="true" label="Rename chromosomes" help="--rename-chrs. File containing chromosome renaming map, with &quot;old_name new_name\n&quot; pairs separated by whitespaces, each on a separate line."/>
        <param name="remove" type="text" size="80" label="List of annotations to remove" help="-x. Comma-separated list of annotations to remove." />
    </inputs>
    <outputs>
        <data name="output_file" format="vcf" label="${tool.name} on ${on_string}">
            <change_format>
                <when input="output_type" value="b" format="bcf" />
            </change_format>
        </data>
    </outputs>
    <help>
**About this tool**

**BCFtools annotate**: Add or remove annotations.

Please see https://samtools.github.io/bcftools/bcftools.html for more info on options.
  </help>
</tool>