view vcfvcfintersect.xml @ 5:166c4f50525f draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/vcflib/vcfvcfintersect commit 36e9065027cc7bf721e9d203208477ee88906c57"
author iuc
date Thu, 23 Jan 2020 08:11:02 -0500
parents 6f6bf10618d7
children
line wrap: on
line source

<tool id="vcfvcfintersect" name="VCF-VCFintersect:" version="@WRAPPER_VERSION@+galaxy0">
    <description>Intersect two VCF datasets</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio" />
    <command><![CDATA[
        #set $reference_fasta_filename = "localref.fa"
        #if str( $reference_source.reference_source_selector ) == "history":
           ln -s '${reference_source.ref_file}' '${reference_fasta_filename}' &&
        #else:
           #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
        #end if

        #if $adv_options.adv_options_selector == "use_adv_controls":
            vcfintersect '${adv_options.adv_options_input}' ${loci} ${invert} -r '${reference_fasta_filename}' -w "${window_size}" ${isect_union} '${vcf_input1}' '${vcf_input2}' > '${out_file1}'
        #else:
            vcfintersect ${loci} ${invert} -r '${reference_fasta_filename}' -w "${window_size}" ${isect_union} '${vcf_input1}' '${vcf_input2}' > '${out_file1}'
        #end if
    ]]></command>
    <inputs>
        <!-- selecting refernce source -->
        <param name="vcf_input1" type="data" format="vcf" label="The first VCF dataset" />
        <param name="vcf_input2" type="data" format="vcf" label="The second VCF dataset"
            help="The second dataset will be instersected with the first"/>
        <conditional name="reference_source">
            <param name="reference_source_selector" type="select" label="Choose the source for the reference genome"
                help="This tools needs to access reference genomes sequence specified by this option.">
                <option value="cached">Locally cached</option>
                <option value="history">History</option>
            </param>
            <when value="cached">
                <param name="ref_file" type="select" label="Select reference genome">
                    <options from_data_table="fasta_indexes">
                    <!--<filter type="data_meta" key="dbkey" ref="input_bam" column="value"/>-->
                    </options>
                    <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
                </param>
            </when>
            <when value="history"> <!-- FIX ME!!!! -->
                <param name="ref_file" type="data" format="fasta" label="Using reference file" />
            </when>
        </conditional>
        <param name="isect_union" type="select" label="Union or intersection" help="-i or -u">
            <option value="-i">Intersect</option>
            <option value="-u">Union</option>
        </param>
        <param name="invert" type="boolean" truevalue="-v" falsevalue="" label="Invert selection?" help="-v, --invert" />
        <param name="window_size" type="integer" value="30"
            label="compare records up to this many bp away (window size)" help="-w, --window-size" />
        <param name="loci" type="boolean" truevalue="-l" falsevalue=""
            label="output whole loci when one alternate allele matches" help="-l, --loci" />
        <conditional name="adv_options">
            <param name="adv_options_selector" type="select" label="Advanced controls" help="Allows you to specify options that are not listed above">
                <option value="no">Don't use advanced options</option>
                <option value="use_adv_controls">Use advanced options</option>
            </param>
            <when value="no" />
            <when value="use_adv_controls">
                <param name="adv_options_input" type="text" value="-t &quot;vcfvcf-intersect-result&quot;"
                    label="Enter additional command line options described in the help section below"
                    help="such as -m, -t, -V, -M, and -T">
                    <sanitizer>
                        <valid initial="string.printable">
                            <remove value="&apos;"/>
                        </valid>
                        <mapping initial="none">
                            <add source="&apos;" target="__sq__"/>
                        </mapping>
                    </sanitizer>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="vcf" name="out_file1" />
    </outputs>
    <tests>
        <test>
            <param name="vcf_input1" value="vcfvcfintersect-input1.vcf" />
            <param name="vcf_input2" value="vcfvcfintersect-input2.vcf" />
            <param name="reference_source_selector" value="history" />
            <param name="ref_file" value="vcflib-test-genome-phix.fa" />
            <param name="isect_union" value="-i" />
            <param name="invert" value="False" />
            <param name="loci" value="False" />
            <param name="adv_options_selector" value="no" />
            <param name="window_size" value="30" />
            <output name="out_file1" file="vcfvcfintersect-test1.vcf"/>
        </test>
        <test>
            <param name="reference_source_selector" value="history" />
            <param name="vcf_input1" value="vcfvcfintersect-input1.vcf" />
            <param name="vcf_input2" value="vcfvcfintersect-input2.vcf" />
            <param name="isect_union" value="-u" />
            <param name="invert" value="False" />
            <param name="loci" value="False" />
            <param name="adv_options_selector" value="no" />
            <param name="window_size" value="30" />
            <param name="ref_file" value="vcflib-test-genome-phix.fa" />
            <output name="out_file1" file="vcfvcfintersect-test2.vcf"/>
        </test>
    </tests>
    <help>
Computes intersections and unions for two VCF datasets. Unifies equivalent alleles within window-size bp.

The options are::

    -v, --invert              invert the selection, printing only records which would
    -i, --intersect-vcf FILE  use this VCF for set intersection generation
    -u, --union-vcf FILE      use this VCF for set union generation
    -w, --window-size N       compare records up to this many bp away (default 30)
    -l, --loci                output whole loci when one alternate allele matches
    -m, --ref-match           intersect on the basis of record REF string
    -t, --tag TAG             attach TAG to each record's info field if it would intersect
    -V, --tag-value VAL       use this value to indicate that the allele is passing
                              '.' will be used otherwise.  default: 'PASS'
    -M, --merge-from FROM-TAG
    -T, --merge-to   TO-TAG   merge from FROM-TAG used in the -i file, setting TO-TAG
                              in the current file.

----

VCFVCFintersect is based on vcfintersect utility of VCFlib toolkit developed by Erik Garrison (https://github.com/ekg/vcflib).
    </help>
    <expand macro="citations" />
</tool>