Getting started with Snakemake
Objective 4
Motivation
Have you noticed how Snakemake sometimes decides to re-run everything (although output files already exist) and sometimes not?
Snakemake always justifies its choices in the output log. Sometimes its because the files are missing, other times it might because the code has changed, etc.. For example:
Or:
How to control re-running criteria?
--rerun-triggers
. By default, all triggers are used (code,input,mtime,params,software-env
), which guarantees that results are consistent with the workflow code and configuration. To revert to Snakemake’s behaviour before v.7.8.0, you can use --rerun-triggers mtime
. This option will tell Snakemake to only use modification time when determining whether a job should be executed or not. For example:Force re-run
If you rerun your snakemake command line now, without changing anything to the code (with or without the --rerun-trigger mtime
option), you should see a message from Snakemake telling you that nothing needs doing:
– delete all output folders and results before re-running the Snakemake command
– use Snakemake’s --forcerun
(-R
) or --forceall
(-F
) options when you run the Snakemake command. --forcerun
reruns a specific rule or input which you will have to specify in the command line. --forceall
forces everything to be re-run. For example: