changeset 52:411c871f4cfd

Uploaded
author bgruening
date Sat, 03 Aug 2013 09:48:44 -0400
parents 6a2a7374450b
children a281b5931ffb
files bamCompare.xml bamCorrelate.xml bamCoverage.xml bamFingerprint.xml bigwigCompare.xml computeGCBias.xml computeMatrix.xml correctGCBias.xml heatmapper.xml profiler.xml test-data/master.mat.gz test-data/master.png test-data/test.bw test-data/test2.bed
diffstat 14 files changed, 295 insertions(+), 285 deletions(-) [+]
line wrap: on
line diff
--- a/bamCompare.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/bamCompare.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -3,9 +3,7 @@
   <requirements>
     <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
     <requirement type="package" version="1.7.1">numpy</requirement>
-    <requirement type="python-module">argsparse</requirement>
-    <requirement type="python-module">pysam</requirement>
-    <requirement type="python-module">numpy</requirement>
+    <requirement type="package" version="0.1">ucsc_tools</requirement>
   </requirements>
   <command>
   bamCompare
@@ -65,74 +63,72 @@
 
   <inputs>
     <param name="bamFile1" format="bam" type="data" label="Treatment BAM file"
-	   help="The BAM file must be sorted and indexed."/>
+       help="The BAM file must be sorted and indexed."/>
 
     <param name="bamFile2" format="bam" type="data" label="Input BAM file"
-	   help="The BAM file must be sorted and indexed."/>
+       help="The BAM file must be sorted and indexed."/>
 
     <param name="fragmentLength" type="integer" value="300" 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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
+       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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
 
     <param name="binSize" type="integer" value="50" min="1" 
-	   label="Bin size in bp"
-	   help="The genome will be divided in bins (also called tiles) of the specified length. For each bin the overlaping number of fragments (or reads)  will be reported. If only half a fragment overlaps, this fraction will be reported. "/>
+       label="Bin size in bp"
+       help="The genome will be divided in bins (also called tiles) of the specified length. For each bin the overlaping number of fragments (or reads)  will be reported. If only half a fragment overlaps, this fraction will be reported. "/>
 
 
     <conditional name="scaling">
       <param name="method" type="select" 
-	     label="Method to use for scaling the largest sample to the smallest">
-	    <option value="readCount" selected="true">read count</option>
-	    <option value="SES">signal extraction scaling (SES)</option>
-	    <option value="own">enter own scaling factors</option>
+         label="Method to use for scaling the largest sample to the smallest">
+        <option value="readCount" selected="true">read count</option>
+        <option value="SES">signal extraction scaling (SES)</option>
+        <option value="own">enter own scaling factors</option>
       </param>
       <when value="SES">
-	    <param name="sampleLength" type="integer" value="1000" min="10"
-	           label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two  BAM files "
-	           help="The default is fine. Only change it if you know what you are doing" />
+        <param name="sampleLength" type="integer" value="1000" min="10"
+               label="Length in base pairs used to sample the genome and compute the size or scaling factors to compare the two  BAM files "
+               help="The default is fine. Only change it if you know what you are doing" />
       </when>
       <when value="readCount" />
       <when value="own">
-	    <param name="scaleFactor1" type="float" value="1"
-	           label="Scale factor for treatment"/>
+        <param name="scaleFactor1" type="float" value="1"
+               label="Scale factor for treatment"/>
 
-	    <param name="scaleFactor2" type="float" value="1"
-	           label="Scale factor for input"/>
+        <param name="scaleFactor2" type="float" value="1"
+               label="Scale factor for input"/>
       </when>
     </conditional>
 
     <conditional name="comparison">
       <param name="type" type="select" 
-	     label="How to compare the two files">
-	    <option value="log2" selected="true">compute log2 of the number of reads ratio</option>
-	    <option value="ratio">compute the ratio of the number of reads</option>
-	    <option value="subtract">compute difference (subtract input from treatment) of the number of reads</option>
+         label="How to compare the two files">
+        <option value="log2" selected="true">compute log2 of the number of reads ratio</option>
+        <option value="ratio">compute the ratio of the number of reads</option>
+        <option value="subtract">compute difference (subtract input from treatment) of the number of reads</option>
       </param>
       <when value="log2" />
       <when value="ratio" />
       <when value="subtract">
-	    <conditional name="normalization">
-	      <param name="type" type="select" label="Normalization method" >
+        <conditional name="normalization">
+          <param name="type" type="select" label="Normalization method" >
                 <option value="1x">Normalize coverage to 1x</option>
                 <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
