diff hicTransform.xml @ 8:ae9cc6dbfaca draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 3b41d687ff30583540d055f6995de00530cca81d-dirty"
author bgruening
date Mon, 16 Dec 2019 15:41:36 -0500
parents 014e59185b0c
children 3f529510975e
line wrap: on
line diff
--- a/hicTransform.xml	Mon Dec 16 08:53:27 2019 -0500
+++ b/hicTransform.xml	Mon Dec 16 15:41:36 2019 -0500
@@ -7,75 +7,62 @@
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
 
-
-        hicTransform --matrix '$matrix_h5_cooler'
-        --method all
-        --outFileName matrix.$outputFormat
-        && mv obs_exp_matrix.$outputFormat obs_exp_matrix
-        && mv pearson_matrix.$outputFormat pearson_matrix
-        && mv covariance_matrix.$outputFormat covariance_matrix
+        ln -s '$matrix_h5_cooler' 'matrix.$matrix_h5_cooler.ext' &&
+        @BINARY@ --matrix 'matrix.$matrix_h5_cooler.ext'
+        --method $method_selector
+        --outFileName 'matrix.$matrix_h5_cooler.ext'
+        && mv 'matrix.$matrix_h5_cooler.ext' matrix
 ]]>
     </command>
     <inputs>
         <expand macro='matrix_h5_cooler_macro' />
-        <param name='outputFormat' type='select' label="Output file format">
-            <option value='h5'>HiCExplorer format</option>
-            <option value="cool">cool</option>
+        <param name="method_selector" type="select" label="Choose method to apply">
+                <option value="obs_exp" selected="True">obs / exp</option>
+                <option value="obs_exp_norm">obs / exp (Homer norm)</option>
+                <option value="obs_exp_non_zero">obs / exp (exclude non-zero from exp)</option>
+                <option value="pearson">pearson</option>
+                <option value="covariance">covariance</option>
         </param>
 
     </inputs>
     <outputs>
-        <data name="obs_exp" from_work_dir="obs_exp_matrix" format="h5" label="${tool.name} on ${matrix_h5_cooler.name} [${on_string}]: Observed/Expected matrix">
+        <data name="matrix_out" from_work_dir="matrix" format="cool" label="${tool.name} on ${matrix_h5_cooler.name} [${on_string}]: $method_selector">
             <change_format>
-                <when input="outputFormat" value="cool" format="cool"/>
+                <when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5"/>
             </change_format>
         </data>
-        <data name="pearson" from_work_dir="pearson_matrix" format="h5" label="${tool.name}  on ${matrix_h5_cooler.name} [${on_string}]: Pearson matrix">
-            <change_format>
-                <when input="outputFormat" value="cool" format="cool"/>
-            </change_format>
-        </data>
-        <data name="covariance" from_work_dir="covariance_matrix" format="h5" label="${tool.name} on ${matrix_h5_cooler.name} [${on_string}]: Covariance matrix">
-            <change_format>
-                <when input="outputFormat" value="cool" format="cool"/>
-            </change_format>
-        </data>
-
     </outputs>
     <tests>
         <test>
-            <param name="matrix_h5_cooler" value="small_test_matrix_50kb_res.h5"/>
-            <param name="outputFormat" value="h5" />
-            <output name="obs_exp" file="obs_exp_small_50kb.h5" ftype="h5" compare="sim_size"/>
-            <output name="pearson" file="pearson_small_50kb.h5" ftype="h5" compare="sim_size" delta="50000"/>
-            <output name="covariance" file="covariance_small_50kb.h5" ftype="h5" compare="sim_size" delta="150000"/>
-        </test>
-        <test>
-            <param name="matrix_h5_cooler" value="small_test_matrix_50kb_res.h5"/>
-            <param name="outputFormat" value="cool" />
-            <output name="obs_exp" file="obs_exp_small_50kb.cool" ftype="cool" compare="sim_size"/>
-            <output name="pearson" file="pearson_small_50kb_transform.cool" ftype="cool" compare="sim_size"/>
-            <output name="covariance" file="covariance_small_50kb.cool" ftype="cool" compare="sim_size"/>
+            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
+            <param name='method_selector' value='obs_exp_norm'/>
+            <output name="matrix_out" ftype="h5">
+                <assert_contents>
+                    <has_h5_keys keys='intervals,matrix'/>
+                </assert_contents>
+            </output>
         </test>
     </tests>
     <help><![CDATA[
 Transformation of matrix for plotting
 =====================================
 
-**hicTransform** computes three matrices based on one Hi-C contact matrix as input based on the methods determined by `Lieberman-Aiden et al. (2009)`_:
+**hicTransform** computes a matrix based on one Hi-C contact matrix as input:
 
 - An **observed/expected matrix** obtained "by dividing each entry in the contact matrix by the genome-wide average contact probability for loci at that genomic distance" (`Lieberman-Aiden et al. (2009)`_). This transformation allows to better assess long range interactions.
+- An **observed/expected norm matrix** which computes the expected matrix as EXP_i,j = sum(diagonal(i-j)) * sum(row(j)) * sum(row(i)) / sum(matrix)
+- An **observed/expected non-zero values matrix** which computes the expected matrix as the sum per genomic distance j divided by sum of non-zero contacts: sum(diagonal(j) / number of non-zero elements in diagonal(j)
 - A **Pearson correlation matrix** obtained by computing the Pearson correlation between each bin based on observed/expected values. This matrix transformation allows to better identify the bins that are entering in contact together, or not, at long ranges, and thus helps defining compartments in the nucleus (``hicPCA``).
 - A **covariance matrix**, which is used as a basis for the Principal Component Analysis (PCA) to compute the eigenvectors outputed by **hicTransform**.
 
-These three matrices can be used with ``hicPlotMatrix`` or ``hicPlotTADs`` for a visualization of the A / B compartment analysis.
+These matrices can be used with ``hicPlotMatrix`` or ``pyGenomeTracks`` for a visualization of the A / B compartment analysis.
 
 _________________
 
 Output
 ------
 
-From one Hi-C contact matrix, **hicTransform** outputs the observed/expected, Pearson correlation and covariance matrices.
+From one Hi-C contact matrix, **hicTransform** outputs a matrix with the selected method applied.
 
 _________________