Skip to content

learners

Setup

Snakemake can be installed in several ways. In this lesson, we use Pixi because it is fast and keeps the environment setup simple.

Installing Pixi

Detailed installation instructions
You can find the full installation instructions at https://pixi.prefix.dev/latest/installation/.

If CVMFS is available, we recommend to source the setup.sh as described below.

source /cvmfs/cms-griddata.cern.ch/cat/sw/pixi/latest/setup.sh

Check that pixi is available:

pixi version
Later episodes use Apptainer

The first episodes only need Snakemake itself. The later episode on containers also needs Apptainer, which is usually easiest on a Linux system where Apptainer is already available, such as LxPlus or a Tier-3 cluster.

If you are working locally on macOS or Windows, you can still follow the early episodes, but you may want to switch to such a system for the container material.

Installing Snakemake

We will use a dedicated directory for this tutorial:

mkdir snakemake-tutorial
cd snakemake-tutorial
pixi init
pixi workspace channel add conda-forge
pixi workspace channel add bioconda
pixi add snakemake
Alternative installation instructions
You can find several more options to install Snakemake at https://snakemake.readthedocs.io/en/stable/getting_started/installation.html.

To activate the environment, run:

pixi shell

Snakemake should then be available:

snakemake --help

You can also run Snakemake without activating the shell (type exit to get out of it) directly through pixi:

pixi run snakemake --help

Next step

Now you’re ready to start using Snakemake.