This is a test version of Biostars. For the public version, visit https://www.biostars.org.
snakemake output directory

I am new to snakemake. I have a simple quesiton and I can not do the fastqc output into a directory

rule run_fastqc:
    input:
        "data/ERR127302_1_subset.fastq.gz"
    output:
        directory("result/")
    shell:
        "fastqc {input} -o {output} "

I try the command:

snakemake -j 1 -n

The output is:

Building DAG of jobs...
Nothing to be done.

is there any advices ? Thanks.

snakemake ngs

2 answers

I can successfully output the result to the result directory.

rule run_fastqc:
    input:
        "data/ERR127302_1_subset.fastq.gz"
    output:
        "result/{sample}_fastqc.html",
        "result/{sample}_fastqc.zip"
    params:
        dir="result"
    shell:
        "fastqc {input} -o {params.dir}"

The html file and the zip will be in the result directory

it is right answer

Nothing to be done suggests the output, i.e. directory results, exists and is newer than the input so no need to rerun the jobs.

I want the fastqc output file, the html file and the zip file output to result directory but it output nothing.

I tried to change the output in the Snakefile like below:

output:
    expand("result/{sample}_fastqc.html",sample=SAMPLES),
    expand("result/{sample}_fastqc.zip",sample=SAMPLES)

but it still outputs to the data directory, do you know why

Did you define rule all?

no, I didn't. what should I input in rule all

rule all:
    input:
        expand("result/{sample}_fastqc.html",sample=SAMPLES),
        expand("result/{sample}_fastqc.zip",sample=SAMPLES)

it stills output at the data directory

Try this as shell command: fastqc {input} -q -f fastq -o result/

Log in to answer this question.