snakemake icon indicating copy to clipboard operation
snakemake copied to clipboard

glob_wildcards does not obey wildcard_constraints directive

Open ASLeonard opened this issue 3 years ago • 1 comments

True on v7.8.2, but from peeking at the code, there is no mention of wildcard constraints near the glob_wildcards definition.

So code like this "fails" because it pulls in the wrong files

wildcard_constraints:
    chunk = r'\d*:\d*-\d*'

def aggregate_scatter(wildcards):
     checkpoint_dir = checkpoints.bcftools_scatter.get(**wildcards).output[0]
     return expand('chunk-{chunk}.imputed.vcf.gz',chunk=glob_wildcards('chunk-{chunk}.vcf.gz')).chunk)

while explicitly adding the constraint to the glob glob_wildcards('chunk-{chunk,\d*:\d*-\d*}.vcf.gz') now works. Not that hard to work around, but an easy mistake to make since I would assume wildcard_constraints always applies and just leads to repeating yourself.

ASLeonard avatar Jun 18 '22 14:06 ASLeonard

This is still not fixed as of v8.16.0. Spent all this time trying to figure out why my checkpoint wasn't working it was because of this

hermidalc avatar Aug 05 '24 12:08 hermidalc

I think this is a duplicate of #482.

vandalt avatar Sep 25 '24 15:09 vandalt