Flags in file patterns given to expand() are invalid.

Create issue
Issue #1281 resolved
Former user created an issue

I'm trying to run some of my old code (an example is provided below), but since upgrading to version 5.6, it doesn't seem to work anymore. I receive the following error message:

Flags in file patterns given to expand() are invalid. Flags (e.g. temp(), directory()) have to be applied outside of expand (e.g. 'temp(expand("plots/{sample}.pdf", sample=SAMPLES))').

Rule checkme uses the rule.rule_name.output syntax and that seems to cause problems (that rule is not needed per se and it's added just to test the rule.rule_name.output syntax):

# using dictionary expansion

mydictionary={
'apple': 'crunchy fruit',
'banana': 'mushy and yellow'
}

rule all:
    input:
        expand('{key}.sh', key=mydictionary.keys())

rule test:
    output: temp('{f}.txt')
    params:
        keyval=lambda wildcards: mydictionary[wildcards.f]
    shell:
        """
        echo {params.keyval} > {output}
        cat {output}
        """

rule test2:
    input: rules.test.output
    output: temp('{f}.sh')
    shell: "touch {output}"

rule checkme:
    input: expand(rules.test2.output, f=mydictionary.keys())

Comments (2)

  1. Johannes Köster

    Thanks for reporting and the nice example. I have added it as a test case. Everything should be fixed now in master.

  2. Log in to comment