Accessing file path from a config.yaml in Snakemake

Viewed 284

I'm working with Snakemake for NGS analysis. I have a list of input files, stored in a YAML file as follows:

DATASETS:
    sample1: /path/to/input/bam
    .
    .

A very simplified skeleton of my Snakemake file, as described earlier in Snakemake: How to use config file efficiently and https://www.biostars.org/p/406452/, is as follows:

rule all:
    input:
        expand("report/{sample}.xlsx", sample = config["DATASETS"])

rule call:
    input:
        lambda wildcards: config["DATASETS"][wildcards.sample]
    output:
        "tmp/{sample}.vcf"
    shell: 
        "some mutect2 script"

rule summarize:
    input:
        "tmp/{sample}.vcf"
    output:
        "report/{sample}.xlsx"
    shell:
        "processVCF.py"  

This complains about missing input files for rule all. I'm really not too sure what I am missing out here: Could someone perhaps point out where I can start looking to try to solve my problem?

This problem persists even when I execute snakemake -n tmp/sample1.vcf, so it seems the problem is related to the inability to pass the input file to the rule call. I have a nagging feeling that I'm really missing something trivial here.

0 Answers
Related