comparison hicPlotMatrix.xml @ 25:8f0ad6a9476f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 8586409c5f329eaf75902eedc3d29a6e82560788
author iuc
date Mon, 01 Jul 2024 19:11:51 +0000
parents 4fa8acf5581c
children
comparison
equal deleted inserted replaced
24:4fa8acf5581c 25:8f0ad6a9476f
1 <tool id="hicexplorer_hicplotmatrix" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> 1 <tool id="hicexplorer_hicplotmatrix" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>plot a Hi-C contact matrix heatmap</description> 2 <description>plot a Hi-C contact matrix heatmap</description>
3 <macros> 3 <macros>
4 <token name="@BINARY@">hicPlotMatrix</token> 4 <token name="@BINARY@">hicPlotMatrix</token>
5 <import>macros.xml</import> 5 <import>macros.xml</import>
6 </macros> 6 </macros>
8 <command detect_errors="exit_code"><![CDATA[ 8 <command detect_errors="exit_code"><![CDATA[
9 9
10 #if str($pca_conditional.pca_type) == 'bigwig': 10 #if str($pca_conditional.pca_type) == 'bigwig':
11 ln -s '$pca_conditional.pca_bigwig' pca.bw && 11 ln -s '$pca_conditional.pca_bigwig' pca.bw &&
12 #set $pca = '--bigwig pca.bw' 12 #set $pca = '--bigwig pca.bw'
13 #elif str($pca_conditional.pca_type) == '': 13 #elif str($pca_conditional.pca_type) == 'no_file':
14 #set $pca = '' 14 #set $pca = ''
15 #end if 15 #end if
16 ln -s $matrix_h5_cooler matrix.$matrix_h5_cooler.ext && 16 ln -s $matrix_h5_cooler matrix.$matrix_h5_cooler.ext &&
17 @BINARY@ 17 @BINARY@
18 --matrix 'matrix.$matrix_h5_cooler.ext' 18 --matrix 'matrix.$matrix_h5_cooler.ext'
95 95
96 #if $increaseFigureHeight: 96 #if $increaseFigureHeight:
97 --increaseFigureHeight $increaseFigureHeight 97 --increaseFigureHeight $increaseFigureHeight
98 #end if 98 #end if
99 99
100 #if $loops: 100 #if str($loop_conditional.loop_selector) == 'yes':
101 --loops '$loops' 101 --loops $loop_conditional.loops
102 --loopLargeRegionsOperation $loop_conditional.loops_large_selector
103 #end if
104
105 #if $tads:
106 --tads '$tads'
102 #end if 107 #end if
103 && mv plot.$image_file_format plot 108 && mv plot.$image_file_format plot
104 ]]> 109 ]]>
105 </command> 110 </command>
106 <inputs> 111 <inputs>
107 <expand macro='matrix_h5_cooler_macro' /> 112 <expand macro="matrix_h5_cooler_macro" />
108 113
109 <param argument="--title" type="text" optional="true" label="Plot title"> 114 <param argument="--title" type="text" optional="true" label="Plot title">
110 <validator type="expression" message="Only alphanumeric characters and a space are allowed.">value.isalnum()</validator> 115 <validator type="expression" message="Only alphanumeric characters and a space are allowed.">value.isalnum()</validator>
111 </param> 116 </param>
112 <param argument="--scoreName" type="text" optional="true" label="Score name" help="The label for the heatmap legend."> 117 <param argument="--scoreName" type="text" optional="true" label="Score name" help="The label for the heatmap legend.">
130 <param argument="--log1p" type="boolean" truevalue="--log1p" falsevalue="" checked="false" label="Plot the log1p of the matrix values (log(Hi-C contacts+1)). This option is recommended." /> 135 <param argument="--log1p" type="boolean" truevalue="--log1p" falsevalue="" checked="false" label="Plot the log1p of the matrix values (log(Hi-C contacts+1)). This option is recommended." />
131 <param argument="--log" type="boolean" truevalue="--log" falsevalue="" checked="false" label="Plot the log of the matrix values. (log(Hi-C contacts))" /> 136 <param argument="--log" type="boolean" truevalue="--log" falsevalue="" checked="false" label="Plot the log of the matrix values. (log(Hi-C contacts))" />
132 <param argument="--fontSize" type="integer" optional="true" label="Font size" help="Fontsize in the plot for x and y axis." /> 137 <param argument="--fontSize" type="integer" optional="true" label="Font size" help="Fontsize in the plot for x and y axis." />
133 <param argument="--rotationX" type="integer" optional="true" label="Rotate x-labels by degree" help="Rotation in degrees for the labels of x-axis." /> 138 <param argument="--rotationX" type="integer" optional="true" label="Rotate x-labels by degree" help="Rotation in degrees for the labels of x-axis." />
134 <param argument="--rotationY" type="integer" optional="true" label="Rotate y-labels by degree" help="Rotation in degrees for the labels of y-axis." /> 139 <param argument="--rotationY" type="integer" optional="true" label="Rotate y-labels by degree" help="Rotation in degrees for the labels of y-axis." />
135 <param argument="--increaseFigureWidth" type="float" value='0.5' optional="true" label="Increase figure width size" help="Plotting additional bigwig tracks can cause compression in x or y direction of the heatmap. Set this factor to a value unequal to 0 to correct this." /> 140 <param argument="--increaseFigureWidth" type="float" value="0.5" optional="true" label="Increase figure width size" help="Plotting additional bigwig tracks can cause compression in x or y direction of the heatmap. Set this factor to a value unequal to 0 to correct this." />
136 <param argument="--increaseFigureHeight" type="float" value='0.5' optional="true" label="Increase figure height size" help="Plotting additional bigwig tracks can cause compression in x or y direction of the heatmap. Set this factor to a value unequal to 0 to correct this." /> 141 <param argument="--increaseFigureHeight" type="float" value="0.5" optional="true" label="Increase figure height size" help="Plotting additional bigwig tracks can cause compression in x or y direction of the heatmap. Set this factor to a value unequal to 0 to correct this." />
137 <expand macro="colormap" /> 142 <expand macro="colormap" />
138 143
139 <param argument="--vMin" type="float" optional="true" label="vMin" help="Minimum value of the plotted score." /> 144 <param argument="--vMin" type="float" optional="true" label="vMin" help="Minimum value of the plotted score." />
140 <param argument="--vMax" type="float" optional="true" label="vMax" help="Maximum value of the plotted score." /> 145 <param argument="--vMax" type="float" optional="true" label="vMax" help="Maximum value of the plotted score." />
141 146
142 <conditional name="pca_conditional"> 147 <conditional name="pca_conditional">
143 <param name='pca_type' label='Datatype of eigenvector file' type='select'> 148 <param name="pca_type" label="Datatype of eigenvector file" type="select">
144 <option value='' selected="true">None</option> 149 <option value="no_file" selected="true">No file</option>
145 <option value='bigwig'>bigwig</option> 150 <option value="bigwig">bigwig</option>
146 </param> 151 </param>
147 <when value='' /> 152 <when value="no_file" />
148 <when value='bigwig'> 153 <when value="bigwig">
149 <param name='pca_bigwig' type="data" format="bigwig" label="Eigenvector file" /> 154 <param name="pca_bigwig" type="data" format="bigwig" label="Eigenvector file" />
150 <param argument="--vMinBigwig" type="float" optional="true" label="vMinBigwig" help="Minimum value of the plotted bigwig score." /> 155 <param argument="--vMinBigwig" type="float" optional="true" label="vMinBigwig" help="Minimum value of the plotted bigwig score." />
151 <param argument="--vMaxBigwig" type="float" optional="true" label="vMaxBigwig" help="Maximum value of the plotted bigwig score." /> 156 <param argument="--vMaxBigwig" type="float" optional="true" label="vMaxBigwig" help="Maximum value of the plotted bigwig score." />
152 <param name='flipBigwigSign' type='boolean' optional="true" truevalue='--flipBigwigSign' falsevalue='' label='Flip the sign of the bigwig values' /> 157 <param name="flipBigwigSign" type="boolean" optional="true" truevalue="--flipBigwigSign" falsevalue="" label="Flip the sign of the bigwig values" />
153 <param argument="--scaleFactorBigwig" type="float" optional="true" label="Scale factor for bigwig" help="Scale the bigwig values by a factor." /> 158 <param argument="--scaleFactorBigwig" type="float" optional="true" label="Scale factor for bigwig" help="Scale the bigwig values by a factor." />
154 <param name='bigwigAdditionalVerticalAxis' type='boolean' optional="true" truevalue='--bigwigAdditionalVerticalAxis' falsevalue='' label='Plot an additional vertical axis.' /> 159 <param name="bigwigAdditionalVerticalAxis" type="boolean" optional="true" truevalue="--bigwigAdditionalVerticalAxis" falsevalue="" label="Plot an additional vertical axis." />
155 </when> 160 </when>
156 </conditional> 161 </conditional>
157 <param name='loops' type="data" format="interval" optional='True' label="Add detected loops" /> 162 <conditional name="loop_conditional">
163 <param name="loop_selector" type="select" label="Plot loops">
164 <option value="yes">Yes</option>
165 <option value="no" selected="True">No</option>
166 </param>
167 <when value="yes">
168 <param name="loops" type="data" format="interval" optional="True" label="Add detected loops" />
169 <param name="loops_large_selector" label="Start bin of the loop for plotting" type="select">
170 <option value="first" selected="true">First</option>
171 <option value="center">Center</option>
172 <option value="last">Last</option>
173 </param>
174 </when>
175 <when value="no" />
176
177 </conditional>
178 <param name="loops" type="data" format="interval" optional="True" label="Add detected loops" />
179 <param name="tads" type="data" format="interval" optional="True" label="Add detected tads" />
180
158 <param name="image_file_format" type="select" label="Image output format"> 181 <param name="image_file_format" type="select" label="Image output format">
159 <option value="png" selected="True">png</option> 182 <option value="png" selected="True">png</option>
160 <option value="svg">svg</option> 183 <option value="svg">svg</option>
161 <option value="pdf">pdf</option> 184 <option value="pdf">pdf</option>
162 </param> 185 </param>
172 </outputs> 195 </outputs>
173 <tests> 196 <tests>
174 <test> 197 <test>
175 <param name="matrix_h5_cooler" value="small_test_matrix.h5" /> 198 <param name="matrix_h5_cooler" value="small_test_matrix.h5" />
176 <conditional name="pca_conditional"> 199 <conditional name="pca_conditional">
177 <param name="pca_type" value='' /> 200 <param name="pca_type" value="no_file" />
178 </conditional> 201 </conditional>
179 <param name="region" value="chr2L:3000000-3500000" /> 202 <param name="region" value="chr2L:3000000-3500000" />
180 <param name="region2" value="chr2L:3100000-3600000" /> 203 <param name="region2" value="chr2L:3100000-3600000" />
181 <param name="log1p" value="True" /> 204 <param name="log1p" value="True" />
182 <param name="clearMaskedBins" value="True" /> 205 <param name="clearMaskedBins" value="True" />
187 </test> 210 </test>
188 <test> 211 <test>
189 <param name="matrix_h5_cooler" value="small_test_matrix.cool" /> 212 <param name="matrix_h5_cooler" value="small_test_matrix.cool" />
190 <param name="region" value="chr2L:3000000-3500000" /> 213 <param name="region" value="chr2L:3000000-3500000" />
191 <conditional name="pca_conditional"> 214 <conditional name="pca_conditional">
192 <param name="pca_type" value='' /> 215 <param name="pca_type" value="no_file" />
193 </conditional> 216 </conditional>
194 <param name="image_file_format" value="pdf" /> 217 <param name="image_file_format" value="pdf" />
195 <param name="dpi" value="10" /> 218 <param name="dpi" value="10" />
196 <output name="outFileName" file="hicPlotMatrix/plot2.pdf" ftype="pdf" compare="sim_size" /> 219 <output name="outFileName" file="hicPlotMatrix/plot2.pdf" ftype="pdf" compare="sim_size" />
197 </test> 220 </test>
198 <test> 221 <test>
199 <param name="matrix_h5_cooler" value="small_test_matrix.cool" /> 222 <param name="matrix_h5_cooler" value="small_test_matrix.cool" />
200 <conditional name="pca_conditional"> 223 <conditional name="pca_conditional">
201 <param name="pca_type" value='bigwig' /> 224 <param name="pca_type" value="bigwig" />
202 <param name="pca_bigwig" value="hicPCA/pca1_test1.bw" /> 225 <param name="pca_bigwig" value="hicPCA/pca1_test1.bw" />
203 <param name='vMinBigwig' value='10' /> 226 <param name="vMinBigwig" value="10" />
204 <param name='vMaxBigwig' value='20' /> 227 <param name="vMaxBigwig" value="20" />
205 <param name='scaleFactorBigwig' value='2000' /> 228 <param name="scaleFactorBigwig" value="2000" />
206 <param name='flipBigwigSign' value='True' /> 229 <param name="flipBigwigSign" value="True" />
207 </conditional> 230 </conditional>
208 <param name='colormap' value='hot' /> 231 <param name="colormap" value="hot" />
209 <param name="region" value="chr2L:3000000-3500000" /> 232 <param name="region" value="chr2L:3000000-3500000" />
210 <param name="dpi" value="10" /> 233 <param name="dpi" value="10" />
211 234
212 <param name="image_file_format" value="svg" /> 235 <param name="image_file_format" value="svg" />
213 <output name="outFileName" file="hicPlotMatrix/plot3_pca.svg" ftype="svg" compare="sim_size" /> 236 <output name="outFileName" file="hicPlotMatrix/plot3_pca.svg" ftype="svg" compare="sim_size" />
238 .. image:: $PATH_TO_IMAGES/hicPlotMatrix.png 261 .. image:: $PATH_TO_IMAGES/hicPlotMatrix.png
239 :width: 50% 262 :width: 50%
240 263
241 Contact matrix of *Drosophila melanogaster* embryos visualized using **hicPlotMatrix**. Hi-C matrix bins were merged to a 25 kb bin size using ``hicMergeMatrixBins`` and the matrix has then been corrected using ``hicCorrectMatrix`` before plotting. 264 Contact matrix of *Drosophila melanogaster* embryos visualized using **hicPlotMatrix**. Hi-C matrix bins were merged to a 25 kb bin size using ``hicMergeMatrixBins`` and the matrix has then been corrected using ``hicCorrectMatrix`` before plotting.
242 265
243 Another example is available below using Hi-C data 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>`_). A Hi-C contact matrix has been plotted with the ``--perChr`` option and the first eigenvector (pca1) computed by ``hicPCA``. For this plot a pearson correlated matrix was used, which is computed by first creating an observed / expected matrix and then a pearson correlation matrix with ``hicTransform``. 266 Another example is available below using Hi-C data published by `Lieberman-Aiden <https://pubmed.ncbi.nlm.nih.gov/19815776/>`_ in 2009, (`GSE18199 <https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE18199>`_). A Hi-C contact matrix has been plotted with the ``--perChr`` option and the first eigenvector (pca1) computed by ``hicPCA``. For this plot a pearson correlated matrix was used, which is computed by first creating an observed / expected matrix and then a pearson correlation matrix with ``hicTransform``.
244 267
245 .. image:: $PATH_TO_IMAGES/SRR0279XX_perChr_eigenvector1.png 268 .. image:: $PATH_TO_IMAGES/SRR0279XX_perChr_eigenvector1.png
246 :width: 70 % 269 :width: 70 %
247 270
248 _________________ 271 _________________