view trinity.xml @ 19:cee61b3fcf78 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit 5098e1bf7037e204f24fa1cbf7c3749bf0779550
author iuc
date Mon, 22 Jan 2018 11:26:29 -0500
parents d3b1249af60c
children 171b827eadf2
line wrap: on
line source

<tool id="trinity" name="Trinity" version="@WRAPPER_VERSION@.2">
    <description>de novo assembly of RNA-Seq data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="aggressive"><![CDATA[
        if [ -z "\$GALAXY_MEMORY_MB" ] ; then
            GALAXY_MEMORY_GB=1 ;
        else
            GALAXY_MEMORY_GB=\$((GALAXY_MEMORY_MB / 1024)) ;
        fi ;

        if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
            workdir=`pwd` ;
            cd "\$TRINITY_SCRATCH_DIR" ;
        fi ;

        #if $additional_params.guided.is_guided == "yes":
            ln -s '${$additional_params.guided.genome_guided_bam}' 'localbam.bam' &&
            ln -s '${$additional_params.guided.genome_guided_bam.metadata.bam_index}' 'localbam.bam.bai' &&
        #end if
        Trinity --no_version_check

        ## Inputs.
        #if $inputs.paired_or_single == "paired":

            --left ${ ','.join(['"%s"' % x for x in $inputs.left_input]) }

            --right ${ ','.join(['"%s"' % x for x in $inputs.right_input]) }

            #if $inputs.left_input[0].is_of_type('fasta'):
                --seqType fa
            #else:
                --seqType fq
            #end if

            @COMMAND_PAIRED_STRAND_JACCARD@

        #elif $inputs.paired_or_single == "paired_collection"
            --left ${ ','.join(['"%s"' % x.forward for x in $inputs.pair_input]) }

            --right ${ ','.join(['"%s"' % x.reverse for x in $inputs.pair_input]) }

            #if $inputs.pair_input[0].forward.is_of_type('fasta'):
                --seqType fa
            #else:
                --seqType fq
            #end if

            @COMMAND_PAIRED_STRAND_JACCARD@

        #else:
            --single ${ ','.join(['"%s"' % x for x in $inputs.input]) }

            #if $inputs.input[0].is_of_type('fasta'):
                --seqType fa
            #else:
                --seqType fq
            #end if

            #if $inputs.strand.is_strand_specific:
                --SS_lib_type $inputs.strand.library_type
            #end if
        #end if

        $norm

        ## Additional parameters.
        #if $additional_params.min_contig_length:
            --min_contig_length $additional_params.min_contig_length
        #end if
        #if $additional_params.long_reads:
            --long_reads $additional_params.long_reads
        #end if
        #if $additional_params.guided.is_guided == "yes":
            --genome_guided_bam 'localbam.bam'

            #if $additional_params.guided.genome_guided_min_coverage:
                --genome_guided_min_coverage $additional_params.guided.genome_guided_min_coverage
            #end if

            #if $additional_params.guided.genome_guided_min_reads_per_partition:
                --genome_guided_min_reads_per_partition $additional_params.guided.genome_guided_min_reads_per_partition
            #end if

            #if $additional_params.guided.genome_guided_max_intron:
                --genome_guided_max_intron $additional_params.guided.genome_guided_max_intron
            #end if

        #end if

        #if $additional_params.min_kmer_cov:
            --min_kmer_cov $additional_params.min_kmer_cov
        #end if

        ## CPU and butterfly options.
        --CPU \${GALAXY_SLOTS:-4} --max_memory \${GALAXY_MEMORY_GB:-1}G --bflyHeapSpaceMax \${GALAXY_MEMORY_GB:-1}G --bfly_opts '-V 10 --stderr'

        ## > $trinity_log 2>&1

        &&

        if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
            mkdir -p "\$workdir/trinity_out_dir";
            cp -p trinity_out_dir/Trinity* "\$workdir/trinity_out_dir";
            cd "\$workdir";
        fi ;

    ]]></command>
    <inputs>
        <conditional name="inputs">
            <param name="paired_or_single" type="select" label="Paired or Single-end data?">
                <option value="single">Single-end</option>
                <option value="paired" selected="true">Paired-end</option>
                <option value="paired_collection">Paired-end collection</option>
            </param>
            <when value="single">
                <param name="input" argument="--single" type="data" format="fasta,fastqsanger" multiple="true" label="Single-end reads" help=""/>
                <conditional name="strand">
                    <param name="is_strand_specific" type="boolean" checked="false" label="Strand specific data"/>
                    <when value="false">
                    </when>
                    <when value="true">
                        <param name="library_type" argument="--SS_lib_type" type="select" label="Strand-specific Library Type">
                            <option value="F">F</option>
                            <option value="R">R</option>
                        </param>
                    </when>
                </conditional>
            </when>
            <when value="paired">
                <param name="left_input" argument="--left" type="data" format="fasta,fastqsanger" multiple="true" label="Left/Forward strand reads" />
                <param name="right_input" argument="--right" type="data" format="fasta,fastqsanger" multiple="true" label="Right/Reverse strand reads" />
                <expand macro="input_paired_strand_jaccard" />
            </when>
            <when value="paired_collection">
                <param name="pair_input" type="data_collection" collection_type="list:paired" format="fasta,fastqsanger" label="FASTA/FASTQ dataset collection with R1/R2 pair" help="Can be lists of pair dataset collection"/>
                <expand macro="input_paired_strand_jaccard" />
            </when>
        </conditional>

        <param name="norm" type="boolean" argument="--normalize_reads" truevalue="--normalize_reads" falsevalue="" checked="true" label="Run in silico normalization of reads" help="Defaults to max. read coverage of 50."/>

        <section name="additional_params" title="Additional Options" expanded="False">
            <param name="min_contig_length" argument="--min_contig_length" type="integer" optional="true" value="200" min="1" label="Minimum Contig Length" help="All contigs shorter than this will be discarded"/>

            <conditional name="guided">
                <param name="is_guided" type="select" label="Use the genome guided mode?" help="If you already mapped the reads to the genome, Trinity can use this information">
                    <option value="no">No</option>
                    <option value="yes">Yes</option>
                 </param>
                <when value="no">
                </when>
                <when value="yes">
                    <param format="bam" name="genome_guided_bam" argument="--genome_guided_bam" type="data" label="Coordinate-sorted BAM file" />
                    <param name="genome_guided_max_intron" argument="--genome_guided_max_intron" type="integer" value="" min="1" label="Maximum allowed intron length (also maximum fragment span on genome)"/>
                    <param name="genome_guided_min_coverage" argument="--genome_guided_min_coverage" type="integer" optional="true" value="1" min="1" label="Minimum read coverage for identifying an expressed region of the genome"/>
                    <param name="genome_guided_min_reads_per_partition" argument="--genome_guided_min_reads_per_partition" type="integer" optional="true" value="10" min="1" label="Minimum number of reads per partition"/>
                </when>
            </conditional>

            <param name="long_reads" argument="--long_reads" type="data" format="fasta" optional="true" label="Error-corrected or circular consensus (CCS) pac bio reads" help="Experimental feature! Long reads must be in the same orientation as short reads if they are strand specific"/>

            <param name="min_kmer_cov" argument="--min_kmer_cov" type="integer" optional="true" value="1" min="1" label="Minimum count for K-mers to be assembled"/>
        </section>
    </inputs>
    <outputs>
        <data name="assembled_transcripts" format="fasta" label="${tool.name} on ${on_string}: Assembled Transcripts" from_work_dir="trinity_out_dir/Trinity.fasta"/>
    </outputs>
    <tests>
        <test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq" ftype="fastqsanger"/>
            <param name="right_input" value="reads.right.fq" ftype="fastqsanger"/>
            <param name="is_strand_specific" value="true"/>
            <param name="norm" value="false"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="raw/Trinity.fasta" compare="sim_size" delta="500" />
        </test>
        <test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq" ftype="fastqsanger"/>
            <param name="right_input" value="reads.right.fq" ftype="fastqsanger"/>
            <param name="is_strand_specific" value="true"/>
            <param name="norm" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity.fasta" compare="sim_size" delta="500" />
        </test>
        <test>
            <param name="paired_or_single" value="paired_collection"/>
            <param name="pair_input">
                <collection type="list:paired">
                    <element name="pair1">
                        <collection type="paired">
                            <element name="forward" value="reads.left.fq" ftype="fastqsanger" />
                            <element name="reverse" value="reads.right.fq" ftype="fastqsanger"/>
                        </collection>
                    </element>
                    <element name="pair2">
                        <collection type="paired">
                            <element name="forward" value="reads.left.fq" ftype="fastqsanger" />
                            <element name="reverse" value="reads.right.fq" ftype="fastqsanger"/>
                        </collection>
                    </element>
                </collection>
            </param>
            <param name="is_strand_specific" value="true"/>
            <param name="norm" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity.fasta" compare="sim_size" delta="500" />
        </test>
    </tests>
    <help>
Trinity_ assembles transcript sequences from Illumina RNA-Seq data.

.. _Trinity: http://trinityrnaseq.github.io
    </help>

    <expand macro="citation" />
</tool>