view bcftools_query.xml @ 7:e0ad88dec40d draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit 2684e1443f03bfe2ae20c31d23817415ec8f7e69
author iuc
date Thu, 21 Feb 2019 16:05:32 -0500
parents 24ff7b989329
children 0770b1203e90
line wrap: on
line source

<?xml version='1.0' encoding='utf-8'?>
<tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@TOOL_VERSION@">
    <description>Extracts fields from VCF/BCF file and prints them in user-defined format</description>
    <macros>
        <token name="@EXECUTABLE@">query</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="aggressive"><![CDATA[
@PREPARE_ENV@
@PREPARE_INPUT_FILES@
#set $section = $sec_restrict
@PREPARE_TARGETS_FILE@
@PREPARE_REGIONS_FILE@

bcftools @EXECUTABLE@

## Query section
#set $section = $sec_query
  --format '${section.format}'

${section.allow_undef_tags}

${section.print_header}

## Default section
#set $section = $sec_restrict
@INCLUDE@
@EXCLUDE@
@COLLAPSE@
@REGIONS@
@SAMPLES@
@TARGETS@

## Primary Input/Outputs
--vcf-list @INPUT_LIST_FILE@
> $output_file
]]>
    </command>
    <inputs>
        <expand macro="macro_inputs" />
        <section name="sec_restrict" expanded="false" title="Restrict to">
            <expand macro="macro_collapse" />
            <expand macro="macro_samples" />
            <expand macro="macro_regions" />
            <expand macro="macro_targets" />
            <expand macro="macro_include" />
            <expand macro="macro_exclude" />
        </section>
        <section name="sec_query" expanded="true" title="Query Options">
            <param name="format" type="text" value="" label="Format for Output">
                <help>
                <![CDATA[ 
                Example: %CHROM\t%POS\t%REF\t%ALT{0}\n
                ( NOTE TAB: '\t' and new line character: '\n' )
                ]]>
                </help>
                <sanitizer sanitize="False"/>
                <validator type="empty_field" />
            </param>
            <param name="tsv" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Output is tab-delimited"
                   help="Fields in your Format are separated by a TAB character: \t"/>
            <param name="allow_undef_tags" type="boolean" truevalue="--allow-undef-tags" falsevalue="" label="Allow Undefined Tags" 
                   help="Print &quot;.&quot; for undefined tags" />
            <param name="print_header" type="boolean" truevalue="--print-header" falsevalue="" label="Print Header Line" />
        </section>

    </inputs>
    <outputs>
        <data name="output_file" format="txt">
            <change_format>
                <when input="tsv" value="True" format="tabular" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input_files" ftype="vcf" value="query.vcf" />
            <param name="format" value="%CHROM\t%POS\t%REF\t%ALT\t%DP4\t%AN[\t%GT\t%TGT]\n" />
            <param name="tsv" value="True" />
            <output name="output_file" file="query.out" />
        </test>
    </tests>
    <help><![CDATA[ 
=====================================
 bcftools @EXECUTABLE@
=====================================

Extracts fields from VCF/BCF file and prints them in user-defined format

  Format:

  ::

    ``%CHROM``          The CHROM column (similarly also other columns: POS, ID, REF, ALT, QUAL, FILTER)
    ``%INFO/TAG``       Any tag in the INFO column
    ``%TYPE``           Variant type (REF, SNP, MNP, INDEL, OTHER)
    ``%MASK``           Indicates presence of the site in other files (with multiple files)
    ``%TAG{INT}``       Curly brackets to subscript vectors (0-based)
    ``%FIRST_ALT``      Alias for %ALT{0}
    ``[]``              The brackets loop over all samples
    ``%GT``             Genotype (e.g. 0/1)
    ``%TBCSQ``          Translated FORMAT/BCSQ. See the csq command above for explanation and examples.
    ``%TGT``            Translated genotype (e.g. C/A)
    ``%IUPACGT``        Genotype translated to IUPAC ambiguity codes (e.g. M instead of C/A)
    ``%LINE``           Prints the whole line
    ``%SAMPLE``         Sample name
    ``%POS0``           POS in 0-based coordinates
    ``%END``            End position of the REF allele
    ``%END0``           End position of the REF allele in 0-based cordinates
    ``\n``              new line
    ``\t``              tab character


  Examples:

  ::

    # Print chromosome, position, ref allele and the first alternate allele
    bcftools query -f '%CHROM  %POS  %REF  %ALT{0}\n' file.vcf.gz

    # Similar to above, but use tabs instead of spaces, add sample name and genotype
    bcftools query -f '%CHROM\t%POS\t%REF\t%ALT[\t%SAMPLE=%GT]\n' file.vcf.gz

    # Print FORMAT/GT fields followed by FORMAT/GT fields
    bcftools query -f 'GQ:[ %GQ] \t GT:[ %GT]\n' file.vcf

    # Make a BED file: chr, pos (0-based), end pos (1-based), id
    bcftools query -f'%CHROM\t%POS0\t%END\t%ID\n' file.bcf


@COLLAPSE_HELP@
@REGIONS_HELP@
@TARGETS_HELP@
@EXPRESSIONS_HELP@

@BCFTOOLS_MANPAGE@#@EXECUTABLE@

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