Skip to contents

Execute a bioinformatics tool command. This function automatically manages the toolbox and installation of tools.

Usage

sn_run(
  tool_name,
  command,
  version = NULL,
  ...,
  dry_run = FALSE,
  work_dir = ".",
  log_level = "normal",
  log_dir = NULL
)

Arguments

tool_name

Character. Name of the tool to run.

command

Character. Command name within the tool.

version

Character. Version of the tool to use. If NULL, uses first available version.

...

Named parameters for the tool command.

dry_run

Logical. If TRUE, only show the command without executing.

work_dir

Character. Working directory for execution.

log_level

Character or Integer. Logging level: "silent"/"quiet"/0, "minimal"/1, "normal"/2. Default "normal".

log_dir

Character. Directory to save log files. If NULL, uses work_dir.

Value

ToolCall object containing execution results.

See also

Other core functions: sn_options()

Examples

if (FALSE) { # \dontrun{
# Run tool command directly
result <- sn_run("samtools", "view",
  input = "test.bam",
  output = "filtered.bam",
  extra = "-q 20"
)

# Dry run to see command
result <- sn_run("samtools", "index",
  input = "test.bam",
  dry_run = TRUE
)
} # }