Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prevent Snakemake from re-running rules when their output is already present #152

Open
lukenoaa opened this issue Sep 18, 2024 · 0 comments

Comments

@lukenoaa
Copy link
Member

Snakemake has the unfortunate habit of re-running rules when their output is already present. To prevent this, follow these steps:

  1. Run the rule you want with the --dry-run flag. This will show you the "reason" that each rule is being run.
  2. If the reason is:
    • "Updated input files": Run the rule with the --touch parameter, which will touch output files (mark them up to date without really changing them) instead of running their commands. This is used to pretend that the rules were executed, in order to fool future invocations of snakemake. Fails if a file does not yet exist.
    • "Software environment definition has changed since last execution": Run the rule with the parameter --rerun-triggers mtimes, which is the traditional way of just considering file modification dates. Otherwise, the default is to use all triggers, which guarantees that results are consistent with the workflow code and configuration but may cause undesirable behavior.

@ksilnoaa, this should help some of the issues we've had. I will add this text to the README for the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant