0

In the version of Snakemake that I have just updated to (7.15.2), "snakemake -n" will return the "Reason" for each job. This could be for example "input files updated by another job", "missing output files" or "updated input files". I only want to run jobs where the reason is "missing output files", and ignore all jobs that have any other reason. In a previous version of Snakemake (7.3.2), there was some command line flag like "--rerun-triggers-mtime" or something (can't remember exactly what) that allowed this.

How can i do this on snakemake 7.15.2?

metatoaster
  • 17,419
  • 5
  • 55
  • 66
  • According to the documentation, there hasn't been a change in `--rerun-triggers`. The commandline flag in question can be found here: [How to ignore Snakemake's "params have changed since last execution"?](https://stackoverflow.com/questions/72508225/how-to-ignore-snakemakes-params-have-changed-since-last-execution) – KeyboardCat Oct 18 '22 at 05:50
  • (However, that restores Snakemake's "classic" behavior which looks at modification time. Do you want Snakemake to behave like it did before it considered code changes,..., or do you explicitly only want rules that are missing output files? There might be some differences there.) – KeyboardCat Oct 18 '22 at 06:18
  • Thanks @KeyboardCat. Indeed I didn't realise it was the same, "snakemake -n --rerun-triggers mtime" is still functional. However, out of your options I want the latter: I explicitly only want rules that are missing output files. Sadly, using "--rerun-triggers mtime" does not seem to do this. – rovertsins Oct 18 '22 at 14:27

1 Answers1

2

You could get a summary of the workflow to extract the missing files, then use this list of missing files as input to the actual execution. E.g.:

# Show summary of jobs
snakemake -S

# Get filenames where status (column 6) is missing:
x=`snakemake -S | awk -v FS='\t' '$6 == "missing"' | cut -f 1`

# Run workflow
snakemake -j 1 -n $x 
dariober
  • 8,240
  • 3
  • 30
  • 47