Skip to content

Commit

Permalink
write stdout+stderr to autotax_log.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperSkytte committed Jun 30, 2021
1 parent 729d2c7 commit c3384f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions autotax.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
export VERSION="1.6.1"
export VERSION="1.6.2"

#################################
############# setup #############
Expand Down Expand Up @@ -224,15 +224,19 @@ derep() {

denoise() {
#check user arguments
local minsize=2
local OPTIND
while getopts ":i:o:" opt; do
while getopts ":i:o:s:" opt; do
case ${opt} in
i )
local input=$OPTARG
;;
o )
local output=$OPTARG
;;
s )
local minsize=$OPTARG
;;
\? )
userError "Invalid Option: -$OPTARG"
exit 1
Expand All @@ -245,8 +249,7 @@ denoise() {
done
# Denoise with UNOISE3 accepting sequences seen only twice (see article supplementary for why this is acceptable)
echoWithHeader " - Denoising sequences using UNOISE3"
usearch11 -unoise3 $input -zotus $output -minsize ${denoise_minsize}
#cp temp/uniques_wsize.fa temp/preFLASVs.fa
usearch11 -unoise3 $input -zotus $output -minsize $minsize
}

findLongest() {
Expand Down Expand Up @@ -1278,7 +1281,7 @@ then
esac
done
shift $((OPTIND -1))
autotax
(autotax) |& tee autotax_log.txt
if [ $? -gt 0 ]
then
exit 1
Expand Down
4 changes: 2 additions & 2 deletions tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ load autotax
[ "$status" -eq 0 ]

#check if output pattern matches the format " *** [2020-03-16 10:08:30]: test"
pattern="^ *** \[[0-9\ -:]*\]: test$"
pattern="^ \*\*\* \[[0-9\ -:]*\]: test$"
[[ ${lines[0]} =~ $pattern ]]
}

Expand Down Expand Up @@ -186,7 +186,7 @@ load autotax
[ "$status" -eq 1 ]

#expect no error
run denoise -i $in -o ${test_run_dir}$out
run denoise -i $in -o ${test_run_dir}$out -s 2
echo $output >&2 #redirect to stderr for debugging
[ "$status" -eq 0 ]

Expand Down

0 comments on commit c3384f8

Please sign in to comment.