I am trying to run a shell command with snakemake that requires an output directory defined in the command. Specifically, I am trying to use fastqc which has the following required parameters:
fastqc {input} -o {output.dir}
Below are the three versions of my snakefile, none of which worked.
Version 1:
rule QC_rawdata:
input:
expand("raw_reads/{sample}_{replicate}.fastq.gz", sample=SAMPLE, replicate=REPLICATE)
output:
directory("fastqc_raw_reads/")
shell:
"fastqc {input} -o {output}"
Version 2:
rule QC_rawdata:
input:
expand("raw_reads/{sample}_{replicate}.fastq.gz", sample=SAMPLE, replicate=REPLICATE)
output:
zip=expand("fastqc_raw_reads/{sample}_{replicate}_fastqc.zip", sample=SAMPLE, replicate=REPLICATE),
html=expand("AA-041_Mus_Sat_Cells_Nelfb-{sample}_{replicate}_fastqc.html", sample=SAMPLE, replicate=REPLICATE)
shell:
"fastqc {input} -o {output}"
Error: Syntax error
Version 3:
rule QC_rawdata:
input:
expand("raw_reads/{sample}_{replicate}.fastq.gz", sample=SAMPLE, replicate=REPLICATE)
output:
directory("fastqc_raw_reads/"),
zip=expand("fastqc_raw_reads/{sample}_{replicate}_fastqc.zip", sample=SAMPLE, replicate=REPLICATE),
html=expand("AA-041_Mus_Sat_Cells_Nelfb-{sample}_{replicate}_fastqc.html", sample=SAMPLE, replicate=REPLICATE)
shell:
"fastqc {input} -o {output}"
Error: Syntax error
I was using https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#directories-as-outputs as a reference.
I think I am missing some fundamental way in which output directories are defined in snakemake. If I can't point to a specific output file in my shell command then how do I write my snakemake file?