Executing snakemake rules in conda environments on Windows

Viewed 255

I used the latest version of Miniconda on Windows (Miniconda3-py37_4.8.3-Windows-x86_64) to install snakemake in a separate conda environment (snakemake-minimal=5.19.2, python=3.8.3). With this setup, I tried to run a snakemake workflow that uses individual conda environments for each rule. The workflow itself was tested on Ubuntu and is working fine there.

However, when running on the Windows setup described above, I ran into several problems. Looking into these issues I stumbled upon a few things in snakemake/deployment/conda.py that seem to be incompatible with Windows. I found 2 examples, but I am quite sure there are a few more:

  • Lines 301 to 305: Here conda env create is called with the optional the --file and --prefix tags. On Windows, their arguments need to be surrounded by double quotes instead of single quotes. For instance, line 304 should read "--file \"{}\"".format(target_env_file).
  • Line 460 uses the source command to activate a conda environment, obviously not compatible with a default Windows setup.

Based on these observations, I came to the conclusion that running snakemake rules in separate conda environments is currently not supported for Windows. However, I was quite surprised that I found no mention about this in the docs or anywhere else. Did I miss something here? I know I could use for instance WSL to make it run on Windows, but is there also a way to run it in a "native" Windows setup?

0 Answers
Related