view bcftools_merge.xml @ 4:df40d7f9737c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit 3edcac645f34d5a94884dedaf95c5774f4afc5c7
author iuc
date Sat, 11 Mar 2017 18:00:12 -0500
parents 5add48c63b9a
children c5c61f2f8757
line wrap: on
line source

<?xml version='1.0' encoding='utf-8'?>
<tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@VERSION@">
    <description>Merge multiple VCF/BCF files from non-overlapping sample sets to create one multi-sample file</description>
    <macros>
        <token name="@EXECUTABLE@">merge</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="aggressive"><![CDATA[
@PREPARE_ENV@
@PREPARE_INPUT_FILES@
bcftools @EXECUTABLE@

## Header section
#set $section = $sec_header
${section.print_header}
#if $section.use_header:
  --use-header "${section.use_header}"
#end if

## Merge section
#set $section = $sec_merge
${section.force_samples}

#if $section.info_rules:
  --info-rules "${section.info_rules}"
#end if

#if $section.merge:
  --merge "${section.merge}"
#end if

#set $section = $sec_restrict
@APPLY_FILTERS@
@REGIONS@

@OUTPUT_TYPE@
@THREADS@

## Primary Input/Outputs
@INPUT_FILES@
> "$output_file"
]]>
    </command>
    <inputs>
        <expand macro="macro_inputs" />
        <section name="sec_restrict" expanded="false" title="Restrict to">
            <expand macro="macro_apply_filters" />
            <expand macro="macro_regions" />
        </section>
        <section name="sec_merge" expanded="true" title="Merge Options">
            <param name="force_samples" type="boolean" truevalue="--force-samples" falsevalue="" label="Force Samples" help="Resolve duplicate sample names" />
            <param name="info_rules" type="text" label="Info Rules" help="Rules for merging INFO fields (method is one of sum,avg,min,max,join) or &quot;-&quot; to turn off the default [DP:sum,DP4:sum]" />
            <param name="merge" type="select" label="Merge" optional="True" 
                  help="Allow multiallelic records for: snps|indels|both|all|none|id, see man page for details [both]" >
                  <option value="none">none - no new multiallelics, output multiple records instead</option>
                  <option value="snps">snps - allow multiallelic SNP records</option>
                  <option value="indels">indels - allow multiallelic indel records</option>
                  <option value="both">both - both SNP and indel records can be multiallelic</option>
                  <option value="all">all - SNP records can be merged with indel records</option>
                  <option value="id">id - merge by ID</option>
            </param>
        </section>
        <section name="sec_header" expanded="false" title="Header Options">
          <param name="use_header" type="data" format="vcf" label="Use Header" optional="True" help="Use the provided header" />
          <param name="print_header" type="boolean" truevalue="--print-header" falsevalue="" label="Print Header" help="Print only the merged header and exit" />
        </section>
        <expand macro="macro_select_output_type" />
    </inputs>
    <outputs>
        <expand macro="macro_vcf_output"/>
    </outputs>
    <tests>
        <test>
            <param name="input_files" ftype="vcf" value="merge.a.vcf,merge.b.vcf,merge.c.vcf" />
            <param name="force_samples" value="true" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text text="3000150" />
                    <has_text text="3188209" />
                    <has_text_matching expression="\tq10;q20\t[\s]*INDEL"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input_files" ftype="vcf" value="merge.2.a.vcf,merge.2.b.vcf" />
            <param name="force_samples" value="true" />
            <param name="merge" value="none" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="1\t3000000\t.\tC\tCCG\t"/>
                    <has_text_matching expression="1\t3000000\t.\tC\tG\t"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input_files" ftype="vcf" value="merge.2.a.vcf,merge.2.b.vcf" />
            <param name="force_samples" value="true" />
            <param name="merge" value="both" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="1\t3000150\t\.\tC\t(A,G|G,A)\t"/>
                    <has_text_matching expression="1\t3106154\t\.\tC\t(CC,CCC|CCC,CC)\t"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input_files" ftype="vcf" value="merge.2.a.vcf,merge.2.b.vcf" />
            <param name="force_samples" value="true" />
            <param name="merge" value="all" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="1\t3000000\t\.\tC\t(CCG,G|G,CCG)\t"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input_files" ftype="vcf" value="merge.3.a.vcf,merge.3.b.vcf" />
            <param name="force_samples" value="true" />
            <param name="info_rules" value="TR:sum,TA:sum,TG:sum" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="1\t3000000\t.\tC\t(CG,CCG|CCG,CG)\t"/>
                    <has_text_matching expression="TR=[^;\t]*11"/>
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="input_files" ftype="vcf" value="merge.4.a.vcf,merge.4.b.vcf" />
            <param name="force_samples" value="true" />
            <param name="merge" value="id" />
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="1\t3000000\tid1\tC\t(A,CCG|CCG,A)\t"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
=====================================
 bcftools @EXECUTABLE@
=====================================


Merge multiple VCF/BCF files from non-overlapping sample sets to create one multi-sample file. 

Note that only records from different files can be merged, never from the same file. 
For "vertical" merge take a look at "bcftools norm" instead.

@REGIONS_HELP@

@BCFTOOLS_MANPAGE@#@EXECUTABLE@

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