Skip to content

Commit

Permalink
wrap only augur filter in set -o pipefail (#175)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
tomkinsc authored Nov 30, 2020
1 parent e7d7e96 commit ba04a93
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pipes/WDL/tasks/tasks_nextstrain.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ task filter_subsample_sequences {
}
String out_fname = sub(sub(basename(sequences_fasta), ".vcf", ".filtered.vcf"), ".fasta$", ".filtered.fasta")
command {
set -e -o pipefail
set -e
augur version > VERSION
touch wherefile
Expand All @@ -143,6 +143,7 @@ task filter_subsample_sequences {
cat $VALS >> wherefile
fi
set -o pipefail
cat wherefile | tr '\n' '\0' | xargs -0 -t augur filter \
--sequences ~{sequences_fasta} \
--metadata ~{sample_metadata_tsv} \
Expand All @@ -157,6 +158,8 @@ task filter_subsample_sequences {
~{"--group-by " + group_by} \
~{"--subsample-seed " + subsample_seed} \
--output "~{out_fname}" | tee STDOUT
set +o pipefail
#cat ~{sequences_fasta} | grep \> | wc -l > IN_COUNT
grep "sequences were dropped during filtering" STDOUT | cut -f 1 -d ' ' > DROP_COUNT
grep "sequences have been written out to" STDOUT | cut -f 1 -d ' ' > OUT_COUNT
Expand Down Expand Up @@ -265,7 +268,7 @@ task mafft_one_chr {
Int cpus = 32
}
command {
set -e -o pipefail
set -e
touch args.txt
# boolean options
Expand Down

0 comments on commit ba04a93

Please sign in to comment.