view biotradis_bacteria_tradis.xml @ 10:4e8358bc80f9 draft

"planemo upload for repository https://github.com/quadram-institute-bioscience/galaxy-tools/tree/master/tools/biotradis commit 35e807998700f046b29e0b8100416cf6ea0f930b-dirty"
author thanhlv
date Fri, 17 Jan 2020 12:16:55 -0500
parents cbe965d49727
children 47269fae5647
line wrap: on
line source

<tool id="bacteria_tradis" name="bacteria tradis" version="@VERSION@">
    <description>Generates a BAM file with tags added to read strings</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        #import re

        ## Creates symlinks for each input file based on the Galaxy 'element_identifier'
        ## Used so that a human-readable name appears in the output table (instead of 'dataset_xyz.dat')
        #set $named_input_files = ''
        #for $input_file in $input_files
            ## Add single quotes around each input file identifier
            #set $_input_file = "'{}'".format($input_file.element_identifier)
            ln -s '${input_file}' ${_input_file} &&
            echo ${_input_file} >> fq.list &&
        #end for

        bacteria_tradis -f fq.list
                        -t $tag
                        -r $ref
                        -td $tag_dir
                        -mm $mm
                        -m $m
                    #if $smalt:
                        $smalt
                        #if str($smalt_settings.smalt_k)!=""
                        --smalt_k $smalt_settings.smalt_k
                        #end if
                        #if str($smalt_settings.smalt_s)!=""
                            --smalt_s $smalt_settings.smalt_s
                        #end if
                        --smalt_y $smalt_settings.smalt_y
                        --smalt_r $smalt_settings.smalt_r
                        -n "\${GALAXY_SLOTS:-2}"
                    #end if
                    $verbose
                    && mkdir plots bams
                    && mv *insert_site_plot.gz ./plots
                    && mv *mapped.bam* ./bams
    ]]>    </command>
    <inputs>
        <param name="input_files" type="data" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2" multiple="true" label="Input files" help="Support multiple files"/>
        <param name="tag" type="text" optional="true" label="Tag" help="Tag to search for" />
        <param name="ref" type="data" format="fasta" label="Reference geome" help="Fasta format" />
        <param name="tag_dir" type="select" label="Tag direction" help="3 or 5(optional. default = 3)">
            <option value="3" selected="true">3</option>
            <option value="5">5</option>
        </param>
        <param name="mm" type="integer" value="0" label="Number of mismatches allowed when matching tag"/>
        <param name="m" type="integer" value="30" label="Mapping quality cutoff score"/>
        <param name="out_bam" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Output mapped bam files"/>
        <param name="smalt" type="boolean" truevalue="--smalt" falsevalue="" checked="false" label="Use smalt as the mapper" help="Default mapper is bwa" />
        <section name="smalt_settings" title="Optional setting for SMALT" expanded="False">
            <param argument="--smalt_k" type="integer" value="" optional="True" label="Custom k-mer value for SMALT mapping"/>
            <param argument="--smalt_s" type="integer" value="" optional="True" label="Custom step size for SMALT mapping"/>
            <param argument="--smalt_y" type="float" value="0.96" label="Custom y parameter for SMALT"/>
            <param argument="--smalt_r" type="integer" value="-1" label="Custom r parameter for SMALT"/>
        </section>
        <param argument="--verbose" type="boolean" truevalue="-v" falsevalue="" checked="false" label="verbose debugging output" help="(Default:No)" />
    </inputs>

    <outputs>
        <collection name="insert_plots" format="gz" type="list" label="Insert size plots">
            <discover_datasets pattern="__name_and_ext__" directory="plots" visible="true" />
        </collection>
        <collection name="mapped_bam" type="list" format="bam" label="Mapped bam files">
            <filter>out_bam is True</filter>
            <discover_datasets pattern="__name_and_ext__" directory="bams" visible="true" />
        </collection>
        <data name="fastq_stats" format="txt" label="${tool.name} on ${on_string}: Fastq Stats" from_work_dir="fq.stats"/>
    </outputs>

    <help>
        <![CDATA[
        Run a TraDIS analysis. This involves:
        1: filtering the data with tags matching that passed via -t option
        2: removing the tags from the sequences
        3: mapping
        4: creating an insertion site plot
        5: creating a stats summary

        Usage: bacteria_tradis [options]

        Options:
        -f        : text file listing fastq files with tradis tags attached
        -t        : tag to search for (optional.  If not set runs bwa in tagless mode with no filtering.)
        -r        : reference genome in fasta format (.fa)
        -td       : tag direction - 3 or 5 (optional. default = 3)
        -mm       : number of mismatches allowed when matching tag (optional. default = 0)
        -m        : mapping quality cutoff score (optional. default = 30)
        -k        : custom k-mer value (min seed length) (optional)
        --smalt   : use smalt rather than bwa as the mapper
        --smalt_k : custom k-mer value for SMALT mapping (optional)
        --smalt_s : custom step size for SMALT mapping (optional)
        --smalt_y : custom y parameter for SMALT (optional. default = 0.96)
        --smalt_r : custom r parameter for SMALT (optional. default = -1)
        -n        : number of threads to use for SMALT and samtools sort (optional. default = 1)
        -e        : set defaults for essentiality experiment (smalt_r = 0, -m = 0)
        -v        : verbose debugging output

        Documentation can be found at `site <https://github.com/sanger-pathogens/Bio-Tradis>`_.
    ]]>    </help>
    <expand macro="citations" />

</tool>