-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwdl_ampseq.wdl
206 lines (195 loc) · 6.39 KB
/
wdl_ampseq.wdl
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
version 1.0
workflow ampseq {
input {
#General commands
String path_to_fq = "/Users/jar4142/Desktop/Plate_1_Reduced/"
String pattern_fw = "*_L001_R1_001.fastq.gz"
String pattern_rv = "*_L001_R2_001.fastq.gz"
#Commands for AmpSeq
String Class = "parasite"
String maxEE = "5,5"
String trimRight = "0,0"
Int minLen = 30
String truncQ = "5,5"
String matchIDs = "0"
Int max_consist = 10
Float omegaA = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
String saveRdata = ""
Int justConcatenate = 0
Int maxMismatch = 0
String no_ref = 'False'
String adjust_mode = "absolute"
String strain = "3D7"
String strain2 = "DD2"
String polyN = "5"
String min_reads = "0"
String min_samples = "0"
String max_snv_dist = "-1"
String max_indel_dist = "-1"
String include_failed = "False"
String exclude_bimeras = "False"
String adapter = "None"
#Command for the decontamination pipeline
Int minreads_threshold = 1000
Float contamination_threshold = 0.5
String verbose = "False"
}
call ampseq_pipeline {
input:
path_to_fq = path_to_fq,
pattern_fw = pattern_fw,
pattern_rv = pattern_rv,
Class = Class,
maxEE = maxEE,
trimRight = trimRight,
minLen = minLen,
truncQ = truncQ,
matchIDs = matchIDs,
max_consist = max_consist,
omegaA = omegaA,
saveRdata = saveRdata,
justConcatenate = justConcatenate,
maxMismatch = maxMismatch,
no_ref = no_ref,
adjust_mode = adjust_mode,
strain = strain,
strain2 = strain2,
polyN = polyN,
min_reads = min_reads,
min_samples = min_samples,
max_snv_dist = max_snv_dist,
max_indel_dist = max_indel_dist,
include_failed = include_failed,
exclude_bimeras = exclude_bimeras,
minreads_threshold = minreads_threshold,
contamination_threshold = contamination_threshold,
verbose = verbose,
adapter = adapter
}
output {
File? ASVBimeras_f = ampseq_pipeline.ASVBimeras
File? CIGARVariants_Bfilter_f = ampseq_pipeline.CIGARVariants_Bfilter
File? ASV_to_CIGAR_f = ampseq_pipeline.ASV_to_CIGAR
File? seqtab_f = ampseq_pipeline.seqtab
File? ASVTable_f = ampseq_pipeline.ASVTable
File? ASVSeqs_f = ampseq_pipeline.ASVSeqs
File? missing_files_f = ampseq_pipeline.missing_files
File? decontamination_sample_cards_f = ampseq_pipeline.decontamination_sample_cards
File? decontamination_report_f = ampseq_pipeline.decontamination_report
}
}
task ampseq_pipeline {
input {
String path_to_fq
String pattern_fw = "*_L001_R1_001.fastq.gz"
String pattern_rv = "*_L001_R2_001.fastq.gz"
String Class = "parasite"
String maxEE = "5,5"
String trimRight = "0,0"
Int minLen = 30
String truncQ = "5,5"
String matchIDs = "0"
Int max_consist = 10
Float omegaA = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
String saveRdata = ""
Int justConcatenate = 0
Int maxMismatch = 0
String no_ref = 'False'
String adjust_mode = "absolute"
String strain = "3D7"
String strain2 = "DD2"
String polyN = "5"
String min_reads = "0"
String min_samples = "0"
String max_snv_dist = "-1"
String max_indel_dist = "-1"
String include_failed = "False"
String exclude_bimeras = "False"
Int minreads_threshold = 1000
Float contamination_threshold = 0.5
String verbose = "False"
String adapter = "None"
}
Map[String, String] in_map = {
"path_to_fq": "fq_dir",
"pattern_fw": pattern_fw,
"pattern_rv": pattern_rv,
"Class": Class,
"maxEE": maxEE,
"trimRight": trimRight,
"minLen": minLen,
"truncQ": truncQ,
"matchIDs": matchIDs,
"max_consist": max_consist,
"omegaA": omegaA,
"saveRdata": saveRdata,
"justConcatenate": justConcatenate,
"maxMismatch": maxMismatch,
"no_ref": no_ref,
"adjust_mode": adjust_mode,
"strain": strain,
"strain2": strain2,
"polyN": polyN,
"min_reads": min_reads,
"min_samples": min_samples,
"max_snv_dist": max_snv_dist,
"max_indel_dist": max_indel_dist,
"include_failed": include_failed,
"exclude_bimeras": exclude_bimeras,
"minreads_threshold": minreads_threshold,
"contamination_threshold": contamination_threshold,
"verbose": verbose,
"adapter": adapter,
"path_to_flist": 'barcodes_matches.csv',
"pr1": 'primers_fw.fasta',
"pr2": 'primers_rv.fasta'
}
File config_json = write_json(in_map)
command <<<
set -euxo pipefail
#set -x
mkdir fq_dir
gsutil ls ~{path_to_fq}
gsutil -m cp -r ~{path_to_fq}* fq_dir/
#Move reference files to the main level
mv fq_dir/barcodes_matches.csv .
mv fq_dir/primers_*.fasta .
mv fq_dir/snv_filters.txt .
mv fq_dir/*ref1.fasta reference_panel_1.fasta
mv fq_dir/*ref2.fasta reference_panel_2.fasta
# Check if the first line in barcodes_matches.csv indicates the presence of inline barcodes
if grep -q "," barcodes_matches.csv ; then
echo "Sequencing run with inline barcodes. Performing analysis of combinatorial indices followed by denoising"
find . -type f
python /Code/Amplicon_TerraPipeline.py --config ~{config_json} --terra --meta --adaptor_removal --contamination --separate_reads --primer_removal --dada2 --postproc_dada2 --asv_to_cigar
Rscript /Code/render_report.R -d /cromwell_root/Report/Merge/ -o /cromwell_root/Report/ -p /cromwell_root/barcodes_matches.csv -m 1000 -c 0.5 -mf /cromwell_root/Results/missing_files.tsv
tar -czvf Report_Cards.tar.gz /cromwell_root/Report
find . -type f
else
echo "Sequencing run without inline barcodes. Skipping analysis of combinatorial indices and performing only denoising"
find . -type f
python /Code/Amplicon_TerraPipeline.py --config ~{config_json} --terra --meta --adaptor_removal --separate_reads --primer_removal --dada2 --postproc_dada2 --asv_to_cigar
find . -type f
fi
>>>
output {
File? ASVBimeras = "Results/ASVBimeras.txt"
File? CIGARVariants_Bfilter = "Results/CIGARVariants_Bfilter.out.tsv"
File? ASV_to_CIGAR = "Results/ASV_to_CIGAR/ASV_to_CIGAR.out.txt"
File? seqtab = "Results/seqtab.tsv"
File? ASVTable = "Results/PostProc_DADA2/ASVTable.txt"
File? ASVSeqs = "Results/PostProc_DADA2/ASVSeqs.fasta"
File? missing_files = "Results/missing_files.tsv"
File? decontamination_sample_cards = "Report_Cards.tar.gz"
File? decontamination_report = "Results/ci_report_layouting.html"
}
runtime {
cpu: 1
memory: "15 GiB"
disks: "local-disk 10 HDD"
bootDiskSizeGb: 10
preemptible: 3
maxRetries: 1
docker: 'jorgeamaya/mixed_reads_ampseq'
}
}