diff hicCorrectMatrix.xml @ 5:44919af9194b 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:24:06 -0500
parents b55d7936cbe0
children 1612e9458940
line wrap: on
line diff
--- a/hicCorrectMatrix.xml	Sat Dec 16 16:35:10 2017 -0500
+++ b/hicCorrectMatrix.xml	Sat Dec 30 09:24:06 2017 -0500
@@ -7,11 +7,9 @@
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
 
-        ln -s '$matrix' temp_matrix.npz.h5 &&
-
         hicCorrectMatrix
             $mode.mode_selector
-            --matrix temp_matrix.npz.h5
+            --matrix '$matrix_h5_cooler'
 
             ## special: --chromosomes is optional, but if given needs at least one argument
             #set chroms = '" "'.join([ str($var.chromosome) for $var in $chromosomes ])
@@ -22,7 +20,11 @@
             #if $mode.mode_selector == 'correct':
 
                 --iterNum $mode.iterNum
-                --outFileName corrected_matrix.npz.h5
+                #if $mode.outputFormat == 'h5'
+                    --outFileName matrix.h5
+                #elif $mode.outputFormat == 'cool'
+                    --outFileName matrix.cool
+                #end if
 
                 #if $mode.filterThreshold_low and $mode.filterThreshold_large:
                     --filterThreshold $mode.filterThreshold_low $mode.filterThreshold_large
@@ -62,9 +64,7 @@
 ]]>
     </command>
     <inputs>
-        <param argument="--matrix" name="matrix" type="data" format="h5"
-            label="Hi-C matrix" />
-
+        <expand macro='matrix_h5_cooler_macro' />
         <conditional name="mode">
             <param name="mode_selector" type="select" label="Range restriction (in bp)" argument="--range">
                 <option value="diagnostic_plot">Diagnostic plot</option>
@@ -97,7 +97,10 @@
                 <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false"
                     label="Normalize each chromosome separately" />
                 <expand macro="filterThreshold" />
-
+                <param name='outputFormat' type='select' label="Output file format">
+                    <option value='h5'>HiCExplorer format</option>
+                    <option value="cool">cool</option>
+                </param>
             </when>
         </conditional>
 
@@ -111,16 +114,25 @@
 
     </inputs>
     <outputs>
-        <data name="outFileName"  from_work_dir="corrected_matrix.npz.h5" format="h5">
+        <data name="outFileName_h5" from_work_dir="matrix.h5" format="h5">
+            <filter>outputFormat == 'h5'</filter>
             <filter>mode['mode_selector'] == "correct"</filter>
+            
         </data>
+        <data name="outFileName_cool" from_work_dir="matrix.cool" format="cool">
+            <filter>outputFormat == 'cool'</filter>
+            <filter>mode['mode_selector'] == "correct"</filter>
+            
+        </data>
+       
         <data name="diagnostic_plot" from_work_dir="diagnostic_plot.png" format="png">
             <filter>mode['mode_selector'] == "diagnostic_plot"</filter>
         </data>
     </outputs>
     <tests>
         <test>
-            <param name="matrix" value="small_test_matrix.h5" ftype="h5"/>
+            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
+            
             <param name="mode_selector" value="correct"/>
             <repeat name="chromosomes">
                 <param name="chromosome" value="chrUextra"/>
@@ -128,10 +140,12 @@
             <repeat name="chromosomes">
                 <param name="chromosome" value="chr3LHet"/>
             </repeat> 
-            <output name="outFileName" file="hicCorrectMatrix_result1.npz.h5" ftype="h5" compare="sim_size"/>
+            <param name='outputFormat' value='h5'/>
+
+            <output name="outFileName_h5" file="hicCorrectMatrix_result1.npz.h5" ftype="h5" compare="sim_size"/>
         </test>
         <test>
-            <param name="matrix" ftype="h5" value="small_test_matrix.h5"/>
+            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
             <param name="mode_selector" value="diagnostic_plot"/>
             <repeat name="chromosomes">
                 <param name="chromosome" value="chrUextra"/>
@@ -147,12 +161,12 @@
 Matrix correction
 ==================
 
-| ``hicCorrectMatrix`` runs Dekker's iterative correction over a Hi-C matrix (`Imakaev 2012`_.). For correcting the matrix, 
-| it is important to remove the unassembled scaffolds (e.g. `NT_`), mitochondrial DNA and Y chromosome and keep only 
-| chromosomes, as scaffolds create problems with matrix correction. Therefore 
-| we use the chromosome names (1-19, X, Y) here. 
-| 
-| **Important**: Use ‘chr1 chr2 chr3 etc.’ if your genome index uses chromosome names with the ‘chr’ prefix.
+``hicCorrectMatrix`` runs Dekker's iterative correction over a Hi-C matrix (`Imakaev 2012`_.). For correcting the matrix, 
+it is important to remove the unassembled scaffolds (e.g. `NT_`), mitochondrial DNA and Y chromosome and keep only 
+chromosomes, as scaffolds create problems with matrix correction. Therefore 
+we use the chromosome names (1-19, X, Y) here. 
+ 
+**Important**: Use ‘chr1 chr2 chr3 etc.’ if your genome index uses chromosome names with the ‘chr’ prefix.
 
 Matrix correction works in two steps: first a histogram containing the sum of contact  per bin (row sum) is produced. This plot needs to be inspected to decide the best threshold for removing bins with lower number of reads. The second steps removes the low scoring bins and does the correction.