-                <option value="no">Do not normalize or scale</option>	
-	      </param>
-	      <when value="rpkm" />
-	      <when value="no" />
-	      <when value="1x">
-	        <param name="normalizeTo1x" type="integer" value="2150570000"
-		       label="Report normalized coverage to 1x sequenceing depth"
-		       help ="Sequencing depth is defined as the total number of mapped reads * fragment length / effective genome size. To use this option, the effective genome size has to be given. Common values are: mm9: 2150570000, hg19:2451960000, dm3:121400000 and ce10:93260000."/>
-	      </when>
-	    </conditional>
+                <option value="no">Do not normalize or scale</option>
+          </param>
+          <when value="rpkm" />
+          <when value="no" />
+          <when value="1x">
+            <param name="normalizeTo1x" type="integer" value="2150570000"
+               label="Report normalized coverage to 1x sequenceing depth"
+               help ="Sequencing depth is defined as the total number of mapped reads * fragment length / effective genome size. To use this option, the effective genome size has to be given. Common values are: mm9: 2150570000, hg19:2451960000, dm3:121400000 and ce10:93260000."/>
+          </when>
+        </conditional>
       </when>
     </conditional>
 
-    
-
     <param name="outFileFormat" type="select" label="Coverage file format">
         <option value="bigwig" selected="true">bigwig</option>
-	<option value="bedgraph">bedgraph</option>
+    <option value="bedgraph">bedgraph</option>
     </param>
     
         <conditional name="advancedOpt">
@@ -144,39 +140,39 @@
       <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."/>
+       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="region" type="text" value=""
-	   label="Region of the genome to limit the operation to"
-	   help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	   
-	 <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."/>
-	  
-	 <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"/>
-	    
-	  <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
-	   label ="Treat missing data as zero"
-	   help  ="This parameter determines if missing data should be treated as zeros. If unchecked, missing data will be ignored and not included in the output file. Missing data is defined as those regions for which both BAM files have 0 reads." />
+       label="Region of the genome to limit the operation to"
+       help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+       
+     <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."/>
+      
+     <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"/>
+        
+      <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
+       label ="Treat missing data as zero"
+       help  ="This parameter determines if missing data should be treated as zeros. If unchecked, missing data will be ignored and not included in the output file. Missing data is defined as those regions for which both BAM files have 0 reads." />
 
-	</when>
+    </when>
  </conditional>
 
   </inputs>
   <outputs>
     <data format="bigwig" name="outFileName">
-	<change_format>
-		<when input="outFileFormat" value="bigwig" format="bigwig" />
-		<when input="outFileFormat" value="bedgraph" format="bedgraph" />
-	</change_format>
+    <change_format>
+        <when input="outFileFormat" value="bigwig" format="bigwig" />
+        <when input="outFileFormat" value="bedgraph" format="bedgraph" />
+    </change_format>
     </data>
   </outputs>
   <help>
--- a/bamCorrelate.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/bamCorrelate.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -69,14 +69,14 @@
   </repeat>
   
   <param name="fragmentLength" type="integer" value="300" 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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
-  
+       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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
+
   <param name="corMethod" type="select" label="Correlation method">
     <option value="pearson">Pearson</option>
     <option value="spearman">Spearman</option>
   </param>
-  
+
   <conditional name="advancedOpt">
     <param name="showAdvancedOpt" type="select" label="Show advanced options" >
       <option value="no" selected="true">no</option>
@@ -85,40 +85,40 @@
     <when value="no" />
     <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."/>
-	   
+       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="region" type="text" value=""
-	   label="Region of the genome to limit the operation to"
-	   help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	
-	<param name="binSize" type="integer" value="10000" min="1" 
-	   label="Bin size in bp"
-	   help="Length in base pairs for a window used to sample the genome."/>
-	
-	<param name="numberOfSamples" type="integer" value="100000" min="1" 
-	   label="Number of samples"
-	   help="Number of samples taken from the genome to compute the scaling factors"/>
-    
+       label="Region of the genome to limit the operation to"
+       help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+
+    <param name="binSize" type="integer" value="10000" min="1" 
+       label="Bin size in bp"
+       help="Length in base pairs for a window used to sample the genome."/>
+
+    <param name="numberOfSamples" type="integer" value="100000" min="1" 
+       label="Number of samples"
+       help="Number of samples taken from the genome to compute the scaling factors"/>
+
     <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."/>
-	  
-	<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"/>
-	    
-	<param name="includeZeros" type="boolean" truevalue="--includeZeros" falsevalue=""
-	   label ="Include zeros"
-	   help  ="If set, then zero counts that happen for *all* bam files given are included. The default behavior is to ignore those cases" />
-  
+        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."/>
+
+    <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"/>
+        
+    <param name="includeZeros" type="boolean" truevalue="--includeZeros" falsevalue=""
+       label ="Include zeros"
+       help  ="If set, then zero counts that happen for *all* bam files given are included. The default behavior is to ignore those cases" />
+
     </when>
   </conditional>
-  
+
   <conditional name="outputOpt">
     <param name="showOutputOpt" type="select" label="Show additional output options" >
       <option value="no" selected="true">no</option>
@@ -130,7 +130,7 @@
     <param name="saveCorMatrix" type="boolean" label="Save the correlation matrix"/>
     </when>
   </conditional>
-  
+
   </inputs>
   <outputs>
     <data format="png" name="outFileName" />
