How can I ignore changed code in Snakemake

Viewed 156

I am using Snakemake 7.3.8.

I have the message stating:

Blockquote The code used to generate one or several output files has changed: To inspect which output files have changes, run 'snakemake --list-code-changes'. To trigger a re-run, use 'snakemake -R $(snakemake --list-code-changes)'.

I assume that this is because the control file (snakefile) has been modified and differs from the cached copy of the code (I located it in .snakemake/metadata).

Let's assume that I confident that changes in the code are irrelevant and that I can proceed. It there a way to tell Snakemake to ignore these particular changes in the code without re-running?

2 Answers

You can run:

snakemake -R $(snakemake --list-code-changes) --touch

The touch option:

--touch, -t           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. Note that this will only touch
files that would otherwise be recreated by Snakemake (e.g. because their
input files are newer). For enforcing a touch, combine this with --force,
--forceall, or --forcerun. Note however that you loose the provenance
information when the files have been created in realitiy. Hence, this should
be used only as a last resort. (default: False)

This worked for me:

snakemake -j 1 --list-code-changes | xargs -i -P 20 snakemake {} --cm

tthough it is potentially dangerous, as it removes metadata on the files.

Related