view trinity.xml @ 34:8f1c3df4dd49 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit ec26c475a013d89b0f973f29250d660e79d4751f
author iuc
date Wed, 20 Sep 2023 14:54:54 +0000
parents 9fa24d5aac68
children
line wrap: on
line source

<tool id="trinity" name="Trinity" version="@TOOL_VERSION@+galaxy1" profile="21.05">
    <description>de novo assembly of RNA-Seq data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools"/>
    <expand macro="requirements">
        <requirement type="package" version="3.2.7">rsync</requirement>
    </expand>
    <command detect_errors="aggressive"><![CDATA[
        if [ -z "\$GALAXY_MEMORY_MB" ] ; then
            GALAXY_MEMORY_GB=1 ;
        else
            GALAXY_MEMORY_GB=\$((GALAXY_MEMORY_MB / 1024)) ;
        fi ;

        TRINITY_SCRATCH_DIR=\${TRINITY_SCRATCH_DIR:-\${TMPDIR:-\$_GALAXY_JOB_TMP_DIR}}
        workdir=\$(pwd)
        scratchfolder=\$(mktemp -d -p "\$TRINITY_SCRATCH_DIR");
        emptyfolder=\$(mktemp -d -p "\$TRINITY_SCRATCH_DIR");
        cd "\$scratchfolder" ;

        #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
        #if $pool.pool_mode == "Yes":
            #if str($pool.inputs.paired_or_single) == "single":
                #for i, f in enumerate($pool.inputs.input):
                    ln -s '$f' input${i}.${f.ext} &&
                #end for
            #elif str($pool.inputs.paired_or_single) == "paired":
                #for i, f in enumerate($pool.inputs.left_input):
                    ln -s '$f' left_input${i}.${f.ext} &&
                #end for
                #for i, f in enumerate($pool.inputs.right_input):
                    ln -s '$f' right_input${i}.${f.ext} &&
                #end for
            #elif str($pool.inputs.paired_or_single) == "paired_collection":
                #for i, f in enumerate($pool.inputs.pair_input):
                    ln -s '$f.forward' 'left_input${i}.${f.forward.ext}' &&
                    ln -s '$f.reverse' 'right_input${i}.${f.reverse.ext}' &&
                #end for
            #end if
        #elif $pool.pool_mode == "No":
            #if $pool.inputs.paired_or_single == "unmerged_paired_collection":
                ln -s '$pool.inputs.pair_input.forward' 'left_input.${$pool.inputs.pair_input.forward.ext}' &&
                ln -s '$pool.inputs.pair_input.reverse' 'right_input.${pool.inputs.pair_input.reverse.ext}' &&
            #elif $pool.inputs.paired_or_single == "unmerged_single_collection":
                ln -s '$pool.inputs.input' 'input.${pool.inputs.input.ext}' &&
            #end if
        #end if

        Trinity --no_version_check
        --output ./trinity_out_dir
        ## do not try to run the high-mem normalization stats generator in parallel for paired-end fastqs
        --no_parallel_norm_stats
        ## Inputs
        #if $pool.pool_mode == "Yes":
            #if str($pool.inputs.paired_or_single) == "single":
                --single ${ ','.join(["'input%s.%s'" % ($i, $f.ext) for i, f in enumerate($pool.inputs.input)]) }
                #if $pool.inputs.input[0].is_of_type('fasta'):
                    --seqType fa
                #else:
                    --seqType fq
                #end if

                #if $pool.inputs.strand.is_strand_specific == 'true':
                    --SS_lib_type $pool.inputs.strand.library_type
                #end if
            #elif str($pool.inputs.paired_or_single) == "paired":
                --left ${ ','.join(["'left_input%s.%s'" % ($i, $f.ext) for i, f in enumerate($pool.inputs.left_input)]) }

                --right ${ ','.join(["'right_input%s.%s'" % ($i, $f.ext) for i, f in enumerate($pool.inputs.right_input)]) }

                #if $pool.inputs.left_input[0].is_of_type('fasta'):
                    --seqType fa
                #else:
                    --seqType fq
                #end if
                @COMMAND_PAIRED_STRAND_JACCARD@
            #elif str($pool.inputs.paired_or_single) == "paired_collection":
                --left ${ ','.join(["'left_input%s.%s'" % ($i, $f.forward.ext) for i, f in enumerate($pool.inputs.pair_input)]) }
                --right ${ ','.join(["'right_input%s.%s'" % ($i, $f.reverse.ext) for i, f in enumerate($pool.inputs.pair_input)]) }
                #if $pool.inputs.pair_input[0].forward.is_of_type('fasta'):
                    --seqType fa
                #else:
                    --seqType fq
                #end if
                @COMMAND_PAIRED_STRAND_JACCARD@
            #end if
        #elif $pool.pool_mode == "No":
            #if $pool.inputs.paired_or_single == "unmerged_paired_collection":
                --left 'left_input.${$pool.inputs.pair_input.forward.ext}'

                --right 'right_input.${pool.inputs.pair_input.reverse.ext}'

                #if $pool.inputs.pair_input.forward.is_of_type('fasta'):
                    --seqType fa
                #else:
                    --seqType fq
                #end if
                @COMMAND_PAIRED_STRAND_JACCARD@
            #elif $pool.inputs.paired_or_single == "unmerged_single_collection":
                --single 'input.${pool.inputs.input.ext}'

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

                #if $pool.inputs.strand.is_strand_specific == 'true':
                    --SS_lib_type $pool.inputs.strand.library_type
                #end if
            #end if
        #end if
        $no_normalize_reads

        ## 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 can create millions of files in the same directory, so the cleaning task makes use of rsync
        ## for ensuring better performances.
        ## see: https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html
        rsync -a --delete "\$emptyfolder/" "\$scratchfolder/" --exclude=trinity_out_dir.Trinity.fasta --exclude=trinity_out_dir.Trinity.fasta.gene_trans_map;
        mv "\$scratchfolder/trinity_out_dir.Trinity.fasta" '$assembled_transcripts';
        mv "\$scratchfolder/trinity_out_dir.Trinity.fasta.gene_trans_map" '$gene_to_trans';
        cd "\$workdir";
        rmdir "\$emptyfolder" "\$scratchfolder"
    ]]></command>
    <inputs>
        <conditional name="pool">
            <param name="pool_mode" type="select" label="Are you pooling sequence datasets?" help="" >
                <option value="No">No</option>
                <option value="Yes" selected="True">Yes</option>
            </param>
            <when value="Yes" >
                <conditional name="inputs">
                    <param name="paired_or_single" type="select" label="Paired or Single-end data?">
                        <option value="single" selected="true">Single-end</option>
                        <option value="paired">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,fastqsanger.gz" multiple="true" label="Single-end reads" help=""/>
                        <expand macro="is_strand_specific_f_r"/>
                    </when>
                    <when value="paired">
                        <param name="left_input" argument="--left" type="data" format="fasta,fastqsanger,fastqsanger.gz" multiple="true" label="Left/Forward strand reads" />
                        <param name="right_input" argument="--right" type="data" format="fasta,fastqsanger,fastqsanger.gz" 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,fastqsanger.gz" 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>
            </when>
            <when value="No">
                <conditional name="inputs">
                    <param name="paired_or_single" type="select" label="Paired or Single-end data?">
                        <option value="unmerged_single_collection">Single-end</option>
                        <option value="unmerged_paired_collection">Paired-end</option>
                    </param>
                    <when value="unmerged_single_collection">
                        <param name="input" argument="--single" type="data" format="fasta,fastqsanger,fastqsanger.gz" label="Single-end reads" help="Elements of collection will NOT be merged"/>
                        <expand macro="is_strand_specific_f_r"/>
                    </when>
                    <when value="unmerged_paired_collection">
                        <param name="pair_input" type="data_collection" collection_type="paired" format="fasta,fastqsanger,fastqsanger.gz" label="FASTA/FASTQ dataset collection with R1/R2 pair" help="Pair dataset collection. The paired datasets will NOT be merged"/>
                        <expand macro="input_paired_strand_jaccard" />
                    </when>
                </conditional>
            </when>
        </conditional>
        <param argument="--no_normalize_reads" type="boolean" truevalue="" falsevalue="--no_normalize_reads" 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 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 argument="--genome_guided_bam" type="data" format="bam" label="Coordinate-sorted BAM file" />
                    <param argument="--genome_guided_max_intron" type="integer" value="" min="1" label="Maximum allowed intron length (also maximum fragment span on genome)"/>
                    <param 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 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 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 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"/>
        <data name="gene_to_trans" format="tabular" label="${tool.name} on ${on_string}: Gene to transcripts map"/>
    </outputs>
    <tests>
        <test>
            <param name="pool_mode" value="No" />
            <param name="paired_or_single" value="unmerged_paired_collection"/>
            <param name="pair_input">
                <collection type="paired">
                    <element name="forward" value="reads.left.fq" ftype="fastqsanger" />
                    <element name="reverse" value="reads.right.fq" ftype="fastqsanger"/>
                </collection>
            </param>
            <param name="is_strand_specific" value="true"/>
            <param name="no_normalize_reads" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity_paired_unmerged_1.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="norm/Trinity_paired_unmerged_1.map" compare="sim_size" />
        </test>
        <test>
            <param name="pool_mode" value="No" />
            <param name="paired_or_single" value="unmerged_paired_collection"/>
            <param name="pair_input">
                <collection type="paired">
                    <element name="forward" value="reads.left.fq.gz" ftype="fastqsanger.gz" />
                    <element name="reverse" value="reads.right.fq.gz" ftype="fastqsanger.gz" />
                </collection>
            </param>
            <param name="is_strand_specific" value="true"/>
            <param name="no_normalize_reads" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity_paired_unmerged_1.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="norm/Trinity_paired_unmerged_1.map" compare="sim_size" />
        </test>
        <test>
            <param name="pool_mode" value="No" />
            <param name="paired_or_single" value="unmerged_single_collection"/>
            <param name="input" value="reads.left.fq" ftype="fastqsanger"/>
            <param name="is_strand_specific" value="true"/>
            <param name="no_normalize_reads" value="false"/>
            <param name="library_type" value="F"/>
            <output name="assembled_transcripts" file="raw/Trinity_single_unmerged_1.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="raw/Trinity_single_unmerged_1.map" compare="sim_size" />
        </test>
        <test>
            <param name="pool_mode" value="Yes" />
            <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="no_normalize_reads" value="false"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="raw/Trinity.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="raw/Trinity.map" compare="sim_size" />
        </test>
        <test>
            <param name="pool_mode" value="Yes" />
            <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="no_normalize_reads" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="norm/Trinity.map" compare="sim_size" />
        </test>
        <test>
            <param name="pool_mode" value="Yes" />
            <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="no_normalize_reads" value="true"/>
            <param name="library_type" value="RF"/>
            <output name="assembled_transcripts" file="norm/Trinity.fasta" compare="sim_size" delta="500" />
            <output name="gene_to_trans" file="norm/Trinity.map" compare="sim_size" />
        </test>
    </tests>
    <help>
Trinity_ assembles transcript sequences from Illumina RNA-Seq data.

.. _Trinity: https://github.com/trinityrnaseq/trinityrnaseq/wiki
    </help>
    <expand macro="citation" />
</tool>