--- a/bamCoverage.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/bamCoverage.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -2,6 +2,7 @@
   <description>Given a BAM file, generates a coverage bigwig file.  Multiple options available to count reads and normalize coverage.</description>
   <requirements>
     <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
+    <requirement type="package" version="0.1">ucsc_tools</requirement>
     <requirement type="package" version="1.7.1">numpy</requirement>
   </requirements>
   <command>bamCoverage
@@ -43,39 +44,39 @@
 
   <inputs>
     <param name="bamInput" format="bam" type="data" label="Input BAM file"
-	   help="The BAM file must be sorted and indexed."/>
+       help="The BAM file must be sorted and indexed."/>
 
     <param name="fragmentLength" type="integer" value="300" 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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
+       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;). The formula to normalize using the sequencing depth is genomeSize/(number of mapped reads * fragment length). *NOTE*: If the BAM files contain mated and unmated paired-end reads, unmated reads will be extended to match the fragment length."/>
 
     <param name="binSize" type="integer" value="50" min="1" 
-	   label="Bin size in bp"
-	   help="The genome will be divided in bins (also called tiles) of the specified length. For each bin the overlaping number of fragments (or reads)  will be reported. If only half a fragment overlaps, this fraction will be reported. "/>
+       label="Bin size in bp"
+       help="The genome will be divided in bins (also called tiles) of the specified length. For each bin the overlaping number of fragments (or reads)  will be reported. If only half a fragment overlaps, this fraction will be reported. "/>
 
     <conditional name="scaling">
       <param name="type" type="select" label="Scaling/Normalization method" >
         <option value="1x">Normalize coverage to 1x</option>
         <option value="rpkm">Normalize to fragments (reads) per kilobase per million (RPKM)</option>
-        <option value="own">Set your own scaling factor</option>	
-        <option value="no">Do not normalize or scale</option>	
+        <option value="own">Set your own scaling factor</option>
+        <option value="no">Do not normalize or scale</option>
       </param>
       <when value="rpkm"/>
       <when value="no"/>
       <when value="1x">
-	<param name="normalizeTo1x" type="integer" value="2150570000"
-	       label="Genome size"
-	       help ="Enter the genome size to normalize the reads counts. Sequencing depth is defined as the total number of mapped reads * fragment length / effective genome size. To use this option, the effective genome size has to be given. Common values are: mm9: 2150570000, hg19:2451960000, dm3:121400000 and ce10:93260000."/>
+    <param name="normalizeTo1x" type="integer" value="2150570000"
+           label="Genome size"
+           help ="Enter the genome size to normalize the reads counts. Sequencing depth is defined as the total number of mapped reads * fragment length / effective genome size. To use this option, the effective genome size has to be given. Common values are: mm9: 2150570000, hg19:2451960000, dm3:121400000 and ce10:93260000."/>
       </when>
       <when value="own">
-	<param name="scaleFactor" type="float" value="1" size="3" 
-	       label="Scale factor to multiply all values" />
+    <param name="scaleFactor" type="float" value="1" size="3" 
+           label="Scale factor to multiply all values" />
       </when>
     </conditional>
 
     <param name="outFileFormat" type="select" label="Coverage file format">
         <option value="bigwig" selected="true">bigwig</option>
-	<option value="bedgraph">bedgraph</option>
+    <option value="bedgraph">bedgraph</option>
     </param>
     
     
@@ -88,34 +89,34 @@
       <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."/>
+       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="region" type="text" value=""
-	   label="Region of the genome to limit the operation to"
-	   help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	   
-	 <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."/>
-	  
-	 <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"/>
-	</when>
+       label="Region of the genome to limit the operation to"
+       help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+       
+     <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."/>
+      
+     <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"/>
+    </when>
  </conditional>
 
   </inputs>
   <outputs>
     <data format="bigwig" name="outFileName">
-	<change_format>
-		<when input="outFileFormat" value="bigwig" format="bigwig" />
-		<when input="outFileFormat" value="bedgraph" format="bedgraph" />
-	</change_format>
+    <change_format>
+        <when input="outFileFormat" value="bigwig" format="bigwig" />
+        <when input="outFileFormat" value="bedgraph" format="bedgraph" />
+    </change_format>
     </data>
   </outputs>
   <help>
--- a/bamFingerprint.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/bamFingerprint.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -65,7 +65,7 @@
   </repeat>
   
   <param name="fragmentLength" type="integer" value="200" min="1"
-	   label="Length of the average fragment size"/>
+       label="Length of the average fragment size"/>
   
   <conditional name="advancedOpt">
     <param name="showAdvancedOpt" type="select" label="Show advanced options" >
@@ -75,40 +75,39 @@
     <when value="no" />
     <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."/>
