diff bamCoverage.xml @ 52:c0a054f2eff8 draft

Uploaded
author bgruening
date Mon, 22 Dec 2014 18:56:27 -0500
parents 1d802a322244
children
line wrap: on
line diff
--- a/bamCoverage.xml	Thu Sep 18 16:58:56 2014 -0400
+++ b/bamCoverage.xml	Mon Dec 22 18:56:27 2014 -0500
@@ -7,62 +7,64 @@
         <import>deepTools_macros.xml</import>
     </macros>
     <command>
+<![CDATA[
         bamCoverage
 
-        @THREADS@
+            @THREADS@
 
-        --bam '$bamInput'
-        --bamIndex ${bamInput.metadata.bam_index}
-        --outFileName '$outFileName'
-        --outFileFormat '$outFileFormat'
+            --bam '$bamInput'
+            --bamIndex ${bamInput.metadata.bam_index}
+            --outFileName '$outFileName'
+            --outFileFormat '$outFileFormat'
 
-        --fragmentLength $fragmentLength
-        --binSize $binSize
+            --fragmentLength $fragmentLength
+            --binSize $binSize
 
-        #if $scaling.type=='rpkm':
-            --normalizeUsingRPKM
-        #elif $scaling.type=='1x':
-            #if $scaling.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
-                --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize
-            #else:
-                --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize_opt
-            #end if
-        #elif $scaling.type=='own':
-            --scaleFactor $scaling.scaleFactor
-        #end if
-
-        #if str($region).strip() != '':
-            --region '$region'
-        #end if
-
-        #if $advancedOpt.showAdvancedOpt == "yes":
-            #if $advancedOpt.smoothLength:
-                --smoothLength '$advancedOpt.smoothLength'
+            #if $scaling.type=='rpkm':
+                --normalizeUsingRPKM
+            #elif $scaling.type=='1x':
+                #if $scaling.effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
+                    --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize
+                #else:
+                    --normalizeTo1x $scaling.effectiveGenomeSize.effectiveGenomeSize_opt
+                #end if
+            #elif $scaling.type=='own':
+                --scaleFactor $scaling.scaleFactor
             #end if
 
-            $advancedOpt.doNotExtendPairedEnds
-            $advancedOpt.ignoreDuplicates
-
-            #if $advancedOpt.minMappingQuality:
-                --minMappingQuality '$advancedOpt.minMappingQuality'
+            #if str($region).strip() != '':
+                --region '$region'
             #end if
 
-            --missingDataAsZero $advancedOpt.missingDataAsZero
+            #if $advancedOpt.showAdvancedOpt == "yes":
+                #if $advancedOpt.smoothLength:
+                    --smoothLength '$advancedOpt.smoothLength'
+                #end if
+
+                $advancedOpt.doNotExtendPairedEnds
+                $advancedOpt.ignoreDuplicates
 
-            ##if str($advancedOpt.ignoreForNormalization).strip() != '':
-            ##    --ignoreForNormalization $advancedOpt.ignoreForNormalization
-            ##end if
+                #if $advancedOpt.minMappingQuality:
+                    --minMappingQuality '$advancedOpt.minMappingQuality'
+                #end if
+
+                --missingDataAsZero $advancedOpt.missingDataAsZero
 
-        #end if
+                ##if str($advancedOpt.ignoreForNormalization).strip() != '':
+                ##    --ignoreForNormalization $advancedOpt.ignoreForNormalization
+                ##end if
+
+            #end if
+]]>
     </command>
 
     <inputs>
         <param name="bamInput" format="bam" type="data" label="BAM file"
             help="The BAM file must be sorted."/>
 
-        <param name="fragmentLength" type="integer" value="300" min="1"
+        <param name="fragmentLength" type="integer" value="200" min="1"
             label="Length of the average fragment size"
-            help ="Reads will be extended to match this length unless they are paired-end, in which case they will be extended to match the fragment length. If this value is set to the read length or smaller, the read will not be extended. *Warning* the fragment length affects the normalization to 1x (see &quot;normalize coverage to 1x&quot;). Sequencing depth is defined as: (total number of mapped reads * fragment length) / effective genome size. *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
+            help ="Reads will be extended to match this length unless they are paired-end, in which case they will be extended to match the fragment length. If this value is set to the read length or smaller, the read will not be extended. *Warning* the fragment length affects the normalization to 1x (see &quot;normalize coverage to 1x&quot;). Sequencing depth is defined as: (total number of mapped reads * fragment length) / effective genome size. *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length. (--fragmentLength)"/>
 
         <param name="binSize" type="integer" value="50" min="1" 
             label="Bin size in bp"
