comparison computeMatrix.xml @ 30:5231f398d784 draft

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