|
17
|
1 <tool id="macs2_callpeak" name="MACS2 callpeak" version="2.0.10.0">
|
|
|
2 <description>Call peaks from alignment results</description>
|
|
|
3 <expand macro="requirements">
|
|
|
4 <requirement type="package" version="3.0.1">R_3_0_1</requirement>
|
|
18
|
5 <requirement type="package" version="4.1.0">gnu_awk</requirement>
|
|
17
|
6 <requirement type="set_environment">MACS2_SCRIPT_PATH</requirement>
|
|
|
7 </expand>
|
|
|
8 <expand macro="version_command" />
|
|
|
9 <macros>
|
|
|
10 <import>macs2_macros.xml</import>
|
|
|
11 </macros>
|
|
|
12 <command>
|
|
|
13 #import os
|
|
|
14 #set $temp_stderr = 'macs2_stderr'
|
|
19
|
15 (macs2 callpeak
|
|
17
|
16
|
|
|
17 --name "MACS2"
|
|
19
|
18 -t ${ ' '.join( map( lambda x:'"%s"' % ( x ), $input_treatment_file ) ) }
|
|
17
|
19
|
|
19
|
20 #if str( $input_control_file ) != 'None':
|
|
20
|
21 -c ${ ' '.join( map( lambda x:'"%s"' % ( x ), $input_control_file ) ) }
|
|
17
|
22 #end if
|
|
|
23
|
|
20
|
24 #for $ifile in $input_treatment_file[0]:
|
|
|
25 #if ${ ifile.ext.upper() } == 'BAM' and ${ bampe }:
|
|
|
26 --format BAMPE
|
|
|
27 #else:
|
|
|
28 --format='${ ifile.ext.upper() }'
|
|
|
29 #end
|
|
17
|
30 #end for
|
|
|
31
|
|
|
32 @effective_genome_size@
|
|
|
33
|
|
|
34 --bw='$band_width'
|
|
|
35
|
|
|
36 ## advanced options
|
|
|
37 #if $advanced_options.advanced_options_selector == 'on':
|
|
|
38 $advanced_options.nolambda
|
|
|
39 $advanced_options.call_summits
|
|
|
40 #if $advanced_options.broad_options.broad_options_selector == 'broad':
|
|
|
41 --broad
|
|
19
|
42 --broad-cutoff='${ advanced_options.broad_options.broad_cutoff }'
|
|
17
|
43 #end if
|
|
20
|
44
|
|
|
45 #if $advanced_options.keepdup.keepdup_opt == 'specific':
|
|
|
46 --keep-dup '${ $advanced_options.keepdup.keep_duplicates }'
|
|
|
47 #else
|
|
|
48 --keep-dup '${ $advanced_options.keepdup.keepdup_opt }'
|
|
|
49 #end if
|
|
|
50
|
|
|
51 #if str( $advanced_options.keep_dup_options.keep_dup_options_selector ) == "user":
|
|
|
52 --keep-dup "${ advanced_options.keep_dup_options.user_keepdup }"
|
|
|
53 #else
|
|
|
54 --keep-dup "${ advanced_options.keep_dup_options.keep_dup_options_selector }"
|
|
|
55 #end if
|
|
|
56
|
|
17
|
57 #end if
|
|
|
58
|
|
|
59 ## With --bdg two additional output files will be generated.
|
|
|
60 #if 'bdg' in str($outputs).split(','):
|
|
|
61 --bdg
|
|
|
62 #end if
|
|
|
63
|
|
|
64 ## cutoff selection
|
|
|
65 #if str( $cutoff_options.cutoff_options_selector ) == 'qvalue':
|
|
19
|
66 --qvalue "${ cutoff_options.qvalue }"
|
|
17
|
67 #elif str( $cutoff_options.cutoff_options_selector ) == 'pvalue':
|
|
|
68 #if str($cutoff_options.pvalue).strip() != '':
|
|
19
|
69 --pvalue "${ cutoff_options.pvalue }"
|
|
17
|
70 #end if
|
|
|
71 #else:
|
|
19
|
72 --foldenrichment "${ cutoff_options.foldenrichment }"
|
|
17
|
73 #end if
|
|
|
74
|
|
|
75 ## model options
|
|
|
76 #if $nomodel_type.nomodel_type_selector == 'nomodel':
|
|
|
77 --nomodel
|
|
|
78 ##--shiftsize '$nomodel_type.shiftsize'
|
|
19
|
79 --extsize '${ nomodel_type.extsize }'
|
|
17
|
80 #end if
|
|
|
81
|
|
19
|
82 2> $temp_stderr)
|
|
17
|
83 #if 'peaks_bed' in str($outputs).split(','):
|
|
19
|
84 &&
|
|
|
85 awk '$2-=1' MACS2_peaks.xls | awk '!/^#/' | awk -v OFS='\t' '$1=$1' | tail -n+3 > "${ output_bed }"
|
|
17
|
86 #end if
|
|
|
87
|
|
|
88 ## run R to create pdf from model script
|
|
|
89 #if 'pdf' in str($outputs).split(','):
|
|
19
|
90 &&
|
|
|
91 Rscript MACS2_model.r > MACS2_model.r.log
|
|
17
|
92 #end if
|
|
|
93
|
|
|
94 #if 'html' in str($outputs).split(','):
|
|
|
95 ## if output files exists, move them to the extra_files_path and create a html result page linking to them
|
|
19
|
96 &&
|
|
|
97 (
|
|
17
|
98 count=`ls -1 MACS2* 2>/dev/null | wc -l`;
|
|
|
99 if [ \$count != 0 ];
|
|
|
100 then
|
|
19
|
101 mkdir "${ output_extra_files.extra_files_path }";
|
|
|
102 cp MACS2* "${ output_extra_files.extra_files_path }";
|
|
|
103 python "\$MACS2_SCRIPT_PATH/dir2html.py" "${ output_extra_files.extra_files_path }" $temp_stderr > "${ output_extra_files }";
|
|
17
|
104 fi;
|
|
19
|
105 )
|
|
17
|
106 #end if
|
|
20
|
107 ;
|
|
|
108 exit_code_for_galaxy=\$?;
|
|
|
109 cat $temp_stderr 2>&1;
|
|
|
110 (exit \$exit_code_for_galaxy)
|
|
17
|
111 </command>
|
|
|
112 <expand macro="stdio" />
|
|
|
113 <inputs>
|
|
20
|
114 <param name="input_treatment_file" type="data" format="bam,sam,bed" multiple="True" label="ChIP-Seq Treatment File" />
|
|
17
|
115 <param name="input_control_file" type="data" format="bam,sam,bed" multiple="True" optional="True" label="ChIP-Seq Control File" />
|
|
20
|
116
|
|
|
117 <param name="bampe" type="boolean" truevalue="--format BAMPE" falsevalue="" checked="False" label="Are your inputs Paired-end BAM files?"
|
|
|
118 help="The 'Build model step' will be ignored and the real fragments will be used for each template defined by leftmost and rightmost mapping positions. (--format BAMPE)"/>
|
|
17
|
119
|
|
|
120 <expand macro="conditional_effective_genome_size" />
|
|
|
121 <expand macro="band_width" />
|
|
|
122
|
|
|
123 <conditional name="cutoff_options">
|
|
|
124 <param name="cutoff_options_selector" type="select" label="Peak detection based on" help="default uses q-value">
|
|
|
125 <option value="qvalue" selected="true">q-value</option>
|
|
|
126 <option value="pvalue">p-value</option>
|
|
|
127 <option value="foldenrichment">foldenrichment</option>
|
|
|
128 </param>
|
|
|
129 <when value="pvalue">
|
|
|
130 <param name="pvalue" type="float" value="" label="p-value cutoff for peak detection"
|
|
|
131 help="default: not set (--pvalue)"/>
|
|
|
132 </when>
|
|
|
133 <when value="qvalue">
|
|
|
134 <param name="qvalue" type="float" value="0.05" label="Minimum FDR (q-value) cutoff for peak detection"
|
|
|
135 help="default: 0.05 (--qvalue)"/>
|
|
|
136 </when>
|
|
|
137 <when value="foldenrichment">
|
|
|
138 <param name="foldenrichment" value="" type="integer" label="Foldenrichment cutoff for peak detection"
|
|
|
139 help="(--foldenrichment)"/>
|
|
|
140 </when>
|
|
|
141 </conditional>
|
|
|
142
|
|
|
143 <conditional name="nomodel_type">
|
|
|
144 <param name="nomodel_type_selector" type="select" label="Build Model">
|
|
|
145 <option value="nomodel">Do not build the shifting model (--nomodel)</option>
|
|
|
146 <option value="create_model" selected="true">Build the shifting model</option>
|
|
|
147 </param>
|
|
|
148 <when value="create_model"/>
|
|
|
149 <when value="nomodel">
|
|
|
150 <!--<param name="shiftsize" type="integer" label="Arbitrary shift size in bp" value="100" help="(shiftsize)"/>-->
|
|
|
151 <param name="extsize" type="integer" value="100" label="The arbitrary extension size in bp"
|
|
|
152 help="MACS will use this value as fragment size to extend each read towards 3' end, then pile them up. It's exactly twice the number of legacy shiftsize. In previous language, each read is moved 3' direction to middle of fragment by 1/2 d, then extended to both direction with 1/2 d. This is equivalent to say each read is extended towards 3' into a d size fragment. DEFAULT: 200 (--extsize)"/>
|
|
|
153 </when>
|
|
|
154 </conditional>
|
|
|
155
|
|
|
156 <param name="outputs" type="select" display="checkboxes" multiple="True" label="Outputs">
|
|
|
157 <option value="peaks_bed" selected="True">Peaks as BED file</option>
|
|
20
|
158 <!--<option value="narrow">narrow Peaks</option>-->
|
|
|
159 <!--<option value="summits" selected="true">summits</option>-->
|
|
17
|
160 <option value="bdg" selected="true">Scores in bedGraph files (--bdg)</option>
|
|
|
161 <option value="html">Summary page (html)</option>
|
|
|
162 <option value="pdf">Plot in PDF</option>
|
|
|
163 <validator type="no_options" message="Please select at least one output file." />
|
|
|
164 </param>
|
|
|
165
|
|
|
166 <conditional name="advanced_options">
|
|
|
167 <param name="advanced_options_selector" type="select" label="Advanced options">
|
|
|
168 <option value="off" selected="true">Hide advanced options</option>
|
|
|
169 <option value="on">Display advanced options</option>
|
|
|
170 </param>
|
|
|
171 <when value="on">
|
|
20
|
172 <param name="nolambda" type="boolean" truevalue="--nolambda" falsevalue="" checked="False"
|
|
|
173 label="Use fixed background lambda as local lambda for every peak region" help="up to 9X more time consuming (--nolambda)"/>
|
|
17
|
174 <conditional name="broad_options">
|
|
|
175 <param name="broad_options_selector" type="select"
|
|
|
176 label="Composite broad regions" help="by putting nearby highly enriched regions into a broad region with loose cutoff (--broad)">
|
|
|
177 <option value="nobroad" selected="true">No broad regions</option>
|
|
|
178 <option value="broad">broad regions</option>
|
|
|
179 </param>
|
|
|
180 <when value="broad">
|
|
20
|
181 <param name="broad_cutoff" type="float" label="Cutoff for broad region" value="0.1"
|
|
|
182 help="value is either p-value or q-value as specified above (--broad-cutoff)"/>
|
|
17
|
183 </when>
|
|
20
|
184 <when value="nobroad">
|
|
|
185 <param name="call_summits" type="boolean" truevalue="--call-summits" falsevalue="" checked="False"
|
|
|
186 label="Use a more sophisticated signal processing approach to find subpeak summits in each enriched peak region"
|
|
|
187 help="(--call-summits)"/>
|
|
|
188 </when>
|
|
17
|
189 </conditional>
|
|
20
|
190 <expand macro="keep_duplicates" />
|
|
17
|
191 </when>
|
|
|
192 <when value="off" />
|
|
|
193 </conditional>
|
|
|
194 </inputs>
|
|
|
195 <outputs>
|
|
|
196 <!--callpeaks output-->
|
|
|
197 <data name="output_bed" format="bed" label="${tool.name} on ${on_string} (Peaks in BED format)">
|
|
|
198 <filter>'peaks_bed' in outputs</filter>
|
|
|
199 </data>
|
|
20
|
200 <data name="output_broadpeaks" format="tabular" from_work_dir="MACS2_peaks.broadPeak" label="${tool.name} on ${on_string} (broad Peaks)">
|
|
|
201 <filter>
|
|
|
202 ((
|
|
|
203 advanced_options['advanced_options_selector'] == "on" and
|
|
|
204 advanced_options['broad_options']['broad_options_selector'] == "broad"
|
|
|
205 ))
|
|
|
206 </filter>
|
|
17
|
207 </data>
|
|
20
|
208 <data name="output_gappedpeaks" format="tabular" from_work_dir="MACS2_peaks.gappedPeak" label="${tool.name} on ${on_string} (gapped Peaks)">
|
|
17
|
209 <filter>
|
|
|
210 ((
|
|
|
211 advanced_options['advanced_options_selector'] == "on" and
|
|
|
212 advanced_options['broad_options']['broad_options_selector'] == "broad"
|
|
|
213 ))
|
|
|
214 </filter>
|
|
|
215 </data>
|
|
20
|
216 <data name="output_narrowpeaks" format="tabular" from_work_dir="MACS2_peaks.narrowPeak" label="${tool.name} on ${on_string} (narrow Peaks)">
|
|
|
217 <filter>
|
|
|
218 ((
|
|
|
219 advanced_options['advanced_options_selector'] == "on" and
|
|
|
220 advanced_options['broad_options']['broad_options_selector'] == "nobroad"
|
|
|
221 ))
|
|
|
222 </filter>
|
|
|
223 </data>
|
|
17
|
224 <data name="output_summits" format="bed" from_work_dir="MACS2_summits.bed" label="${tool.name} on ${on_string} (summits in BED)">
|
|
20
|
225 <filter>
|
|
|
226 ((
|
|
|
227 advanced_options['advanced_options_selector'] == "on" and
|
|
|
228 advanced_options['broad_options']['broad_options_selector'] == "nobroad"
|
|
|
229 ))
|
|
|
230 </filter>
|
|
17
|
231 </data>
|
|
|
232 <data name="output_plot" format="pdf" from_work_dir="MACS2_model.pdf" label="${tool.name} on ${on_string} (plot)">
|
|
|
233 <filter>'pdf' in outputs</filter>
|
|
|
234 </data>
|
|
|
235 <data name="output_treat_pileup" format="bedgraph" from_work_dir="MACS2_treat_pileup.bdg" label="${tool.name} on ${on_string} (Bedgraph Treatment)">
|
|
|
236 <filter>'bdg' in outputs</filter>
|
|
|
237 </data>
|
|
|
238 <data name="output_control_lambda" format="bedgraph" from_work_dir="MACS2_control_lambda.bdg" label="${tool.name} on ${on_string} (Bedgraph Control)">
|
|
|
239 <filter>'bdg' in outputs</filter>
|
|
|
240 </data>
|
|
|
241 <data name="output_extra_files" format="html" label="${tool.name} on ${on_string} (html report)">
|
|
|
242 <filter>'html' in outputs</filter>
|
|
|
243 </data>
|
|
|
244 </outputs>
|
|
|
245 <tests>
|
|
|
246 <test>
|
|
|
247 <param name="input_control_file" value="Control_200K.bed" ftype="bed"/>
|
|
|
248 <param name="input_treatment_file" value="ChIP_200K.bed" ftype="bed"/>
|
|
|
249 <param name="cutoff_options_selector" value="qvalue"/>
|
|
|
250 <param name="qvalue" value="0.05"/>
|
|
|
251 <param name="band_width" value="300"/>
|
|
|
252 <param name="outputs" value="peaks_bed,bdg,summits"/>
|
|
|
253 <param name="effective_genome_size_options_selector" value="3300000000"/>
|
|
|
254 <output name="output_control_lambda" compare="contains" file="callpeak_control_part.bdg"/>
|
|
|
255 <output name="output_treat_pileup" compare="contains" file="callpeak_treatment_part.bdg"/>
|
|
|
256 <output name="output_bed" compare="contains" file="callpeak_part.bed"/>
|
|
|
257 <output name="output_summits" compare="contains" file="callpeak_summits_part.bed"/>
|
|
|
258 </test>
|
|
|
259 </tests>
|
|
|
260 <help>
|
|
|
261 **What it does**
|
|
|
262
|
|
|
263 With the improvement of sequencing techniques, chromatin immunoprecipitation followed by high throughput sequencing (ChIP-Seq)
|
|
|
264 is getting popular to study genome-wide protein-DNA interactions. To address the lack of powerful ChIP-Seq analysis method, we present a novel algorithm, named Model-based Analysis of ChIP-Seq (MACS), for
|
|
|
265 identifying transcript factor binding sites. MACS captures the influence of genome complexity to evaluate the significance of enriched ChIP regions, and MACS improves the spatial resolution of
|
|
|
266 binding sites through combining the information of both sequencing tag position and orientation. MACS can be easily used for ChIP-Seq data alone, or with control sample with the increase of specificity.
|
|
|
267
|
|
|
268 View the original MACS2 documentation: https://github.com/taoliu/MACS/blob/master/README
|
|
|
269
|
|
|
270 ------
|
|
|
271
|
|
|
272 **Usage**
|
|
|
273
|
|
|
274 **Peak Calling**: Main MACS2 Function to Call peaks from alignment results.
|
|
|
275
|
|
|
276 If you choose "Scores in bedGraph files" MACS will output the fragment pileup, control lambda, -log10-pvalue and -log10-qvalue scores in bedGraph files.
|
|
|
277 The peaks in BED format contain the following colomns: chr end length abs_summit pileup -log10(pvalue) fold_enrichment -log10(qvalue) name
|
|
|
278
|
|
|
279 **Compare .bdg files**: Deduct noise by comparing two signal tracks in bedGraph.
|
|
|
280
|
|
|
281
|
|
|
282 @citation@
|
|
|
283 </help>
|
|
|
284 </tool>
|