From b56a0322ab984cd4bdfeebb507c55a91904de9b4 Mon Sep 17 00:00:00 2001 From: Abhinav Sharma Date: Tue, 8 Dec 2020 18:57:14 +0530 Subject: [PATCH] Apply suggestions from code review by @drpatelh Co-authored-by: Harshil Patel --- software/multiqc/main.nf | 14 +++++++------- software/multiqc/meta.yml | 8 ++++---- tests/software/fastqc/main.nf | 2 +- tests/software/multiqc/main.nf | 6 ++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/software/multiqc/main.nf b/software/multiqc/main.nf index b682b583..80dfb0c5 100644 --- a/software/multiqc/main.nf +++ b/software/multiqc/main.nf @@ -5,28 +5,28 @@ params.options = [:] def options = initOptions(params.options) process MULTIQC { - tag "multiqc" label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename: filename, options: params.options, publish_dir: getSoftwareName(task.process), publish_id: '') } - conda(params.enable_conda ? "bioconda::multiqc=1.9" : null) + conda (params.enable_conda ? "bioconda::multiqc=1.9" : null) container "quay.io/biocontainers/multiqc:1.9--pyh9f0ad1d_0" input: - path multiqc_config - path multiqc_custom_config - path('fastqc/*') + path multiqc_files output: path "*multiqc_report.html", emit: report - path "*_data", emit: data - path "*_plots", optional: true, emit: plots + path "*_data" , emit: data + path "*_plots" , optional:true, emit: plots + path "*.version.txt" , emit: version script: + def software = getSoftwareName(task.process) def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : '' """ multiqc -f $options.args $custom_config . + multiqc --version | sed -e "s/multiqc, version //g" > ${software}.version.txt """ } diff --git a/software/multiqc/meta.yml b/software/multiqc/meta.yml index 9d2c2dde..4fac4394 100644 --- a/software/multiqc/meta.yml +++ b/software/multiqc/meta.yml @@ -28,16 +28,16 @@ params: Run the module with Conda using the software specified via the `conda` directive input: - - generic_report: + - multiqc_files: type: file description: | - List of report, for example the html and zip output of FastQC + List of reports / files recognised by MultiQC, for example the html and zip output of FastQC output: - - dir: + - data: type: dir description: MultiQC data dir pattern: "multiqc_data" - - html: + - report: type: file description: MultiQC report file pattern: "multiqc_report.html" diff --git a/tests/software/fastqc/main.nf b/tests/software/fastqc/main.nf index 7885c903..27411a17 100644 --- a/tests/software/fastqc/main.nf +++ b/tests/software/fastqc/main.nf @@ -31,6 +31,6 @@ workflow test_paired_end { emit: html = FASTQC_PE.out.html - zip = FASTQC_PE.out.zip + zip = FASTQC_PE.out.zip } diff --git a/tests/software/multiqc/main.nf b/tests/software/multiqc/main.nf index 8bc429c6..ab25e8c3 100644 --- a/tests/software/multiqc/main.nf +++ b/tests/software/multiqc/main.nf @@ -6,15 +6,13 @@ include { MULTIQC } from '../../../software/multiqc/main.nf' addParams(options: include { test_paired_end } from '../fastqc/main.nf' addParams(options: [publish_dir: 'test_paired_end']) ch_multiqc_config = file("$launchDir/tests/software/multiqc/multiqc_config.yml", checkIfExists: true) -ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config) : Channel.empty() workflow test_multiqc { test_paired_end() input = [ - ch_multiqc_config, - ch_multiqc_custom_config.collect().ifEmpty([]), - test_paired_end.out.zip.collect { it[1] }.ifEmpty([]) + ch_multiqc_config + .mix(test_paired_end.out.zip.collect { it[1] }.ifEmpty([])) ] MULTIQC(*input)