This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any wat to access the input of a snakemake rule in the output

I have a rule that needs to take a that could come from many different locations, do some processing, then put output in a new path which varies depending on the input. Is it possible to do this with key value pairs like this:

def get_vcf_path():
    an input function that gets vcf path

my_dict = {'vcf_input_path' : 'vcf_output_path'}

rule my_rule:
input:
    vcf_in_path=get_vcf_path

output:
    vcf_out_path= lambda wildcards: my_dict [wildcards.input.vcf_path]


shell:
    do stuff

I seem to be having issues. I kind of wonder if snakemake cant have output that is that dynamic because it won't be able to tell which rule outputs satisfy rule all.

snakemake

1 answer

OP here, I don't think you can: https://groups.google.com/g/snakemake/c/VVyw0b6PYig

Log in to answer this question.