I am trying to build a simple workflow to feed a list of parameters to a script. To illustrate:
SAMPLES=['A','B']
rule test:
params:
sample=expand("{sample}", sample=SAMPLES)
script:
"test.py {params.sample}"
However, snakemake only executes the script with sample A
, not B
. In other words, I believe it is executing python test.py A B
, not python test.py A
and then python test.py B
. Similarly, I think this is illustrated by:
SAMPLES=['A','B']
rule print_samples:
params:
sample=expand("{sample}", sample=SAMPLES)
script:
"echo {params.sample} \n"
I would expect to see A
and B
printed out on separate lines, but instead it prints A B
on the same line.
Am I missing something about the way expand works with params? Ideally I would like to add the -j
flag to run them in parallel (at the moment -j
simply executes with A
alone).