Is it possible to have optionally empty wildcards? It seems like it was possible a few years ago (https://groups.google.com/g/snakemake/c/S7fTL4jAYIM), but the described method didn't work for a user last year and now is not working for me.
My Snakefile looks something like this (abbreviated for clarity):
wildcard_constraints:
udn_id="ID.+",
compound="(no_)*compound(_genome|_exome)*"
rule all:
input: expand("file/path/{id}/{compound}{.*}.html",
id=[config["id"]], compound=compound_list, freq=freq_list)
rule create_html:
output: "file/path/{id}/{compound}{freq,.*}.html"
input: "/oak/stanford/groups/euan/UDN/output/AnnotSV/AnnotSV_3.0.5/{udn_id}/WGS_blood_"+hg+"/gateway_hpo/{udn_id}.{comp_het}{cohort_freq,.*}.annotated.tsv"
shell: #Run shell commands
rule append_freq:
output: "file/path/{id}/{compound}.ha_freq.tsv"
input: "file/path/{id}/{compound}.tsv"
script: "file/path/get_ha_freq.py"
I get the error
No values given for wildcard ''.
File file/path, line 6 in <module>
when I run this.
I also tried implementing a wildcard constraint like this:
wildcard_constraints:
udn_id="ID.+",
compound="(no_)*compound(_genome|_exome)*"
freq=".*"
rule all:
input: expand("file/path/{id}/{compound}{freq}.html",
id=[config["id"]], compound=compound_list, freq=freq_list)
rule create_html:
output: "file/path/{id}/{compound}{freq}.html"
input: "/oak/stanford/groups/euan/UDN/output/AnnotSV/AnnotSV_3.0.5/{udn_id}/WGS_blood_"+hg+"/gateway_hpo/{udn_id}.{comp_het}{cohort_freq}.annotated.tsv"
shell: #Run shell commands
rule append_freq:
output: "file/path/{id}/{compound}.ha_freq.tsv"
input: "file/path/{id}/{compound}.tsv"
script: "file/path/get_ha_freq.py"
but I received the error,
No values given for wildcard 'freq'.
File file/path, line 7 in <module>
when I did this.
What error am I making?