I have a rule in a snakemake workflow that might produce an empty output file, depending on the input. That output file is then used in another rule whose command will be totally ok with an empty file as input, as long as the path exists for that input file, and still complete successfully with the correct result. Is there a way I can write the workflow so that snakemake doesn't consider the first rule to have failed because it produced an empty file?
Edit with some output from snakemake:
RuleException:
CalledProcessError in line 123 of /home/ckern/All_Species_Chromatin_Model/Snakefile:
Command ' set -euo pipefail; grep E6$ Model_10/Cattle_Cortex_10_segments.bed > Model_10/Cattle_Cortex_10_E6.bed ' returned non-zero exit status 1.
File "/home/ckern/All_Species_Chromatin_Model/Snakefile", line 123, in __rule_split_states
File "/share/apps/conda3/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Removing output files of failed job split_states since they might be corrupted:
Model_10/Cattle_Cortex_10_E6.bed
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message