view macros.xml @ 12:262026eb36a5 draft

"planemo upload commit 6ba769440f8f6a62e9ebfac069a30edc541bac0a"
author iuc
date Thu, 05 Dec 2019 01:33:18 -0500
parents b9e787edcbbd
children 345bdf4546fd
line wrap: on
line source

<?xml version="1.0"?>
<macros>
    <macro name="barcode_sanitizer" >
        <sanitizer invalid_char="">
            <valid initial="string.letters,string.digits">
                <add value="&#42;" /><!-- asterisk -->
                <add value="&#44;" /><!-- comma -->
                <add value="&#46;" /><!-- period -->
                <add value="&#60;" /><!-- less than -->
                <add value="&#61;" /><!-- equals sign -->
                <add value="&#62;" /><!-- greater than -->
                <add value="&#63;" /><!-- question mark -->
                <add value="&#95;" /><!-- underscore -->
                <add value="&#40;" /><!-- left bracket -->
                <add value="&#41;" /><!-- right bracket -->
                <add value="&#91;"/> <!-- left square bracket -->
                <add value="&#93;"/> <!-- right square bracket -->
                <add value="&#123;"/><!-- left brace -->
                <add value="&#125;"/><!-- right brace -->
                <add value="&#94;"/> <!-- caret -->
                <add value="-"/>
                <add value="!"/>
            </valid>
        </sanitizer>
    </macro>
    <macro name="barcode2_conditional" >
        <conditional name="barcode">
            <param name="barcode_select" argument="--split-barcode" type="select" label="Barcode on both reads?">
                <option value="first_read_only">Barcode on first read only</option>
                <option value="both_reads">Barcode on both reads</option>
            </param>
            <when value="first_read_only"/>
            <when value="both_reads">
                <param name="bc_pattern2" argument="--bc-pattern2" type="text" value="" label="Barcode pattern for second read"
                       help="Use this option to specify the format of the UMI/barcode for
                             the second read pair if required." >
                    <expand macro="barcode_sanitizer" />
                </param>
            </when>
        </conditional>
    </macro>
    <xml name="input_types">
        <conditional name="input_type">
            <param name="type" type="select" label="Library type">
                <option value="single">Single-end</option>
                <option value="paired">Paired-end</option>
                <option value="paired_collection">Paired-end Dataset Collection</option>
            </param>
            <when value="single">
                <param name="input_single" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
            </when>
            <when value="paired">
                <param name="input_read1" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
                <param name="input_read2" type="data" format="fastq,fastq.gz" label="Reads in FASTQ format" />
                <expand macro="barcode2_conditional" />
            </when>
            <when value="paired_collection">
                <param name="input_readpair" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Reads in FASTQ format" />
                <expand macro="barcode2_conditional" />
            </when>
        </conditional>
    </xml>
    <xml name="citations">
        <citations>
            <citation type="doi">10.1101/gr.209601.116</citation>
            <citation type="bibtex">
                @misc{githubUMI-tools,
                title = {UMI-tools},
                publisher = {GitHub},
                journal = {GitHub repository},
                url = {https://github.com/CGATOxford/UMI-tools},
                }
            </citation>
        </citations>
    </xml>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="@VERSION@">umi_tools</requirement>
            <yield />
        </requirements>
    </xml>
    <token name="@VERSION@">0.5.5</token>
    <token name="@COMMAND_LINK@"><![CDATA[
        #set $gz = False
        #if $input_type.type == 'single':
            #if $input_type.input_single.is_of_type("fastq.gz", "fastqsanger.gz"):
                ln -s '$input_type.input_single' input_single.gz &&
                #set $gz = True
            #else
                ln -s '$input_type.input_single' input_single.txt &&
            #end if
        #elif $input_type.type == 'paired':
            #if $input_type.input_read1.is_of_type("fastq.gz", "fastqsanger.gz"):
                ln -s '$input_type.input_read1' input_read1.gz &&
                ln -s '$input_type.input_read2' input_read2.gz &&
                #set $gz = True
            #else
                ln -s '$input_type.input_read1' input_read1.txt &&
                ln -s '$input_type.input_read2' input_read2.txt &&
            #end if
        #else  ## paired_collection
            #if $input_type.input_readpair.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
                ln -s '$input_type.input_readpair.forward' input_read1.gz &&
                ln -s '$input_type.input_readpair.reverse' input_read2.gz &&
                #set $gz = True
            #else
                ln -s '$input_type.input_readpair.forward' input_read1.txt &&
                ln -s '$input_type.input_readpair.reverse' input_read2.txt &&
            #end if
        #end if
    ]]></token>
</macros>