From 9530ba667bb6c809d998fb9bd567bb9514cb23e5 Mon Sep 17 00:00:00 2001 From: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:40:11 +0530 Subject: [PATCH] pangolin - use seqera containers + nf-test; rm pytests (#6740) * use seqera containers + nf-test; rm pytests * Update modules/nf-core/pangolin/main.nf Co-authored-by: Joon Klaps * update snapshots * fix home path sing & update conda env * Fixing the meta.yml and pining pangolin-data --------- Co-authored-by: Joon Klaps --- modules/nf-core/pangolin/environment.yml | 4 +- modules/nf-core/pangolin/main.nf | 6 +- modules/nf-core/pangolin/meta.yml | 8 +-- modules/nf-core/pangolin/tests/main.nf.test | 57 ++++++++++++++++ .../nf-core/pangolin/tests/main.nf.test.snap | 68 +++++++++++++++++++ tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/pangolin/main.nf | 12 ---- .../modules/nf-core/pangolin/nextflow.config | 5 -- tests/modules/nf-core/pangolin/test.yml | 7 -- 9 files changed, 136 insertions(+), 34 deletions(-) create mode 100644 modules/nf-core/pangolin/tests/main.nf.test create mode 100644 modules/nf-core/pangolin/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/pangolin/main.nf delete mode 100644 tests/modules/nf-core/pangolin/nextflow.config delete mode 100644 tests/modules/nf-core/pangolin/test.yml diff --git a/modules/nf-core/pangolin/environment.yml b/modules/nf-core/pangolin/environment.yml index 4fcf2f1f85a..d4379368c85 100644 --- a/modules/nf-core/pangolin/environment.yml +++ b/modules/nf-core/pangolin/environment.yml @@ -2,4 +2,6 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::pangolin=4.2 + - bioconda::pangolin-data=1.30 + - bioconda::pangolin=4.3 + - bioconda::snakemake=7.30.1 diff --git a/modules/nf-core/pangolin/main.nf b/modules/nf-core/pangolin/main.nf index 00cf42909d1..08200de2cea 100644 --- a/modules/nf-core/pangolin/main.nf +++ b/modules/nf-core/pangolin/main.nf @@ -4,8 +4,8 @@ process PANGOLIN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pangolin:4.2--pyhdfd78af_1' : - 'biocontainers/pangolin:4.2--pyhdfd78af_1' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/bb/bb7bac48e43a9cd6274e1f99c761a5785b74f6d8a55313ee634aaffbe87c1869/data' : + 'community.wave.seqera.io/library/pangolin-data_pangolin_snakemake:5bbc297f7502ff33' }" input: tuple val(meta), path(fasta) @@ -21,6 +21,8 @@ process PANGOLIN { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ + export XDG_CACHE_HOME=/tmp/.cache + pangolin \\ $fasta\\ --outfile ${prefix}.pangolin.csv \\ diff --git a/modules/nf-core/pangolin/meta.yml b/modules/nf-core/pangolin/meta.yml index 9220aefc145..78713c13221 100644 --- a/modules/nf-core/pangolin/meta.yml +++ b/modules/nf-core/pangolin/meta.yml @@ -5,7 +5,7 @@ keywords: - pangolin - lineage tools: - - star: + - pangolin: description: | Phylogenetic Assignment of Named Global Outbreak LINeages homepage: https://github.com/cov-lineages/pangolin#pangolearn-description @@ -24,9 +24,9 @@ input: output: - report: - meta: - type: file - description: Pangolin lineage report - pattern: "*.{csv}" + type: map + description: | + Groovy Map containing sample information - "*.csv": type: file description: Pangolin lineage report diff --git a/modules/nf-core/pangolin/tests/main.nf.test b/modules/nf-core/pangolin/tests/main.nf.test new file mode 100644 index 00000000000..1ee097e3c74 --- /dev/null +++ b/modules/nf-core/pangolin/tests/main.nf.test @@ -0,0 +1,57 @@ +nextflow_process { + + name "Test Process PANGOLIN" + script "../main.nf" + process "PANGOLIN" + + tag "modules" + tag "modules_nfcore" + tag "pangolin" + + test("sarscov2 genome [fasta]") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 genome [fasta] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/pangolin/tests/main.nf.test.snap b/modules/nf-core/pangolin/tests/main.nf.test.snap new file mode 100644 index 00000000000..681a4783686 --- /dev/null +++ b/modules/nf-core/pangolin/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "sarscov2 genome [fasta] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + ] + ], + "1": [ + "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + ], + "report": [ + [ + { + "id": "test" + }, + "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + ] + ], + "versions": [ + "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-18T10:33:48.797026222" + }, + "sarscov2 genome [fasta]": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + ] + ], + "1": [ + "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + ], + "report": [ + [ + { + "id": "test" + }, + "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + ] + ], + "versions": [ + "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-18T10:33:17.535254436" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 584db480a14..e40cb75442f 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -476,9 +476,6 @@ nucmer: oncocnv: - modules/nf-core/oncocnv/** - tests/modules/nf-core/oncocnv/** -pangolin: - - modules/nf-core/pangolin/** - - tests/modules/nf-core/pangolin/** parabricks/applybqsr: - modules/nf-core/parabricks/applybqsr/** - tests/modules/nf-core/parabricks/applybqsr/** diff --git a/tests/modules/nf-core/pangolin/main.nf b/tests/modules/nf-core/pangolin/main.nf deleted file mode 100644 index 6bed60ae0d7..00000000000 --- a/tests/modules/nf-core/pangolin/main.nf +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PANGOLIN } from '../../../../modules/nf-core/pangolin/main.nf' - -workflow test_pangolin { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] ] - - PANGOLIN ( input ) -} diff --git a/tests/modules/nf-core/pangolin/nextflow.config b/tests/modules/nf-core/pangolin/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/pangolin/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/pangolin/test.yml b/tests/modules/nf-core/pangolin/test.yml deleted file mode 100644 index 2b24c99d430..00000000000 --- a/tests/modules/nf-core/pangolin/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: pangolin - command: nextflow run ./tests/modules/nf-core/pangolin -entry test_pangolin -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pangolin/nextflow.config - tags: - - pangolin - files: - - path: ./output/pangolin/test.pangolin.csv - md5sum: 5913b1fc7645798ab7be31e9029c5f7e