From 5fd3ba3ce623bad0d3d82bb4357ae539a6d0ab49 Mon Sep 17 00:00:00 2001 From: Abhinav Sharma Date: Wed, 2 Dec 2020 12:38:41 +0530 Subject: [PATCH] Update the tests for MultiQC --- .github/workflows/multiqc.yml | 9 ++++++++- software/multiqc/main.nf | 22 ++++++++++------------ tests/software/multiqc/main.nf | 8 ++++---- tests/software/multiqc/test.yml | 5 +---- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/multiqc.yml b/.github/workflows/multiqc.yml index 542d3317..1c45d5bd 100644 --- a/.github/workflows/multiqc.yml +++ b/.github/workflows/multiqc.yml @@ -26,5 +26,12 @@ jobs: wget -qO- get.nextflow.io | bash sudo mv nextflow /usr/local/bin/ + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install --upgrade pip pytest-workflow + # Test the module - - run: nextflow run ./software/multiqc/test/ -profile docker + - run: pytest --tag multiqc --symlink --wt 2 \ No newline at end of file diff --git a/software/multiqc/main.nf b/software/multiqc/main.nf index a577a299..0e2ba0c9 100644 --- a/software/multiqc/main.nf +++ b/software/multiqc/main.nf @@ -2,31 +2,29 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] -def options = initOptions(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:'') } + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') } - conda(params.enable_conda ? "bioconda::multiqc=1.9" : null) - container "quay.io/biocontainers/multiqc:1.9--py_1" + conda (params.enable_conda ? "bioconda::multiqc=1.9" : null) + container "quay.io/biocontainers/multiqc:1.9--pyh9f0ad1d_0" input: - path(generic_report) + tuple val(meta), path(reads) + output: - path "multiqc_data", emit: dir - path "multiqc_report.html", emit: html - path "*.version.txt", emit: version + path "*multiqc_report.html", emit: report + path "*_data" , emit: data + path "*_plots" , optional:true, emit: plots script: - def software = getSoftwareName(task.process) - """ - multiqc . - multiqc --version | sed -e "s/multiqc, version //g" > ${software}.version.txt + multiqc -f $options.args . """ } diff --git a/tests/software/multiqc/main.nf b/tests/software/multiqc/main.nf index 54fb78ed..9ff15f27 100644 --- a/tests/software/multiqc/main.nf +++ b/tests/software/multiqc/main.nf @@ -10,10 +10,10 @@ workflow test_multiqc { def input = [] input = [[id: 'test'], // meta map - [file("${launchDir}/tests/data/fastqc/test_1.fastq.html", checkIfExists: true), - file("${launchDir}/tests/data/fastqc/test_1.fastq.zip", checkIfExists: true), - file("${launchDir}/tests/data/fastqc/test_2.fastq.html", checkIfExists: true), - file("${launchDir}/tests/data/fastqc/test_2.fastq.zip", checkIfExists: true)]] + [file("${launchDir}/tests/data/fastqc/test_1_fastqc.html", checkIfExists: true), + file("${launchDir}/tests/data/fastqc/test_1_fastqc.zip", checkIfExists: true), + file("${launchDir}/tests/data/fastqc/test_2_fastqc.html", checkIfExists: true), + file("${launchDir}/tests/data/fastqc/test_2_fastqc.zip", checkIfExists: true)]] MULTIQC(input) } diff --git a/tests/software/multiqc/test.yml b/tests/software/multiqc/test.yml index 664b524e..6b1a198b 100644 --- a/tests/software/multiqc/test.yml +++ b/tests/software/multiqc/test.yml @@ -3,7 +3,4 @@ tags: - multiqc files: - - path: output/test_multiqc/test_fastqc.html - md5sum: 7027e72c3e55292c1567f12e02565e3b - - path: output/test_multiqc/test_fastqc.html - md5sum: 7027e72c3e55292c1567f12e02565e3b + - path: output/test_multiqc/multiqc_report.html