Skip to content

Exercises: first workflow

Work in snakemake-workshop/work-intro with .venv active, after completing the walkthrough. Exercises 2.1 and 2.2 are the core practice; 2.3 is an extension. Predict the plan before running a command.

2.1 Request one result

All ten outputs already exist. Run:

snakemake --cores 2 --scheduler greedy --dry-run output_7.txt

How many run_app jobs are needed? Why does this request not ask for every file listed by all?

2.2 Recover two missing files

Remove only these two generated files:

rm output_2.txt output_8.txt

Write and run the dry-run command for the default target. Predict the number of run_app jobs, then execute the plan. Check that all ten outputs exist again. Must the regenerated values differ from the originals?

Hint

An explicit file target and the default target need not request the same set of files. The default target is the first rule in this Snakefile.

2.3 Extension: twelve results

In your working copy of Snakefile, change only range(10) to range(12). Before executing, predict the new filenames and the number of additional jobs. Check the dry run, execute and inspect the new files. Keep this change in your working copy; the next module starts in a separate directory.

Solutions