-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgenomad.wdl
More file actions
87 lines (79 loc) · 2.3 KB
/
Copy pathgenomad.wdl
File metadata and controls
87 lines (79 loc) · 2.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
version 1.0
workflow jgi_genomad {
input {
Boolean genomad_execute = false
File input_fasta
String container
Int len_cutoff = 2000
String db_dir = "/refdata/genomad_db/"
Int threads = 1
}
call run_genomad {
input:
genomad_execute = genomad_execute,
input_fasta = input_fasta,
container = container,
len_cutoff = len_cutoff,
db_dir = db_dir,
threads = threads
}
output {
File virus_summary = run_genomad.virus_summary
File plasmid_summary = run_genomad.plasmid_summary
File aggregated_class = run_genomad.aggregated_class
File info = run_genomad.std_out
}
}
task run_genomad {
input {
Boolean genomad_execute
File input_fasta
Int len_cutoff
String db_dir
Int threads
String container
String agg_class = "genomad_aggregated_classification.tsv"
String plas_sum = "genomad_plasmid_summary.tsv"
String vir_sum = "genomad_virus_summary.tsv"
}
command <<<
set -euo pipefail
# echo ~{len_cutoff}
if [[ "~{genomad_execute}" = true ]]
then
echo "starting genomad"
/usr/local/bin/_entrypoint.sh \
genomad.sh \
--len_cutoff ~{len_cutoff} \
--database_dir ~{db_dir} \
--threads ~{threads} \
~{input_fasta}
# allow for glob / recursive search of files moved by genomad.sh
shopt -s globstar
# file tree should be jgi_genomad/{execution_id}/call-run_genomad/execution/outputs.tsv
# if running just genomad.wdl, files end up in call-run_genomad/ instead of in execution/
mv ../../**/*.tsv .
# move and rename files output from genomad.sh script so that cromwell can find them
mv *classification.tsv ~{agg_class}
mv *plasmid_summary.tsv ~{plas_sum}
mv *virus_summary.tsv ~{vir_sum}
else
echo "skipping genomad"
echo "NA" > ~{agg_class}
echo "NA" > ~{plas_sum}
echo "NA" > ~{vir_sum}
fi
echo "finished run_genomad"
>>>
runtime {
runtime_minutes: "90"
memory: "86G"
docker: container
}
output {
File aggregated_class = "~{agg_class}"
File plasmid_summary = " ~{plas_sum}"
File virus_summary = "~{vir_sum}"
File std_out = stdout()
}
}