4

Is it possible to have a snakemake with a wildcard and expand:

rule a:
    input:
        "input/{first}.txt",
        expand("data/{second}.txt", second=A_LIST)
    output:
        expand("output/{first}_{second}, second=A_LIST)
pogibas
  • 27,303
  • 19
  • 84
  • 117
Parsa
  • 3,054
  • 3
  • 19
  • 35

1 Answers1

6

Use double braces for wildcards, if your pattern has both wildcard and variable. For example, expand("output/{{first}}_{second}", second=A_LIST)

A_LIST = ['1', '2']

rule all:
    input:
        expand("output/abc_{second}", second=A_LIST)

rule a:
    input:
        "input/{first}.txt",
        expand("data/{second}.txt", second=A_LIST)
    output:
        expand("output/{{first}}_{second}", second=A_LIST)
    shell:
        "touch {output}"
Manavalan Gajapathy
  • 3,900
  • 2
  • 20
  • 43