Skip to content

Commit

Permalink
add warning to name option and move checks after options
Browse files Browse the repository at this point in the history
  • Loading branch information
LanderDC committed Jun 5, 2024
1 parent 7cc6aa8 commit dc714d1
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions bin/viper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ GENERAL:
--bb-threads Set the number of threads for BBMap tools (clumpify.sh, reformat.sh). (default: number of threads given to --threads)
Can be set to 1 if viper.sh fails on these steps with 'Exception in thread' error.
--keep-reads Do not move the read files to the output directory, but keep them in place.
--keep-intermediary Do not remove the intermediary files from the SPAdes assembly, and BAM/fasta indices.
--keep-intermediary Do not remove the intermediary files from the SPAdes assembly, and BAM/fasta indices.
EOF
}
Expand Down Expand Up @@ -170,18 +170,6 @@ map_removal(){
fi
}

##### CHECKS #####

#Check if all dependencies are installed in PATH
commands='seqkit samtools ktClassifyBLAST metaspades.py trimmomatic pigz bwa-mem2 diamond python bowtie2 reformat.sh fastqc perl clumpify.sh quast.py blastn makeblastdb anicalc.py aniclust.py'
for i in $commands; do
command -v $i &> /dev/null
if [[ ! $? -eq 0 ]]; then
printf '%s\n' "[$(date "+%F %H:%M:%S")] ERROR: "$i" could not be found, please install "$i" in PATH or activate your conda environment."
exit 1
fi
done

##### OPTIONS #####

if [[ $# -eq 0 ]]; then
Expand Down Expand Up @@ -454,7 +442,7 @@ while [ ! $# -eq 0 ]; do
;;
-n | --name)
if [[ "$2" == *['!'@#\$%^\&*()+]* ]]; then
:
>&2 printf '\n%s\n' "[$(date "+%F %H:%M:%S")] WARNING: Invalid provided prefix for files. Continuing with common prefix of fastq files."
shift
else
sample="$2"
Expand All @@ -480,6 +468,19 @@ while [ ! $# -eq 0 ]; do
shift
done

##### CHECKS #####

#Check if all dependencies are installed in PATH
commands='seqkit samtools ktClassifyBLAST metaspades.py trimmomatic pigz bwa-mem2 diamond python bowtie2 reformat.sh fastqc perl clumpify.sh quast.py blastn makeblastdb anicalc.py aniclust.py'
for i in $commands; do
command -v $i &> /dev/null
if [[ ! $? -eq 0 ]]; then
printf '%s\n' "[$(date "+%F %H:%M:%S")] ERROR: "$i" could not be found, please install "$i" in PATH or activate your conda environment."
exit 1
fi
done


#Set bbthreads
if [[ -z "$bbthreads" ]]; then
bbthreads="$threads"
Expand Down

0 comments on commit dc714d1

Please sign in to comment.