-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbiowardrobe_chipseq_se.cwl
422 lines (366 loc) · 11.9 KB
/
biowardrobe_chipseq_se.cwl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
cwlVersion: v1.0
class: Workflow
requirements:
- class: SubworkflowFeatureRequirement
- class: ScatterFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
- class: MultipleInputFeatureRequirement
inputs:
indices_folder:
type: Directory
label: "BOWTIE indices folder"
doc: "Path to BOWTIE generated indices folder"
annotation_file:
type: File
label: "Annotation file"
format: "http://edamontology.org/format_3475"
doc: "Tab-separated input annotation file"
genome_size:
type: string
label: "Effective genome size"
doc: "MACS2 effective genome size: hs, mm, ce, dm or number, for example 2.7e9"
chrom_length:
type: File
label: "Chromosome length file"
format: "http://edamontology.org/format_2330"
doc: "Chromosome length file"
control_file:
type: File?
default: null
label: "Control BAM file"
format: "http://edamontology.org/format_2572"
doc: "Control BAM file file for MACS2 peak calling"
broad_peak:
type: boolean
label: "Callpeak broad"
doc: "Set to call broad peak for MACS2"
fastq_file:
type: File
label: "FASTQ input file"
format: "http://edamontology.org/format_1930"
doc: "Reads data in a FASTQ format, received after single end sequencing"
exp_fragment_size:
type: int?
default: 150
label: "Expected fragment size"
doc: "Expected fragment size for MACS2"
force_fragment_size:
type: boolean?
default: false
label: "Force fragment size"
doc: "Force MACS2 to use exp_fragment_size"
clip_3p_end:
type: int?
default: 0
label: "Clip from 3p end"
doc: "Number of bases to clip from the 3p end"
clip_5p_end:
type: int?
default: 0
label: "Clip from 5p end"
doc: "Number of bases to clip from the 5p end"
remove_duplicates:
type: boolean?
default: false
label: "Remove duplicates"
doc: "Calls samtools rmdup to remove duplicates from sortesd BAM file"
threads:
type: int?
default: 2
doc: "Number of threads for those steps that support multithreading"
label: "Number of threads"
outputs:
bigwig:
type: File
format: "http://edamontology.org/format_3006"
label: "BigWig file"
doc: "Generated BigWig file"
outputSource: bam_to_bigwig/bigwig_file
fastx_statistics:
type: File
label: "FASTQ statistics"
format: "http://edamontology.org/format_2330"
doc: "fastx_quality_stats generated FASTQ file quality statistics file"
outputSource: fastx_quality_stats/statistics_file
bowtie_log:
type: File
label: "BOWTIE alignment log"
format: "http://edamontology.org/format_2330"
doc: "BOWTIE generated alignment log"
outputSource: bowtie_aligner/log_file
iaintersect_log:
type: File
label: "Island intersect log"
format: "http://edamontology.org/format_3475"
doc: "Iaintersect generated log"
outputSource: island_intersect/log_file
iaintersect_result:
type: File
label: "Island intersect results"
format: "http://edamontology.org/format_3475"
doc: "Iaintersect generated results"
outputSource: island_intersect/result_file
atdp_log:
type: File
label: "ATDP log"
format: "http://edamontology.org/format_3475"
doc: "Average Tag Density generated log"
outputSource: average_tag_density/log_file
atdp_result:
type: File
label: "ATDP results"
format: "http://edamontology.org/format_3475"
doc: "Average Tag Density generated results"
outputSource: average_tag_density/result_file
samtools_rmdup_log:
type: File
label: "Remove duplicates log"
format: "http://edamontology.org/format_2330"
doc: "Samtools rmdup generated log"
outputSource: samtools_rmdup/rmdup_log
bambai_pair:
type: File
format: "http://edamontology.org/format_2572"
label: "Coordinate sorted BAM alignment file (+index BAI)"
doc: "Coordinate sorted BAM file and BAI index file"
outputSource: samtools_sort_index_after_rmdup/bam_bai_pair
macs2_called_peaks:
type: File?
label: "Called peaks"
format: "http://edamontology.org/format_3468"
doc: "XLS file to include information about called peaks"
outputSource: macs2_callpeak/peak_xls_file
macs2_narrow_peaks:
type: File?
label: "Narrow peaks"
format: "http://edamontology.org/format_3613"
doc: "Contains the peak locations together with peak summit, pvalue and qvalue"
outputSource: macs2_callpeak/narrow_peak_file
macs2_broad_peaks:
type: File?
label: "Broad peaks"
format: "http://edamontology.org/format_3614"
doc: "Contains the peak locations together with peak summit, pvalue and qvalue"
outputSource: macs2_callpeak/broad_peak_file
macs2_peak_summits:
type: File?
label: "Peak summits"
format: "http://edamontology.org/format_3003"
doc: "Contains the peak summits locations for every peaks"
outputSource: macs2_callpeak/peak_summits_file
macs2_moder_r:
type: File?
label: "MACS2 generated R script"
format: "http://edamontology.org/format_2330"
doc: "R script to produce a PDF image about the model based on your data"
outputSource: macs2_callpeak/moder_r_file
macs2_gapped_peak:
type: File?
label: "Gapped peak"
format: "http://edamontology.org/format_3586"
doc: "Contains both the broad region and narrow peaks"
outputSource: macs2_callpeak/gapped_peak_file
macs2_log:
type: File?
label: "MACS2 log"
format: "http://edamontology.org/format_2330"
doc: "MACS2 output log"
outputSource: macs2_callpeak/macs_log
get_stat_log:
type: File?
label: "Bowtie & Samtools Rmdup combined log"
format: "http://edamontology.org/format_2330"
doc: "Processed and combined Bowtie aligner and Samtools rmdup log"
outputSource: get_stat/output_file
macs2_fragment_stat:
type: File?
label: "FRAGMENT, FRAGMENTE, ISLANDS"
format: "http://edamontology.org/format_2330"
doc: "fragment, calculated fragment, islands count from MACS2 results"
outputSource: macs2_callpeak/macs2_stat_file
steps:
extract_fastq:
run: ./tools/extract-fastq.cwl
in:
compressed_file: fastq_file
out: [fastq_file]
fastx_quality_stats:
run: ./tools/fastx-quality-stats.cwl
in:
input_file: extract_fastq/fastq_file
out: [statistics_file]
bowtie_aligner:
run: ./tools/bowtie-alignreads.cwl
in:
upstream_filelist: extract_fastq/fastq_file
indices_folder: indices_folder
clip_3p_end: clip_3p_end
clip_5p_end: clip_5p_end
v:
default: 3
m:
default: 1
best:
default: true
strata:
default: true
sam:
default: true
threads: threads
q:
default: true
out: [sam_file, log_file]
samtools_sort_index:
run: ./tools/samtools-sort-index.cwl
in:
sort_input: bowtie_aligner/sam_file
threads: threads
out: [bam_bai_pair]
samtools_rmdup:
run: ./tools/samtools-rmdup.cwl
in:
trigger: remove_duplicates
bam_file: samtools_sort_index/bam_bai_pair
single_end:
default: true
out: [rmdup_output, rmdup_log]
samtools_sort_index_after_rmdup:
run: ./tools/samtools-sort-index.cwl
in:
trigger: remove_duplicates
sort_input: samtools_rmdup/rmdup_output
threads: threads
out: [bam_bai_pair]
macs2_callpeak:
run: ./tools/macs2-callpeak-biowardrobe-only.cwl
in:
treatment_file: samtools_sort_index_after_rmdup/bam_bai_pair
control_file: control_file
nolambda:
source: control_file
valueFrom: $(!self)
genome_size: genome_size
mfold:
default: "4 40"
verbose:
default: 3
nomodel: force_fragment_size
extsize: exp_fragment_size
bw: exp_fragment_size
broad: broad_peak
call_summits:
source: broad_peak
valueFrom: $(!self)
keep_dup:
default: auto
q_value:
default: 0.05
format_mode:
default: BAM
buffer_size:
default: 10000
out:
- peak_xls_file
- narrow_peak_file
- peak_summits_file
- broad_peak_file
- moder_r_file
- gapped_peak_file
- treat_pileup_bdg_file
- control_lambda_bdg_file
- macs_log
- macs2_stat_file
- macs2_fragments_calculated
bam_to_bigwig:
run: ./subworkflows/bam-bedgraph-bigwig.cwl
in:
bam_file: samtools_sort_index_after_rmdup/bam_bai_pair
chrom_length_file: chrom_length
mapped_reads_number: get_stat/mapped_reads
fragment_size: macs2_callpeak/macs2_fragments_calculated
out: [bigwig_file]
get_stat:
run: ./tools/python-get-stat-chipseq.cwl
in:
bowtie_log: bowtie_aligner/log_file
rmdup_log: samtools_rmdup/rmdup_log
out:
- output_file
- mapped_reads
island_intersect:
run: ./tools/iaintersect.cwl
in:
input_filename: macs2_callpeak/peak_xls_file
annotation_filename: annotation_file
promoter_bp:
default: 1000
out: [result_file, log_file]
average_tag_density:
run: ./tools/atdp.cwl
in:
input_file: samtools_sort_index_after_rmdup/bam_bai_pair
annotation_filename: annotation_file
fragmentsize_bp: macs2_callpeak/macs2_fragments_calculated
avd_window_bp:
default: 5000
avd_smooth_bp:
default: 50
ignore_chr:
default: chrM
double_chr:
default: "chrX chrY"
avd_heat_window_bp:
default: 200
mapped_reads: get_stat/mapped_reads
out: [result_file, log_file]
$namespaces:
s: http://schema.org/
$schemas:
- http://schema.org/docs/schema_org_rdfa.html
s:name: "biowardrobe_chipseq_se"
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/ga4gh_challenge/master/biowardrobe_chipseq_se.cwl
s:codeRepository: https://github.com/Barski-lab/ga4gh_challenge
s:license: http://www.apache.org/licenses/LICENSE-2.0
s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/
s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898
doc: |
The workflow is used to run CHIP-Seq basic analysis with single-end input FASTQ file.
In outputs it returns coordinate sorted BAM file alongside with index BAI file, quality
statistics of the input FASTQ file, reads coverage in a form of bigWig file, peaks calling
data in a form of narrowPeak or broadPeak files.
s:about: |
The workflow is a CWL version of a Python pipeline from BioWardrobe (Kartashov and Barski, 2015).
It starts by extracting input FASTQ file (in case it was compressed). Next step runs BowTie
(Langmead et al., 2009) to perform alignment to a reference genome, resulting in an unsorted SAM file.
The SAM file is then sorted and indexed with samtools (Li et al., 2009) to obtain a BAM file and a BAI index.
Next MACS2 (Zhang et al., 2008) is used to call peaks and to estimate fragment size. In the last few steps,
the coverage by estimated fragments is calculated from the BAM file and is reported in bigWig format. The pipeline
also reports statistics, such as read quality, peak number and base frequency, and other troubleshooting information
using tools such as fastx-toolkit and bamtools.