79449276

Date: 2025-02-18 18:34:55
Score: 2.5
Natty:
Report link

What person came along and down-voted this question?! I voted it up again. It's a common problem in Snakemake and it has a good answer - shadow rules:

https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#shadow-rules

Using shadow mode is not as mysterious as it may seem. It just does exactly what you are trying to do with subfolders but in a consistent and robust way. The "shadow" is just a temporary directory where the rule runs and makes whatever output, then Snakemake moves the output file back to the real working directory and deletes anything else. It's great for cleaning up temp files, and for resolving conflicts like you have.

If you ever tried Nextflow, that system basically runs every step as a shadow rule.

The short answer is, just add shadow: 'minimal' to your original rule (the simple version that did [*command to generate SolFix*]; mv SolFix {output.SolFix_ebv}) and then you should be golden. Let me know if you still have problems.

Reasons:
  • RegEx Blacklisted phrase (2): down-vote
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What
  • Low reputation (0.5):
Posted by: Tim Booth