From e75a6a7fb16a29bad904ba1bc1a2b4aa83deea16 Mon Sep 17 00:00:00 2001 From: John Huddleston Date: Wed, 20 Mar 2024 16:02:58 -0700 Subject: [PATCH] Update instructions to run the workflow Modernizes instructions to install Snakemake and run the workflow. Instead of manually installing the workflow's Conda environment and using the Snakemake in that environment to run the workflow, install a modern Snakemake and let Snakemake create the workflow environment on the fly. If the user has installed a modern Miniconda, the Conda solver will be using libmamba which is substantially faster than the old Conda solver that gets installed in the workflow's environment. Snakemake still tries to use mamba as the default Conda backend, so this commit updates all Snakemake commands to explicitly set the backend to "conda". --- README.md | 17 +++++++++-------- envs/anaconda.python3.yaml | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 70921f4..13e7ba4 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,12 @@ git clone https://github.com/blab/flu-forecasting.git cd flu-forecasting ``` -Create and activate a conda environment for the pipeline. +Create and activate a Conda environment for Snakemake. +You will use this environment to run the workflow. ```bash -conda env create -f envs/anaconda.python3.yaml -conda activate flu_forecasting +conda create --yes -c conda-forge -c bioconda -n snakemake snakemake +conda activate snakemake ``` ## Quickstart @@ -51,13 +52,13 @@ This will first simulate influenza-like populations and then fit models to those Inspect all steps to be executed by the pipeline with a dryrun. ```bash -snakemake --dryrun --use-conda --config active_builds='simulated_sample_1' +snakemake --dryrun --use-conda --conda-frontend conda --config active_builds='simulated_sample_1' ``` Run the pipeline locally with four jobs (or cores) at once. ```bash -snakemake --use-conda --config active_builds='simulated_sample_1' -j 4 +snakemake --use-conda --conda-frontend conda --config active_builds='simulated_sample_1' -j 4 ``` Always specify a value for `-j`, to limit the number of cores available to the simulator. @@ -255,19 +256,19 @@ These model files contain all information required to fit the HI- and FRA-based Run the entire pipeline locally with four simultaneous jobs. ```bash -snakemake --use-conda -j 4 +snakemake --use-conda --conda-frontend conda -j 4 ``` You can also run just one of the natural builds as follows, to confirm your environment is configured properly. ```bash -snakemake --use-conda --config active_builds='natural_sample_1_with_90_vpm_sliding' -j 4 +snakemake --use-conda --conda-frontend conda --config active_builds='natural_sample_1_with_90_vpm_sliding' -j 4 ``` Or you can run just one of the simulated builds as follows. ```bash -snakemake --use-conda --config active_builds='simulated_sample_3' -j 4 +snakemake --use-conda --conda-frontend conda --config active_builds='simulated_sample_3' -j 4 ``` Alternately, follow [Snakemake documentation to distribute the entire pipeline to your cloud or cluster accounts](https://snakemake.readthedocs.io/en/stable/executing/cluster-cloud.html). diff --git a/envs/anaconda.python3.yaml b/envs/anaconda.python3.yaml index 8af20b7..39c82d0 100644 --- a/envs/anaconda.python3.yaml +++ b/envs/anaconda.python3.yaml @@ -1,5 +1,6 @@ name: flu_forecasting channels: +- conda-forge - bioconda - defaults dependencies: