Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions modules/nf-core/plasmidid/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process PLASMIDID {
tuple val(meta), path("${prefix}/database/") , emit: database
tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files
tuple val(meta), path("${prefix}/kmer/") , emit: kmer
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simplified as

Suggested change
tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid
tuple val("${task.process}"), val('plasmidid'), eval("plasmidID --version 2>&1| sed 's/^plasmidID //'"), topic: versions, emit: versions_plasmidid


when:
task.ext.when == null || task.ext.when
Expand All @@ -37,9 +37,14 @@ process PLASMIDID {
-o .

mv NO_GROUP/$prefix ./$prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":
plasmidid: \$(echo \$(plasmidID --version 2>&1))
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p ${prefix}/images ${prefix}/logs ${prefix}/data ${prefix}/database ${prefix}/fasta_files ${prefix}/kmer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some files in the empty folders that correspond to what is present in the real test ?

touch ${prefix}/${prefix}_final_results.html
touch ${prefix}/${prefix}_final_results.tab
"""
}
31 changes: 23 additions & 8 deletions modules/nf-core/plasmidid/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ tools:
homepage: https://github.com/BU-ISCIII/plasmidID/wiki
documentation: https://github.com/BU-ISCIII/plasmidID#readme
tool_dev_url: https://github.com/BU-ISCIII/plasmidID
licence: ["GPL v3"]
licence:
- "GPL v3"
identifier: biotools:plasmidid
input:
- - meta:
Expand Down Expand Up @@ -51,7 +52,7 @@ output:
description: Results in a tabular file
pattern: "*.{tab}"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
- edam: http://edamontology.org/format_3475
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the comment

Suggested change
- edam: http://edamontology.org/format_3475
- edam: http://edamontology.org/format_3475 # TSV

images:
- - meta:
type: map
Expand Down Expand Up @@ -112,13 +113,27 @@ output:
type: directory
description: Directory containing the kmer files produced by plasmidid
pattern: "database"
versions_plasmidid:
- - ${task.process}:
type: string
description: The name of the process
- plasmidid:
type: string
description: The name of the tool
- echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- plasmidid:
type: string
description: The name of the tool
- echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@joseespinosa"
- "@drpatelh"
Expand Down
36 changes: 23 additions & 13 deletions modules/nf-core/plasmidid/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

nextflow_process {

name "Test Process PLASMIDID"
Expand Down Expand Up @@ -27,18 +26,29 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.data[0][1]).name,
file(process.out.database[0][1]).name,
file(process.out.images[0][1]).name,
file(process.out.kmer[0][1]).name,
file(process.out.logs[0][1]).name,
process.out.fasta_files,
process.out.html,
process.out.tab,
process.out.versions
).match()
}
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() }
)
}
}

test("test-plasmidid-stub") {
options "-stub"
when {
process {
"""
input[0] = [ [ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the empty new line as well as // meta map. This is no more needed.

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the stub test all the files should be stable.

)
}
}
Expand Down
195 changes: 160 additions & 35 deletions modules/nf-core/plasmidid/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,45 +1,170 @@
{
"test-plasmidid": {
"content": [
"data",
"database",
"images",
"kmer",
"logs",
[
[
{
"id": "test"
},
[
"MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074"
{
"data": [
[
{
"id": "test"
},
"data"
]
],
"database": [
[
{
"id": "test"
},
"database"
]
],
"fasta_files": [
[
{
"id": "test"
},
[
"MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074"
]
]
],
"html": [
[
{
"id": "test"
},
"test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d"
]
],
"images": [
[
{
"id": "test"
},
"images"
]
],
"kmer": [
[
{
"id": "test"
},
"kmer"
]
],
"logs": [
[
{
"id": "test"
},
"logs"
]
],
"tab": [
[
{
"id": "test"
},
"test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd"
]
],
"versions_plasmidid": [
[
"PLASMIDID",
"plasmidid",
"1.6.4"
]
]
],
[
[
{
"id": "test"
},
"test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d"
]
],
[
[
{
"id": "test"
},
"test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd"
}
],
"timestamp": "2026-04-30T12:54:16.108858",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"test-plasmidid-stub": {
"content": [
{
"data": [
[
{
"id": "test"
},
"data"
]
],
"database": [
[
{
"id": "test"
},
"database"
]
],
"fasta_files": [
[
{
"id": "test"
},
[

]
]
],
"html": [
[
{
"id": "test"
},
"test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"images": [
[
{
"id": "test"
},
"images"
]
],
"kmer": [
[
{
"id": "test"
},
"kmer"
]
],
"logs": [
[
{
"id": "test"
},
"logs"
]
],
"tab": [
[
{
"id": "test"
},
"test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_plasmidid": [
[
"PLASMIDID",
"plasmidid",
"1.6.4"
]
]
],
[
"versions.yml:md5,29b9d094c38ac1cf78d12bb079ced8b2"
]
}
],
"timestamp": "2026-04-30T15:08:17.915883",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-29T10:03:30.225921"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading