-
Notifications
You must be signed in to change notification settings - Fork 17
/
03-map-se.cwl
286 lines (286 loc) · 7.84 KB
/
03-map-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
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.0
doc: 'ATAC-seq 03 mapping - reads: SE'
requirements:
- class: ScatterFeatureRequirement
- class: SubworkflowFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
inputs:
input_fastq_files:
doc: Input fastq files
type: File[]
genome_sizes_file:
doc: Genome sizes tab-delimited file (used in samtools)
type: File
genome_ref_first_index_file:
doc: Bowtie first index files for reference genome (e.g. *1.ebwt). The rest of the files should be in the same folder.
type: File
secondaryFiles:
- ^^.2.ebwt
- ^^.3.ebwt
- ^^.4.ebwt
- ^^.rev.1.ebwt
- ^^.rev.2.ebwt
picard_jar_path:
default: /usr/picard/picard.jar
doc: Picard Java jar file
type: string
picard_java_opts:
doc: JVM arguments should be a quoted, space separated list (e.g. "-Xms128m -Xmx512m")
type: string?
nthreads:
default: 1
type: int
steps:
extract_basename_1:
run: ../utils/basename.cwl
scatter: file_path
in:
file_path:
source: input_fastq_files
valueFrom: $(self.basename)
sep:
valueFrom: '(\.fastq.gz|\.fastq)'
do_not_escape_sep:
valueFrom: ${return true}
out:
- basename
bowtie-se:
run: ../map/bowtie-se.cwl
scatterMethod: dotproduct
scatter:
- input_fastq_file
- output_filename
in:
input_fastq_file: input_fastq_files
output_filename: extract_basename_1/basename
v:
valueFrom: ${return 2}
X:
valueFrom: ${return 2000}
genome_ref_first_index_file: genome_ref_first_index_file
nthreads: nthreads
out:
- output_aligned_file
- output_bowtie_log
sam2bam:
run: ../map/samtools2bam.cwl
scatter: input_file
in:
nthreads: nthreads
input_file: bowtie-se/output_aligned_file
out:
- bam_file
sort_bams:
run: ../map/samtools-sort.cwl
scatter: input_file
in:
nthreads: nthreads
input_file: sam2bam/bam_file
out:
- sorted_file
index_bams:
run: ../map/samtools-index.cwl
scatter: input_file
in:
input_file: sort_bams/sorted_file
out:
- indexed_file
filter-unmapped:
run: ../map/samtools-filter-unmapped.cwl
scatterMethod: dotproduct
scatter:
- input_file
- output_filename
in:
output_filename: extract_basename_1/basename
input_file: sort_bams/sorted_file
out:
- filtered_file
filtered2sorted:
run: ../map/samtools-sort.cwl
in:
nthreads: nthreads
input_file: filter-unmapped/filtered_file
scatter:
- input_file
out:
- sorted_file
index_filtered_bam:
run: ../map/samtools-index.cwl
scatter: input_file
in:
input_file: filtered2sorted/sorted_file
out:
- indexed_file
preseq-c-curve:
run: ../map/preseq-c_curve.cwl
scatterMethod: dotproduct
scatter:
- input_sorted_file
- output_file_basename
in:
input_sorted_file: filtered2sorted/sorted_file
output_file_basename: extract_basename_1/basename
out:
- output_file
execute_pcr_bottleneck_coef:
in:
input_bam_files: filtered2sorted/sorted_file
genome_sizes: genome_sizes_file
input_output_filenames: extract_basename_1/basename
run: ../map/pcr-bottleneck-coef.cwl
out:
- pbc_file
mark_duplicates:
run: ../map/picard-MarkDuplicates.cwl
scatterMethod: dotproduct
scatter:
- input_file
- output_filename
in:
input_file: index_filtered_bam/indexed_file
java_opts: picard_java_opts
picard_jar_path: picard_jar_path
output_filename: extract_basename_1/basename
output_suffix:
valueFrom: bam
out:
- output_metrics_file
- output_dedup_bam_file
sort_dups_marked_bams:
run: ../map/samtools-sort.cwl
scatter:
- input_file
in:
nthreads: nthreads
input_file: mark_duplicates/output_dedup_bam_file
suffix:
valueFrom: .dups_marked.bam
out:
- sorted_file
index_dups_marked_bams:
run: ../map/samtools-index.cwl
scatter:
- input_file
in:
input_file: sort_dups_marked_bams/sorted_file
out:
- indexed_file
remove_duplicates:
run: ../map/samtools-view.cwl
scatter:
- input_file
in:
input_file: index_dups_marked_bams/indexed_file
F:
valueFrom: ${return 1024}
suffix:
valueFrom: .dedup.bam
b:
valueFrom: ${return true}
outfile_name:
valueFrom: ${return inputs.input_file.basename.replace('dups_marked', 'dedup')}
out:
- outfile
sort_dedup_bams:
run: ../map/samtools-sort.cwl
scatter:
- input_file
in:
nthreads: nthreads
input_file: remove_duplicates/outfile
out:
- sorted_file
index_dedup_bams:
run: ../map/samtools-index.cwl
scatter:
- input_file
in:
input_file: sort_dedup_bams/sorted_file
out:
- indexed_file
mapped_reads_count:
run: ../map/bowtie-log-read-count.cwl
scatter: bowtie_log
in:
bowtie_log: bowtie-se/output_bowtie_log
out:
- output
percent_uniq_reads:
run: ../map/preseq-percent-uniq-reads.cwl
scatter: preseq_c_curve_outfile
in:
preseq_c_curve_outfile: preseq-c-curve/output_file
out:
- output
mapped_filtered_reads_count:
run: ../peak_calling/samtools-extract-number-mapped-reads.cwl
scatter: input_bam_file
in:
output_suffix:
valueFrom: .mapped_and_filtered.read_count.txt
input_bam_file: sort_dedup_bams/sorted_file
out:
- output_read_count
bam_idxstats:
run: ../map/samtools-idxstats.cwl
scatter: bam
in:
bam: index_bams/indexed_file
out:
- idxstats_file
percent_mitochondrial_reads:
run: ../utils/idxstats-percentage-of-reads-in-chrom.cwl
scatter: idxstats
in:
idxstats: bam_idxstats/idxstats_file
chrom:
valueFrom: chrM
output_filename:
valueFrom: ${return inputs.idxstats.basename.replace(/^.*[\\\/]/, '').replace(/\.[^/.]+$/, '').replace(/\.[^/.]+$/, '').replace(/\.[^/.]+$/, '.mitochondrial_percentage.txt')}
out:
- percent_map
outputs:
output_pbc_files:
doc: PCR Bottleneck Coeficient files.
type: File[]
outputSource: execute_pcr_bottleneck_coef/pbc_file
output_read_count_mapped:
doc: Read counts of the mapped BAM files
type: File[]
outputSource: mapped_reads_count/output
output_data_sorted_dedup_bam_files:
doc: BAM files without duplicate reads.
type: File[]
outputSource: index_dedup_bams/indexed_file
output_data_sorted_dups_marked_bam_files:
doc: BAM files with marked duplicate reads.
type: File[]
outputSource: index_dups_marked_bams/indexed_file
output_picard_mark_duplicates_files:
doc: Picard MarkDuplicates metrics files.
type: File[]
outputSource: mark_duplicates/output_metrics_file
output_read_count_mapped_filtered:
doc: Read counts of the mapped and filtered BAM files
type: File[]
outputSource: mapped_filtered_reads_count/output_read_count
output_percentage_uniq_reads:
doc: Percentage of uniq reads from preseq c_curve output
type: File[]
outputSource: percent_uniq_reads/output
output_bowtie_log:
doc: Bowtie log file.
type: File[]
outputSource: bowtie-se/output_bowtie_log
output_preseq_c_curve_files:
doc: Preseq c_curve output files.
type: File[]
outputSource: preseq-c-curve/output_file
output_percent_mitochondrial_reads:
doc: Percentage of mitochondrial reads.
type: File[]
outputSource: percent_mitochondrial_reads/percent_map