From 963b38131897e1e96a36962424779f81d5972d04 Mon Sep 17 00:00:00 2001 From: Sergey Koren Date: Tue, 8 Aug 2023 11:05:02 -0400 Subject: [PATCH] Check for required dependencies depending on what pipelien we're running (e.g. graphaligner only for ONT, bwa only for HiC, etc) --- src/verkko.sh | 53 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/src/verkko.sh b/src/verkko.sh index 4111f5bb..9f7a8261 100755 --- a/src/verkko.sh +++ b/src/verkko.sh @@ -675,34 +675,43 @@ elif [ ! -e "$mbg" ] ; then errors="${errors}Can't find MBG executable at '$mbg'.\n" fi -if [ "x$graphaligner" = "x" ] ; then - errors="${errors}Can't find GraphAligner executable in \$PATH or \$VERKKO/bin/GraphAligner.\n" -elif [ ! -e "$graphaligner" ] ; then - errors="${errors}Can't find GraphAligner executable at '$graphaligner'.\n" -fi +# graphaligner and winnowmap are required when we have ONT data +if [ "x$withont" = "xTrue" ] ; then + if [ "x$graphaligner" = "x" ] ; then + errors="${errors}Can't find GraphAligner executable in \$PATH or \$VERKKO/bin/GraphAligner.\n" + elif [ ! -e "$graphaligner" ] ; then + errors="${errors}Can't find GraphAligner executable at '$graphaligner'.\n" + fi -if [ "x$mashmap" = "x" ] ; then - errors="${errors}Can't find MashMap executable in \$PATH or \$VERKKO/bin/mashmap.\n" -elif [ ! -e "$mashmap" ] ; then - errors="${errors}Can't find MashMap executable at '$mashmap'.\n" + if [ "x$winnowmap" = "x" ] ; then + errors="${errors}Can't find Winnowmap executable in \$PATH or \$VERKKO/bin/winnowmap.\n" + elif [ ! -e "$winnowmap" ] ; then + errors="${errors}Can't find Winnowmap executable at '$winnowmap'.\n" + fi fi -if [ "x$winnowmap" = "x" ] ; then - errors="${errors}Can't find Winnowmap executable in \$PATH or \$VERKKO/bin/winnowmap.\n" -elif [ ! -e "$winnowmap" ] ; then - errors="${errors}Can't find Winnowmap executable at '$winnowmap'.\n" +# mashmap required for hic and for screening contaminant +if [ ! -z "$screen" -o "x$withhic" = "xTrue" ] ; then + if [ "x$mashmap" = "x" ] ; then + errors="${errors}Can't find MashMap executable in \$PATH or \$VERKKO/bin/mashmap.\n" + elif [ ! -e "$mashmap" ] ; then + errors="${errors}Can't find MashMap executable at '$mashmap'.\n" + fi fi -if [ "x$bwa" = "x" ] ; then - errors="${errors}Can't find BWA executable in \$PATH or \$VERKKO/bin/bwa.\n" -elif [ ! -e "$bwa" ] ; then - errors="${errors}Can't find BWA executable at '$bwa'.\n" -fi +# bwa and samtools required for HiC data +if [ "x$withhic" = "xTrue" ] ; then + if [ "x$bwa" = "x" ] ; then + errors="${errors}Can't find BWA executable in \$PATH or \$VERKKO/bin/bwa.\n" + elif [ ! -e "$bwa" ] ; then + errors="${errors}Can't find BWA executable at '$bwa'.\n" + fi -if [ "x$samtools" = "x" ] ; then - errors="${errors}Can't find Samtools executable in \$PATH or \$VERKKO/bin/samtools.\n" -elif [ ! -e "$samtools" ] ; then - errors="${errors}Can't find Samtools executable at '$samtools'.\n" + if [ "x$samtools" = "x" ] ; then + errors="${errors}Can't find Samtools executable in \$PATH or \$VERKKO/bin/samtools.\n" + elif [ ! -e "$samtools" ] ; then + errors="${errors}Can't find Samtools executable at '$samtools'.\n" + fi fi #