From e5bf87aec3b7de144c7f2599154b6bb2620b5c84 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:58:27 +0200 Subject: [PATCH 1/8] possible fix for name collisions --- modules/multiqc/main.nf | 2 +- tests/modules/multiqc/main.nf | 23 +++++++++++++++++++---- tests/modules/multiqc/nextflow.config | 4 +++- tests/modules/multiqc/test.yml | 11 +++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index ae019dbf..bd3c9dc8 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -7,7 +7,7 @@ process MULTIQC { 'quay.io/biocontainers/multiqc:1.12--pyhdfd78af_0' }" input: - path multiqc_files + path "??/*" output: path "*multiqc_report.html", emit: report diff --git a/tests/modules/multiqc/main.nf b/tests/modules/multiqc/main.nf index 43643985..3719d423 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -2,15 +2,30 @@ nextflow.enable.dsl = 2 -include { FASTQC } from '../../../modules/fastqc/main.nf' -include { MULTIQC } from '../../../modules/multiqc/main.nf' +include { FASTQC } from '../../../modules/fastqc/main.nf' +include { FASTQC as FASTQC2 } from '../../../modules/fastqc/main.nf' +include { MULTIQC } from '../../../modules/multiqc/main.nf' workflow test_multiqc { input = [ [ id: 'test', single_end: false ], - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] ] FASTQC ( input ) MULTIQC ( FASTQC.out.zip.collect { it[1] } ) } + +workflow test_multiqc_fn_collision { + fqc_input = [ [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ] + mqc_input = Channel.empty() + + FASTQC ( fqc_input ) + mqc_input = mqc_input.mix(FASTQC.out.zip.collect { it[1] }) + + FASTQC2 ( fqc_input ) + mqc_input = mqc_input.mix(FASTQC2.out.zip.collect { it[1] }) + + MULTIQC ( mqc_input ) +} diff --git a/tests/modules/multiqc/nextflow.config b/tests/modules/multiqc/nextflow.config index 8730f1c4..76d125e5 100644 --- a/tests/modules/multiqc/nextflow.config +++ b/tests/modules/multiqc/nextflow.config @@ -1,5 +1,7 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - + withName: "FASTQC*" { + publishDir = [ enabled: false ] + } } diff --git a/tests/modules/multiqc/test.yml b/tests/modules/multiqc/test.yml index 39796872..33129c79 100644 --- a/tests/modules/multiqc/test.yml +++ b/tests/modules/multiqc/test.yml @@ -1,5 +1,12 @@ -- name: multiqc - command: nextflow run ./tests/modules/multiqc -entry test_multiqc -c ./tests/config/nextflow.config -c ./tests/modules/multiqc/nextflow.config +- name: multiqc test_multiqc + command: nextflow run ./tests/modules/multiqc -entry test_multiqc -c ./tests/config/nextflow.config -c ./tests/modules/multiqc/nextflow.config + tags: + - multiqc + files: + - path: output/multiqc/multiqc_report.html + +- name: multiqc test_multiqc_fn_collision + command: nextflow run ./tests/modules/multiqc -entry test_multiqc_fn_collision -c ./tests/config/nextflow.config -c ./tests/modules/multiqc/nextflow.config tags: - multiqc files: From d196552e064b6979109931e4d48a68617f090254 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 7 Jun 2022 16:33:04 +0200 Subject: [PATCH 2/8] update input --- modules/multiqc/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index bd3c9dc8..d376db60 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -7,7 +7,7 @@ process MULTIQC { 'quay.io/biocontainers/multiqc:1.12--pyhdfd78af_0' }" input: - path "??/*" + path "*/*" output: path "*multiqc_report.html", emit: report From 439d2a9e679977add51da377f3dbfdf68ab5c6a9 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 13:48:27 +0200 Subject: [PATCH 3/8] update mqc inputs --- modules/multiqc/main.nf | 3 ++- modules/multiqc/meta.yml | 8 ++++++++ tests/modules/multiqc/main.nf | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index d376db60..df68d853 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -7,7 +7,8 @@ process MULTIQC { 'quay.io/biocontainers/multiqc:1.12--pyhdfd78af_0' }" input: - path "*/*" + path multiqc_files, stageAs: "?/*" + tuple path(mqc_config), path(mqc_logo) output: path "*multiqc_report.html", emit: report diff --git a/modules/multiqc/meta.yml b/modules/multiqc/meta.yml index 6fa891ef..bf3a27fe 100644 --- a/modules/multiqc/meta.yml +++ b/modules/multiqc/meta.yml @@ -17,6 +17,14 @@ input: type: file description: | List of reports / files recognised by MultiQC, for example the html and zip output of FastQC + - multiqc_config: + type: file + description: Config yml for MultiQC + pattern: "*.{yml,yaml}" + - multiqc_logo: + type: file + description: Logo file for MultiQC + pattern: "*.{png}" output: - report: type: file diff --git a/tests/modules/multiqc/main.nf b/tests/modules/multiqc/main.nf index 3719d423..e015cbc3 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -12,7 +12,7 @@ workflow test_multiqc { ] FASTQC ( input ) - MULTIQC ( FASTQC.out.zip.collect { it[1] } ) + MULTIQC ( FASTQC.out.zip.collect { it[1] }, [[],[]] ) } workflow test_multiqc_fn_collision { @@ -27,5 +27,5 @@ workflow test_multiqc_fn_collision { FASTQC2 ( fqc_input ) mqc_input = mqc_input.mix(FASTQC2.out.zip.collect { it[1] }) - MULTIQC ( mqc_input ) + MULTIQC ( mqc_input, [[],[]] ) } From f1e33ca6e0d7d40fda3f78822b7789c6c13eb21c Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:02:04 +0200 Subject: [PATCH 4/8] update mqc command --- modules/multiqc/main.nf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index df68d853..de4de537 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -8,7 +8,7 @@ process MULTIQC { input: path multiqc_files, stageAs: "?/*" - tuple path(mqc_config), path(mqc_logo) + tuple path(multiqc_config), path(multiqc_logo) output: path "*multiqc_report.html", emit: report @@ -21,8 +21,13 @@ process MULTIQC { script: def args = task.ext.args ?: '' + def config = multiqc_config ?: '--config $multiqc_config' """ - multiqc -f $args . + multiqc \ + --force \ + $config \ + $args \ + . cat <<-END_VERSIONS > versions.yml "${task.process}": From 100b3f244c1dced5a6fa74af77829d7ef759e648 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:24:55 +0200 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Mahesh Binzer-Panchal --- modules/multiqc/main.nf | 2 +- tests/modules/multiqc/main.nf | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index de4de537..52069c21 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -21,7 +21,7 @@ process MULTIQC { script: def args = task.ext.args ?: '' - def config = multiqc_config ?: '--config $multiqc_config' + def config = multiqc_config ?: "--config $multiqc_config" """ multiqc \ --force \ diff --git a/tests/modules/multiqc/main.nf b/tests/modules/multiqc/main.nf index e015cbc3..236d8ad0 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -16,9 +16,10 @@ workflow test_multiqc { } workflow test_multiqc_fn_collision { - fqc_input = [ [ id: 'test', single_end: false ], - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] - ] + fqc_input = [ + [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ] mqc_input = Channel.empty() FASTQC ( fqc_input ) From 7b018acabbdf4ab893e7a7d9f321f6e87748cb02 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:36:13 +0200 Subject: [PATCH 6/8] Update modules/multiqc/main.nf Co-authored-by: Mahesh Binzer-Panchal --- modules/multiqc/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index 52069c21..6960bd4c 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -21,7 +21,7 @@ process MULTIQC { script: def args = task.ext.args ?: '' - def config = multiqc_config ?: "--config $multiqc_config" + def config = multiqc_config ? "--config $multiqc_config" : '' """ multiqc \ --force \ From e5f8924fabf4c8380f55fb7aee89fd2c268161b1 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:41:10 +0200 Subject: [PATCH 7/8] Update modules/multiqc/main.nf Co-authored-by: Mahesh Binzer-Panchal --- modules/multiqc/main.nf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index 6960bd4c..b0831b5d 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -23,10 +23,10 @@ process MULTIQC { def args = task.ext.args ?: '' def config = multiqc_config ? "--config $multiqc_config" : '' """ - multiqc \ - --force \ - $config \ - $args \ + multiqc \\ + --force \\ + $config \\ + $args \\ . cat <<-END_VERSIONS > versions.yml From c005a5e00777d577d661e1c2a81a779de1bda3fc Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:42:58 +0200 Subject: [PATCH 8/8] formatting --- tests/modules/multiqc/main.nf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/modules/multiqc/main.nf b/tests/modules/multiqc/main.nf index 236d8ad0..6c21d061 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -7,16 +7,17 @@ include { FASTQC as FASTQC2 } from '../../../modules/fastqc/main.nf' include { MULTIQC } from '../../../modules/multiqc/main.nf' workflow test_multiqc { - input = [ [ id: 'test', single_end: false ], - [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] - ] + input = [ + [ id: 'test', single_end: false ], + [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] + ] FASTQC ( input ) MULTIQC ( FASTQC.out.zip.collect { it[1] }, [[],[]] ) } workflow test_multiqc_fn_collision { - fqc_input = [ + fqc_input = [ [ id: 'test', single_end: false ], [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)] ]