view align_and_estimate_abundance.xml @ 1:a966877db15b draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit 95f3e6a69bf939326c73a98e3306bccae8414ecd
author iuc
date Fri, 18 Nov 2016 06:07:41 -0500
parents a21e229da9a1
children 515119330a55
line wrap: on
line source

<tool id="trinity_align_and_estimate_abundance" name="Align reads and estimate abundance" version="@WRAPPER_VERSION@.1">
    <description>on a de novo assembly of RNA-Seq data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements">
        <requirement type="package" version="1.1.2">bowtie</requirement>
        <requirement type="package" version="2.2.6">bowtie2</requirement>
        <requirement type="package" version="1.2.28">rsem</requirement>
        <requirement type="package" version="1.5.1">eXpress</requirement>
        <requirement type="package" version="0.6.0">salmon</requirement>
    </expand>
    <expand macro="stdio"/>
    <command><![CDATA[
        ln -s '$transcripts' input.fa &&

        #if $inputs.paired_or_single == "paired":
            #if $inputs.left_input.is_of_type('fasta'):
                ln -s '$inputs.left_input' paired_left.fa &&
                ln -s '$inputs.right_input' paired_right.fa
            #else:
                ln -s '$inputs.left_input' paired_left.fq &&
                ln -s '$inputs.right_input' paired_right.fq
            #end if
        #else:
            #if $inputs.left_input.is_of_type('fasta'):
                ln -s '$inputs.input' single.fa
            #else:
                ln -s '$inputs.input' single.fq
            #end if
        #end if

        &&

        align_and_estimate_abundance.pl

        --transcripts input.fa

        --est_method $method.est_method
        #if $method.est_method == "RSEM" or $method.est_method == "eXpress":
            --aln_method $method.aln_method
        #else if $method.est_method == "salmon":
            --salmon_idx_type $method.salmon_idx_type
        #end if

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

            #if $inputs.left_input.is_of_type('fasta'):
                --left paired_left.fa --right paired_right.fa --seqType fa
            #else:
                --left paired_left.fq --right paired_right.fq --seqType fq
            #end if

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

            --max_ins_size $inputs.paired_fragment_length

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

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

        ## Additional parameters.
        #if $additional_params.gene_map.has_gene_map == "no":
            --gene_trans_map $additional_params.gene_map.gene_trans_map
        #else
            --trinity_mode
        #end if

        --prep_reference

        --output_dir output

        ## CPU
        --thread_count \${GALAXY_SLOTS:-4}
    ]]></command>
    <inputs>
        <param format="fasta" name="transcripts" argument="--transcripts" type="data" label="Transcripts" help="de novo assembly of RNA-Seq data"/>
        <conditional name="inputs">
            <param name="paired_or_single" type="select" label="Paired or Single-end data?">
                <option value="paired">Paired</option>
                <option value="single">Single</option>
            </param>
            <when value="paired">
                <param format="fasta,fastqsanger" name="left_input" argument="--left" type="data" label="Left/Forward strand reads" help=""/>
                <param format="fasta,fastqsanger" name="right_input" argument="--right" type="data" label="Right/Reverse strand 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="FR">Forward-Reverse</option>
                            <option value="RF">Reverse-Forward</option>
                        </param>
                    </when>
                </conditional>
                <param name="paired_fragment_length" argument="--max_ins_size" type="integer" value="800" min="1" label="Maximum insert size" help="bowtie -X parameter"/>
            </when>
            <when value="single">
                <param format="fasta,fastqsanger" argument="--single" name="input" type="data" 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>
        </conditional>

        <conditional name="method">
            <param type="select" name="est_method" argument="--est_method" label="Abundance estimation method">
                <option value="RSEM">RSEM</option>
                <option value="eXpress">eXpress</option>
                <option value="salmon">Salmon</option>
            </param>
            <when value="RSEM">
                <param type="select" name="aln_method" argument="--aln_method" label="Alignment method">
                    <option value="bowtie">Bowtie</option>
                    <option value="bowtie2">Bowtie2</option>
                </param>
            </when>
            <when value="eXpress">
                <param type="select" name="aln_method" argument="--aln_method" label="Alignment method">
                    <option value="bowtie">Bowtie</option>
                    <option value="bowtie2">Bowtie2</option>
                </param>
            </when>
            <when value="salmon">
                <param type="select" name="salmon_idx_type" argument="--salmon_idx_type" label="Index type">
                    <option value="quasi">Quasi</option>
                    <option value="fmd">FMD</option>
                </param>
            </when>
        </conditional>

        <section name="additional_params" title="Additional Options" expanded="False">
            <conditional name="gene_map">
                <param name="has_gene_map" type="select" label="Trinity assembly?" help="If the transcripts were not assembled by trinity, additional information is needed">
                    <option value="yes">Yes</option>
                    <option value="no">No</option>
                </param>
                <when value="yes">
                </when>
                <when value="no">
                    <param format="tabular" name="gene_trans_map" argument="--gene_trans_map" type="data" label="Gene to transcript correspondence ('gene(tab)transcript' lines)" />
                </when>
            </conditional>

        </section>
    </inputs>
    <outputs>
        <data format="tabular" name="isoforms_counts_rsem" label="${tool.name} on ${on_string}: isoforms counts" from_work_dir="output/RSEM.isoforms.results">
            <filter>method['est_method'] == "RSEM"</filter>
        </data>
        <data format="tabular" name="genes_counts_rsem" label="${tool.name} on ${on_string}: genes counts" from_work_dir="output/RSEM.genes.results">
            <filter>method['est_method'] == "RSEM"</filter>
        </data>

        <data format="tabular" name="isoforms_counts_express" label="${tool.name} on ${on_string}: isoforms counts" from_work_dir="output/results.xprs">
            <filter>method['est_method'] == "eXpress"</filter>
        </data>
        <data format="tabular" name="genes_counts_express" label="${tool.name} on ${on_string}: genes counts" from_work_dir="output/results.xprs.genes">
            <filter>method['est_method'] == "eXpress"</filter>
        </data>

        <data format="tabular" name="isoforms_counts_salmon" label="${tool.name} on ${on_string}: isoforms counts" from_work_dir="output/quant.sf">
            <filter>method['est_method'] == "salmon"</filter>
        </data>
        <data format="tabular" name="genes_counts_salmon" label="${tool.name} on ${on_string}: genes counts" from_work_dir="output/quant.sf.genes">
            <filter>method['est_method'] == "salmon"</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq"/>
            <param name="right_input" value="reads.right.fq"/>
            <param name="transcripts" value="raw/Trinity.fasta"/>
            <param name="library_type" value="RF"/>
            <param name="est_method" value="RSEM"/>
            <param name="aln_method" value="bowtie"/>
            <param name="has_gene_map" value="yes"/>
            <output name="isoforms_counts_rsem">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN0_c0_g1_i1&#009;.*" />
                    <has_n_columns n="8" />
                </assert_contents>
            </output>
            <output name="genes_counts_rsem">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN0_c0_g1&#009;.*" />
                    <has_n_columns n="7" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq"/>
            <param name="right_input" value="reads.right.fq"/>
            <param name="transcripts" value="raw/Trinity.fasta"/>
            <param name="library_type" value="RF"/>
            <param name="est_method" value="RSEM"/>
            <param name="aln_method" value="bowtie2"/>
            <param name="has_gene_map" value="yes"/>
            <output name="isoforms_counts_rsem">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN0_c0_g1_i1&#009;.*" />
                    <has_n_columns n="8" />
                </assert_contents>
            </output>
            <output name="genes_counts_rsem">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN0_c0_g1&#009;.*" />
                    <has_n_columns n="7" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq"/>
            <param name="right_input" value="reads.right.fq"/>
            <param name="transcripts" value="raw/Trinity.fasta"/>
            <param name="library_type" value="RF"/>
            <param name="est_method" value="eXpress"/>
            <param name="aln_method" value="bowtie"/>
            <param name="has_gene_map" value="yes"/>
            <output name="isoforms_counts_express">
                <assert_contents>
                    <has_line_matching expression=".*&#009;TRINITY_DN2_c3_g1_i1&#009;.*" />
                    <has_n_columns n="15" />
                </assert_contents>
            </output>
            <output name="genes_counts_express">
                <assert_contents>
                    <has_line_matching expression="NA&#009;TRINITY_DN3_c0_g1.*" />
                    <has_n_columns n="15" />
                </assert_contents>
            </output>
        </test>
        <!-- test disabled because broken in travis, probably due to conda/symlink problem-->
        <!--test>
            <param name="paired_or_single" value="paired"/>
            <param name="left_input" value="reads.left.fq"/>
            <param name="right_input" value="reads.right.fq"/>
            <param name="transcripts" value="raw/Trinity.fasta"/>
            <param name="library_type" value="RF"/>
            <param name="est_method" value="salmon"/>
            <param name="aln_method" value="bowtie"/>
            <param name="has_gene_map" value="yes"/>
            <output name="isoforms_counts_salmon">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN2_c3_g1_i1&#009;.*" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <output name="genes_counts_salmon">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1.*" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test-->
    </tests>
    <help>
<![CDATA[
Trinity_ assembles transcript sequences from Illumina RNA-Seq data.
This tool estimates the abundance of isoforms and genes of a transcriptome assembled with Trinity, using FastQ of a specific sample.

**Inputs**

It takes as input a transcriptome assembled with Trinity and the reads from a RNASeq sample.
You have to choose between several counting methods.

If you dont align on a Trinity assembly, you need to provide a file of the following (tabular) format to map gene ids to transcript ids:

=========== ================
gene1       transcript1
----------- ----------------
gene2       transcript2
=========== ================

**Output**

This tool will produce 2 tabular files, with counts for isoforms and genes respectively. More details on this page:

.. _Trinity manual: https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-Transcript-Quantification


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

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