I want to run a Snakemake workflow where the input is defined by a combination of different variables (e.g. pairs of samples, sample ID and Nanopore barcode,...):
sample_1 = ["foo", "bar", "baz"]
sample_2 = ["spam", "ham", "eggs"]
I've got a rule using these:
rule frobnicate:
input:
assembly = "{first_sample}_{second_sample}.txt"
output:
frobnicated = "{first_sample}_{second_sample}.frob"
I now want to create a rule all
that will do this for some combinations of the samples in sample_1
and sample_2
, but not all of them.
Using expand
would give me all possible combinations of sample_1
and sample_2
.
How can I, for example, just combine the first variable in the first list with the first in the second and so on (foo_spam.frob
, bar_ham.frob
, and baz_eggs.frob
)?
And what if I want some more complex combination?