Skip to content

Commit ba04a93

Browse files
authored
wrap only augur filter in set -o pipefail (#175)
* set "-o pipefail" for filter_subsample_sequences Previously, if the commands along the way in the pipeline fail, the tasks succeed. This adds "-o pipefail" so errors lead to non-zero exits.
1 parent e7d7e96 commit ba04a93

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pipes/WDL/tasks/tasks_nextstrain.wdl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ task filter_subsample_sequences {
128128
}
129129
String out_fname = sub(sub(basename(sequences_fasta), ".vcf", ".filtered.vcf"), ".fasta$", ".filtered.fasta")
130130
command {
131-
set -e -o pipefail
131+
set -e
132132
augur version > VERSION
133133
134134
touch wherefile
@@ -143,6 +143,7 @@ task filter_subsample_sequences {
143143
cat $VALS >> wherefile
144144
fi
145145
146+
set -o pipefail
146147
cat wherefile | tr '\n' '\0' | xargs -0 -t augur filter \
147148
--sequences ~{sequences_fasta} \
148149
--metadata ~{sample_metadata_tsv} \
@@ -157,6 +158,8 @@ task filter_subsample_sequences {
157158
~{"--group-by " + group_by} \
158159
~{"--subsample-seed " + subsample_seed} \
159160
--output "~{out_fname}" | tee STDOUT
161+
set +o pipefail
162+
160163
#cat ~{sequences_fasta} | grep \> | wc -l > IN_COUNT
161164
grep "sequences were dropped during filtering" STDOUT | cut -f 1 -d ' ' > DROP_COUNT
162165
grep "sequences have been written out to" STDOUT | cut -f 1 -d ' ' > OUT_COUNT
@@ -265,7 +268,7 @@ task mafft_one_chr {
265268
Int cpus = 32
266269
}
267270
command {
268-
set -e -o pipefail
271+
set -e
269272
touch args.txt
270273
271274
# boolean options

0 commit comments

Comments
 (0)