view abundance_estimates_to_matrix.xml @ 20:a009c96c5c18 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit 1d443e73d2eb888660bbbc7af198f5bcca9c1a70
author iuc
date Tue, 11 Apr 2023 19:52:45 +0000
parents 442e3696c634
children 400691c87530
line wrap: on
line source

<tool id="trinity_abundance_estimates_to_matrix" name="Build expression matrix" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
    <description>for a de novo assembly of RNA-Seq data by Trinity</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools"/>
    <expand macro="requirements"/>
    <command detect_errors="aggressive"><![CDATA[
        #import re
        #for $entry in $samples:
            ln -f -s '${entry}' '${re.sub('[^\w\-_]', '_', entry.element_identifier)}' &&
        #end for

        abundance_estimates_to_matrix.pl

        --est_method ${est_method}
        --cross_sample_norm ${additional_params.cross_sample_norm}

        #if $gene_trans_map:
            --gene_trans_map '$gene_trans_map'
        #else:
            --gene_trans_map 'none'
        #end if

        #for $entry in $samples:
            '${re.sub('[^\w\-_]', '_', entry.element_identifier)}'
        #end for

        && mv *.isoform.counts.matrix '$trans_counts'
        && mv *.isoform.TPM.not_cross_norm '$TPM_no_norm'
        #if $gene_trans_map:
            && mv *.gene.counts.matrix '$trans_counts_gene'
            && mv *.gene.TPM.not_cross_norm '$TPM_no_norm_gene'
        #end if

        #if $additional_params.cross_sample_norm == "TMM":
            && mv *.isoform.TMM.EXPR.matrix '$norm_TMM'
            #if $gene_trans_map:
                && mv *.gene.TMM.EXPR.matrix '$norm_TMM_gene'
            #end if
        #else if $additional_params.cross_sample_norm == "UpperQuartile":
            && mv *.isoform.UpperQuartile.EXPR.matrix '$norm_UQ'
            #if $gene_trans_map:
                && mv *.gene.UpperQuartile.EXPR.matrix '$norm_UQ_gene'
            #end if
        #end if
    ]]></command>
    <inputs>
        <param name="samples" type="data" format="tabular" multiple="true" label="Abundance estimates" help="output(s) from 'Align reads and estimate abundance' tool" />
        <param argument="--gene_trans_map" type="data" format="tabular" optional="true"  label="Gene to transcript correspondence ('gene(tab)transcript' lines)" help="Only needed for gene level estimates" />
        <param type="select" argument="--est_method" label="Abundance estimation method">
            <option value="RSEM">RSEM</option>
            <option value="eXpress">eXpress</option>
            <option value="salmon">Salmon</option>
            <option value="kallisto">Kallisto</option>
        </param>

        <section name="additional_params" title="Additional Options" expanded="False">
            <param type="select" argument="--cross_sample_norm" label="Cross sample normalization">
                <option value="TMM">TMM</option>
                <option value="UpperQuartile">UpperQuartile</option>
                <option value="none">None</option>
            </param>
        </section>
    </inputs>
    <outputs>
        <data format="tabular" name="trans_counts" label="${tool.name} on ${on_string}: estimated RNA-Seq fragment isoform counts (raw counts)"/>
        <data format="tabular" name="TPM_no_norm" label="${tool.name} on ${on_string}: Matrix of isoform TPM expression values (not cross-sample normalized)"/>

        <data format="tabular" name="trans_counts_gene" label="${tool.name} on ${on_string}: estimated RNA-Seq fragment gene counts (raw counts)">
            <filter>gene_trans_map</filter>
        </data>
        <data format="tabular" name="TPM_no_norm_gene" label="${tool.name} on ${on_string}: Matrix of gene TPM expression values (not cross-sample normalized)">
            <filter>gene_trans_map</filter>
        </data>

        <data format="tabular" name="norm_TMM" label="${tool.name} on ${on_string}: Matrix of TMM-normalized expression values">
            <filter>additional_params['cross_sample_norm'] == "TMM"</filter>
        </data>
        <data format="tabular" name="norm_UQ" label="${tool.name} on ${on_string}: Matrix of UpperQuartile-normalized expression values">
            <filter>additional_params['cross_sample_norm'] == "UpperQuartile"</filter>
        </data>

        <data format="tabular" name="norm_TMM_gene" label="${tool.name} on ${on_string}: Matrix of TMM-normalized expression values (gene)">
            <filter>additional_params['cross_sample_norm'] == "TMM" and gene_trans_map</filter>
        </data>
        <data format="tabular" name="norm_UQ_gene" label="${tool.name} on ${on_string}: Matrix of UpperQuartile-normalized expression values (gene)">
            <filter>additional_params['cross_sample_norm'] == "UpperQuartile" and gene_trans_map</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="samples" ftype="tabular" value="count/rsem_bowtie/sample_A,count/rsem_bowtie/sample_B"/>
            <param name="est_method" value="RSEM"/>
            <param name="cross_sample_norm" value="TMM"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="norm_TMM">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/rsem_bowtie2/sample_A,count/rsem_bowtie2/sample_B"/>
            <param name="est_method" value="RSEM"/>
            <param name="cross_sample_norm" value="TMM"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="norm_TMM">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/express_bowtie/sample_A,count/express_bowtie/sample_B"/>
            <param name="est_method" value="eXpress"/>
            <param name="cross_sample_norm" value="TMM"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="norm_TMM">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/rsem_bowtie/sample_A,count/rsem_bowtie/sample_B"/>
            <param name="est_method" value="RSEM"/>
            <param name="cross_sample_norm" value="UpperQuartile"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="norm_UQ">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/rsem_bowtie/sample_A,count/rsem_bowtie/sample_B"/>
            <param name="est_method" value="RSEM"/>
            <param name="cross_sample_norm" value="none"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/salmon/sample_A,count/salmon/sample_B"/>
            <param name="est_method" value="salmon"/>
            <param name="cross_sample_norm" value="none"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="samples" ftype="tabular" value="count/kallisto/abundance.tsv.genes,count/kallisto/abundance_B.tsv.genes"/>
            <param name="est_method" value="kallisto"/>
            <param name="cross_sample_norm" value="TMM"/>
            <output name="trans_counts">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="TPM_no_norm">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
            <output name="norm_TMM">
                <assert_contents>
                    <has_line_matching expression="TRINITY_DN3_c0_g1&#009;.*" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>
<![CDATA[
Trinity_ assembles transcript sequences from Illumina RNA-Seq data.
This tool will combine abundance estimations (produced by 'Align reads and estimate abundance on a de novo assembly of RNA-Seq data' tool) from multiple samples into a single tabular file.
This matrix can then be used by 'RNASeq samples quality check for transcript quantification' and 'Differential Expression Analysis using a Trinity assembly' tools.

**Inputs**

It takes as input multiple results from 'Align reads and estimate abundance on a de novo assembly of RNA-Seq data' tool/
Each sample must have a name, that should be used in subsequent tools.

**Output**

This tool will produce a single matrix file. 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>