-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathwf_metabuli.wdl
More file actions
99 lines (97 loc) · 3.3 KB
/
wf_metabuli.wdl
File metadata and controls
99 lines (97 loc) · 3.3 KB
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
version 1.0
import "../../tasks/task_versioning.wdl" as versioning_task
import "../../tasks/taxon_id/contamination/task_metabuli.wdl" as metabuli_task
import "../../tasks/quality_control/read_filtering/task_fastp.wdl" as fastp_task
import "../../tasks/quality_control/read_filtering/task_porechop.wdl" as porechop_task
import "../../tasks/taxon_id/task_ete4_taxon_id.wdl" as identify_taxon_id_task
workflow metabuli_wf {
meta {
description: "Classify ONT/Illumina paired-end reads using Metabuli"
}
input {
String samplename
String? taxon
File read1
File? read2
Boolean call_trim = true
Boolean? illumina
}
call versioning_task.version_capture {
input:
}
if (defined(taxon)) {
call identify_taxon_id_task.ete4_taxon_id as ete4_identify {
input:
taxon = select_first([taxon])
}
}
# Determine seq_mode
if (! defined(read2) && select_first([illumina, false])) {
Int se_mode = 1
}
if (defined(read2)) {
Int pe_mode = 2
Boolean implicit_illumina = true
}
if (! defined(read2) && ! select_first([illumina, false])) {
Int ont_mode = 3
}
# Trim reads if requested
if (call_trim && (select_first([illumina, false]) || defined(implicit_illumina))) {
# Trim Illumina
call fastp_task.fastp {
input:
read1 = read1,
read2 = read2,
samplename = samplename,
fastp_trim_adapters = true
}
}
# Trim ONT
if (call_trim && ! (select_first([illumina, false]) || defined(implicit_illumina))) {
call porechop_task.porechop {
input:
read1 = read1,
samplename = samplename
}
}
if (defined(read2)) {
File read2_input = select_first([fastp.read2_trimmed, read2])
}
call metabuli_task.metabuli {
input:
samplename = samplename,
taxon_id = ete4_identify.taxon_id,
read1 = select_first([fastp.read1_trimmed, porechop.trimmed_reads, read1]),
read2 = read2_input,
seq_mode = select_first([se_mode, pe_mode, ont_mode])
}
output {
# PHB Version Captures
String metabuli_wf_version = version_capture.phb_version
String metabuli_wf_analysis_date = version_capture.date
# Taxon ID
String? ncbi_taxon_id = ete4_identify.taxon_id
String? ncbi_taxon_name = ete4_identify.taxon_name
String? ncbi_read_extraction_rank = ete4_identify.taxon_rank
String? ete4_version = ete4_identify.ete4_version
String? ete4_docker = ete4_identify.ete4_docker
# Read trimming
File? fastp_read1_trimmed = fastp.read1_trimmed
File? fastp_read2_trimmed = fastp.read2_trimmed
String? fastp_version = fastp.fastp_version
String? fastp_docker = fastp.fastp_docker
File? fastp_html_report = fastp.fastp_stats_html
File? fastp_json_report = fastp.fastp_stats_json
File? porechop_read1_trimmed = porechop.trimmed_reads
String? porechop_version = porechop.porechop_version
# Metabuli
String metabuli_version = metabuli.metabuli_version
String metabuli_docker = metabuli.metabuli_docker
File metabuli_report = metabuli.metabuli_report
File metabuli_classified_report = metabuli.metabuli_classified
File metabuli_krona_report = metabuli.metabuli_krona_report
File? metabuli_classified_read1 = metabuli.metabuli_read1_extract
File? metabuli_classified_read2 = metabuli.metabuli_read2_extract
}
}