-	   
+       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="region" type="text" value=""
-	   label="Region of the genome to limit the operation to"
-	   help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	
-	<param name="binSize" type="integer" value="10000" min="1" 
-	   label="Bin size in bp"
-	   help="Length in base pairs for a window used to sample the genome."/>
-	
-	<param name="numberOfSamples" type="integer" value="100000" min="1" 
-	   label="Number of samples"
-	   help="Number of samples taken from the genome to compute the scaling factors"/>
+       label="Region of the genome to limit the operation to"
+       help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+    
+    <param name="binSize" type="integer" value="10000" min="1" 
+       label="Bin size in bp"
+       help="Length in base pairs for a window used to sample the genome."/>
+    
+    <param name="numberOfSamples" type="integer" value="100000" min="1" 
+       label="Number of samples"
+       help="Number of samples taken from the genome to compute the scaling factors"/>
     
     <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."/>
-	  
-	<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"/>
-	    
-	<param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue=""
-	   label ="Include zeros"
-	   help  ="If set, then zero counts that happen for *all* bam files given are ignored. This will result in a reduced number of read counts than the specified in number of samples" />
-  
+        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."/>
+      
+    <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"/>
+        
+    <param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue=""
+       label ="Include zeros"
+       help  ="If set, then zero counts that happen for *all* bam files given are ignored. This will result in a reduced number of read counts than the specified in number of samples" />
     </when>
   </conditional>
-  
+
   <conditional name="outputOpt">
     <param name="showOutputOpt" type="select" label="Show additional output options" >
       <option value="no" selected="true">no</option>
@@ -119,7 +118,6 @@
     <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
     </when>
   </conditional>
-  
   </inputs>
   <outputs>
     <data format="png" name="outFileName" />
--- a/bigwigCompare.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/bigwigCompare.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -2,6 +2,8 @@
   <description>compares two bigwig files based on the number of mapped reads</description>
   <requirements>
     <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
+    <requirement type="package" version="0.1">ucsc_tools</requirement>
+    <requirement type="package" version="1.7.1">numpy</requirement>
   </requirements>
   <command>
   bigwigCompare
@@ -35,20 +37,18 @@
     <param name="bigwigFile2" format="bigwig" type="data" label="Input bigwig file" />
 
       <param name="comparison_type" type="select" 
-	     label="How to compare the two files"
-	     help="The reciprocal ratio returns the negative of the inverse of the ratio if the ratio is less than 0. The resulting values are interpreted as negative fold changes." >
-	    <option value="log2" selected="true">log2 ratio</option>
-	    <option value="ratio">simple ratio</option>
-	    <option value="subtract">difference (subtract input from treatment)</option>
-	    <option value="add">sum</option>
-	    <option value="reciprocal_ratio">reciprocal ratio</option>
+         label="How to compare the two files"
+         help="The reciprocal ratio returns the negative of the inverse of the ratio if the ratio is less than 0. The resulting values are interpreted as negative fold changes." >
+        <option value="log2" selected="true">log2 ratio</option>
+        <option value="ratio">simple ratio</option>
+        <option value="subtract">difference (subtract input from treatment)</option>
+        <option value="add">sum</option>
+        <option value="reciprocal_ratio">reciprocal ratio</option>
       </param>
 
-    
-
     <param name="outFileFormat" type="select" label="Coverage file format">
         <option value="bigwig" selected="true">bigwig</option>
-	<option value="bedgraph">bedgraph</option>
+    <option value="bedgraph">bedgraph</option>
     </param>
     
         <conditional name="advancedOpt">
@@ -60,40 +60,34 @@
       <when value="yes">
       
           <param name="binSize" type="integer" value="50" min="1" 
-	   label="Bin size in bp"
-	   help="Size of the bins in bp for the ouput of the bigwig/bedgraph file "/>
+       label="Bin size in bp"
+       help="Size of the bins in bp for the ouput of the bigwig/bedgraph file "/>
     
     <param name="region" type="text" value=""
-	   label="Region of the genome to limit the operation to"
-	   help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	   
-	<param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
-	   label ="Treat missing data as zero"
-	   help  ="This parameter determines if missing data should be replaced with a zero. If set to &quot;no&quot;, missing data will be ignored and will not be included in the output file at all. Missing data is defined as those regions for which no value exists in *any* of the bigwig files. The decision to include or exclude missing data depends on the interpretation of the data. Missing data in a bigwig file may mean that there is no information available for certain regions, for example a repetitive region that is not being considered. In the same file regions with low coverage may get zero read counts. If missing data is replaced by zero, this would convert the excluded repetitive regions into regions of low coverage." />
-	
-	<param name="scaleFactor1" type="float" value="1" label="Scale factor for treatment"/>
-	<param name="scaleFactor2" type="float" value="1" label="Scale factor for input"/>
-	<param name="pseudocount" type="float" value="1" label="Pseudocount" help="Small number to avoid dividing by zero."/>
+       label="Region of the genome to limit the operation to"
+       help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+       
+    <param name="missingDataAsZero" type="boolean" truevalue="yes" falsevalue="no" checked="True"
+       label ="Treat missing data as zero"
+       help  ="This parameter determines if missing data should be replaced with a zero. If set to &quot;no&quot;, missing data will be ignored and will not be included in the output file at all. Missing data is defined as those regions for which no value exists in *any* of the bigwig files. The decision to include or exclude missing data depends on the interpretation of the data. Missing data in a bigwig file may mean that there is no information available for certain regions, for example a repetitive region that is not being considered. In the same file regions with low coverage may get zero read counts. If missing data is replaced by zero, this would convert the excluded repetitive regions into regions of low coverage." />
+    
+    <param name="scaleFactor1" type="float" value="1" label="Scale factor for treatment"/>
+    <param name="scaleFactor2" type="float" value="1" label="Scale factor for input"/>
+    <param name="pseudocount" type="float" value="1" label="Pseudocount" help="Small number to avoid dividing by zero."/>
 
