diff --git a/modules/nf-core/clippy/main.nf b/modules/nf-core/clippy/main.nf index d8ce862689f9..5c6a1dfda8fc 100644 --- a/modules/nf-core/clippy/main.nf +++ b/modules/nf-core/clippy/main.nf @@ -37,4 +37,18 @@ process CLIPPY { clippy: \$(clippy -v) END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_Peaks.bed + touch ${prefix}_Summits.bed + touch ${prefix}_intergenic_regions.gtf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + clippy: \$(clippy -v) + END_VERSIONS + """ + } diff --git a/modules/nf-core/clippy/tests/main.nf.test b/modules/nf-core/clippy/tests/main.nf.test new file mode 100644 index 000000000000..7ae795aee9ca --- /dev/null +++ b/modules/nf-core/clippy/tests/main.nf.test @@ -0,0 +1,90 @@ +nextflow_process { + + name "Test Process CLIPPY" + script "../main.nf" + process "CLIPPY" + + tag "modules" + tag "modules_nfcore" + tag "clippy" + + test("non-intergenic") { + + config "./nextflow.config" + + when { + params { + module_args = '-inter 3' + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chr21_gencode.gtf', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("intergenic") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chr21_gencode.gtf', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("non-intergenic - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [] + ] + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/clippy/tests/main.nf.test.snap b/modules/nf-core/clippy/tests/main.nf.test.snap new file mode 100644 index 000000000000..b11068a2a237 --- /dev/null +++ b/modules/nf-core/clippy/tests/main.nf.test.snap @@ -0,0 +1,177 @@ +{ + "non-intergenic - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_Peaks.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_Summits.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test_intergenic_regions.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ], + "intergenic_gtf": [ + [ + { + "id": "test" + }, + "test_intergenic_regions.gtf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "peaks": [ + [ + { + "id": "test" + }, + "test_Peaks.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summits": [ + [ + { + "id": "test" + }, + "test_Summits.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T16:59:22.78408481" + }, + "non-intergenic": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ], + "intergenic_gtf": [ + + ], + "peaks": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c" + ] + ], + "summits": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba" + ] + ], + "versions": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T16:58:19.283343973" + }, + "intergenic": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ], + "intergenic_gtf": [ + + ], + "peaks": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed:md5,d793b0bafe5478207bfe80dd635a215c" + ] + ], + "summits": [ + [ + { + "id": "test" + }, + "test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed:md5,afc2143816a8ae91329d7e557a91eeba" + ] + ], + "versions": [ + "versions.yml:md5,b9f94c70bed994e77aa7feccaa25aff5" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T16:59:13.088102108" + } +} \ No newline at end of file diff --git a/modules/nf-core/clippy/tests/nextflow.config b/modules/nf-core/clippy/tests/nextflow.config new file mode 100644 index 000000000000..1426c14deb08 --- /dev/null +++ b/modules/nf-core/clippy/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'CLIPPY_INTERGENIC' { + ext.args = params.module_args + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 1f7d49a8ed71..e68fc24b5da7 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -76,9 +76,6 @@ cellrangeratac/mkfastq: cellrangeratac/mkref: - modules/nf-core/cellrangeratac/mkref/** - tests/modules/nf-core/cellrangeratac/mkref/** -clippy: - - modules/nf-core/clippy/** - - tests/modules/nf-core/clippy/** cnvnator/cnvnator: - modules/nf-core/cnvnator/cnvnator/** - tests/modules/nf-core/cnvnator/cnvnator/** diff --git a/tests/modules/nf-core/clippy/main.nf b/tests/modules/nf-core/clippy/main.nf deleted file mode 100644 index f4cf9225fea0..000000000000 --- a/tests/modules/nf-core/clippy/main.nf +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CLIPPY as CLIPPY_NON_INTERGENIC } from '../../../../modules/nf-core/clippy/main.nf' -include { CLIPPY as CLIPPY_INTERGENIC } from '../../../../modules/nf-core/clippy/main.nf' - -workflow test_clippy { - - input = [ - [ id:'test' ], // meta map - file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true) - ] - - CLIPPY_NON_INTERGENIC ( - input, - file(params.test_data['homo_sapiens']['genome']['genome_21_gencode_gtf'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) - ) -} - -workflow test_clippy_intergenic { - - input = [ - [ id:'test' ], // meta map - file("https://raw.githubusercontent.com/nf-core/test-datasets/clipseq/crosslinks/clippy.bed", checkIfExists: true) - ] - - CLIPPY_INTERGENIC ( - input, - file(params.test_data['homo_sapiens']['genome']['genome_21_gencode_gtf'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) - ) -} \ No newline at end of file diff --git a/tests/modules/nf-core/clippy/nextflow.config b/tests/modules/nf-core/clippy/nextflow.config deleted file mode 100644 index df562787ee7f..000000000000 --- a/tests/modules/nf-core/clippy/nextflow.config +++ /dev/null @@ -1,10 +0,0 @@ -process { - withName: 'CLIPPY_NON_INTERGENIC' { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - } - - withName: 'CLIPPY_INTERGENIC' { - ext.args = { "-inter 3" } - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - } -} \ No newline at end of file diff --git a/tests/modules/nf-core/clippy/test.yml b/tests/modules/nf-core/clippy/test.yml deleted file mode 100644 index 51df2484c799..000000000000 --- a/tests/modules/nf-core/clippy/test.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: clippy test_clippy - command: nextflow run ./tests/modules/nf-core/clippy -entry test_clippy -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/clippy/nextflow.config - tags: - - clippy - files: - - path: output/clippy/test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed - md5sum: d793b0bafe5478207bfe80dd635a215c - - path: output/clippy/test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed - md5sum: afc2143816a8ae91329d7e557a91eeba - - path: output/clippy/versions.yml - -- name: clippy test_clippy_intergenic - command: nextflow run ./tests/modules/nf-core/clippy -entry test_clippy_intergenic -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/clippy/nextflow.config - tags: - - clippy - files: - - path: output/clippy/test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Peaks.bed - md5sum: d793b0bafe5478207bfe80dd635a215c - - path: output/clippy/test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_Summits.bed - md5sum: afc2143816a8ae91329d7e557a91eeba - - path: output/clippy/test_rollmean10_minHeightAdjust1.0_minPromAdjust1.0_minGeneCount5_intergenic_regions.gtf - md5sum: 3cb78f0e1822e089bc85393df1d1327b - - path: output/clippy/versions.yml