diff hicBuildMatrix.xml @ 2:eb0d14cdf8b8 draft

planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 4d61b6bf2fed275ab38c226d0c4390b095a38251
author bgruening
date Thu, 02 Nov 2017 11:11:01 -0400
parents 9767c021cd58
children 2a13bfe5bff2
line wrap: on
line diff
--- a/hicBuildMatrix.xml	Mon Apr 03 07:07:13 2017 -0400
+++ b/hicBuildMatrix.xml	Thu Nov 02 11:11:01 2017 -0400
@@ -5,15 +5,12 @@
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements" >
-        <requirement type="package" version="1.3.1">samtools</requirement>
+        <requirement type="package" version="1.6">samtools</requirement>
     </expand>
-    <command>
-<![CDATA[
+    <command detect_errors="exit_code"><![CDATA[
 
         mkdir ./QCfolder &&
-        mkdir $qc.files_path
-        &&
-
+        mkdir $qc.files_path &&
         hicBuildMatrix
 
             --samFiles
@@ -21,21 +18,16 @@
                 '${repeat.samFile}'
             #end for
 
-            #if $binSize:
-                --binSize $binSize
-            #end if
-
-            #if $restrictionCutFile:
-                --restrictionCutFile '$restrictionCutFile'
+            #if $restrictionCutFileBinSize_conditional.restrictionCutFileBinSize_selector == "optionRestrictionCutFile":
+                --restrictionCutFile '$restrictionCutFileBinSize_conditional.restrictionCutFile'
+                --minDistance $restrictionCutFileBinSize_conditional.minDistance
+                --maxDistance $restrictionCutFileBinSize_conditional.maxDistance          
             #end if
 
-            #if $minDistance:
-                --minDistance $minDistance
+            #if $restrictionCutFileBinSize_conditional.restrictionCutFileBinSize_selector == "optionBinSize":
+                --binSize $restrictionCutFileBinSize_conditional.binSize
             #end if
 
-            #if $maxDistance:
-                --maxDistance $maxDistance
-            #end if
 
             #if $restrictionSequence:
                 --restrictionSequence '$restrictionSequence'
@@ -48,49 +40,56 @@
             --outFileName ./matrix.h5
             --outBam ./unsorted.bam
 
-            #if $restrictionCutFile:
-                --restrictionCutFile '$restrictionCutFile'
-            #end if
-
-            $removeSelfCircles
+            $keepSelfCircles
 
             #if $minMappingQuality and $minMappingQuality is not None:
                 --minMappingQuality $minMappingQuality
             #end if
 
+            #if $danglingSequence:
+                --danglingSequence '$danglingSequence'
+            #end if
+
+            --threads @THREADS@
+            
             --QCfolder ./QCfolder
         &&
         mv ./QCfolder/* $qc.files_path/
         &&
         mv $qc.files_path/hicQC.html $qc
-        &&
-        samtools sort ./unsorted.bam -o sorted.bam
-
+        && samtools sort ./unsorted.bam -o sorted.bam
+       
 ]]>
     </command>
     <inputs>
         <repeat max="2" min="2" name="samFiles" title="Sam/Bam files to process">
             <param name="samFile" type="data" format="sam,bam"/>
         </repeat>
-
-        <param argument="--restrictionCutFile" type="data" format="bed" optional="True"
-            help="BED file with all restriction cut places. Should contain only mappable restriction sites. If given, the
-                  bins are set to match the restriction fragments (i.e. the region between one restriction site and the next)"/>
+        <conditional name="restrictionCutFileBinSize_conditional">
+            <param name="restrictionCutFileBinSize_selector" type="select" label="Choose to use a restriction cut file or a bin size">
+                <option value="optionRestrictionCutFile">Restriction cut file</option>
+                <option value="optionBinSize" selected="True">Bin size</option>
+            </param>
+            <when value="optionRestrictionCutFile">
+                <param argument="--restrictionCutFile" type="data" format="bed" optional="True"
+                        help="BED file with all restriction cut places. Should contain only mappable restriction sites. If given, the
+                            bins are set to match the restriction fragments (i.e. the region between one restriction site and the next)"/>
+                <param name="restrictionCutFile" type="data" format="bed" optional="true" label="BED file with all restriction cut places"
+                        help="Should contaion only  mappable restriction sites. If given, the bins are set to match the restriction fragments
+                        (i.e. the region between one restriction site and the next)." argument="--restrictionCutFile"/>
+                <param name="minDistance" type="integer" value="" optional="true" label="Minimum distance between restriction sites"
+                        help="Restriction sites that are closer that this distance are merged into one.
+                        This option only applies if --restrictionCutFile is given." argument="--minDistance"/>
 
-        <param name="binSize" type="integer" value="" optional="true" label="Bin size in bp"
-            help="If used, the restriction cut places (if given) are used to only consider reads that are in the vicinity of the resctriction sites.
-            Otherwise all reads in the interval are considered. " argument="--binSize"/>
-        
-        <param name="restrictionCutFile" type="data" format="bed" optional="true" label="BED file with all restriction cut places"
-            help="Should contaion only  mappable restriction sites. If given, the bins are set to match the restriction fragments
-            (i.e. the region between one restriction site and the next)." argument="--restrictionCutFile"/>
-
-        <param name="minDistance" type="integer" value="" optional="true" label="Minimum distance between restriction sites"
-            help="Restriction sites that are closer that this distance are merged into one.
-            This option only applies if --restrictionCutFile is given." argument="--minDistance"/>
-
-        <param name="maxDistance" type="integer" value="" optional="true" label="Maximum distance in bp from restriction site to read, to consider a read a valid one"
-            help="This option only applies if --restrictionCutFile is given."  argument="--maxDistance"/>
+                <param name="maxDistance" type="integer" value="" optional="true" label="Maximum distance in bp from restriction site to read, to consider a read a valid one"
+                        help="This option only applies if --restrictionCutFile is given."  argument="--maxDistance"/>
+            </when>
+            <when value="optionBinSize">
+                <param name="binSize" type="integer" value="" optional="true" label="Bin size in bp"
+                        help="If used, the restriction cut places (if given) are used to only consider reads that are in the vicinity of the resctriction sites.
+                        Otherwise all reads in the interval are considered. " argument="--binSize"/>
+            </when>
+        </conditional>
 
         <param name="restrictionSequence" type="text" optional="true" label="Sequence of the restriction site"
             help="This is used to discard reads that end/start with such sequence and that are considered un-ligated fragments or
@@ -98,11 +97,19 @@
 
         <expand macro="region" />
 
-        <param argument="--removeSelfCircles" type="boolean" truevalue="--removeSelfCircles" falsevalue=""
-            label="Save the matrix of values underlying the heatmap" help="If set, outward facing reads, at a distance of less thatn 25kbs are removed." />
+        <param argument="--keepSelfCircles" type="boolean" truevalue="--keepSelfCircles" falsevalue=""
+            label="Keep self circles" help="If set, outward facing reads without any restriction fragment (self circles) are kept. '
+ +                             'They will be counted and shown in the QC plots." />
 
         <expand macro="minMappingQuality" />
 
+        <param name="danglingSequence" type="text" optional="true" label="The dangling sequence"
+            help="Dangling end sequence left by the restriction enzyme. For DpnII for example, 
+                    the dangling end is the same restriction sequence. This is used
+                    to discard reads that end/start with such sequence 
+                    and that are considered un-ligated fragments or 
+                    'dangling-ends'. If not given, such statistics will 
+                    not be available." argument="--danglingSequence"/>
     </inputs>
     <outputs>
         <data name="outBam" from_work_dir="sorted.bam" format="bam" label="${tool.name} BAM file on ${on_string}"/>
@@ -117,9 +124,12 @@
             <repeat name="samFiles">
                 <param name="samFile" value="small_test_R2_unsorted.bam" ftype="sam"/>
             </repeat>
-            <param name="binSize" value="5000"/>
-            <output name="outBam" file="hicBuildMatrix_result1.bam" ftype="bam"/>
-            <output name="outFileName" file="hicBuildMatrix_result1.h5" ftype="h5" compare="sim_size"/>
+            <conditional name="restrictionCutFileBinSize_conditional">
+                <param name="restrictionCutFileBinSize_selector" value="optionBinSize"/>
+                <param name="binSize" value="5000"/>
+            </conditional>
+            <output name="outBam" file="small_test_matrix_result_sorted.bam" ftype="bam"/>
+            <output name="outFileName" file="small_test_matrix.h5" ftype="h5" compare="sim_size" delta="30000"/>
         </test>
     </tests>
     <help><![CDATA[