Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix to output file for barrnap #5919

Merged
merged 15 commits into from
Jul 11, 2024
6 changes: 3 additions & 3 deletions modules/nf-core/barrnap/main.nf
SPPearce marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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}":
Expand All @@ -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
SPPearce marked this conversation as resolved.
Show resolved Hide resolved

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 4 additions & 1 deletion modules/nf-core/barrnap/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
57 changes: 57 additions & 0 deletions modules/nf-core/barrnap/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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() }
)
}
}
}


72 changes: 72 additions & 0 deletions modules/nf-core/barrnap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/barrnap/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
barrnap:
- "modules/nf-core/barrnap/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
15 changes: 0 additions & 15 deletions tests/modules/nf-core/barrnap/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/barrnap/nextflow.config

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/barrnap/test.yml

This file was deleted.

Loading