![]() With conda_r_skeleton_helper on my laptop, I then followed the instructions on the README file and added the R CRAN packages I wanted to build a recipe for to the packages.txt file. I did this successfully with the optimr package, and couldn’t believe how streamlined the process is. No more! Luiz Irber recently showed me how to make a conda-forge recipe from a CRAN pacakge. I would usually also make this installation script write out a text file so that I knew the rule had finished running. In this case, I used to install all of the dependencies (assuming they had conda packages) in a conda environment, and then install the package I was interested in a rule in snakemake. ![]() However, sometimes I run into a situation where the package or library I use in my workflow does not have a conda package associated with it. To execute this snakefile, I would run: snakemake -use-conda Rscript -e "library(dplyr) library(readr) iris %>% group_by(Species) %>% tally() %>% write_csv('iris_tally.csv')" Here is an example of a simple Snakefile, as well as the accompanying conda environment. This makes my workflows more repeatable, and allows me to quickly switch between different systems (e.g. my campus compute cluster and NSF XSEDE’s Jetstream). I use conda to specify all of the software I need for a rule, and conda takes care of building the environments for me. It has a lot of wonderful features (file tracking, cluster integration, reports, and integration with multiple languages), including support for conda environments. ![]() Snakemake is a workflow manager written by bioinformaticians for bioinformaticians. ![]() For almost every workflow I run, I use snakemake. ![]()
0 Comments
Leave a Reply. |