Skip to contents

Checks if a specified command-line tool ('blastn' or 'efetch') is available on the system. If not, it creates a conda environment and installs the required tool.

Usage

check_cmd(
  cmd = "blastn",
  env_name = "blast-env",
  verbose = "silent",
  force = FALSE
)

Arguments

cmd

Character string specifying the command-line tool to check for. Supported commands are "blastn" and "efetch". Default is "blastn".

env_name

Character string specifying the name of the conda environment to create or use. Default is "blast-env".

verbose

Character string specifying the verbosity level during environment creation. Options are "silent", "verbose", etc. Default is "silent".

force

Logical indicating whether to force the re-creation of the conda environment even if it exists. Default is FALSE.

Value

Invisibly returns TRUE if the command is available or successfully installed.

Examples

if (FALSE) { # \dontrun{
# Check if 'blastn' command is available, and install it if not
check_cmd("blastn", env_name = "blast-env")

# Check if 'efetch' command is available, and install it if not
check_cmd("efetch", env_name = "entrez-env")

# Force re-creation of the conda environment and re-install 'blastn'
check_cmd("blastn", env_name = "blast-env", force = TRUE)
} # }