run | R Documentation |
This function allows the execution of command-line tools within a specified Conda environment.
It runs the provided command in the designated Conda environment using the Micromamba binaries managed by the condathis
package.
run(
cmd,
...,
env_name = "condathis-env",
method = c("native", "auto"),
verbose = c("silent", "cmd", "output", "full", FALSE, TRUE),
error = c("cancel", "continue"),
stdout = "|",
stderr = "|"
)
cmd |
Character. The main command to be executed in the Conda environment. |
... |
Additional arguments to be passed to the command. These arguments will be passed directly to the command executed in the Conda environment. File paths should not contain special characters or spaces. |
env_name |
Character. The name of the Conda environment where the tool will be run. Defaults to |
method |
Character string. The method to use for running the command. Options are |
verbose |
Character string specifying the verbosity level of the function's output. Acceptable values are:
|
error |
Character string. How to handle errors. Options are |
stdout |
Default: "|" keep stdout to the R object
returned by |
stderr |
Default: "|" keep stderr to the R object
returned by |
The run()
function provides a flexible way to execute command-line tools within Conda environments.
This is particularly useful for reproducible research and ensuring that specific versions of tools are used.
An object of class list
representing the result of the command execution.
Contains information about the standard output, standard error, and exit status of the command.
install_micromamba
, create_env
## Not run:
condathis::with_sandbox_dir({
## Create env
create_env("samtools", env_name = "samtools-env")
## Run a command in a specific Conda environment
samtools_res <- run("samtools", "view", fs::path_package("condathis", "extdata", "example.bam"),
env_name = "samtools-env"
)
parse_output(samtools_res)[1]
#> [1] "SOLEXA-1GA-1_6_FC20ET7:6:92:473:531\t0\tchr1\t10156..."
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.