

Defining a conda environment for your workflow When you change a conda environment by modifying its YAML file and run Snakemake with -use-conda, Snakemake will detect these changes and create a new environment based on the updated environment definition. snakemake/conda/, by default) and activates each environment as needed for each rule. The next time you run Snakemake with the -use-conda flag, Snakemake detects the existing environment (stored in. activates an environment prior to running each rule that uses it.installs the packages defined for that environment.creates a new conda environment for each distinct environment definition in the workflow.The first time you run Snakemake with the -use-conda flag, Snakemake automatically: To run your workflow with conda environments enabled, provide the -use-conda flag as shown below. The example below, from the Snakemake documentation, shows how each rule can define its own conda environment. Workflow managers like Snakemake and Nextflow support running workflow jobs inside custom conda environments. Managing workflow software with Snakemake When a package is listed without a specific version, the latest version conda will install the latest version. For example, the Nextstrain team uses a standard conda environment for most projects. We also use Conda environments when our workflows require custom software or specific versions of software that are not included in pre-built container images.Ĭonda environments are defined by a single YAML file that lists which software packages and versions of that software should be installed. We use conda environments to run workflows on high performance compute clusters where Docker is not supported for security reasons. We use containers via the Nextstrain CLI to run SARS-CoV-2 and seasonal influenza workflows on AWS Batch. The Nextstrain team uses both of these solutions in different contexts.


Software management for reproducible workflows

Run your workflows with snakemake -use-conda.Pin augur versions in conda environment files.Define conda environments per rule in your Snakemake workflows.
