I'm running associations for a list of genes and markers. I have a list of genes genes = ['gene1', 'gene2', ...]
and a dictionary where the keys are gene names and the values are lists of markers that I want to associate with that gene, i.e. markers = {'gene1': ['marker1.1', 'marker1.2', ...], 'gene2': ['marker2.1', 'marker2.2', ...], ...}
. I have a rule that outputs a file gene/assoc/marker
for a given gene and a marker.
Is it possible expand on the genes
list and the markers
dictionary simultaneously, such that the gene that is being expanded on works as a key into the dict? Something akin to the following:
markers = {
'gene1': ['marker1.1', 'marker1.2', ...],
'gene2': ['marker2.1', 'marker2.2', ...],
...
}
genes = markers.keys()
rule all:
input:
expand('{gene}/assoc/{marker}', gene=genes, marker=markers[current_gene])