view hicPCA.xml @ 5:dbf4afa03b00 draft

planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit dddc0b9035b8edadfd45d74b01aeca245c2725d7
author iuc
date Fri, 27 Apr 2018 08:39:37 -0400
parents 38a612a120a8
children ebb9b94138c1
line wrap: on
line source

<tool id="hicexplorer_hicpca" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <description>compute the principal components for A / B compartment analysis</description>
    <macros>
        <token name="@BINARY@">hicPCA</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[

        hicPCA --matrix '$matrix_h5_cooler'

        --outputFileName pca1.$outputFormat pca2.$outputFormat
        --format $outputFormat

        && mv pca1.$outputFormat pca1
        && mv pca2.$outputFormat pca2

]]>
    </command>
    <inputs>
        <expand macro='matrix_h5_cooler_macro' />
        <param name='outputFormat' type='select' label="Output file format">
            <option value='bigwig' selected="true">bigwig</option>
            <option value="bedgraph">bedgraph</option>
        </param>

    </inputs>
    <outputs>

        <data name="pca1" from_work_dir="pca1" format="bigwig" label="${tool.name} on ${matrix_h5_cooler.name} [${on_string}]: PC1">
            <filter>outputFormat == 'bigwig'</filter>
            <change_format>
                <when input="outputFormat" value="bedgraph" format="bedgraph" />
            </change_format>
        </data>
        <data name="pca2" from_work_dir="pca2" format="bigwig"  label="${tool.name} on ${matrix_h5_cooler.name} [${on_string}]: PC2">
            <change_format>
                <when input="outputFormat" value="bedgraph" format="bedgraph" />
            </change_format>
        </data>


    </outputs>
    <tests>
        <test>
            <param name="matrix_h5_cooler" value="small_test_matrix_50kb_res.h5"/>
            <param name="outputFormat" value="bedgraph" />
            <output name="pca1" file="pca1.bedgraph" ftype="bedgraph" compare="sim_size"/>
            <output name="pca2" file="pca2.bedgraph" ftype="bedgraph" compare="sim_size"/>
        </test>
        <test>
            <param name="matrix_h5_cooler" value="small_test_matrix_50kb_res.h5"/>

            <param name="outputFormat" value="bigwig" />
            <output name="pca1" file="pca1.bw" ftype="bigwig" compare="sim_size"/>
            <output name="pca2" file="pca2.bw" ftype="bigwig" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
Principal component analysis
============================

`Lieberman-Aiden et al. (2009)`_ demonstrated that open and closed chromatin domains throughout the genome occupy different spatial compartments in the nucleus, defined as A (activate) and B (inactive) compartments.

**hicPCA** computes two eigenvector files based on the input matrix for an A / B compartment analysis following the computation steps detailed by `Lieberman-Aiden et al. (2009)`_: the transformation of the contact matrix
into an observed vs. expected matrix and consecutively a Pearson correlation matrix shows a plaid pattern. These plaid pattern are called A and B. Applying a PCA on the Pearson correlation matrix gives the eigenvectors
and Lieberman-Aiden shows that the values of the eigenvectors correspond to the distribution of genes and with features of open and closed chromatin. In some cases the first principal component corresponds to the two
chromosomes arms and the second eigenvector to the plaid pattern. Therefore always the first two principal components needs to be returned and investigated.

_________________

Usage
-----

This tool must be used on Hi-C contact matrices with large bins (over 20kb) using ``hicMergeMatrixBins`` and corrected with ``hicCorrectMatrix``. Using matrices with a too high resolution (small bins or at restriction enzyme resolution) might take several days to run (even with over 100 CPU) or will fail due to memory limitations.

_________________

Output
------
Two files are outputed by **hicPCA**, one with the first (pca1) and one with the second (pca2) eigenvector as bigwig or bedgraph. These files can be plotted alongside Hi-C heatmaps, gene density or external datasets such as open chromatin or histone marks enrichment using ``hicPlotTADs`` or ``hicPlotMatrix``.

For example, below you can find a ``hicPlotMatrix`` of the Pearson correlation matrix derived from a contact matrix for chromosome 6 in mouse computed with ``hicTransform`` (which is part of A/B compartments computation). The optional data track at the bottom shows the first eigenvector for A/B compartment obtained using **hicPCA**.

.. image:: $PATH_TO_IMAGES/hicPCA.png
   :scale: 35 %

_________________

| For more information about HiCExplorer please consider our documentation on readthedocs.io_

.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
.. _`Lieberman-Aiden et al. (2009)`: https://dx.doi.org/10.1126%2Fscience.1181369
]]></help>
    <expand macro="citations" />
</tool>