diff hicCorrectMatrix.xml @ 15:3bd060bcefed draft

"planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 91a0182476a7fc26be7bef1677790518c4e88348-dirty"
author bgruening
date Mon, 16 Dec 2019 13:09:28 +0000
parents bccd04d7e35d
children 9582c8c75c17
line wrap: on
line diff
--- a/hicCorrectMatrix.xml	Mon Dec 09 10:25:15 2019 +0000
+++ b/hicCorrectMatrix.xml	Mon Dec 16 13:09:28 2019 +0000
@@ -6,56 +6,58 @@
     </macros>
     <expand macro="requirements" />
     <command detect_errors="exit_code"><![CDATA[
-        ln -s '$matrix_h5_cooler' 'matrix.$matrix_h5_cooler.ext' &&
-        
-        @BINARY@
+
+        hicCorrectMatrix
             $mode.mode_selector
-            --matrix 'matrix.$matrix_h5_cooler.ext'
+            --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 ])
+            #set chroms = '" "'.join([ str($var.chromosome) for $var in $chromosomes ])
             #if chroms
-                --chromosomes $chroms
+                --chromosomes "$chroms"
             #end if
 
             #if $mode.mode_selector == 'correct':
-                #if $mode.correctionMethod.correctionMethod_selector == 'ice':
-                    --correctionMethod ICE
-                    --iterNum $mode.correctionMethod.iterNum
-                    
+
+                --iterNum $mode.iterNum
+                --outFileName matrix.$mode.outputFormat
 
-                    #if $mode.correctionMethod.filterThreshold_low and $mode.correctionMethod.filterThreshold_large:
-                        --filterThreshold $mode.correctionMethod.filterThreshold_low $mode.correctionMethod.filterThreshold_large
-                    #end if
+                #if $mode.filterThreshold_low and $mode.filterThreshold_large:
+                    --filterThreshold $mode.filterThreshold_low $mode.filterThreshold_large
+                #end if
 
-                    #if $mode.correctionMethod.inflationCutoff:
-                        --inflationCutoff $mode.correctionMethod.inflationCutoff
-                    #end if
+                #if $mode.inflationCutoff:
+                    --inflationCutoff $mode.inflationCutoff
+                #end if
 
-                    #if $mode.correctionMethod.transCutoff:
-                        --transCutoff $mode.correctionMethod.transCutoff
-                    #end if
-
-                    #if $mode.correctionMethod.sequencedCountCutoff:
-                        --sequencedCountCutoff $mode.correctionMethod.sequencedCountCutoff
-                    #end if
+                #if $mode.transCutoff:
+                    --transCutoff $mode.transCutoff
+                #end if
 
-                    $mode.correctionMethod.skipDiagonal
-                    $mode.correctionMethod.perchr
-                #else:
-                    --correctionMethod KR
+                #if $mode.sequencedCountCutoff:
+                    --sequencedCountCutoff $mode.sequencedCountCutoff
                 #end if
-                --outFileName matrix.$matrix_h5_cooler.ext
-            #elif $mode.mode_selector == 'diagnostic_plot':
+
+                $mode.skipDiagonal
+                $mode.perchr
+
+            #elif $mode.mode_selector == 'merge_failed':
                 --plotName diagnostic_plot.png
-                ##--outMatrixFile corrected_matrix.npz.h5
+                --outMatrixFile corrected_matrix.npz.h5
                 #if $mode.xMax:
                     --xMax $mode.xMax
                 #end if
-                $mode.perchr
+                #if $mode.filterThreshold_low and $mode.filterThreshold_large:
+                    --filterThreshold '$mode.filterThreshold_low' '$mode.filterThreshold_large'
+                #end if
+            #else:
+                --plotName diagnostic_plot.png
+                #if $mode.xMax:
+                    --xMax $mode.xMax
+                #end if
             #end if
         #if $mode.mode_selector == 'correct':
-            && mv matrix.$matrix_h5_cooler.ext matrix
+            && mv matrix.$mode.outputFormat matrix
         #end if
 ]]>
     </command>
@@ -68,44 +70,35 @@
             </param>
             <when value="diagnostic_plot">
                 <expand macro="xMax" />
-                <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false"
-                            label="Compute statistics for each chromosome separately" />
             </when>
             <when value="correct">
-                <conditional name='correctionMethod'>
-                    <param name='correctionMethod_selector' type='select' label='Correction method'>
-                        <option value='ice'>Iterative_correction (Imakaev)</option>
-                        <option value='kr'>Knights-Ruiz</option>
-                    </param>
+                <param argument="--iterNum" name="iterNum" type="integer" optional="true" value="500"
+                    label="Number of iterations" />
 
-                    <when value='ice'>
-                        <param argument="--iterNum" name="iterNum" type="integer" optional="true" value="500"
-                            label="Number of iterations" />
+                <param argument="--inflationCutoff" name="inflationCutoff" type="float" optional="true"
+                    label="Inflation cutoff" value=""
+                    help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction.
+                    For example, a inflationCutoff of 3 will filter out all bins that were expanded 3 times or more during the iterative correction."/>
 
-                        <param argument="--inflationCutoff" name="inflationCutoff" type="float" optional="true"
-                            label="Inflation cutoff" value=""
-                            help="Value corresponding to the maximum number of times a bin can be scaled up during the iterative correction.
-                            For example, a inflationCutoff of 3 will filter out all bins that were expanded 3 times or more during the iterative correction."/>
+                <param argument="--transCutoff" name="transCutoff" type="float" optional="true"
+                    label="Trans region cutoff" value=""
+                    help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05."/>
 
