Home > Enterprise >  Preinstall conda envs Snakemake
Preinstall conda envs Snakemake

Time:02-28

When trying to run snakemake, I always have to install/download conda envs.

(snakemake) (ec2-user)$ bash run_snakemake.sh
Building DAG of jobs...
Creating conda environment ../envs/svg_env.yaml...
Downloading and installing remote packages.

Is there a way to preinstall? I notice that conda envs get installed inside .snakemake/ folder.

CodePudding user response:

As per docs, running this will create the envs:

snakemake --use-conda --conda-create-envs-only

Relevant quote:

Conda deployment also works well for offline or air-gapped environments. Running snakemake --use-conda --conda-create-envs-only will only install the required conda environments without running the full workflow. Subsequent runs with --use-conda will make use of the local environments without requiring internet access.

CodePudding user response:

@SultanOrazbayev has the right answer for preinstall, but based on your question of reinstalling every run, I also wanted to note that by default snakemake places its .snakemake dir in the working directory. If you are utilizing that to run your workflow multiple times, it could cause the environments to reinstall. To prevent that, you can set the singularity-prefix and conda-prefix options.

Also of note, while it is called conda-create-envs-only it will also set up singularity images if you run with use-singularity.

  • Related