From dc6cf30e4778a40e9c3c92927ab18c20daefc124 Mon Sep 17 00:00:00 2001 From: Maxime Garcia Date: Fri, 27 Sep 2019 11:32:04 +0200 Subject: [PATCH] Avoid collision in MultiQC (#38) * enforcing file names to be idsample_idRun pre merging to avoid collision * more consistency for fastqc and bamqc output * update CHANGELOG --- CHANGELOG.md | 2 ++ main.nf | 41 ++++++++++++++++++----------------------- nextflow.config | 1 + 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8adbcab63..d19537ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/) - [#35](https://github.com/nf-core/sarek/pull/35) - Refactor references handling - [#35](https://github.com/nf-core/sarek/pull/35) - use Channel values instead of `referenceMap` - [#37](https://github.com/nf-core/sarek/pull/37) - Bump version for Release +- [#38](https://github.com/nf-core/sarek/pull/38) - File names before merge is based on `${idSample}_${idRun}` instead of `${idRun}` ### `Removed` @@ -123,6 +124,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/) - [#31](https://github.com/nf-core/sarek/pull/31) - Fix badges according to nf-core lint - [#31](https://github.com/nf-core/sarek/pull/31) - Fix rcolorbrewer version according to nf-core lint - [#33](https://github.com/nf-core/sarek/pull/33) - Fix MD Linting +- [#38](https://github.com/nf-core/sarek/pull/38) - Avoid collision in MultiQC ### `Deprecated` diff --git a/main.nf b/main.nf index 9a1f6a2c9..ae9da92a4 100644 --- a/main.nf +++ b/main.nf @@ -594,19 +594,19 @@ process FastQCFQ { tag {idPatient + "-" + idRun} - publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idRun}", mode: params.publishDirMode + publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idSample}_${idRun}", mode: params.publishDirMode input: - set idPatient, idSample, idRun, file("${idRun}_R1.fastq.gz"), file("${idRun}_R2.fastq.gz") from inputPairReadsFastQC + set idPatient, idSample, idRun, file("${idSample}_${idRun}_R1.fastq.gz"), file("${idSample}_${idRun}_R2.fastq.gz") from inputPairReadsFastQC output: - file "*_fastqc.{zip,html}" into fastQCFQReport + file("*.{html,zip}") into fastQCFQReport when: step == 'mapping' && !('fastqc' in skipQC) script: """ - fastqc -t 2 -q ${idRun}_R1.fastq.gz ${idRun}_R2.fastq.gz + fastqc -t 2 -q ${idSample}_${idRun}_R1.fastq.gz ${idSample}_${idRun}_R2.fastq.gz """ } @@ -615,19 +615,19 @@ process FastQCBAM { tag {idPatient + "-" + idRun} - publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idRun}", mode: params.publishDirMode + publishDir "${params.outdir}/Reports/${idSample}/FastQC/${idSample}_${idRun}", mode: params.publishDirMode input: - set idPatient, idSample, idRun, file("${idRun}.bam") from inputBAMFastQC + set idPatient, idSample, idRun, file("${idSample}_${idRun}.bam") from inputBAMFastQC output: - file "*_fastqc.{zip,html}" into fastQCBAMReport + file("*.{html,zip}") into fastQCBAMReport when: step == 'mapping' && !('fastqc' in skipQC) script: """ - fastqc -t 2 -q "${idRun}.bam" + fastqc -t 2 -q ${idSample}_${idRun}.bam """ } @@ -648,8 +648,8 @@ process MapReads { file(fasta) from ch_fasta output: - set idPatient, idSample, idRun, file("${idRun}.bam") into bamMapped - set idPatient, idSample, file("${idRun}.bam") into bamMappedBamQC + set idPatient, idSample, idRun, file("${idSample}_${idRun}.bam") into bamMapped + set idPatient, idSample, file("${idSample}_${idRun}.bam") into bamMappedBamQC when: step == 'mapping' @@ -670,7 +670,7 @@ process MapReads { ${convertToFastq} bwa mem -K 100000000 -R \"${readGroup}\" ${extra} -t ${task.cpus} -M ${fasta} \ ${input} | \ - samtools sort --threads ${task.cpus} -m 2G - > ${idRun}.bam + samtools sort --threads ${task.cpus} -m 2G - > ${idSample}_${idRun}.bam """ } @@ -2361,24 +2361,19 @@ compressVCFOutVEP = compressVCFOutVEP.dump(tag:'VCF') // STEP MULTIQC -multiQCReport = Channel.empty() - .mix( - bamQCReport, - bcftoolsReport, - fastQCReport, - markDuplicatesReport, - samtoolsStatsReport, - snpeffReport, - vcftoolsReport - ).collect() - process MultiQC { publishDir "${params.outdir}/Reports/MultiQC", mode: params.publishDirMode input: file (multiqcConfig) from Channel.value(params.multiqc_config ? file(params.multiqc_config) : "") - file (reports) from multiQCReport file (versions) from yamlSoftwareVersion + file ('bamQC/*') from bamQCReport.collect().ifEmpty([]) + file ('BCFToolsStats/*') from bcftoolsReport.collect().ifEmpty([]) + file ('FastQC/*') from fastQCReport.collect().ifEmpty([]) + file ('MarkDuplicates/*') from markDuplicatesReport.collect().ifEmpty([]) + file ('SamToolsStats/*') from samtoolsStatsReport.collect().ifEmpty([]) + file ('snpEff/*') from snpeffReport.collect().ifEmpty([]) + file ('VCFTools/*') from vcftoolsReport.collect().ifEmpty([]) output: set file("*multiqc_report.html"), file("*multiqc_data") into multiQCOut diff --git a/nextflow.config b/nextflow.config index 88c33ebe3..71cead284 100644 --- a/nextflow.config +++ b/nextflow.config @@ -115,6 +115,7 @@ profiles { singularity.enabled = false } singularity { + autoMounts = true docker.enabled = false singularity.enabled = true }