library(echoconda) 

conda

echoconda's primary purpose is to robustly build, use and export conda environments from within R.

Build env from yaml

Will build the "echoR_mini" conda environment by default.

conda_env <- echoconda::yaml_to_env("echoR_mini")

Export

yaml_path <- echoconda::env_to_yaml(conda_env = "echoR_mini")

Activate conda env

echoconda::activate_env(conda_env = "echoR_mini")

Find package path

pkgs <- echoconda::find_packages(packages = c("python","tabix","axel"),
                                 conda_env = "echoR_mini")
knitr::kable(pkgs)

Find python path

python <- echoconda::find_python_path(conda_env = "echoR_mini")
print(python)

import CLI

In addition, echoconda has some functionality for automatically converting command line interface (CLI) tools into R functions.

tabix

Here we will use a conda-installed version of tabix as an example.

#### Import tool ####
tabix <- echoconda::import_cli(path = "tabix",
                               conda_env = "echoR_mini")

#### Use function to query file ####
target_path <- system.file("extdata", "BST1.1KGphase3.vcf.bgz",
                           package = "echodata")
query <- "4:5000-100000000"

res <- tabix(D = TRUE, 
             h = TRUE,
             ... = paste(target_path, query))
dat <- data.table::fread(text = res, skip = "#CHROM")

Session Info

utils::sessionInfo()




RajLabMSSM/echoconda documentation built on June 6, 2024, 10:38 a.m.