diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index ae019dbf..b0831b5d 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 multiqc_files + path multiqc_files, stageAs: "?/*" + tuple path(multiqc_config), path(multiqc_logo) output: path "*multiqc_report.html", emit: report @@ -20,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}": 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 43643985..6c21d061 100644 --- a/tests/modules/multiqc/main.nf +++ b/tests/modules/multiqc/main.nf @@ -2,15 +2,32 @@ 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) ] - ] + 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] } ) + 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: