2

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.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • Welcome to SO, your question is beautifully formatted! Can you add `print(config["DATASETS"])`? My guess would be that the config is empty. You need to make use of https://snakemake.readthedocs.io/en/stable/snakefiles/configuration.html?highlight=configfile#standard-configuration, its missing from your skeleton – Maarten-vd-Sande Oct 15 '20 at 06:14
  • 1
    Thanks for the reply! The config was read. Turns out it was really something really trivial: after spending the entire morning trying to debug, turns out it might have been my indentation in my Snakefile. After fixing the indentations, it worked well! – Jeremy Ng Wee Kiat Oct 15 '20 at 07:28

0 Answers0