From aae680b9401b985ac61349ce75a6ec784c50bce3 Mon Sep 17 00:00:00 2001 From: Hyun-Hwan Jeong Date: Wed, 14 May 2025 14:09:24 -0500 Subject: [PATCH 1/3] add nf-test for purgedups/calcuts. Closes #7671 --- modules/nf-core/purgedups/calcuts/meta.yml | 5 ++ .../purgedups/calcuts/tests/main.nf.test | 46 +++++++++++++++++ .../purgedups/calcuts/tests/main.nf.test.snap | 51 +++++++++++++++++++ tests/config/pytest_modules.yml | 3 -- .../modules/nf-core/purgedups/calcuts/main.nf | 17 ------- .../nf-core/purgedups/calcuts/nextflow.config | 9 ---- .../nf-core/purgedups/calcuts/test.yml | 10 ---- 7 files changed, 102 insertions(+), 39 deletions(-) create mode 100644 modules/nf-core/purgedups/calcuts/tests/main.nf.test create mode 100644 modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/purgedups/calcuts/main.nf delete mode 100644 tests/modules/nf-core/purgedups/calcuts/nextflow.config delete mode 100644 tests/modules/nf-core/purgedups/calcuts/test.yml diff --git a/modules/nf-core/purgedups/calcuts/meta.yml b/modules/nf-core/purgedups/calcuts/meta.yml index 4c236d65227..690710545e5 100644 --- a/modules/nf-core/purgedups/calcuts/meta.yml +++ b/modules/nf-core/purgedups/calcuts/meta.yml @@ -24,6 +24,7 @@ input: type: file description: Histogram of coverage pattern: "*.stat" + ontologies: [] output: - cutoff: - meta: @@ -35,6 +36,7 @@ output: type: file description: Cutoff file pattern: "*.cutoffs" + ontologies: [] - log: - meta: type: map @@ -45,11 +47,14 @@ output: type: file description: Log file pattern: ".calcuts.log" + ontologies: [] - versions: - versions.yml: type: file description: File containing software versions pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@mahesh-panchal" maintainers: diff --git a/modules/nf-core/purgedups/calcuts/tests/main.nf.test b/modules/nf-core/purgedups/calcuts/tests/main.nf.test new file mode 100644 index 00000000000..81aed5e7b4a --- /dev/null +++ b/modules/nf-core/purgedups/calcuts/tests/main.nf.test @@ -0,0 +1,46 @@ +nextflow_process { + + name "Test Process PURGEDUPS_CALCUTS" + script "../main.nf" + process "PURGEDUPS_CALCUTS" + + tag "modules" + tag "modules_nfcore" + tag "purgedups" + tag "purgedups/pbcstat" + tag "purgedups/calcuts" + + test("test_purgedups_calcuts") { + + setup { + run("PURGEDUPS_PBCSTAT") { + script "../../pbcstat/main.nf" + + process { + """ + input[0] = [ + [id:'test'],// meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf',checkIfExists:true) + ] + """ + } + } + } + when { + params { + module_args = '' + } + process { + """ + input[0] = PURGEDUPS_PBCSTAT.out.stat + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap b/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap new file mode 100644 index 00000000000..826efc2c1a6 --- /dev/null +++ b/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap @@ -0,0 +1,51 @@ +{ + "test_purgedups_calcuts": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.cutoffs:md5,e13542222f6e6e4e0d87754956641008" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.calcuts.log:md5,04053f23b4dbb7947e8b2cb820ca6681" + ] + ], + "2": [ + "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde" + ], + "cutoff": [ + [ + { + "id": "test" + }, + "test.cutoffs:md5,e13542222f6e6e4e0d87754956641008" + ] + ], + "log": [ + [ + { + "id": "test" + }, + "test.calcuts.log:md5,04053f23b4dbb7947e8b2cb820ca6681" + ] + ], + "versions": [ + "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.2" + }, + "timestamp": "2025-05-14T14:07:01.617419051" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 37357c0ae6d..6bef20ee58a 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -64,9 +64,6 @@ pretextsnapshot: propr/logratio: - modules/nf-core/propr/logratio/** - tests/modules/nf-core/propr/logratio/** -purgedups/calcuts: - - modules/nf-core/purgedups/calcuts/** - - tests/modules/nf-core/purgedups/calcuts/** purgedups/getseqs: - modules/nf-core/purgedups/getseqs/** - tests/modules/nf-core/purgedups/getseqs/** diff --git a/tests/modules/nf-core/purgedups/calcuts/main.nf b/tests/modules/nf-core/purgedups/calcuts/main.nf deleted file mode 100644 index 8749ec91aa4..00000000000 --- a/tests/modules/nf-core/purgedups/calcuts/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PURGEDUPS_PBCSTAT } from '../../../../../modules/nf-core/purgedups/pbcstat/main.nf' -include { PURGEDUPS_CALCUTS } from '../../../../../modules/nf-core/purgedups/calcuts/main.nf' - -workflow test_purgedups_calcuts { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_paf'], checkIfExists: true) - ] - - PURGEDUPS_PBCSTAT ( input ) - PURGEDUPS_CALCUTS ( PURGEDUPS_PBCSTAT.out.stat ) -} diff --git a/tests/modules/nf-core/purgedups/calcuts/nextflow.config b/tests/modules/nf-core/purgedups/calcuts/nextflow.config deleted file mode 100644 index ff8606d207e..00000000000 --- a/tests/modules/nf-core/purgedups/calcuts/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'PURGEDUPS_PBCSTAT' { - publishDir = [ enabled: false ] - } - -} diff --git a/tests/modules/nf-core/purgedups/calcuts/test.yml b/tests/modules/nf-core/purgedups/calcuts/test.yml deleted file mode 100644 index 65cefbe9f55..00000000000 --- a/tests/modules/nf-core/purgedups/calcuts/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: purgedups calcuts test_purgedups_calcuts - command: nextflow run ./tests/modules/nf-core/purgedups/calcuts -entry test_purgedups_calcuts -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/purgedups/calcuts/nextflow.config - tags: - - purgedups/calcuts - - purgedups - files: - - path: output/purgedups/test.calcuts.log - md5sum: 04053f23b4dbb7947e8b2cb820ca6681 - - path: output/purgedups/test.cutoffs - md5sum: e13542222f6e6e4e0d87754956641008 From f5b02199d0ba27764ba7e0b8783dd94af0c8b585 Mon Sep 17 00:00:00 2001 From: Hyun-Hwan Jeong Date: Wed, 14 May 2025 15:09:15 -0500 Subject: [PATCH 2/3] nf-test migration for purgedups/getseqs. Closes #7672. --- modules/nf-core/purgedups/getseqs/meta.yml | 6 ++++++ tests/config/pytest_modules.yml | 3 --- tests/modules/nf-core/purgedups/getseqs/main.nf | 17 ----------------- .../nf-core/purgedups/getseqs/nextflow.config | 5 ----- .../modules/nf-core/purgedups/getseqs/test.yml | 10 ---------- 5 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 tests/modules/nf-core/purgedups/getseqs/main.nf delete mode 100644 tests/modules/nf-core/purgedups/getseqs/nextflow.config delete mode 100644 tests/modules/nf-core/purgedups/getseqs/test.yml diff --git a/modules/nf-core/purgedups/getseqs/meta.yml b/modules/nf-core/purgedups/getseqs/meta.yml index 41d85b64970..2363449d89d 100644 --- a/modules/nf-core/purgedups/getseqs/meta.yml +++ b/modules/nf-core/purgedups/getseqs/meta.yml @@ -25,10 +25,12 @@ input: type: file description: Draft assembly in fasta format pattern: "*.fasta" + ontologies: [] - bed: type: file description: Bed file listing duplicated sequences, produced by PURGEDUPS_PURGEDUPS pattern: "*.bed" + ontologies: [] output: - haplotigs: - meta: @@ -40,6 +42,7 @@ output: type: file description: Fasta file containing purged haplotigs pattern: "*.hap.fa" + ontologies: [] - purged: - meta: type: map @@ -50,11 +53,14 @@ output: type: file description: Fasta file purged of duplicated haplotigs pattern: "*.purged.fa" + ontologies: [] - versions: - versions.yml: type: file description: File containing software versions pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@mahesh-panchal" maintainers: diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4d60144fdc4..8577f7f936f 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -58,9 +58,6 @@ pretextsnapshot: propr/logratio: - modules/nf-core/propr/logratio/** - tests/modules/nf-core/propr/logratio/** -purgedups/getseqs: - - modules/nf-core/purgedups/getseqs/** - - tests/modules/nf-core/purgedups/getseqs/** purgedups/histplot: - modules/nf-core/purgedups/histplot/** - tests/modules/nf-core/purgedups/histplot/** diff --git a/tests/modules/nf-core/purgedups/getseqs/main.nf b/tests/modules/nf-core/purgedups/getseqs/main.nf deleted file mode 100644 index 7db512a24f5..00000000000 --- a/tests/modules/nf-core/purgedups/getseqs/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PURGEDUPS_GETSEQS } from '../../../../../modules/nf-core/purgedups/getseqs/main.nf' - -workflow test_purgedups_getseqs { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - // Custom purge dups bed - params.test_data['sarscov2']['genome']['test_bed'] causes seg fault - ch_bed = Channel.value("MT192765.1\n0\t29828\tJUNK\n").collectFile(name: 'test.bed' ).map { bed -> [ input[0], bed ]} - - PURGEDUPS_GETSEQS ( Channel.value(input).join(ch_bed) ) -} diff --git a/tests/modules/nf-core/purgedups/getseqs/nextflow.config b/tests/modules/nf-core/purgedups/getseqs/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/purgedups/getseqs/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/purgedups/getseqs/test.yml b/tests/modules/nf-core/purgedups/getseqs/test.yml deleted file mode 100644 index 6047893d0ef..00000000000 --- a/tests/modules/nf-core/purgedups/getseqs/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: purgedups getseqs test_purgedups_getseqs - command: nextflow run ./tests/modules/nf-core/purgedups/getseqs -entry test_purgedups_getseqs -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/purgedups/getseqs/nextflow.config - tags: - - purgedups - - purgedups/getseqs - files: - - path: output/purgedups/test.hap.fa - - path: output/purgedups/test.purged.fa - md5sum: 70d0b87ecc04353767b1a713992f00fe - - path: output/purgedups/versions.yml From 8916970c54e489b8887f2c30915b4fbf180769f5 Mon Sep 17 00:00:00 2001 From: Hyun-Hwan Jeong Date: Tue, 20 May 2025 21:28:58 -0500 Subject: [PATCH 3/3] Update modules/nf-core/purgedups/calcuts/tests/main.nf.test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> --- modules/nf-core/purgedups/calcuts/tests/main.nf.test | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/nf-core/purgedups/calcuts/tests/main.nf.test b/modules/nf-core/purgedups/calcuts/tests/main.nf.test index 81aed5e7b4a..5844990eb33 100644 --- a/modules/nf-core/purgedups/calcuts/tests/main.nf.test +++ b/modules/nf-core/purgedups/calcuts/tests/main.nf.test @@ -27,9 +27,6 @@ nextflow_process { } } when { - params { - module_args = '' - } process { """ input[0] = PURGEDUPS_PBCSTAT.out.stat