-	</when>
+    </when>
  </conditional>
 
   </inputs>
   <outputs>
     <data format="bigwig" name="outFileName">
-	<change_format>
-		<when input="outFileFormat" value="bigwig" format="bigwig" />
-		<when input="outFileFormat" value="bedgraph" format="bedgraph" />
-	</change_format>
+    <change_format>
+        <when input="outFileFormat" value="bigwig" format="bigwig" />
+        <when input="outFileFormat" value="bedgraph" format="bedgraph" />
+    </change_format>
     </data>
   </outputs>
 
-  <requirements>
-    <requirement type="python-module">argsparse</requirement>
-    <requirement type="python-module">pysam</requirement>
-    <requirement type="python-module">numpy</requirement>
-  </requirements>
-
   <help>
 
 **What it does**
--- a/computeGCBias.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/computeGCBias.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -52,7 +52,7 @@
   <inputs>
   
   <param name="bamInput" format="bam" type="data" label="Input BAM file"
-	   help="The BAM file must be sorted and indexed."/>
+       help="The BAM file must be sorted and indexed."/>
   
   <param name="species" type="text" value="" label="Species name abbreviation" />
   
@@ -82,29 +82,29 @@
       <when value="no" />
       <when value="yes">
           <param name="region" type="text" value=""
-	        label="Region of the genome to limit the operation to"
-	        help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	       
-	       <param name="binSize" type="integer" value="50" min="1" 
-	         label="Bin size in bp"
-	         help="Size of the bins in bp for the ouput of the bigwig/bedgraph file."/>
-	         
-	       <param name="sampleSize" type="integer" value="50000000" min="1"
-	         label="Number of sampling points to be considered" />
-	       
-	       <param name="regionSize" type="integer" value="300" min="1"
-	         label="Region size"
-	         help ="To plot the reads per GC over a region the size of the region is required. By default, the bin size is set to 300bp, which is close to the standard fragment size for Illumina machines. However, if the depth of sequencing is low a larger bin size will be required, otherwise many bins will not overlap with any read."/>
-	       
-	       <param name="filterOut" type="data" format="bed" optional="true"
-	         label="BED file containing genomic regions to be excluded from the estimation of the correction"
-	         help="Such regions  usually contain repetitive regions and peaks that if included will bias the correction. It is recommended to filter out known repetitive regions if multi-reads (reads that map to more than one genomic position) were excluded. In the case of ChIP-seq data, it is recommended to first use a peak caller to identify and filter out the identified peaks." />
-	       <param name="extraSampling" type="data" format="bed" optional="true"
-	         label="BED file containing genomic regions for which extra sampling is required because they are underrepresented in the genome"
-	         help="" />
+            label="Region of the genome to limit the operation to"
+            help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+           
+           <param name="binSize" type="integer" value="50" min="1" 
+             label="Bin size in bp"
+             help="Size of the bins in bp for the ouput of the bigwig/bedgraph file."/>
+             
+           <param name="sampleSize" type="integer" value="50000000" min="1"
+             label="Number of sampling points to be considered" />
+           
+           <param name="regionSize" type="integer" value="300" min="1"
+             label="Region size"
+             help ="To plot the reads per GC over a region the size of the region is required. By default, the bin size is set to 300bp, which is close to the standard fragment size for Illumina machines. However, if the depth of sequencing is low a larger bin size will be required, otherwise many bins will not overlap with any read."/>
+           
+           <param name="filterOut" type="data" format="bed" optional="true"
+             label="BED file containing genomic regions to be excluded from the estimation of the correction"
+             help="Such regions  usually contain repetitive regions and peaks that if included will bias the correction. It is recommended to filter out known repetitive regions if multi-reads (reads that map to more than one genomic position) were excluded. In the case of ChIP-seq data, it is recommended to first use a peak caller to identify and filter out the identified peaks." />
+           <param name="extraSampling" type="data" format="bed" optional="true"
+             label="BED file containing genomic regions for which extra sampling is required because they are underrepresented in the genome"
+             help="" />
       </when>
   </conditional>
-  
+
   <conditional name="output" >
         <param name="showOutputSettings" type="select" label="Show additional output options" >
         <option value="no" selected="true">no</option>
