view align_and_estimate_abundance.xml @ 14:983552d5822d draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit f3d9db3063d2cba26e6fbe82a3eee4e1a6fe0bd5"
author iuc
date Thu, 14 Nov 2019 04:04:32 -0500
parents 6d6b72d14170
children 56162e446004
line wrap: on
line source

<tool id="trinity_align_and_estimate_abundance" name="Align reads and estimate abundance" version="@WRAPPER_VERSION@">
    <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.3.2">rsem</requirement>
        <requirement type="package" version="0.46.0">kallisto</requirement>
    </expand>
    <command detect_errors="aggressive"><![CDATA[
        ln -f -s '$transcripts' input.fa &&

        #if $additional_params.gene_map.has_gene_map == "yes":
            get_Trinity_gene_to_trans_map.pl input.fa > gene_to_trans.map &&
        #else:
            ln -f -s '$additional_params.gene_map.gene_trans_map' gene_to_trans.map &&
        #end if

        #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.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":
            --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.
        --gene_trans_map gene_to_trans.map

        --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="salmon">Salmon</option>
                <option value="kallisto">Kallisto</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="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>
            <when value="kallisto">
            </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_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>

        <data format="tabular" name="isoforms_counts_kallisto" label="${tool.name} on ${on_string}: isoforms counts" from_work_dir="output/abundance.tsv">
            <filter>method['est_method'] == "kallisto"</filter>
        </data>
        <data format="tabular" name="genes_counts_kallisto" label="${tool.name} on ${on_string}: genes counts" from_work_dir="output/abundance.tsv.genes">
            <filter>method['est_method'] == "kallisto"</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="gene_to_trans" value="raw/Trinity.map" />
            <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="gene_to_trans" value="raw/Trinity.map" />
            <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="gene_to_trans" value="raw/Trinity.map" />
            <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>
        <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="gene_to_trans" value="raw/Trinity.map" />
            <param name="library_type" value="RF"/>
            <param name="est_method" value="kallisto"/>
            <param name="has_gene_map" value="yes"/>
            <output name="isoforms_counts_kallisto">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN1_c0_g1_i1&#009;.*" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <output name="genes_counts_kallisto">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN1_c0_g1&#009;.*" />
                    <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>