23
|
1 <tool id="deeptools_computeMatrix" name="computeMatrix" version="1.0.4">
|
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>
|
|
3 <expand macro="requirements" />
|
10
|
4 <expand macro="stdio" />
|
0
|
5 <macros>
|
18
|
6 <token name="@BINARY@">computeMatrix</token>
|
0
|
7 <import>deepTools_macros.xml</import>
|
|
8 </macros>
|
|
9 <command>
|
|
10 #import tempfile
|
|
11
|
|
12 #set $temp_input_handle = tempfile.NamedTemporaryFile()
|
|
13 #set $temp_input_path = $temp_input_handle.name
|
|
14 #silent $temp_input_handle.close()
|
|
15
|
|
16 #for $rf in $regionsFiles:
|
|
17 cat "$rf.regionsFile" >> $temp_input_path;
|
|
18 #if str($rf.label.value).strip():
|
|
19 echo "\#$rf.label.value" >> $temp_input_path;
|
|
20 #else:
|
|
21 echo "\#$rf.regionsFile.name" >> $temp_input_path;
|
|
22 #end if
|
|
23 #end for
|
|
24
|
|
25
|
|
26 computeMatrix
|
|
27
|
|
28 $mode.mode_select
|
|
29 --regionsFileName '$temp_input_path'
|
|
30 --scoreFileName '$scoreFile'
|
|
31 --outFileName '$outFileName'
|
|
32
|
|
33 @THREADS@
|
|
34
|
|
35 #if $output.showOutputSettings == "yes"
|
|
36 #if $output.saveData:
|
|
37 --outFileNameData '$outFileNameData'
|
|
38 #end if
|
|
39 #if $output.saveMatrix:
|
|
40 --outFileNameMatrix '$outFileNameMatrix'
|
|
41 #end if
|
|
42
|
|
43 #if $output.saveSortedRegions:
|
|
44 --outFileSortedRegions '$outFileSortedRegions'
|
|
45 #end if
|
|
46 #end if
|
|
47
|
|
48 #if $mode.mode_select == "reference-point":
|
|
49 --referencePoint $mode.referencePoint
|
|
50 $mode.nanAfterEnd
|
|
51 --beforeRegionStartLength $mode.beforeRegionStartLength
|
|
52 --afterRegionStartLength $mode.afterRegionStartLength
|
|
53 #else
|
|
54 --regionBodyLength $mode.regionBodyLength
|
18
|
55 --startLabel "$mode.startLabel"
|
|
56 --endLabel "$mode.endLabel"
|
0
|
57 #if $mode.regionStartLength.regionStartLength_select == "yes":
|
|
58 --beforeRegionStartLength $mode.regionStartLength.beforeRegionStartLength
|
|
59 --afterRegionStartLength $mode.regionStartLength.afterRegionStartLength
|
|
60 #end if
|
|
61 #end if
|
|
62
|
|
63 #if $advancedOpt.showAdvancedOpt == "yes":
|
|
64 --sortRegions '$advancedOpt.sortRegions'
|
|
65 --sortUsing '$advancedOpt.sortUsing'
|
|
66 --averageTypeBins '$advancedOpt.averageTypeBins'
|
|
67 $advancedOpt.missingDataAsZero
|
|
68 $advancedOpt.skipZeros
|
|
69 --binSize $advancedOpt.binSize
|
|
70
|
|
71 #if $advancedOpt.minThreshold:
|
|
72 --minThreshold $advancedOpt.minThreshold
|
|
73 #end if
|
|
74 #if $advancedOpt.maxThreshold:
|
|
75 --maxThreshold $advancedOpt.maxThreshold
|
|
76 #end if
|
|
77 #if $advancedOpt.scale:
|
|
78 --scale $advancedOpt.scale
|
|
79 #end if
|
|
80
|
|
81 #end if
|
|
82 ; rm $temp_input_path
|
|
83
|
|
84 </command>
|
|
85 <inputs>
|
|
86
|
|
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."/>
|
|
89 <param name="label" type="text" size="30" optional="true" value="" label="Label" help="Label to use in the output."/>
|
|
90 </repeat>
|
|
91
|
|
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
|
|
94 <conditional name="mode" >
|
|
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 <option value="scale-regions" selected="true">scale-regions</option>
|
|
97 <option value="reference-point">reference-point</option>
|
|
98 </param>
|
|
99
|
|
100 <when value="scale-regions" >
|
|
101 <param name="regionBodyLength" type="integer" value="500" label="Distance in bp to which all regions are going to be fitted"/>
|
|
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. "peak start"." />
|
|
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)."/>
|
18
|
104 <conditional name="regionStartLength">
|
|
105 <param name="regionStartLength_select" type="select" label="Set distance up- and downstream of the given regions">
|
|
106 <option value="no" selected="true">no</option>
|
|
107 <option value="yes">yes</option>
|
|
108 </param>
|
|
109 <when value="no" />
|
|
110 <when value="yes">
|
|
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 <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 </when>
|
|
114 </conditional>
|
0
|
115 </when>
|
|
116
|
|
117 <when value="reference-point">
|
|
118 <param name="referencePoint" type="select" label="The reference point for the plotting">
|
9
|
119 <option value="TSS" selected="true">beginning of region (e.g. TSS)</option>
|
10
|
120 <option value="TES">end of region (e.g. TES)</option>
|
9
|
121 <option value="center">center of region</option>
|
0
|
122 </param>
|
|
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 <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 <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>
|
|
127 </conditional>
|
10
|
128
|
13
|
129 <expand macro="input_graphic_output_settings">
|
|
130 <expand macro="input_save_matrix_values" />
|
|
131 </expand>
|
0
|
132
|
|
133 <conditional name="advancedOpt" >
|
|
134 <param name="showAdvancedOpt" type="select" label="Show advanced options" >
|
|
135 <option value="no" selected="true">no</option>
|
|
136 <option value="yes">yes</option>
|
|
137 </param>
|
|
138 <when value="no" />
|
|
139 <when value="yes">
|
|
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="sortRegions" type="select" label="Sort regions"
|
|
142 help="Whether the output file should present the regions sorted.">
|
|
143 <option value="no" selected="true">no ordering</option>
|
|
144 <option value="descend">descending order</option>
|
|
145 <option value="ascend">ascending order</option>
|
|
146 </param>
|
|
147
|
|
148 <param name="sortUsing" type="select" label="Method used for sorting." help="The value is computed for each row." >
|
|
149 <option value="mean" selected="true">mean</option>
|
|
150 <option value="median">median</option>
|
|
151 <option value="min">min</option>
|
|
152 <option value="max">max</option>
|
|
153 <option value="sum">sum</option>
|
|
154 <option value="region_length">region length</option>
|
|
155 </param>
|
|
156
|
|
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 <option value="mean" selected="true">mean</option>
|
|
159 <option value="median">median</option>
|
|
160 <option value="min">min</option>
|
|
161 <option value="max">max</option>
|
|
162 <option value="sum">sum</option>
|
|
163 <option value="std">std</option>
|
|
164 </param>
|
|
165
|
|
166 <param name="missingDataAsZero" type="boolean" truevalue="--missingDataAsZero" falsevalue="" label="Indicate missing data as zero" help="Set to "yes", 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 "Missing data color" options of the heatmapper for additional options)."/>
|
|
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="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 <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 <param name="scale" type="float" optional="true" label="Scale" help="If set, all values are multiplied by this number."/>
|
|
171 </when>
|
|
172 </conditional>
|
|
173
|
|
174 </inputs>
|
|
175 <outputs>
|
10
|
176 <data format="bgzip" name="outFileName" label="${tool.name} on ${on_string}: Matrix" />
|
|
177 <expand macro="output_graphic_outputs" />
|
13
|
178 <expand macro="output_save_matrix_values" />
|
0
|
179 </outputs>
|
|
180 <!--
|
|
181 computeMatrix -S test.bw -R test2.bed -a 100 -b 100 -bs 1
|
|
182 -->
|
|
183 <tests>
|
|
184 <test>
|
|
185 <param name="regionsFile" value="test2.bed" ftype="bed" />
|
|
186 <param name="scoreFile" value="test.bw" ftype="bigwig" />
|
|
187 <param name="advancedOpt.binSize" value="1" />
|
|
188 <param name="mode.beforeRegionStartLength" value="100" />
|
|
189 <param name="mode.afterRegionStartLength" value="100" />
|
|
190 <output name="outFileName" file="master.mat.gz" ftype="bgzip" compare="sim_size" delta="100" />
|
|
191 </test>
|
|
192 </tests>
|
|
193 <help>
|
|
194
|
|
195 **What it does**
|
|
196
|
|
197 This tool summarizes and prepares an intermediary file
|
|
198 containing scores associated with genomic regions that can be used
|
|
199 afterwards to plot a heatmap or a profile.
|
|
200
|
|
201 Genomic regions can really be anything - genes, parts of genes, ChIP-seq
|
|
202 peaks, favorite genome regions... as long as you provide a proper file
|
|
203 in BED or INTERVAL format. This tool can also be used to filter and sort
|
|
204 regions according to their score.
|
|
205
|
|
206
|
|
207 .. image:: $PATH_TO_IMAGES/flowChart_computeMatrixetc.png
|
|
208 :alt: Relationship between computeMatrix, heatmapper and profiler
|
|
209
|
|
210
|
18
|
211 You can find more details in the `computeMatrix wiki`_.
|
0
|
212
|
18
|
213 .. _computeMatrix wiki: https://github.com/fidelram/deepTools/wiki/Visualizations#wiki-computeMatrix
|
|
214
|
|
215
|
|
216 -----
|
0
|
217
|
|
218 @REFERENCES@
|
|
219
|
|
220 </help>
|
|
221 </tool>
|