--- a/computeMatrix.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/computeMatrix.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -44,6 +44,7 @@
     --averageTypeBins '$advancedOpt.averageTypeBins'
     $advancedOpt.missingDataAsZero
     $advancedOpt.skipZeros
+    $advancedOpt.binSize
     
     #if $advancedOpt.minThreshold:
     --minThreshold $advancedOpt.minThreshold
@@ -124,7 +125,7 @@
         <param name="binSize" type="integer" value="100" min="1" optional="true" label="Length, in base pairs, of the non-overlapping bin for averaging the score over the regions length" />
         
         <param name="sortRegions" type="select" label="Sort regions"
-	       help="Whether the output file should present the regions sorted.">
+           help="Whether the output file should present the regions sorted.">
           <option value="no" selected="true">no ordering</option>
           <option value="descend">descending order</option>
           <option value="ascend">ascending order</option>
@@ -172,6 +173,19 @@
       <filter>(output['showOutputSettings'] == 'yes' and output['saveSortedRegions'] == True)</filter>
     </data>  
   </outputs>
+    <!--
+    computeMatrix -S test.bw -R test2.bed -a 100 -b 100 -bs 1 
+    -->
+    <tests>
+        <test>
+            <param name="regionsFile" value="test2.bed" ftype="bed" />
+            <param name="scoreFile" value="test.bw" ftype="bigwig" />
+            <param name="advancedOpt.binSize" value="1" />
+            <param name="mode.beforeRegionStartLength" value="100" />
+            <param name="mode.afterRegionStartLength" value="100" />
+            <output name="outFileName" file="master.mat.gz" ftype="bgzip" compare="sim_size" delta="100" />
+        </test>
+    </tests>
   <help>
 **What it does**
 
--- a/correctGCBias.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/correctGCBias.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -3,6 +3,7 @@
   </description>
   <requirements>
     <requirement type="package" version="1.5.1_98e5d8a61431ea8605c0643d991a1a5d8999b4dc">deepTools</requirement>
+    <requirement type="package" version="0.1">ucsc_tools</requirement>
   </requirements>
   <command>
   correctGCBias
@@ -67,24 +68,24 @@
       <when value="no" />
       <when value="yes">
           <param name="region" type="text" value=""
-	        label="Region of the genome to limit the operation to"
-	        help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
-	       
-	       <param name="binSize" type="integer" value="50" min="1" 
-	         label="Bin size in bp"
-	         help="Size of the bins in bp for the ouput of the bigwig/bedgraph file."/>
+            label="Region of the genome to limit the operation to"
+            help="This is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example &quot;chr10&quot; or &quot;chr10:456700:891000&quot;" />
+           
+           <param name="binSize" type="integer" value="50" min="1" 
+             label="Bin size in bp"
+             help="Size of the bins in bp for the ouput of the bigwig/bedgraph file."/>
       </when>
   </conditional>
   </inputs>
   
   <outputs>
     <data format="bam" name="outFileName">
-	<change_format>
-		<when input="outFileFormat" value="bw" format="bigwig" />
-		<when input="outFileFormat" value="bam" format="bam" />
-		<when input="outFileFormat" value="bg" format="bedgraph" />
-	</change_format>
-	</data>
+    <change_format>
+        <when input="outFileFormat" value="bw" format="bigwig" />
+        <when input="outFileFormat" value="bam" format="bam" />
+        <when input="outFileFormat" value="bg" format="bedgraph" />
+    </change_format>
+    </data>
   </outputs>
   <help>
 
--- a/heatmapper.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/heatmapper.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -98,7 +98,7 @@
       <when value="yes">
         <param name="outFileFormat" type="select" label="Image file format">
             <option value="png" selected="true">png</option>
-	        <option value="pdf">pdf</option>
+            <option value="pdf">pdf</option>
             <option value="svg">svg</option>
             <option value="eps">eps</option>
             <option value="emf">emf</option>
@@ -117,7 +117,7 @@
       <when value="no" />
       <when value="yes">
         <param name="sortRegions" type="select" label="Sort regions"
-	       help="Whether the heatmap should present the regions sorted. The default is to sort in descending order based on the mean value per region.">
+           help="Whether the heatmap should present the regions sorted. The default is to sort in descending order based on the mean value per region.">
           <option value="no" selected="true">no ordering</option>
           <option value="descend">descending order</option>
           <option value="ascend">ascending order</option>
@@ -288,16 +288,16 @@
         <param name="zMin" type="float" value="" size="3" label="Minimum value for the heatmap intensities. Leave empty for automatic values" optional="true"/>
         <param name="zMax" type="float" value="" size="3" label="Maximum value for the heatmap intensities. Leave empty for automatic values" optional="true"/>
         <param name="yMin" type="float" value="" size="3" label="Minimum value for the Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
