Check that necessary programs are available
Will help catch and identify issues where the pipeline fails due to a missing (required) shell command such as `iqtree`. A future commit could enforce minimum versions of these programs.
@@ -4,6 +4,7 @@ from socket import getfqdn
from getpass import getuser
from snakemake.logging import logger
import sys
+from shutil import which
#
# Verify that required versions of dependencies are installed.
@@ -20,6 +21,13 @@ if version.parse(augur_version) < version.parse(MIN_AUGUR_VERSION):
logger.error("ERROR: Found version '%s' of augur, but version '%s' or greater is required" % (augur_version, MIN_AUGUR_VERSION))
sys.exit(1)
+SHELL_COMMANDS_NEEDED = ["augur", "iqtree", "mafft"]
+for sh_cmd in SHELL_COMMANDS_NEEDED:
+ if not which(sh_cmd):
+ logger.error(f"ERROR: `{sh_cmd}` is not available as a shell command. Please follow installation instructions at https://nextstrain.org/docs/ and try again.")
+ sys.exit(1)
+
+
def get_todays_date():
from datetime import datetime
date = datetime.today().strftime('%Y-%m-%d')
