-
Notifications
You must be signed in to change notification settings - Fork 17
/
04-quantification-pe-stranded.cwl
283 lines (283 loc) · 8.02 KB
/
04-quantification-pe-stranded.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
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.0
doc: RNA-seq 04 quantification
requirements:
- class: ScatterFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
- class: SubworkflowFeatureRequirement
inputs:
input_bam_files:
type: File[]
nthreads:
default: 1
type: int
rsem_reference_files:
doc: RSEM genome reference files - generated with the rsem-prepare-reference command
type: Directory
annotation_file:
doc: GTF annotation file
type: File
input_transcripts_bam_files:
type: File[]
input_genome_sizes:
type: File
bamtools_forward_filter_file:
doc: JSON filter file for forward strand used in bamtools (see bamtools-filter command)
type: File
bamtools_reverse_filter_file:
doc: JSON filter file for reverse strand used in bamtools (see bamtools-filter command)
type: File
outputs:
featurecounts_counts:
doc: Normalized fragment extended reads bigWig (signal) files
type: File[]
outputSource: featurecounts/output_files
rsem_isoforms_files:
doc: RSEM isoforms files
type: File[]
outputSource: rsem-calc-expr/isoforms
rsem_genes_files:
doc: RSEM genes files
type: File[]
outputSource: rsem-calc-expr/genes
bam_plus_files:
doc: BAM files containing only reads in the forward (plus) strand.
type: File[]
outputSource: split_bams/bam_plus_files
bw_raw_plus_files:
doc: Raw bigWig files from BAM files containing only reads in the forward (plus) strand.
type: File[]
outputSource: bdg2bw-raw-plus/output_bigwig
bw_norm_plus_files:
doc: Normalized by RPKM bigWig files from BAM files containing only reads in the forward (plus) strand.
type: File[]
outputSource: bamcoverage-plus/output_bam_coverage
bam_minus_files:
doc: BAM files containing only reads in the reverse (minus) strand.
type: File[]
outputSource: split_bams/bam_minus_files
bw_raw_minus_files:
doc: Raw bigWig files from BAM files containing only reads in the reverse (minus) strand.
type: File[]
outputSource: bdg2bw-raw-minus/output_bigwig
bw_norm_minus_files:
doc: Normalized by RPKM bigWig files from BAM files containing only reads in the forward (plus) strand.
type: File[]
outputSource: bdg2bw-norm-minus/output_bigwig
steps:
basename:
run: ../utils/basename.cwl
in:
file_path:
source: input_bam_files
valueFrom: $(self.basename)
sep:
valueFrom: .Aligned.out.sorted
scatter: file_path
out:
- basename
featurecounts:
run: ../quant/subread-featurecounts.cwl
in:
B:
valueFrom: ${return true}
g:
valueFrom: gene_id
output_filename:
source: basename/basename
valueFrom: $(self + ".featurecounts.counts.txt")
p:
valueFrom: ${return true}
s:
valueFrom: ${return 1}
t:
valueFrom: exon
annotation_file: annotation_file
T: nthreads
input_files:
source: input_bam_files
valueFrom: ${if (Array.isArray(self)) return self; return [self]; }
scatterMethod: dotproduct
scatter:
- input_files
- output_filename
out:
- output_files
rsem-calc-expr:
run: ../quant/rsem-calculate-expression.cwl
in:
reference_name:
source: rsem_reference_files
valueFrom: |
${
var trans_file_str = self.listing.map(function(e){return e.location}).filter(function(e){return e.match(/\.transcripts\.fa$/)})[0];
return trans_file_str.match(/.*[\\\\\\/](.*)\.transcripts\.fa$/)[1];
}
reference_files: rsem_reference_files
no-bam-output:
valueFrom: ${return true}
quiet:
valueFrom: ${return true}
seed:
valueFrom: ${return 1234}
sample_name:
source: basename/basename
valueFrom: $(self + ".rsem")
bam: input_transcripts_bam_files
num-threads: nthreads
paired-end:
valueFrom: ${return true}
strand-specific:
valueFrom: ${return true}
scatterMethod: dotproduct
scatter:
- bam
- sample_name
out:
- isoforms
- genes
- rsem_stat
split_bams:
in:
bamtools_reverse_filter_file: bamtools_reverse_filter_file
bamtools_forward_filter_file: bamtools_forward_filter_file
input_bam_files: input_bam_files
input_basenames: basename/basename
run: ../quant/split-bams-by-strand-and-index.cwl
out:
- bam_plus_files
- bam_minus_files
bamcoverage-minus:
run: ../quant/deeptools-bamcoverage.cwl
scatter: bam
in:
binSize:
valueFrom: ${return 1}
numberOfProcessors: nthreads
bam: split_bams/bam_minus_files
output_suffix:
valueFrom: .norm-minus-pre-negated-bw
normalizeUsing:
valueFrom: RPKM
out:
- output_bam_coverage
bw2bdg-minus:
run: ../quant/bigWigToBedGraph.cwl
scatter: bigwig_file
in:
bigwig_file: bamcoverage-minus/output_bam_coverage
out:
- output_bedgraph
negate_minus_bdg_norm:
run: ../quant/negate-minus-strand-bedgraph.cwl
scatter:
- bedgraph_file
- output_filename
scatterMethod: dotproduct
in:
bedgraph_file: bw2bdg-minus/output_bedgraph
output_filename:
source: basename/basename
valueFrom: $(self + ".norm-minus-bdg")
out:
- negated_minus_bdg
bdg2bw-raw-minus:
run: ../quant/bedGraphToBigWig.cwl
scatter: bed_graph
in:
output_suffix:
valueFrom: .bw
genome_sizes: input_genome_sizes
bed_graph: negate_minus_bdg/negated_minus_bdg
out:
- output_bigwig
bedsort-norm-minus:
run: ../quant/bedSort.cwl
scatter: bed_file
in:
bed_file: negate_minus_bdg_norm/negated_minus_bdg
out:
- bed_file_sorted
bdg2bw-norm-minus:
run: ../quant/bedGraphToBigWig.cwl
scatter: bed_graph
in:
output_suffix:
valueFrom: .Aligned.minus.norm.bw
genome_sizes: input_genome_sizes
bed_graph: bedsort-norm-minus/bed_file_sorted
out:
- output_bigwig
bedtools_genomecov_minus:
run: ../map/bedtools-genomecov.cwl
scatter: ibam
in:
bg:
valueFrom: ${return true}
g: input_genome_sizes
ibam: split_bams/bam_minus_files
out:
- output_bedfile
bedsort_genomecov_minus:
run: ../quant/bedSort.cwl
scatter: bed_file
in:
bed_file: bedtools_genomecov_minus/output_bedfile
out:
- bed_file_sorted
negate_minus_bdg:
run: ../quant/negate-minus-strand-bedgraph.cwl
scatterMethod: dotproduct
scatter:
- bedgraph_file
- output_filename
in:
bedgraph_file: bedsort_genomecov_minus/bed_file_sorted
output_filename:
source: basename/basename
valueFrom: $(self + ".Aligned.minus.raw.bdg")
out:
- negated_minus_bdg
bamcoverage-plus:
run: ../quant/deeptools-bamcoverage.cwl
scatter: bam
in:
binSize:
valueFrom: ${return 1}
numberOfProcessors: nthreads
bam: split_bams/bam_plus_files
output_suffix:
valueFrom: .norm.bw
normalizeUsing:
valueFrom: RPKM
out:
- output_bam_coverage
bedtools_genomecov_plus:
run: ../map/bedtools-genomecov.cwl
scatter: ibam
in:
bg:
valueFrom: ${return true}
g: input_genome_sizes
ibam: split_bams/bam_plus_files
out:
- output_bedfile
bdg2bw-raw-plus:
run: ../quant/bedGraphToBigWig.cwl
scatter: bed_graph
in:
output_suffix:
valueFrom: .raw.bw
genome_sizes: input_genome_sizes
bed_graph: bedsort_genomecov_plus/bed_file_sorted
out:
- output_bigwig
bedsort_genomecov_plus:
run: ../quant/bedSort.cwl
scatter: bed_file
in:
bed_file: bedtools_genomecov_plus/output_bedfile
out:
- bed_file_sorted