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.
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.