Error in snakemake with working shell script
1
1
Entering edit mode
15 months ago
Cathy ▴ 10

I want to run fastqc using snakemake.

This is my snakemake script.

configfile: 'sample_config.yaml'
configfile: srcdir('path_config.yaml')

FASTQC = config['FASTQC']
UNZIP = config['UNZIP']

rule all:
    input:
        fqc1 = expand("00_QC/{sample}_fastqc.txt", sample = config['sample']),

rule fastqc:
    input:
        fq1 = lambda wildcards: config['sample'][wildcards.sample]['fq1'],
    output:
        fqc1 = "00_QC/{sample}_fastqc.txt",
    params:
        outdir = "00_QC",
        zip1 = "00_QC/{sample}_fastqc.zip",
        sum1 = "{sample}_fastqc/summary.txt",
    threads: 1
    log:
        fail = "00_QC/log/{sample}.fastqc.log",
        success = "00_QC/log/{sample}.fastqc.success",
    shell:
        "({FASTQC} {input.fq1} -o {params.outdir} -t {threads} "
        "&& {UNZIP} -p {params.zip1} {params.sum1} > {output.fqc1} "
        "&> {log.fail} && mv {log.fail} {log.success}"

And the error message is

one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!

the log file is empty.

But when I run the shell script (the same one snakemake shows as output) it runs well. How can I fix it? I already updated snakemake version and used fastqc in the conda environment but it doesn't work.

snakemake • 917 views
ADD COMMENT
1
Entering edit mode
15 months ago
shell:
        "({FASTQC} {input.fq1} -o {params.outdir} -t {threads} "

There is a ( before {FASTQC} which shouldn't be there. Is this a typo in the question or it is actually in the script? If this doesn't fix it, post the snakemake command you executed (better if you include the -p option) and the terminal logs you get until the error.

ADD COMMENT
0
Entering edit mode

Thank you for your comment. I forgot to type ) in the second line of the shell. I fixed it as "&& {UNZIP} -p {params.zip1} {params.sum1} > {output.fqc1}) " and it works.

ADD REPLY

Login before adding your answer.

Traffic: 1980 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6