comparison computeMatrix.xml @ 52:c0a054f2eff8 draft

Uploaded
author bgruening
date Mon, 22 Dec 2014 18:56:27 -0500
parents 72d1d7c68bd3
children
comparison
equal deleted inserted replaced
51:329e8411cc51 52:c0a054f2eff8
5 <macros> 5 <macros>
6 <token name="@BINARY@">computeMatrix</token> 6 <token name="@BINARY@">computeMatrix</token>
7 <import>deepTools_macros.xml</import> 7 <import>deepTools_macros.xml</import>
8 </macros> 8 </macros>
9 <command> 9 <command>
10 <![CDATA[
10 #import tempfile 11 #import tempfile
11 12
12 #set $temp_input_handle = tempfile.NamedTemporaryFile() 13 #set $temp_input_handle = tempfile.NamedTemporaryFile()
13 #set $temp_input_path = $temp_input_handle.name 14 #set $temp_input_path = $temp_input_handle.name
14 #silent $temp_input_handle.close() 15 #silent $temp_input_handle.close()
15 16
16 #for $rf in $regionsFiles: 17 #for $rf in $regionsFiles:
17 cat "$rf.regionsFile" >> $temp_input_path; 18 cat "$rf.regionsFile" >> $temp_input_path;
18 #if str($rf.label.value).strip(): 19 #if str($rf.label.value).strip():
19 echo "\#$rf.label.value" >> $temp_input_path; 20 echo "\#$rf.label.value" >> $temp_input_path;
20 #else: 21 #else:
21 echo "\#$rf.regionsFile.name" >> $temp_input_path; 22 echo "\#$rf.regionsFile.name" >> $temp_input_path;
22 #end if 23 #end if
23 #end for 24 #end for
24 25
25 26 computeMatrix
26 computeMatrix 27
27 28 $mode.mode_select
28 $mode.mode_select 29 --regionsFileName '$temp_input_path'
29 --regionsFileName '$temp_input_path' 30 --scoreFileName '$scoreFile'
30 --scoreFileName '$scoreFile' 31 --outFileName '$outFileName'
31 --outFileName '$outFileName' 32
32 33 @THREADS@
33 @THREADS@ 34
34 35 #if $output.showOutputSettings == "yes"
35 #if $output.showOutputSettings == "yes" 36 #if $output.saveData:
36 #if $output.saveData: 37 --outFileNameData '$outFileNameData'
37 --outFileNameData '$outFileNameData' 38 #end if
38 #end if 39 #if $output.saveMatrix:
39 #if $output.saveMatrix: 40 --outFileNameMatrix '$outFileNameMatrix'
40 --outFileNameMatrix '$outFileNameMatrix' 41 #end if
41 #end if 42
42 43 #if $output.saveSortedRegions:
43 #if $output.saveSortedRegions: 44 --outFileSortedRegions '$outFileSortedRegions'
44 --outFileSortedRegions '$outFileSortedRegions' 45 #end if
45 #end if 46 #end if
46 #end if 47
47 48 #if $mode.mode_select == "reference-point":
48 #if $mode.mode_select == "reference-point": 49 --referencePoint $mode.referencePoint
49 --referencePoint $mode.referencePoint 50 $mode.nanAfterEnd
50 $mode.nanAfterEnd 51 --beforeRegionStartLength $mode.beforeRegionStartLength
51 --beforeRegionStartLength $mode.beforeRegionStartLength 52 --afterRegionStartLength $mode.afterRegionStartLength
52 --afterRegionStartLength $mode.afterRegionStartLength 53 #else
53 #else 54 --regionBodyLength $mode.regionBodyLength
54 --regionBodyLength $mode.regionBodyLength 55 --startLabel "$mode.startLabel"
55 --startLabel "$mode.startLabel" 56 --endLabel "$mode.endLabel"
56 --endLabel "$mode.endLabel" 57 #if $mode.regionStartLength.regionStartLength_select == "yes":
57 #if $mode.regionStartLength.regionStartLength_select == "yes": 58 --beforeRegionStartLength $mode.regionStartLength.beforeRegionStartLength
58 --beforeRegionStartLength $mode.regionStartLength.beforeRegionStartLength 59 --afterRegionStartLength $mode.regionStartLength.afterRegionStartLength
59 --afterRegionStartLength $mode.regionStartLength.afterRegionStartLength 60 #end if
60 #end if 61 #end if
61 #end if 62
62 63 #if $advancedOpt.showAdvancedOpt == "yes":
63 #if $advancedOpt.showAdvancedOpt == "yes": 64 --sortRegions '$advancedOpt.sortRegions'
64 --sortRegions '$advancedOpt.sortRegions' 65 --sortUsing '$advancedOpt.sortUsing'
65 --sortUsing '$advancedOpt.sortUsing' 66 --averageTypeBins '$advancedOpt.averageTypeBins'
66 --averageTypeBins '$advancedOpt.averageTypeBins' 67 $advancedOpt.missingDataAsZero
67 $advancedOpt.missingDataAsZero 68 $advancedOpt.skipZeros
68 $advancedOpt.skipZeros 69 --binSize $advancedOpt.binSize
69 --binSize $advancedOpt.binSize 70
70 71 #if $advancedOpt.minThreshold:
71 #if $advancedOpt.minThreshold: 72 --minThreshold $advancedOpt.minThreshold
72 --minThreshold $advancedOpt.minThreshold 73 #end if
73 #end if 74 #if $advancedOpt.maxThreshold:
74 #if $advancedOpt.maxThreshold: 75 --maxThreshold $advancedOpt.maxThreshold
75 --maxThreshold $advancedOpt.maxThreshold 76 #end if
76 #end if 77 #if $advancedOpt.scale:
77 #if $advancedOpt.scale: 78 --scale $advancedOpt.scale
78 --scale $advancedOpt.scale 79 #end if
79 #end if 80
80 81 #end if
81 #end if 82 ; rm $temp_input_path
82 ; rm $temp_input_path 83 ]]>
83 84 </command>
84 </command> 85 <inputs>
85 <inputs> 86
86 87 <repeat name="regionsFiles" title="regions to plot" min="1">
87 <repeat name="regionsFiles" title="regions to plot" min="1"> 88 <param name="regionsFile" format="bed" type="data" label="Regions to plot" help="File, in BED format, containing the regions to plot."/>
88 <param name="regionsFile" format="bed" type="data" label="Regions to plot" help="File, in BED format, containing the regions to plot."/> 89 <param name="label" type="text" size="30" optional="true" value="" label="Label" help="Label to use in the output."/>
89 <param name="label" type="text" size="30" optional="true" value="" label="Label" help="Label to use in the output."/> 90 </repeat>
90 </repeat> 91
91 92 <param name="scoreFile" format="bigwig" type="data"
92 <param name="scoreFile" format="bigwig" type="data" label="Score file" help="Should be a bigWig file (containing a score, usually covering the whole genome). You can generate a bigWig file either from a bedGraph or WIG file using UCSC tools or from a BAM file using the deepTool bamCoverage."/> 93 label="Score file"
93 94 help="Should be a bigWig file (containing a score, usually covering the whole genome). You can generate a bigWig file either from a bedGraph or WIG file using UCSC tools or from a BAM file using the deepTool bamCoverage. (-scoreFile)"/>
94 <conditional name="mode" > 95
95 <param name="mode_select" type="select" label="computeMatrix has two main output options" help="In the scale-regions mode, all regions in the BED file are stretched or shrunk to the same length (bp) that is indicated by the user. Reference-point refers to a position within the BED regions (e.g start of region). In the reference-point mode only those genomic positions before (downstream) and/or after (upstream) the reference point will be plotted."> 96 <conditional name="mode" >
96 <option value="scale-regions" selected="true">scale-regions</option> 97 <param name="mode_select" type="select"
97 <option value="reference-point">reference-point</option> 98 label="computeMatrix has two main output options"
98 </param> 99 help="In the scale-regions mode, all regions in the BED file are stretched or shrunk to the same length (bp) that is indicated by the user. Reference-point refers to a position within the BED regions (e.g start of region). In the reference-point mode only those genomic positions before (downstream) and/or after (upstream) the reference point will be plotted.">
99 100 <option value="scale-regions" selected="true">scale-regions</option>
100 <when value="scale-regions" > 101 <option value="reference-point">reference-point</option>
101 <param name="regionBodyLength" type="integer" value="500" label="Distance in bp to which all regions are going to be fitted"/> 102 </param>
102 <param name="startLabel" type="text" value="TSS" size="10" label="Label for the region start" help ="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;." /> 103
103 <param name="endLabel" type="text" value="TES" size="10" label="Label for the region end" help="Label shown in the plot for the region end. Default is TES (transcription end site)."/> 104 <when value="scale-regions" >
104 <conditional name="regionStartLength"> 105 <param name="regionBodyLength" type="integer" value="500"
105 <param name="regionStartLength_select" type="select" label="Set distance up- and downstream of the given regions"> 106 label="Distance in bp to which all regions are going to be fitted" help="(--regionBodyLength)"/>
106 <option value="no" selected="true">no</option> 107 <param name="startLabel" type="text" value="TSS" size="10"
107 <option value="yes">yes</option> 108 label="Label for the region start"
108 </param> 109 help ="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;. (--startLabel)" />
109 <when value="no" /> 110 <param name="endLabel" type="text" value="TES" size="10"
110 <when value="yes"> 111 label="Label for the region end"
111 <param name="beforeRegionStartLength" type="integer" value="1000" min="1" optional="true" label="Distance upstream of the start site of the regions defined in the region file" help="If the regions are genes, this would be the distance upstream of the transcription start site."/> 112 help="Label shown in the plot for the region end. Default is TES (transcription end site). (--endLabel)"/>
112 <param name="afterRegionStartLength" type="integer" value="1000" min="1" optional="true" label="Distance downstream of the end site of the given regions" help="If the regions are genes, this would be the distance downstream of the transcription end site."/> 113 <conditional name="regionStartLength">
113 </when> 114 <param name="regionStartLength_select" type="select" label="Set distance up- and downstream of the given regions">
114 </conditional> 115 <option value="no" selected="true">no</option>
115 </when> 116 <option value="yes">yes</option>
116 117 </param>
117 <when value="reference-point"> 118 <when value="no" />
118 <param name="referencePoint" type="select" label="The reference point for the plotting"> 119 <when value="yes">
119 <option value="TSS" selected="true">beginning of region (e.g. TSS)</option> 120 <param name="beforeRegionStartLength" type="integer" value="1000" min="1"
120 <option value="TES">end of region (e.g. TES)</option> 121 label="Distance upstream of the start site of the regions defined in the region file"
121 <option value="center">center of region</option> 122 help="If the regions are genes, this would be the distance upstream of the transcription start site. (--beforeRegionStartLength)"/>
122 </param> 123 <param name="afterRegionStartLength" type="integer" value="1000" min="1"
123 <param name="nanAfterEnd" type="boolean" truevalue="--nanAfterEnd" falsevalue="" label="Discard any values after the region end" help="This is useful to visualize the region end when not using the scale-regions mode and when the reference-point is set to the TSS."/> 124 label="Distance downstream of the end site of the given regions"
124 <param name="beforeRegionStartLength" type="integer" value="1000" min="1" label="Distance upstream of the start site of the regions defined in the region file" help="If the regions are genes, this would be the distance upstream of the transcription start site."/> 125 help="If the regions are genes, this would be the distance downstream of the transcription end site. (--afterRegionStartLength)"/>
125 <param name="afterRegionStartLength" type="integer" value="1000" min="1" label="Distance downstream of the end site of the given regions" help="If the regions are genes, this would be the distance downstream of the transcription end site."/> 126 </when>
126 </when> 127 </conditional>
127 </conditional> 128 </when>
128 129 <when value="reference-point">
129 <expand macro="input_graphic_output_settings"> 130 <param name="referencePoint" type="select" label="The reference point for the plotting">
130 <expand macro="input_save_matrix_values" /> 131 <option value="TSS" selected="true">beginning of region (e.g. TSS)</option>
131 </expand> 132 <option value="TES">end of region (e.g. TES)</option>
132 133 <option value="center">center of region</option>
133 <conditional name="advancedOpt" > 134 </param>
134 <param name="showAdvancedOpt" type="select" label="Show advanced options" > 135 <param name="nanAfterEnd" type="boolean" truevalue="--nanAfterEnd" falsevalue=""
135 <option value="no" selected="true">no</option> 136 label="Discard any values after the region end"
136 <option value="yes">yes</option> 137 help="This is useful to visualize the region end when not using the scale-regions mode and when the reference-point is set to the TSS. (--nanAfterEnd)"/>
137 </param> 138 <param name="beforeRegionStartLength" type="integer" value="1000" min="1"
138 <when value="no" /> 139 label="Distance upstream of the start site of the regions defined in the region file"
139 <when value="yes"> 140 help="If the regions are genes, this would be the distance upstream of the transcription start site. (--beforeRegionStartLength)"/>
140 <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" /> 141 <param name="afterRegionStartLength" type="integer" value="1000" min="1"
141 <param name="sortRegions" type="select" label="Sort regions" 142 label="Distance downstream of the end site of the given regions"
142 help="Whether the output file should present the regions sorted."> 143 help="If the regions are genes, this would be the distance downstream of the transcription end site. (--afterRegionStartLength)"/>
143 <option value="no" selected="true">no ordering</option> 144 </when>
144 <option value="descend">descending order</option> 145 </conditional>
145 <option value="ascend">ascending order</option> 146
146 </param> 147 <expand macro="input_graphic_output_settings">
147 148 <expand macro="input_save_matrix_values" />
148 <param name="sortUsing" type="select" label="Method used for sorting." help="The value is computed for each row." > 149 </expand>
149 <option value="mean" selected="true">mean</option> 150
150 <option value="median">median</option> 151 <conditional name="advancedOpt" >
151 <option value="min">min</option> 152 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
152 <option value="max">max</option> 153 <option value="no" selected="true">no</option>
153 <option value="sum">sum</option> 154 <option value="yes">yes</option>
154 <option value="region_length">region length</option> 155 </param>
155 </param> 156 <when value="no" />
156 157 <when value="yes">
157 <param name="averageTypeBins" type="select" label="Define the type of statistic that should be displayed." help="The value is computed for each bin."> 158 <param name="binSize" type="integer" value="10" min="1"
158 <option value="mean" selected="true">mean</option> 159 label="Length, in base pairs, of the non-overlapping bin for averaging the score over the regions length"
159 <option value="median">median</option> 160 help="(--binSize)"/>
160 <option value="min">min</option> 161 <param name="sortRegions" type="select" label="Sort regions"
161 <option value="max">max</option> 162 help="Whether the output file should present the regions sorted.">
162 <option value="sum">sum</option> 163 <option value="no" selected="true">no ordering</option>
163 <option value="std">std</option> 164 <option value="descend">descending order</option>
164 </param> 165 <option value="ascend">ascending order</option>
165 166 </param>
166 <param name="missingDataAsZero" type="boolean" truevalue="--missingDataAsZero" falsevalue="" label="Indicate missing data as zero" help="Set to &quot;yes&quot;, if missing data should be indicated as zeros. Default is to ignore such cases which will be depicted as black areas in the heatmap. (see &quot;Missing data color&quot; options of the heatmapper for additional options)."/> 167
167 <param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue="" label="Skip zeros" help="Whether regions with only scores of zero should be included or not. Default is to include them."/> 168 <param name="sortUsing" type="select" label="Method used for sorting"
168 <param name="minThreshold" type="float" optional="true" label="Minimum threshold" help="Any region containing a value that is equal or less than this numeric value will be skipped. This is useful to skip, for example, genes where the read count is zero for any of the bins. This could be the result of unmappable areas and can bias the overall results."/> 169 help="The value is computed for each row. (--sortUsing)" >
169 <param name="maxThreshold" type="float" optional="true" label="Maximum threshold" help="Any region containing a value that is equal or higher that this numeric value will be skipped. The max threshold is useful to skip those few regions with very high read counts (e.g. major satellites) that may bias the average values."/> 170 <option value="mean" selected="true">mean</option>
170 <param name="scale" type="float" optional="true" label="Scale" help="If set, all values are multiplied by this number."/> 171 <option value="median">median</option>
171 </when> 172 <option value="min">min</option>
172 </conditional> 173 <option value="max">max</option>
173 174 <option value="sum">sum</option>
175 <option value="region_length">region length</option>
176 </param>
177
178 <param name="averageTypeBins" type="select"
179 label="Define the type of statistic that should be displayed."
180 help="The value is computed for each bin. (--averageTypeBins)">
181 <option value="mean" selected="true">mean</option>
182 <option value="median">median</option>
183 <option value="min">min</option>
184 <option value="max">max</option>
185 <option value="sum">sum</option>
186 <option value="std">std</option>
187 </param>
188
189 <param name="missingDataAsZero" type="boolean" truevalue="--missingDataAsZero" falsevalue=""
190 label="Indicate missing data as zero"
191 help="Set to &quot;yes&quot;, if missing data should be indicated as zeros. Default is to ignore such cases which will be depicted as black areas in the heatmap. (see &quot;Missing data color&quot; options of the heatmapper for additional options). (--missingDataAsZero)"/>
192 <param name="skipZeros" type="boolean" truevalue="--skipZeros" falsevalue=""
193 label="Skip zeros"
194 help="Whether regions with only scores of zero should be included or not. Default is to include them. (--skipZeros)"/>
195 <param name="minThreshold" type="float" optional="True"
196 label="Minimum threshold"
197 help="Any region containing a value that is equal or less than this numeric value will be skipped. This is useful to skip, for example, genes where the read count is zero for any of the bins. This could be the result of unmappable areas and can bias the overall results. (--minThreshold)"/>
198 <param name="maxThreshold" type="float" optional="True"
199 label="Maximum threshold"
200 help="Any region containing a value that is equal or higher that this numeric value will be skipped. The max threshold is useful to skip those few regions with very high read counts (e.g. major satellites) that may bias the average values. (--maxThreshold)"/>
201 <param name="scale" type="float" optional="True" label="Scaling factor"
202 help="If set, all values are multiplied by this number. (--scale)"/>
203 </when>
204 </conditional>
174 </inputs> 205 </inputs>
175 <outputs> 206 <outputs>
176 <data format="bgzip" name="outFileName" label="${tool.name} on ${on_string}: Matrix" /> 207 <data format="bgzip" name="outFileName" label="${tool.name} on ${on_string}: Matrix" />
177 <expand macro="output_graphic_outputs" /> 208 <expand macro="output_graphic_outputs" />
178 <expand macro="output_save_matrix_values" /> 209 <expand macro="output_save_matrix_values" />
179 </outputs> 210 </outputs>
180 <!-- 211 <!--
181 computeMatrix -S test.bw -R test2.bed -a 100 -b 100 -bs 1 212 computeMatrix -S test.bw -R test2.bed -a 100 -b 100 -bs 1
182 --> 213 -->
183 <tests> 214 <tests>
184 <test> 215 <test>
185 <param name="regionsFile" value="test2.bed" ftype="bed" /> 216 <param name="regionsFile" value="computeMatrix1.bed" ftype="bed" />
186 <param name="scoreFile" value="test.bw" ftype="bigwig" /> 217 <param name="scoreFile" value="bamCoverage_result4.bw" ftype="bigwig" />
187 <param name="advancedOpt.binSize" value="1" /> 218 <param name="showAdvancedOpt" value="yes" />
188 <param name="mode.beforeRegionStartLength" value="100" /> 219 <param name="mode_select" value="reference-point" />
189 <param name="mode.afterRegionStartLength" value="100" /> 220 <param name="binSize" value="10" />
190 <output name="outFileName" file="master.mat.gz" ftype="bgzip" compare="sim_size" delta="100" /> 221 <param name="sortUsing" value="sum" />
222 <param name="averageTypeBins" value="sum" />
223 <param name="missingDataAsZero" value="True" />
224 <param name="beforeRegionStartLength" value="10" />
225 <param name="afterRegionStartLength" value="10" />
226 <output name="outFileName" file="computeMatrix_result1.gz" ftype="bgzip" compare="sim_size" />
227 </test>
228 <test>
229 <param name="regionsFile" value="computeMatrix2.bed" ftype="bed" />
230 <param name="scoreFile" value="computeMatrix2.bw" ftype="bigwig" />
231 <param name="showAdvancedOpt" value="yes" />
232 <param name="mode_select" value="reference-point" />
233 <param name="binSize" value="10" />
234 <param name="beforeRegionStartLength" value="10" />
235 <param name="afterRegionStartLength" value="10" />
236 <output name="outFileName" file="computeMatrix_result2.gz" ftype="bgzip" compare="sim_size" />
191 </test> 237 </test>
192 </tests> 238 </tests>
193 <help> 239 <help>
194 240 <![CDATA[
195 **What it does** 241 **What it does**
196 242
197 This tool prepares an intermediary file (a gzipped table of values) 243 This tool prepares an intermediary file (a gzipped table of values)
198 that contains scores associated with genomic regions that can be used 244 that contains scores associated with genomic regions that can be used
199 afterwards to plot a heatmap or a profile. 245 afterwards to plot a heatmap or a profile.
215 261
216 262
217 ----- 263 -----
218 264
219 @REFERENCES@ 265 @REFERENCES@
220 266 ]]>
221 </help> 267 </help>
222 <expand macro="citations" /> 268 <expand macro="citations" />
223 </tool> 269 </tool>