view plotPCA.xml @ 30:443d9a9d6d11 draft default tip

planemo upload for repository https://github.com/deeptools/deepTools/tree/master/galaxy/wrapper/ commit 4a4029b5c2e725b7cebc27217b76d23910508412
author bgruening
date Wed, 27 Sep 2023 20:28:32 +0000
parents 00d869ea03a1
children
line wrap: on
line source

<tool id="deeptools_plot_pca" name="plotPCA" version="@TOOL_VERSION@+galaxy0" profile="@GALAXY_VERSION@">
    <description>Generate principal component analysis (PCA) plots from multiBamSummary or multiBigwigSummary output</description>
    <macros>
        <token name="@BINARY@">plotPCA</token>
        <import>deepTools_macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command>
<![CDATA[
        @BINARY@
            --corData '$corData'
            --plotTitle '$plotTitle'
            --plotFile '$outFileName'
            --plotFileFormat '$outFileFormat'
            #if str($advancedOpt.showAdvancedOpt) == 'yes':
                @PLOTWIDTHHEIGHT@
                $advancedOpt.log2
                --PCs $advancedOpt.PCs
                --ntop $advancedOpt.ntop
                $advancedOpt.transpose
                $advancedOpt.rowCenter
                #if $advancedOpt.colors:
                    --colors $advancedOpt.colors
                #end if
                #if $advancedOpt.markers:
                    --markers $advancedOpt.markers
                #end if
            #end if
            #if $outFileNameData
                --outFileNameData '$output_outFileNameData'
            #end if
]]>
    </command>
    <inputs>
        <param name="corData" format="deeptools_coverage_matrix" type="data" label="Matrix file from the multiBamSummary or multiBigwigSummary tools"/>
        <expand macro="input_image_file_format" />
        <expand macro="plotTitle" />
        <param argument="--outFileNameData" type="boolean" label="Save the matrix of PCA and eigenvalues underlying the plot."/>
        <conditional name="advancedOpt">
            <param name="showAdvancedOpt" type="select" label="Show advanced options" >
                <option value="no" selected="true">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="no" />
            <when value="yes">
                <expand macro="plotWidthHeight" PLOTWIDTH="10.0" PLOTHEIGHT="10.0" />
                <param name="PCs" argument="--PCs" label="Principal components to plot" value="1 2" type="text"
                    help="The principal components to plot. If specified, you must provide two different integers, greater than zero, separated by a space. An example (and the default) is '1 2'." />
                <param name="ntop" argument="--ntop" label="Number of rows to use" value="1000" type="integer"
                    help="Use only the top N most variable rows in the original matrix. Specifying 0 will result in all rows being used. If the matrix is to be transposed, rows with 0 variance are always excluded, even if a values of 0 is specified. The default is 1000." />
                <param name="log2" argument="--log2" type="boolean" truevalue="--log2" falsevalue="" label="log2 transform data" help="log2 transform the datapoints prior to computing the PCA. Note that 0.01 is added to all values to prevent 0 values from becoming -infinity. Using this option with input that contains negative values will result in an error." />
                <param argument="--transpose" type="boolean" label="Transpose Matrix?" help="Perform the PCA on the transpose of the matrix, (i.e., with samples as rows and features/genes as columns). This then matches what is typically done in R for RNAseq data." truevalue="--transpose" falsevalue="" />
                <param argument="--rowCenter" type="boolean" label="Center Rows?" help="When specified, each row (bin, gene, etc.) in the matrix is centered at 0 before the PCA is computed. This is useful only if you have a strong bin/gene/etc. correlation and the resulting principal component has samples stacked vertically. This option is not applicable if the PCA is performed on the transposed matrix." truevalue="--rowCenter" falsevalue="" />
                <param argument="--colors" type="text" name="colors" label="Symbol colors" value="" optional="True"
                    help="A list of colors for the symbols. Color names and html hex string (e.g., #eeff22) are accepted. The color names should be space separated. For example, --colors 'red blue green'. If not specified, the symbols will be given automatic colors." />
                <param argument="--markers" type="text" name="markers" label="Custom markers" value="" optional="True"
                    help="A list of markers for the symbols. (e.g., '&lt;','&gt;','o') are accepted. The marker values should be space separated. For example, 's' 'o' 's' 'o'. If not specified, the symbols will be given automatic shapes." />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <expand macro="output_image_file_format_not_nested" />
        <data format="tabular" name="output_outFileNameData" label="${tool.name} on ${on_string}: PCA matrix">
            <filter>outFileNameData</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="corData" value="multiBamSummary_result2b.npz" ftype="deeptools_coverage_matrix" />
            <param name="plotTitle" value="Test Plot" />
            <param name="outFileFormat" value="png" />
            <param name="showAdvancedOpt" value="yes" />
            <output name="outFileName" file="plotPCA_result1.png" ftype="png" compare="sim_size" delta="12000" />
        </test>
        <test>
            <param name="corData" value="multiBamSummary_result2b.npz" ftype="deeptools_coverage_matrix" />
            <param name="plotTitle" value="Test Plot" />
            <param name="outFileFormat" value="png" />
            <param name="outFileNameData" value="True" />
            <output name="outFileName" file="plotPCA_result2.png" ftype="png" compare="sim_size" delta="12000" />
            <output name="output_outFileNameData" file="plotPCA_result2.tabular" ftype="tabular" lines_diff="2" />
        </test>
    </tests>
    <help>
<![CDATA[

What it does
------------

This tool takes the **default output file** of ``multiBamSummary`` or ``multiBigwigSummary`` to perform a principal component analysis (PCA).

Output
------

The result is a panel of two plots:

1. Either the loadings (default) or the projections (``--transpose``) of the samples on the desired **two principal components**.
2. The **Scree plot** for principal components where the bars represent the eigenvalues the red line traces the amount of variability is explained by the individual components in a cumulative manner.

Example plot
------------

.. image:: $PATH_TO_IMAGES/plotPCA_annotated.png
   :width: 600
   :height: 315

-----

Theoretical Background
----------------------

Principal component analysis (PCA) can be used, for example, to determine whether **samples display greater variability** between experimental conditions than between replicates of the same treatment. PCA is also useful to identify unexpected patterns, such as those caused by batch effects or outliers.
Principal components represent the directions along which the variation in the data is maximal, so that the information (e.g., read coverage values) from thousands of regions can be represented by just a few dimensions.

PCA is not necessarily meant to identify unknown groupings or clustering; it is up to the researcher to determine the experimental or technical reason underlying the principal components.


-----

@REFERENCES@
]]>
    </help>
    <expand macro="citations" />
</tool>