I wonder if it is possible to join these two rules in Snakemake in a single rule (they do the same in the "run:"):
rule without_d:
input:
vals_pca = 'stats/input_{type}.npz',
output:
for_cnv = 'stats/output_{type, tt|gs}.npz'
run:
# DO STUFF
rule with_d:
input:
vals_pca = 'stats/input_{type}_d{amount}.npz',
output:
for_cnv = 'stats/output_{type, tt|gs}_d{amount}.npz'
run:
# DO STUFF
I have tried to define stats/output_{type}{amount}.npz, but wildcards apparently do not match an empty string.
The second idea was to put it into "or" like stats/{output, output_{type}|output_{type}_d{amount}}, but here the problem is with a wildcard in a wildcard.
Thanks!