I apologize if this is an oddly presented question. I'm having difficulty trying to specifically nail down how to frame this challenge in python and ultimately incorporated into snakemake.
Lets say we have a few list of elements that correspond to files:
gp1 = ["a", "b", "c"]
gp2 = ["x", "y", "z"]
And we have a previous list that names all elements
all = ["a", "b", "c", "x", "y", "z"]
for each "gp#" list I would like to create a new set of lists that represents said element, i.e for gp1
the result would be 3 lists as follows:
gpa = ["a", "b", "c"]
gpb = ["a", "b", "c"]
gpc = ["a", "b", "c"]
and we would have the equivalent for gp2
gpx = ["x", "y", "z"]
gpy = ["x", "y", "z"]
gpz = ["x", "y", "z"]
With these lists in hand I can then use all
as a wildcard and do something like:
mkdir {all} #generate a directory for each element
cp gp{all} {all} #copy the files associated with the elements from each list into each respective corresponding directory
(i.e this would be the "shell/run" portion of two snakemake rules at some point).
This would result in a directory structure as follows:
a
|_a
|_b
|_c
b
|_a
|_b
|_c
c
|_a
|_b
|_c
x
|_x
|_y
|_z
y
|_x
|_y
|_z
z
|_x
|_y
|_z
Again apologies if this is confusing and I'm happy to clarify as comments come in. I'm having a difficult time conceptualizing how to approach this.