/
rnaseq-pe-dutp.cwl
587 lines (518 loc) · 17.3 KB
/
rnaseq-pe-dutp.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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
cwlVersion: v1.0
class: Workflow
requirements:
- class: SubworkflowFeatureRequirement
- class: StepInputExpressionRequirement
- class: MultipleInputFeatureRequirement
- class: InlineJavascriptRequirement
expressionLib:
- var get_root = function(basename) {
return basename.split('.').slice(0,1).join('.');
};
'sd:metadata':
- "../metadata/rnaseq-header.cwl"
'sd:upstream':
genome_indices: "genome-indices.cwl"
inputs:
# General inputs
star_indices_folder:
type: Directory
label: "STAR indices folder"
'sd:upstreamSource': "genome_indices/star_indices"
doc: "Path to STAR generated indices"
bowtie_indices_folder:
type: Directory
label: "BowTie Ribosomal Indices"
'sd:upstreamSource': "genome_indices/ribosomal_indices"
doc: "Path to Bowtie generated indices"
chrom_length_file:
type: File
label: "Chromosome length file"
format: "http://edamontology.org/format_2330"
'sd:upstreamSource': "genome_indices/chrom_length"
doc: "Chromosome length file"
annotation_file:
type: File
label: "Annotation file"
format:
- "http://edamontology.org/format_2306"
- "http://edamontology.org/format_3475"
'sd:upstreamSource': "genome_indices/annotation"
doc: "GTF or TAB-separated annotation file"
fastq_file_upstream:
type: File
label: "FASTQ 1 input file"
format: "http://edamontology.org/format_1930"
doc: "Reads data in a FASTQ format, received after paired end sequencing"
fastq_file_downstream:
type: File
label: "FASTQ 2 input file"
format: "http://edamontology.org/format_1930"
doc: "Reads data in a FASTQ format, received after paired end sequencing"
# Advanced inputs
exclude_chr:
type: string?
'sd:layout':
advanced: true
label: "Chromosome to be excluded in rpkm calculation"
doc: "Chromosome to be excluded in rpkm calculation"
clip_3p_end:
type: int?
default: 0
'sd:layout':
advanced: true
label: "Clip from 3p end"
doc: "Number of bases to clip from the 3p end"
clip_5p_end:
type: int?
default: 0
'sd:layout':
advanced: true
label: "Clip from 5p end"
doc: "Number of bases to clip from the 5p end"
# System dependent
threads:
type: int?
default: 2
'sd:layout':
advanced: true
label: "Number of threads"
doc: "Number of threads for those steps that support multithreading"
outputs:
bigwig_upstream:
type: File
format: "http://edamontology.org/format_3006"
label: "BigWig file"
doc: "Generated BigWig file"
outputSource: bam_to_bigwig_upstream/bigwig_file
'sd:visualPlugins':
- igvbrowser:
tab: 'IGV Genome Browser'
id: 'igvbrowser'
type: 'wig'
name: "BigWig 1"
height: 120
bigwig_downstream:
type: File
format: "http://edamontology.org/format_3006"
label: "BigWig file"
doc: "Generated BigWig file"
outputSource: bam_to_bigwig_downstream/bigwig_file
'sd:visualPlugins':
- igvbrowser:
tab: 'IGV Genome Browser'
id: 'igvbrowser'
type: 'wig'
name: "BigWig 2"
height: 120
star_final_log:
type: File
format: "http://edamontology.org/format_2330"
label: "STAR final log"
doc: "STAR Log.final.out"
outputSource: star_aligner/log_final
star_out_log:
type: File?
format: "http://edamontology.org/format_2330"
label: "STAR log out"
doc: "STAR Log.out"
outputSource: star_aligner/log_out
star_progress_log:
type: File?
format: "http://edamontology.org/format_2330"
label: "STAR progress log"
doc: "STAR Log.progress.out"
outputSource: star_aligner/log_progress
star_stdout_log:
type: File?
format: "http://edamontology.org/format_2330"
label: "STAR stdout log"
doc: "STAR Log.std.out"
outputSource: star_aligner/log_std
star_sj_log:
type: File?
format: "http://edamontology.org/format_2330"
label: "STAR sj log"
doc: "STAR SJ.out.tab"
outputSource: star_aligner/log_sj
fastx_statistics_upstream:
type: File
format: "http://edamontology.org/format_2330"
label: "FASTQ 1 statistics"
doc: "fastx_quality_stats generated FASTQ 1 quality statistics file"
outputSource: fastx_quality_stats_upstream/statistics_file
'sd:visualPlugins':
- line:
tab: 'QC Plots'
Title: 'FASTQ 1 Base frequency plot'
xAxisTitle: 'Nucleotide position'
yAxisTitle: 'Frequency'
colors: ["#b3de69", "#888888", "#fb8072", "#fdc381", "#99c0db"]
data: [$13, $14, $15, $16, $17]
- boxplot:
tab: 'QC Plots'
Title: 'FASTQ 1 Quality Control'
xAxisTitle: 'Nucleotide position'
yAxisTitle: 'Quality score'
colors: ["#b3de69", "#888888", "#fb8072", "#fdc381", "#99c0db"]
data: [$11, $7, $8, $9, $12]
fastx_statistics_downstream:
type: File
format: "http://edamontology.org/format_2330"
label: "FASTQ 2 statistics"
doc: "fastx_quality_stats generated FASTQ 2 quality statistics file"
outputSource: fastx_quality_stats_downstream/statistics_file
'sd:visualPlugins':
- line:
tab: 'QC Plots'
Title: 'FASTQ 2 Base frequency plot'
xAxisTitle: 'Nucleotide position'
yAxisTitle: 'Frequency'
colors: ["#b3de69", "#888888", "#fb8072", "#fdc381", "#99c0db"]
data: [$13, $14, $15, $16, $17]
- boxplot:
tab: 'QC Plots'
Title: 'FASTQ 2 Quality Control'
xAxisTitle: 'Nucleotide position'
yAxisTitle: 'Quality score'
colors: ["#b3de69", "#888888", "#fb8072", "#fdc381", "#99c0db"]
data: [$11, $7, $8, $9, $12]
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/bam_bai_pair
'sd:visualPlugins':
- igvbrowser:
tab: 'IGV Genome Browser'
id: 'igvbrowser'
optional: true
type: 'alignment'
format: 'bam'
name: "BAM Track"
displayMode: "SQUISHED"
bowtie_log:
type: File
format: "http://edamontology.org/format_2330"
label: "Bowtie alignment log"
doc: "Bowtie alignment log file"
outputSource: bowtie_aligner/log_file
rpkm_isoforms:
type: File
format: "http://edamontology.org/format_3752"
label: "RPKM, grouped by isoforms"
doc: "Calculated rpkm values, grouped by isoforms"
outputSource: rpkm_calculation/isoforms_file
rpkm_genes:
type: File
format: "http://edamontology.org/format_3475"
label: "RPKM, grouped by gene name"
doc: "Calculated rpkm values, grouped by gene name"
outputSource: group_isoforms/genes_file
'sd:visualPlugins':
- syncfusiongrid:
tab: 'Gene Expression'
Title: 'RPKM, grouped by gene name'
rpkm_common_tss:
type: File
format: "http://edamontology.org/format_3475"
label: "RPKM, grouped by common TSS"
doc: "Calculated rpkm values, grouped by common TSS"
outputSource: group_isoforms/common_tss_file
htseq_count_gene_expression_file:
type: File
format: "http://edamontology.org/format_3475"
label: "HTSeq: read counts grouped by gene_id"
doc: "HTSeq: read counts grouped by gene_id"
outputSource: htseq_count_gene_expression/feature_counts_report_file
htseq_count_stdout_log:
type: File
format: "http://edamontology.org/format_2330"
label: "HTSeq: stdout log"
doc: "HTSeq: stdout log"
outputSource: htseq_count_gene_expression/stdout_log
htseq_count_stderr_log:
type: File
format: "http://edamontology.org/format_2330"
label: "HTSeq: stderr log"
doc: "HTSeq: stderr log"
outputSource: htseq_count_gene_expression/stderr_log
get_stat_log:
type: File?
label: "YAML formatted combined log"
format: "http://edamontology.org/format_3750"
doc: "YAML formatted combined log"
outputSource: get_stat/collected_statistics_yaml
get_stat_markdown:
type: File?
label: "Markdown formatted combined log"
format: "http://edamontology.org/format_3835"
doc: "Markdown formatted combined log"
outputSource: get_stat/collected_statistics_md
'sd:visualPlugins':
- markdownView:
tab: 'Overview'
get_formatted_stats:
type: File?
label: "Bowtie, STAR and GEEP mapping stats"
format: "http://edamontology.org/format_2330"
doc: "Processed and combined Bowtie & STAR aligner and GEEP logs"
outputSource: get_stat/collected_statistics_tsv
'sd:visualPlugins':
- tableView:
vertical: true
tab: 'Overview'
'sd:preview':
'sd:visualPlugins':
- pie:
colors: ['#b3de69', '#99c0db', '#fdc381', '#fb8072']
data: [$2, $3, $4, $5]
bam_statistics_report:
type: File
label: "BAM statistics report"
format: "http://edamontology.org/format_2330"
doc: "BAM statistics report (right after alignment and sorting)"
outputSource: get_bam_statistics/log_file
insert_size_report:
type: File
label: "Insert size distribution report"
format: "http://edamontology.org/format_3475"
doc: "Insert size distribution report (right after alignment and sorting)"
outputSource: get_bam_statistics/ext_is_section
'sd:visualPlugins':
- scatter:
tab: 'QC Plots'
Title: 'Insert Size Distribution'
xAxisTitle: 'Insert size'
yAxisTitle: 'Pairs total'
colors: ["#4b78a3"]
height: 500
data: [$1, $2]
comparable: "isdp"
steps:
extract_fastq_upstream:
run: ../tools/extract-fastq.cwl
in:
compressed_file: fastq_file_upstream
out: [fastq_file]
extract_fastq_downstream:
run: ../tools/extract-fastq.cwl
in:
compressed_file: fastq_file_downstream
out: [fastq_file]
star_aligner:
run: ../tools/star-alignreads.cwl
in:
readFilesIn: [extract_fastq_upstream/fastq_file, extract_fastq_downstream/fastq_file]
genomeDir: star_indices_folder
outFilterMultimapNmax:
default: 1
outFilterMismatchNmax:
default: 5
alignSJDBoverhangMin:
default: 1
seedSearchStartLmax:
default: 15
clip3pNbases: clip_3p_end
clip5pNbases: clip_5p_end
threads: threads
out:
- aligned_file
- log_final
- uniquely_mapped_reads_number
- log_out
- log_progress
- log_std
- log_sj
fastx_quality_stats_upstream:
run: ../tools/fastx-quality-stats.cwl
in:
input_file: extract_fastq_upstream/fastq_file
out: [statistics_file]
fastx_quality_stats_downstream:
run: ../tools/fastx-quality-stats.cwl
in:
input_file: extract_fastq_downstream/fastq_file
out: [statistics_file]
samtools_sort_index:
run: ../tools/samtools-sort-index.cwl
in:
sort_input: star_aligner/aligned_file
sort_output_filename:
source: extract_fastq_upstream/fastq_file
valueFrom: $(self.location.split('/').slice(-1)[0].split('.').slice(0,-1).join('.')+'.bam')
threads: threads
out: [bam_bai_pair]
bam_to_bigwig_upstream:
run: ../tools/bam-bedgraph-bigwig.cwl
in:
bam_file: samtools_sort_index/bam_bai_pair
chrom_length_file: chrom_length_file
mapped_reads_number:
source: star_aligner/uniquely_mapped_reads_number
valueFrom: $(self*2)
bigwig_filename:
source: samtools_sort_index/bam_bai_pair
valueFrom: |
${
let root = self.basename.split('.').slice(0,-1).join('.');
let ext = "_upstream.bigWig";
return (root == "")?self.basename+ext:root+ext;
}
strand:
default: '+'
dutp:
default: true
out: [bigwig_file]
bam_to_bigwig_downstream:
run: ../tools/bam-bedgraph-bigwig.cwl
in:
bam_file: samtools_sort_index/bam_bai_pair
chrom_length_file: chrom_length_file
mapped_reads_number:
source: star_aligner/uniquely_mapped_reads_number
valueFrom: $(-self*2)
bigwig_filename:
source: samtools_sort_index/bam_bai_pair
valueFrom: |
${
let root = self.basename.split('.').slice(0,-1).join('.');
let ext = "_downstream.bigWig";
return (root == "")?self.basename+ext:root+ext;
}
strand:
default: '-'
dutp:
default: true
out: [bigwig_file]
bowtie_aligner:
run: ../tools/bowtie-alignreads.cwl
in:
upstream_filelist: extract_fastq_upstream/fastq_file
downstream_filelist: extract_fastq_downstream/fastq_file
indices_folder: bowtie_indices_folder
clip_3p_end: clip_3p_end
clip_5p_end: clip_5p_end
v:
default: 3
m:
default: 1
sam:
default: true
threads: threads
out: [log_file]
rpkm_calculation:
run: ../tools/geep.cwl
in:
bam_file: samtools_sort_index/bam_bai_pair
annotation_file: annotation_file
dutp:
default: true
rpkm_threshold:
default: 0.001
exclude_chr: exclude_chr
threads: threads
out: [isoforms_file]
group_isoforms:
run: ../tools/group-isoforms.cwl
in:
isoforms_file: rpkm_calculation/isoforms_file
out:
- genes_file
- common_tss_file
get_annotation_gtf:
run: ../tools/ucsc-genepredtogtf.cwl
in:
annotation_tsv_file: annotation_file
out:
- annotation_gtf_file
htseq_count_gene_expression:
run: ../tools/htseq-count.cwl
in:
alignment_bam_file: samtools_sort_index/bam_bai_pair
annotation_gtf_file: get_annotation_gtf/annotation_gtf_file
strand_specific:
default: "reverse"
feature_type:
default: "exon"
feature_id:
default: "gene_id"
out:
- feature_counts_report_file
- stdout_log
- stderr_log
get_bam_statistics:
run: ../tools/samtools-stats.cwl
in:
bambai_pair: samtools_sort_index/bam_bai_pair
output_filename:
source: samtools_sort_index/bam_bai_pair
valueFrom: $(get_root(self.basename)+"_bam_statistics_report.txt")
out: [log_file, ext_is_section]
get_stat:
run: ../tools/collect-statistics-rna-seq.cwl
in:
star_alignment_report: star_aligner/log_final
bowtie_alignment_report: bowtie_aligner/log_file
bam_statistics_report: get_bam_statistics/log_file
isoforms_file: rpkm_calculation/isoforms_file
paired_end:
default: true
out: [collected_statistics_yaml, collected_statistics_tsv, collected_statistics_md]
$namespaces:
s: http://schema.org/
$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf
s:name: "RNA-Seq pipeline paired-end strand specific"
label: "RNA-Seq pipeline paired-end strand specific"
s:alternateName: "RNA-Seq basic analysis workflow for strand specific paired-end experiment"
s:downloadUrl: https://raw.githubusercontent.com/datirium/workflows/master/workflows/rnaseq-pe-dutp.cwl
s:codeRepository: https://github.com/datirium/workflows
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:misha.kotliar@gmail.com
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898
- class: s:Person
s:name: Andrey Kartashov
s:email: mailto:Andrey.Kartashov@cchmc.org
s:sameAs:
- id: http://orcid.org/0000-0001-9102-5681
# doc:
# $include: ../descriptions/rnaseq-pe-dutp.md
doc: |
The original [BioWardrobe's](https://biowardrobe.com) [PubMed ID:26248465](https://www.ncbi.nlm.nih.gov/pubmed/26248465)
**RNA-Seq** basic analysis for a **paired-end** experiment.
A corresponded input [FASTQ](http://maq.sourceforge.net/fastq.shtml) file has to be provided.
Current workflow should be used only with the paired-end RNA-Seq data. It performs the following steps:
1. Use STAR to align reads from input FASTQ files according to the predefined reference indices; generate unsorted BAM file and alignment statistics file
2. Use fastx_quality_stats to analyze input FASTQ files and generate quality statistics files
3. Use samtools sort to generate coordinate sorted BAM(+BAI) file pair from the unsorted BAM file obtained on the step 1 (after running STAR)
4. Generate BigWig file on the base of sorted BAM file
5. Map input FASTQ files to predefined rRNA reference indices using Bowtie to define the level of rRNA contamination; export resulted statistics to file
6. Calculate isoform expression level for the sorted BAM file and GTF/TAB annotation file using GEEP reads-counting utility; export results to file