-	    <param name="yMax" type="float" value="" size="3" label="Maximum value for Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
-	    
-	    <param name="xAxisLabel" type="text" value="distance from TSS (bp)" size="200" label="Description for the x-axis label" />
+        <param name="yMax" type="float" value="" size="3" label="Maximum value for Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
+        
+        <param name="xAxisLabel" type="text" value="distance from TSS (bp)" size="200" label="Description for the x-axis label" />
         <param name="yAxisLabel" type="text" value="genes" size="30" label="Description for the y-axis label for the top panel" />
         
         <param name="heatmapWidth" type="float" value="7.5" min="1" max="100" label="Heatmap width in cm" help="The minimum value is 1 and the maximum is 100."/>
 
-	    <param name="heatmapHeight" type="float" value="25" min="3" max="100" label="Heatmap height in cm" help="The minimum value is 3 and the maximum is 100."/>
-	    
-	    <param name="whatToShow" type="select" label="What to show" help ="The default is to include a summary or profile plot on top of the heatmap and a heatmap colorbar.">
+        <param name="heatmapHeight" type="float" value="25" min="3" max="100" label="Heatmap height in cm" help="The minimum value is 3 and the maximum is 100."/>
+        
+        <param name="whatToShow" type="select" label="What to show" help ="The default is to include a summary or profile plot on top of the heatmap and a heatmap colorbar.">
           <option value="plot, heatmap and colorbar" selected="true">summary plot, heatmap and colorbar</option>
           <option value="plot only">summary plot only</option>
           <option value="plot and heatmap">summary plot and heatmap (no colorbar)</option>
@@ -324,12 +324,12 @@
   </inputs>
   <outputs>
     <data format="png" name="outFileName" label="${tool.name} image">
-	<change_format>
-		<when input="output.outFileFormat" value="pdf" format="pdf" />
-		<when input="output.outFileFormat" value="svg" format="svg" />
-		<when input="output.outFileFormat" value="eps" format="eps" />
-		<when input="output.outFileFormat" value="emf" format="emf" />
-	</change_format>
+    <change_format>
+        <when input="output.outFileFormat" value="pdf" format="pdf" />
+        <when input="output.outFileFormat" value="svg" format="svg" />
+        <when input="output.outFileFormat" value="eps" format="eps" />
+        <when input="output.outFileFormat" value="emf" format="emf" />
+    </change_format>
     </data>
     <data format="tabular" name="outFileNameData" label="${tool.name} raw plot data">
       <filter>(output['showOutputSettings'] == 'yes' and output['saveData'] == True)</filter>
@@ -341,7 +341,12 @@
       <filter>(output['showOutputSettings'] == 'yes' and output['saveSortedRegions'] == True)</filter>
     </data>  
   </outputs>
-
+    <tests>
+        <test>
+            <param name="matrixFile" value="master.mat.gz" ftype="bgzip" />
+            <output name="outFileName" file="master.png" ftype="png" compare="sim_size" delta="100" />
+        </test>
+    </tests>
   <help>
 
 **What it does**
--- a/profiler.xml	Fri Aug 02 13:53:20 2013 -0400
+++ b/profiler.xml	Sat Aug 03 09:48:44 2013 -0400
@@ -66,25 +66,22 @@
   </command>
 
   <inputs>
-  
-  <param name="matrixFile" format="bgzip" type="data" label="Matrix file from the computeMatrix tool"/>
-  
-  <conditional name="scaleRegions">
-    <param name="showScaleRegionsOpt" type="select" label="The input matrix was computed in scale-regions mode">
-      <option value="no" selected="true">no</option>
-      <option value="yes">yes</option>
+    <param name="matrixFile" format="bgzip" type="data" label="Matrix file from the computeMatrix tool"/>
+    <conditional name="scaleRegions">
+      <param name="showScaleRegionsOpt" type="select" label="The input matrix was computed in scale-regions mode">
+        <option value="no" selected="true">no</option>
+        <option value="yes">yes</option>
       </param>
-      <when value="no" />
-      <when value="yes">
-        <param name="startLabel" type="text" value="TSS" size="10" label="Label for the region start" help ="[only for scale-regions mode] Label shown in the plot for the start of the region. Default is TSS (transcription start site), but could be changed to anything, e.g. &quot;peak start&quot;." />
-        <param name="endLabel" type="text" value="TES" size="10" label="Label for the region end" help="[only for scale-regions mode] Label shown in the plot for the region end. Default is TES (transcription end site)."/>
-        
-        <param name="refPointLabel" type="text" value="TSS" size="10" label="Reference point label" help ="[only for scale-regions mode] Label shown in the plot for the reference-point. Default is the same as the reference point selected (e.g. TSS), but could be anything, e.g. &quot;peak start&quot; etc." />
-      </when>
-  </conditional>
-  
-  <conditional name="output" >
-        <param name="showOutputSettings" type="select" label="Show advanced output settings" >
+        <when value="no" />
+        <when value="yes">
+            <param name="startLabel" type="text" value="TSS" size="10" label="Label for the region start" help ="[only for scale-regions mode] Label shown in the plot for the start of the region. Default is TSS (transcription start site), but could be changed to anything, e.g. &quot;peak start&quot;." />
+            <param name="endLabel" type="text" value="TES" size="10" label="Label for the region end" help="[only for scale-regions mode] Label shown in the plot for the region end. Default is TES (transcription end site)."/>
+            <param name="refPointLabel" type="text" value="TSS" size="10" label="Reference point label" help ="[only for scale-regions mode] Label shown in the plot for the reference-point. Default is the same as the reference point selected (e.g. TSS), but could be anything, e.g. &quot;peak start&quot; etc." />
+        </when>
+    </conditional>
+
+    <conditional name="output" >
+      <param name="showOutputSettings" type="select" label="Show advanced output settings" >
         <option value="no" selected="true">no</option>
         <option value="yes">yes</option>
       </param>