-                        <param argument="--transCutoff" name="transCutoff" type="float" optional="true"
-                            label="Trans region cutoff" value=""
-                            help="Clip high counts in the top -transcut trans regions (i.e. between chromosomes). A usual value is 0.05."/>
+                <param argument="--sequencedCountCutoff" name="sequencedCountCutoff" optional="true" type="float"
+                    label="Sequenced count cutoff"
+                    help="Each bin receives a value indicating the fraction that is covered by reads.
+                        A cutoff of 0.5 will discard all those bins that have less than half of the bin covered."/>
 
-                        <param argument="--sequencedCountCutoff" name="sequencedCountCutoff" optional="true" type="float"
-                            label="Sequenced count cutoff"
-                            help="Each bin receives a value indicating the fraction that is covered by reads.
-                                A cutoff of 0.5 will discard all those bins that have less than half of the bin covered."/>
+                <param argument="--skipDiagonal" name="skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false"
+                    label="Skip diagonal counts"/>
 
-                        <param argument="--skipDiagonal" name="skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" checked="false"
-                            label="Skip diagonal counts"/>
-
-                        <param argument="--perchr" name="perchr" type="boolean" truevalue="--perchr" falsevalue="" checked="false"
-                            label="Normalize each chromosome separately" />
-                        <expand macro="filterThreshold" />
-                    </when>
-                    <when value='kr'>
-                    </when>
-                </conditional>
+                <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>
 
@@ -119,9 +112,9 @@
 
     </inputs>
     <outputs>
-        <data name="outFileName" from_work_dir="matrix" format="cool">
+        <data name="outFileName" from_work_dir="matrix" format="h5">
             <change_format>
-                <when input_dataset="matrix_h5_cooler" attribute="ext" value="h5" format="h5"/>
+                <when input="mode.outputFormat" value="cool" format="cool" />
             </change_format>
             <filter>mode['mode_selector'] == "correct"</filter>
 
@@ -137,63 +130,16 @@
             <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
 
             <param name="mode_selector" value="correct"/>
-            <param name='correctionMethod_selector' value='ice'/>
             <repeat name="chromosomes">
                 <param name="chromosome" value="chrUextra"/>
             </repeat>
             <repeat name="chromosomes">
                 <param name="chromosome" value="chr3LHet"/>
             </repeat>
+            <param name='outputFormat' value='h5'/>
             <param name='filterThreshold_low' value='-2.0' />
             <param name='filterThreshold_large' value='4' />
-            <output name="outFileName" ftype="h5">
-                <assert_contents>
-                    <has_h5_keys keys='correction_factors,intervals,matrix,nan_bins'/>
-                </assert_contents>
-            </output>
-        </test>
-        <test>
-            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
-
-            <param name="mode_selector" value="correct"/>
-            <param name='correctionMethod_selector' value='kr'/>
-            
-            <output name="outFileName" ftype="h5">
-                <assert_contents>
-                    <has_h5_keys keys='correction_factors,intervals,matrix'/>
-                </assert_contents>
-            </output>
-        </test>
-        <test>
-            <param name="matrix_h5_cooler" value="small_test_matrix.cool"/>
-
-            <param name="mode_selector" value="correct"/>
-            <param name='correctionMethod_selector' value='kr'/>
-            
-            <output name="outFileName" ftype="cool">
-                <assert_contents>
-                    <has_h5_keys keys='bins,chroms,indexes,pixels'/>
-                </assert_contents>
-            </output>
-        </test>
-        <test>
-            <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
-
-            <param name="mode_selector" value="correct"/>
-            <param name='correctionMethod_selector' value='ice'/>
-            <repeat name="chromosomes">
-                <param name="chromosome" value="chrUextra"/>
-            </repeat>
-            <repeat name="chromosomes">
-                <param name="chromosome" value="chr3LHet"/>
-            </repeat>
-            <param name='filterThreshold_low' value='-2.0' />
-            <param name='filterThreshold_large' value='4' />
-            <output name="outFileName" ftype="h5">
-                <assert_contents>
-                    <has_h5_keys keys='correction_factors,intervals,matrix,nan_bins'/>
-                </assert_contents>
-            </output>
+            <output name="outFileName" file="hicCorrectMatrix_result1.npz.h5" ftype="h5" compare="sim_size"/>
         </test>
         <test>
             <param name="matrix_h5_cooler" value="small_test_matrix.h5"/>
@@ -204,7 +150,7 @@
             <repeat name="chromosomes">
                 <param name="chromosome" value="chr3LHet"/>
             </repeat>
-            <output name="diagnostic_plot" file="hicCorrectMatrix/diagnostic_plot.png" ftype="png" compare="sim_size"/>
+            <output name="diagnostic_plot" file="diagnostic_plot.png" ftype="png" compare="sim_size"/>
         </test>
     </tests>
     <help><![CDATA[
@@ -265,7 +211,7 @@
 Correct
 _______
 
-Run the iterative correction and outputs the corrected matrix. This matrix can then be used with all downstream analysis tools such as ``hicPlotMatrix``, ``pyGenomeTracks``, ``hicPlotViewpoint``, ``hicAggregateContacts`` for **visualization of Hi-C data**, ``hicCorrelate``, ``hicPlotDistVsCounts``, ``hicTransform``, ``hicFindTADs``, ``hicPCA`` **for data and scores computation on Hi-C data**.
+Run the iterative correction and outputs the corrected matrix. This matrix can then be used with all downstream analysis tools such as ``hicPlotMatrix``, ``hicPlotTADs``, ``hicPlotViewpoint``, ``hicAggregateContacts`` for **visualization of Hi-C data**, ``hicCorrelate``, ``hicPlotDistVsCounts``, ``hicTransform``, ``hicFindTADs``, ``hicPCA`` **for data and scores computation on Hi-C data**.
 
 It is noteworthy that ``hicSumMatrices`` and ``hicMergeMatrixBins`` **must be performed on uncorrected matrices**.