Snakemake is a Python-based workflow management system designed to create reproducible and scalable data analyses. It enables writing workflows in a Python-like DSL called Snakefile, allowing for automatic parallelization, dependency tracking, and execution on various platforms. The current version is 9.19.0, with frequent patch releases and major feature updates typically every few months.
pip install snakemakeVerified import paths — ran on the pinned version, not inferred.
Create a `Snakefile` (the workflow definition) and then execute it using the `snakemake` command-line tool. The example generates a simple file processing workflow and shows how the workflow rules are defined. To run the workflow, execute `snakemake -c 1` in your terminal in the same directory as the Snakefile.
Replace `--use-conda` with `--conda-frontend conda` or `--conda-frontend mamba` in your `snakemake` commands. Ensure `mamba` is installed for faster dependency resolution.
If using a single profile, consolidate configuration into a `profile.yaml` file within your profile directory. If you explicitly pass a profile directory, Snakemake will still look for `config.yaml`, `cluster.yaml`, etc., but `profile.yaml` will take precedence if present.
Only specify `threads` or `resources` if a rule truly benefits from or requires them. For CPU-bound tasks, `threads: 1` is often sufficient unless the tool explicitly uses multiple threads. Use `resources` to specify memory or other custom requirements.
Check the spelling of file paths and rule names. Ensure all necessary input and output files are defined correctly across rules, and that a rule exists to produce the requested output.
Verify that the input file `path/to/input.txt` either exists on disk before the workflow starts, or that there is another rule defined earlier in the Snakefile that produces it as its output.
If no other Snakemake process is running, manually remove the lock file using `snakemake --unlock` from the command line within your workflow directory.
Install Miniconda or Mambaforge and ensure its `bin` directory is added to your system's PATH environment variable. Alternatively, use a different `--conda-frontend` or disable Conda integration if not needed.