diff hicPlotMatrix.xml @ 5:c3703afea1b1 draft

planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 80462804e4fd7deafbcf8e8c5283cc7a98fa7dd5
author bgruening
date Sat, 30 Dec 2017 09:21:50 -0500
parents fd5e51d2b558
children f93a78bc045e
line wrap: on
line diff
--- a/hicPlotMatrix.xml	Sat Dec 16 16:30:53 2017 -0500
+++ b/hicPlotMatrix.xml	Sat Dec 30 09:21:50 2017 -0500
@@ -1,4 +1,4 @@
-<tool id="hicexplorer_hicplotmatrix" name="@BINARY@" version="@WRAPPER_VERSION@.1">
+<tool id="hicexplorer_hicplotmatrix" name="@BINARY@" version="@WRAPPER_VERSION@.0">
     <description>Plots a HiC matrix heatmap</description>
     <macros>
         <token name="@BINARY@">hicPlotMatrix</token>
@@ -6,11 +6,20 @@
     </macros>
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
-        ln -s '$matrix' input_matrix.h5 &&
 
+        #if str($pca_conditional.pca_type) == 'bedgraph':
+            ln -s $pca_conditional.pca_bedgraph pca.bedgraph &&
+            #set $pca = '--pca pca.bedgraph'
+        #elif str($pca_conditional.pca_type) == 'bigwig':
+            ln -s $pca_conditional.pca_bigwig pca.bw &&
+            #set $pca = '--pca pca.bw'
+        #elif str($pca_conditional.pca_type) == '':
+            #set $pca = ''
+        #end if
+        
         @BINARY@
 
-            --matrix input_matrix.h5
+            --matrix '$matrix_h5_cooler'
 
             #if $title and $title is not None:
                 --title '$title'
@@ -20,15 +29,11 @@
                 --scoreName '$scoreName'
             #end if
 
-
             --outFileName plot.$image_file_format
 
             $perChromosome
             $clearMaskedBins
 
-            --whatToShow heatmap
-
-
             ## special: --chromosomeOrder is optional, but if given needs at least one argument
             #set chroms = '" "'.join([ str($var.chromosome) for $var in $chromosomeOrder ])
             #if chroms:
@@ -57,11 +62,14 @@
                 --vMax $vMax
             #end if
 
+            $pca
+
         && mv plot.$image_file_format plot
 ]]>
     </command>
     <inputs>
-        <param argument="--matrix" type="data" format="h5" label="Hi-C matrix to plot"/>
+        <expand macro='matrix_h5_cooler_macro' />
+
         <param argument="--title" type="text" optional="true" label="Plot title"/>
         <param argument="--scoreName" type="text" optional="true" label="Score name"/>
         <param argument="--perChromosome" type="boolean" truevalue="--perChromosome" falsevalue="" checked="false"
@@ -88,6 +96,23 @@
 
         <param argument="--vMin" type="float" optional="true" label="vMin"/>
         <param argument="--vMax" type="float" optional="true" label="vMax"/>
+
+        <conditional name="pca_conditional">
+            <param name='pca_type' label='Datatype of eigenvector file' type='select'>
+                <option value='' selected="true"></option>
+                <option value='bedgraph'>bedgraph</option>
+                <option value='bigwig'>bigwig</option>
+            </param>
+            <when value='' />
+            <when value='bedgraph'>
+                <param name='pca_bedgraph' type="data" format="bedgraph" 
+                            label="Eigenvector file"/>
+            </when>
+            <when value='bigwig'>
+                <param name='pca_bigwig'  type="data" format="bigwig" 
+                            label="Eigenvector file"/>
+            </when>
+        </conditional>
         <param name="image_file_format" type="select" label="Image output format">
             <option value="png" selected="True">png</option>
             <option value="svg">svg</option>
@@ -102,30 +127,63 @@
     </outputs>
     <tests>
         <test>
