I have the following basic snakemake setup:
rule step1:
"""
The output will contain a list of GENEs in a txt file.
"""
input: "input1.txt"
output: "output1.txt"
shell:
"""
analysis1.R {input} {output}
"""
rule step2:
"""
Analysis step2.
"""
input: "input2.txt"
output: "output2.txt"
shell:
"""
analysis2.py {input} {output}
"""
rule step3:
"""
GENE should be coming from the step1 output file, with a GENE name on each
line.
"""
input: rules.step2.output
output: "output3-GENE.txt"
shell:
"""
analysis3.py -i {input} -o {output} -p GENE
"""
I produce a file with a list of genes (parameters) in step1 for step3 and another file in step2. What I would like to do is run step3 as many times as lines I have in output1.txt where the content of the line is a parameter for step3, and it should also be part of the output file name, but I can't wrap my head around it. Any ideas? Thanks for the help!