@@ -102,19 +104,11 @@
             <when value="yes">
                 <param name="smoothLength" type="integer" value="1" optional="true" min="1"
                     label="Smooth values using the following length (in bp)"
-                    help ="The smooth length defines a window, larger than the bin size, to average the number of reads. For example, if the bin size is set to 20 bp and the smooth length is set to 60 bp, then, for each bin size the average of it and its left and right neighbors is considered. Any value smaller than the bin size will be ignored and no smoothing will be applied."/>
-
-                <param name="doNotExtendPairedEnds" type="boolean" truevalue="--doNotExtendPairedEnds" falsevalue=""
-                    label="Do not extend paired ends"
-                    help="If set, reads are not extended to match the fragment length reported in the BAM file, instead they will be extended to match the fragment length. Default is to extend the reads if paired end information is available."/>
+                    help ="The smooth length defines a window, larger than the bin size, to average the number of reads. For example, if the bin size is set to 20 bp and the smooth length is set to 60 bp, then, for each bin size the average of it and its left and right neighbors is considered. Any value smaller than the bin size will be ignored and no smoothing will be applied. (--smoothLength)"/>
 
-                <param name="ignoreDuplicates" type="boolean" truevalue="--ignoreDuplicates" falsevalue=""
-                    label="Ignore duplicates"
-                    help="If set, reads that have the same orientation and start position will be considered only once. If reads are paired, the mate position also has to coincide to ignore a read." /> 
-
-                <param name="minMappingQuality" type="integer" optional="true" value="1" min="1"
-                    label="Minimum mapping quality"
-                    help= "If set, only reads that have a mapping quality score higher than the given value are considered. *Note* Bowtie's Mapping quality is related to uniqueness: the higher the score, the more unique is a read. A mapping quality defined by Bowtie of 10 or less indicates that there is at least a 1 in 10 chance that the read truly originated elsewhere."/>
+                <expand macro="doNotExtendPairedEnds" />
+                <expand macro="ignoreDuplicates" />
+                <expand macro="minMappingQuality" />
 
                 <expand macro="missingDataAsZero" />
 
@@ -133,8 +127,46 @@
             </change_format>
         </data>
     </outputs>
+    <tests>
+        <test>
+            <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
+            <param name="outFileFormat" value="bigwig" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="binSize" value="10" />
+            <param name="type" value="no" />
+            <output name="outFileName" file="bamCoverage_result1.bw" ftype="bigwig" />
+        </test>
+        <test>
+            <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
+            <param name="outFileFormat" value="bigwig" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="binSize" value="10" />
+            <output name="outFileName" file="bamCoverage_result2.bw" ftype="bigwig" />
+        </test>
+        <test>
+            <param name="bamInput" value="bowtie2-test1.bam" ftype="bam" />
+            <param name="outFileFormat" value="bedgraph" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="binSize" value="10" />
+            <output name="outFileName" file="bamCoverage_result3.bg" ftype="bedgraph" />
+        </test>
+        <test>
+            <param name="bamInput" value="phiX.bam" ftype="bam" />
+            <param name="outFileFormat" value="bigwig" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="binSize" value="10" />
+            <output name="outFileName" file="bamCoverage_result4.bw" ftype="bigwig" />
+        </test>
+        <test>
+            <param name="bamInput" value="phiX.bam" ftype="bam" />
+            <param name="outFileFormat" value="bedgraph" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="binSize" value="10" />
+            <output name="outFileName" file="bamCoverage_result4.bg" ftype="bedgraph" />
+        </test>
+    </tests>
     <help>
-
+<![CDATA[
 **What it does**
 
 Given a BAM file, this tool generates a bigWig or bedGraph file of fragment or
@@ -160,7 +192,7 @@
 -----
 
 @REFERENCES@
-
+]]>
     </help>
     <expand macro="citations" />
 </tool>