-            <param name="matrix" ftype="h5" value="Li_et_al_2015.h5"/>
+            <param name="matrix_h5_cooler" value="Li_et_al_2015.h5"/>
+            <conditional name="pca_conditional">
+                <param name="pca_type" value=''/>
+            </conditional>
             <param name="region" value="chrX:3000000-3500000"/>
             <param name="region2" value="chrX:3100000-3600000"/>
             <param name="log1p" value="True"/>
             <param name="clearMaskedBins" value="True"/>
-            <!-- <param name="whatToShow_select" value="heatmap"/> -->
             <param name="image_file_format" value="png" />
             <output name="outFileName" file="master_matrix_plot.png" ftype="png" compare="sim_size"/>
         </test>
+        <test>
+            <param name="matrix_h5_cooler" value="Li_et_al_2015.cool"/>
+            <conditional name="pca_conditional">
+                <param name="pca_type" value=''/>
+            </conditional>
+            <param name="region" value="X:3000000-3500000"/>
+            <param name="image_file_format" value="png" />
+            <output name="outFileName" file="Li_chrX30-35_cool.png" ftype="png" compare="sim_size"/>
+        </test>
+        <test>
+            <param name="matrix_h5_cooler" value="pearson_small_50kb.cool"/>
+            <param name="perChromosome" value="True"/>
+            <conditional name="pca_conditional">
+                <param name="pca_type" value='bedgraph'/>
+                <param name="pca_bedgraph" value="pca1.bedgraph"/>
+            </conditional>
+            <param name='colormap' value='hot'/>
+            <param name="image_file_format" value="svg" />
+            <output name="outFileName" file="small_matrix_50kb_pearson_pca1_plot.svg" ftype="svg" compare="sim_size" delta='35000'/>
+        </test>
+        <test>
+            <param name="matrix_h5_cooler" value="pearson_small_50kb.h5"/>
+            <param name="perChromosome" value="True"/>
+            <conditional name="pca_conditional">
+                <param name="pca_type" value='bigwig'/>
+                <param name="pca_bigwig" value="pca1.bw"/>
+            </conditional>
+            <param name='colormap' value='hot'/>
+            
+            <param name="image_file_format" value="svg" />
+            <output name="outFileName" file="small_matrix_50kb_pearson_pca1_plot.svg" ftype="svg" compare="sim_size" delta='35000'/>
+        </test>
     </tests>
     <help><![CDATA[
 Contact matrix plot
 =======================
 
 ``hicPlotMatrix`` is a visualization tool for a contact matrix. It supports to plot the whole contact matrix, one or more chromosomes, a region or two regions against each other.
-
-.. Additional it can plot the result of a principal component analysis to have a better understanding of A / B compartments.
+ Additional it can plot the result of a principal component analysis to have a better understanding of A / B compartments.
 
 Input
 -----
 
 Parameters
 __________
-- the contact matrix
+- the contact matrix: h5 or cool file format.
 - A title for the plot
 - Score name
 - per chromosome
@@ -135,8 +193,7 @@
 - log / log1p of the values: It is recommended to use log1p.
 - Colormaps_ for the heatmap. 
 - vMin / vMax
-
-.. - principal component: a bedgraph file 
+- principal component: a bedgraph or bigwig file containing eigenvector information
 
 Output
 ------
@@ -144,7 +201,7 @@
 The contact matrix plotted for chromosome 1.
 
 .. image:: SRR027956.svg
-   :width: 70%
+   :width: 60%
 
 
 The contact matrix used with ``--perChr`` and the first eigenvector from the tool ``hicPCA``. For this plot a pearson correlated matrix was used which is computed by creating first an observed / expected matrix and second a pearson correlation matrix. These matricies can be computed with ``hicChangeMatrixType``. The used Hi-C data were published by `Lieberman-Aiden <https://doi.org/10.1126/science.1181369>`_ in 2009, `GSE18199 <https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE18199>`_.