diff --git a/modules/nf-core/barrnap/main.nf b/modules/nf-core/barrnap/main.nf index cd1143c9476..b99573d75f0 100644 --- a/modules/nf-core/barrnap/main.nf +++ b/modules/nf-core/barrnap/main.nf @@ -32,7 +32,7 @@ process BARRNAP { --threads $task.cpus \\ --kingdom $db \\ $input \\ - > rrna_${db}.gff + > ${prefix}_${db}.gff cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -44,9 +44,9 @@ process BARRNAP { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - + db = dbname ? "${dbname}" : 'bac' """ - touch ${prefix}.gff + touch ${prefix}_${db}.gff cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/barrnap/meta.yml b/modules/nf-core/barrnap/meta.yml index 3aaf407abb1..a683e712383 100644 --- a/modules/nf-core/barrnap/meta.yml +++ b/modules/nf-core/barrnap/meta.yml @@ -12,7 +12,7 @@ tools: homepage: "https://github.com/tseemann/barrnap" documentation: "https://github.com/tseemann/barrnap" tool_dev_url: "https://github.com/tseemann/barrnap" - licence: "['GPL v3']" + licence: ["GPL v3"] input: - meta: type: map @@ -23,6 +23,9 @@ input: type: file description: fastq or fasta file nucleotides (it can be amino acids as well) pattern: "*.{fna,fasta,faa,fastq}" + - dbname: + type: string + description: database to use(bacteria, archaea, eukaryota, metazoan mitochondria) output: - meta: type: map diff --git a/modules/nf-core/barrnap/tests/main.nf.test b/modules/nf-core/barrnap/tests/main.nf.test new file mode 100644 index 00000000000..5e60932015d --- /dev/null +++ b/modules/nf-core/barrnap/tests/main.nf.test @@ -0,0 +1,57 @@ +nextflow_process { + + name "Test Process BARRNAP" + script "../main.nf" + process "BARRNAP" + tag "modules" + tag "modules_nfcore" + tag "barrnap" + + test("barrnap") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true), + "bac" + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("barrnap - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true), + "bac" + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} + + diff --git a/modules/nf-core/barrnap/tests/main.nf.test.snap b/modules/nf-core/barrnap/tests/main.nf.test.snap new file mode 100644 index 00000000000..0964a0da270 --- /dev/null +++ b/modules/nf-core/barrnap/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "barrnap - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_bac.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b" + ], + "gff": [ + [ + { + "id": "test", + "single_end": false + }, + "test_bac.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.1" + }, + "timestamp": "2024-07-10T11:25:35.085998" + }, + "barrnap": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_bac.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ] + ], + "1": [ + "versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b" + ], + "gff": [ + [ + { + "id": "test", + "single_end": false + }, + "test_bac.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ] + ], + "versions": [ + "versions.yml:md5,447eafa60f76f6b84d1c41a2f5c2f76b" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.1" + }, + "timestamp": "2024-07-10T11:25:28.621027" + } +} \ No newline at end of file diff --git a/modules/nf-core/barrnap/tests/tags.yml b/modules/nf-core/barrnap/tests/tags.yml new file mode 100644 index 00000000000..5b951105515 --- /dev/null +++ b/modules/nf-core/barrnap/tests/tags.yml @@ -0,0 +1,2 @@ +barrnap: + - "modules/nf-core/barrnap/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3672a771f06..d4192acd77e 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -70,9 +70,6 @@ bamutil/trimbam: bandage/image: - modules/nf-core/bandage/image/** - tests/modules/nf-core/bandage/image/** -barrnap: - - modules/nf-core/barrnap/** - - tests/modules/nf-core/barrnap/** basicpy: - modules/nf-core/basicpy/** - tests/modules/nf-core/basicpy/** diff --git a/tests/modules/nf-core/barrnap/main.nf b/tests/modules/nf-core/barrnap/main.nf deleted file mode 100644 index de58beedd71..00000000000 --- a/tests/modules/nf-core/barrnap/main.nf +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BARRNAP } from '../../../../modules/nf-core/barrnap/main.nf' - -workflow test_barrnap { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) - ] - - BARRNAP ( input ) -} diff --git a/tests/modules/nf-core/barrnap/nextflow.config b/tests/modules/nf-core/barrnap/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/barrnap/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/barrnap/test.yml b/tests/modules/nf-core/barrnap/test.yml deleted file mode 100644 index 5586a72c8c9..00000000000 --- a/tests/modules/nf-core/barrnap/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: barrnap test_barrnap - command: nextflow run ./tests/modules/nf-core/barrnap -entry test_barrnap -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/barrnap/nextflow.config - tags: - - barrnap - files: - - path: output/barrnap/rrna_bac.gff - md5sum: df19e1b84ba6f691d20c72b397c88abf - - path: output/barrnap/versions.yml