@@ -92,7 +89,7 @@
       <when value="yes">
         <param name="outFileFormat" type="select" label="Image file format">
             <option value="png" selected="true">png</option>
-	        <option value="pdf">pdf</option>
+            <option value="pdf">pdf</option>
             <option value="svg">svg</option>
             <option value="eps">eps</option>
             <option value="emf">emf</option>
@@ -102,9 +99,9 @@
         <param name="saveSortedRegions" type="boolean" label="Save the regions after skipping zeros or min/max threshold values" help="The order of the regions in the file follows the sorting order selected. This is useful, for example, to generate other heatmaps keeping the sorting of the first heatmap."/>
       </when>
     </conditional>
-  
-  <conditional name="advancedOpt">
-    <param name="showAdvancedOpt" type="select" label="Show advanced options" >
+
+    <conditional name="advancedOpt">
+      <param name="showAdvancedOpt" type="select" label="Show advanced options" >
         <option value="no" selected="true">no</option>
         <option value="yes">yes</option>
       </param>
@@ -133,31 +130,27 @@
           <option value="std">std</option>
           <option value="overlapped_lines">overlapped lines</option>
         </param>
-        
+
         <param name="regionsLabel" type="text" value="genes" size="30" label="Labels for the regions plotted in the heatmap" help="If more than one region is being plotted a list of labels separated by comma and limited by quotes, is required. For example, &quot;label1, label2&quot;."/>
-        
         <param name="plotTitle" type="text" value="" size="30" label="Title of the plot" help="Title of the plot, to be printed on top of the generated image. Leave blank for no title." />
-        
         <param name="onePlotPerGroup" type="boolean" truevalue="--onePlotPerGroup" falsevalue="" label="Do one plot per group" help="When the region file contains groups separated by &quot;#&quot;, the default is to plot the averages for the distinct plots in one plot. If this option is set, each group will get its own plot, stacked on top of each other."/>
-        
+
         <param name="yMin" type="float" value="" size="3" label="Minimum value for the Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
-	    <param name="yMax" type="float" value="" size="3" label="Maximum value for Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
-	    
-	    <param name="xAxisLabel" type="text" value="gene distance (bp)" size="50" label="Description for the x-axis label" />
+        <param name="yMax" type="float" value="" size="3" label="Maximum value for Y-axis of the summary plot. Leave empty for automatic values" optional="true"/>
+
+        <param name="xAxisLabel" type="text" value="gene distance (bp)" size="50" label="Description for the x-axis label" />
         <param name="yAxisLabel" type="text" value="" size="50" label="Description for the y-axis label for the top panel" />
-        
       </when>
-  </conditional>
-  
+    </conditional>
   </inputs>
   <outputs>
     <data format="png" name="outFileName" label="${tool.name} image">
-	<change_format>
-		<when input="output.outFileFormat" value="pdf" format="pdf" />
-		<when input="output.outFileFormat" value="svg" format="svg" />
-		<when input="output.outFileFormat" value="eps" format="eps" />
-		<when input="output.outFileFormat" value="emf" format="emf" />
-	</change_format>
+    <change_format>
+        <when input="output.outFileFormat" value="pdf" format="pdf" />
+        <when input="output.outFileFormat" value="svg" format="svg" />
+        <when input="output.outFileFormat" value="eps" format="eps" />
+        <when input="output.outFileFormat" value="emf" format="emf" />
+    </change_format>
     </data>
     <data format="tabular" name="outFileNameData" label="${tool.name} raw plot data">
       <filter>(output['showOutputSettings'] == 'yes' and output['saveData'] == True)</filter>
Binary file test-data/master.mat.gz has changed
Binary file test-data/master.png has changed
Binary file test-data/test.bw has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test2.bed	Sat Aug 03 09:48:44 2013 -0400
@@ -0,0 +1,8 @@
+ch1	100	150	CG11023	0	+
+ch2	150	175	cda5	0	-
+ch3	100	125	cda8	0	+
+#Group 1
+ch1	75	125	C11023	0	+
+ch2	125	150	ca5	0	-
+ch3	75	100	ca8	0	+
+#Group 2