I am wondering what might be wrong with my snakemake executions. I have snakemake project with folder tree attached below. I am trying to execute the snakefile with an include statement pointing to another .smk file. However, the execution runs as if I have alraedy generated my targeted output files, but this has not happened yet. What might be the issue?
This is my foldertree:
├── config
│ └── config.yaml
├── results
├── Snakefile
└── workflow
├── envs
├── report
├── rules
│ └── download.smk
└── scripts
In the snakefile, I am using include to try and execute the download.smk rules: Here is what I am doing:
include: 'workflow/rules/download.smk'
And here is my download.smk content:
configfile: './././config/config.yaml'
rule all: input: config["data_dir"] + "/ACBarrie_R1.fastq.gz", config["data_dir"] + "/ACBarrie_R2.fastq.gz", config["ref_dir"] + "/reference.fasta"
rule download_dataset: output: read1 = config["data_dir"] + "/ACBarrie_R1.fastq.gz", read2 = config["data_dir"] + "/ACBarrie_R2.fastq.gz", reference = config["ref_dir"] + "/reference.fasta" params: read1_url = config['samples']['read1_url'], read2_url = config['samples']['read2_url'], genome = config['genome']
threads: config['cores']['download_dataset']
shell:
"""
wget -O {output.read1} {params.read1_url}
wget -O {output.read2} {params.read2_url}
wget -O {output.reference} {params.genome}
"""
However, when I execute, I only get this info:
Assuming unrestricted shared filesystem usage. Building DAG of jobs... Nothing to be done (all requested files are present and up to date).
But in essence, nothing has been executed and the files I expect do not alraedy exist. WHen I execute the download.smk file in isolation using snakemake -s --cores 2 download.smk, it works just fine. What might be the problem?
The default rule is not affected by the include command (see here). So from snakemakes perspective there is nothing you request to be created thus, everything is already done. So the rule all should be part of the snakefile and not your download.smk.
As far as i understand it smk-files should really only include the rules (In your case, the way you structured your rule, I think it must also include the config definition).
If i move rule-all the dag is formed as expected.