Apply suggestions from code review by @drpatelh

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Abhinav Sharma 2020-12-08 18:57:14 +05:30 committed by GitHub
parent 5949bfc15b
commit b56a0322ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 16 deletions

View file

@ -5,28 +5,28 @@ params.options = [:]
def options = initOptions(params.options) def options = initOptions(params.options)
process MULTIQC { process MULTIQC {
tag "multiqc"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename: filename, options: params.options, publish_dir: getSoftwareName(task.process), publish_id: '') } 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" container "quay.io/biocontainers/multiqc:1.9--pyh9f0ad1d_0"
input: input:
path multiqc_config path multiqc_files
path multiqc_custom_config
path('fastqc/*')
output: output:
path "*multiqc_report.html", emit: report path "*multiqc_report.html", emit: report
path "*_data", emit: data path "*_data" , emit: data
path "*_plots", optional: true, emit: plots path "*_plots" , optional:true, emit: plots
path "*.version.txt" , emit: version
script: script:
def software = getSoftwareName(task.process)
def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : '' def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : ''
""" """
multiqc -f $options.args $custom_config . multiqc -f $options.args $custom_config .
multiqc --version | sed -e "s/multiqc, version //g" > ${software}.version.txt
""" """
} }

View file

@ -28,16 +28,16 @@ params:
Run the module with Conda using the software specified Run the module with Conda using the software specified
via the `conda` directive via the `conda` directive
input: input:
- generic_report: - multiqc_files:
type: file type: file
description: | 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: output:
- dir: - data:
type: dir type: dir
description: MultiQC data dir description: MultiQC data dir
pattern: "multiqc_data" pattern: "multiqc_data"
- html: - report:
type: file type: file
description: MultiQC report file description: MultiQC report file
pattern: "multiqc_report.html" pattern: "multiqc_report.html"

View file

@ -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']) 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_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 { workflow test_multiqc {
test_paired_end() test_paired_end()
input = [ input = [
ch_multiqc_config, ch_multiqc_config
ch_multiqc_custom_config.collect().ifEmpty([]), .mix(test_paired_end.out.zip.collect { it[1] }.ifEmpty([]))
test_paired_end.out.zip.collect { it[1] }.ifEmpty([])
] ]
MULTIQC(*input) MULTIQC(*input)