From 6ccc5fa2b70f955c962037efc7f1825baf6ec5fe Mon Sep 17 00:00:00 2001 From: Laurent Modolo <laurent.modolo@ens-lyon.fr> Date: Wed, 25 Jul 2018 14:33:01 +0200 Subject: [PATCH] FastQC.nf: add paired process --- src/nf_modules/FastQC/fastqc.config | 4 +-- src/nf_modules/FastQC/fastqc.nf | 47 ++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/nf_modules/FastQC/fastqc.config b/src/nf_modules/FastQC/fastqc.config index db3b027..a658984 100644 --- a/src/nf_modules/FastQC/fastqc.config +++ b/src/nf_modules/FastQC/fastqc.config @@ -3,14 +3,14 @@ profiles { docker.temp = 'auto' docker.enabled = true process { - $fastqc { + $fastqc_fastq { container = "fastqc:0.11.5" } } } sge { process{ - $fastqc { + $fastqc_fastq { beforeScript = "module purge; module load FastQC/0.11.5" executor = "sge" cpus = 1 diff --git a/src/nf_modules/FastQC/fastqc.nf b/src/nf_modules/FastQC/fastqc.nf index abe18a4..6ab4140 100644 --- a/src/nf_modules/FastQC/fastqc.nf +++ b/src/nf_modules/FastQC/fastqc.nf @@ -5,7 +5,13 @@ */ /* fastQC */ -params.fastq = "" + + +/* +* for single-end data +*/ + +params.fastq = "$baseDir/data/fastq/*.fastq" log.info "fastq files : ${params.fastq}" @@ -14,20 +20,51 @@ Channel .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } .set { fastq_files } -process fastqc { +process fastqc_fastq { tag "$fastq.baseName" - publishDir "results/fastqc/", mode: 'copy' + publishDir "results/fastq/fastqc/", mode: 'copy' + cpus = 1 input: file fastq from fastq_files output: - file "*.htlm" into fastqc_repport + file "*.{zip,html}" into fastqc_repport script: """ -fastqc -o ./ --noextract -f fastq ${fastq} +fastqc --quiet --threads ${task.cpus} --outdir -f fastq ./ ${fastq} """ } +/* +* for paired-end data +*/ + +params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq" + +log.info "fastq files : ${params.fastq}" + +Channel + .fromFilePairs( params.fastq ) + .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } + .set { fastq_files } + +process fastqc_fastq { + tag "$pair_id" + publishDir "results/fastq/fastqc/", mode: 'copy' + + input: + set pair_id, file(reads) from fastq_files + + output: + file "*.{zip,html}" into fastqc_repport + + script: +""" +fastqc --quiet --threads ${task.cpus} --outdir -f fastq ./ \ +${fastq[0]} ${fastq[1]} +""" +} + -- GitLab