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
18 changes: 6 additions & 12 deletions modules/nf-core/checkm2/databasedownload/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ process CHECKM2_DATABASEDOWNLOAD {

output:
tuple val(meta), path("checkm2_db_v${db_version}.dmnd"), emit: database
path("versions.yml") , emit: versions
tuple val("${task.process}"), val('aria2'), eval('aria2c --version 2>&1 | head -n 1 | cut -f3 -d " "'), topic: versions, emit: versions_checkm2_databasedownload

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def args = task.ext.args ?: ''
// Append user-agent if not already present
if( !args.contains('--user-agent') ) {
args = args ? "${args} --user-agent=\"Wget/1.21.4\"" : '--user-agent="Wget/1.21.4"'
}
zenodo_id = db_zenodo_id ?: 14897628 // Default to version 3 if no ID provided
api_data = downloadZenodoApiEntry(zenodo_id)
db_version = api_data.metadata.version
Expand All @@ -47,22 +51,12 @@ process CHECKM2_DATABASEDOWNLOAD {
tar -xzf checkm2_database.tar.gz
db_path=\$(find -name *.dmnd)
mv \$db_path checkm2_db_v${db_version}.dmnd

cat <<-END_VERSIONS > versions.yml
"${task.process}":
aria2: \$(echo \$(aria2c --version 2>&1) | grep 'aria2 version' | cut -f3 -d ' ')
END_VERSIONS
"""

stub:
db_version = 0
meta = [id: 'checkm2_db', version: db_version]
"""
touch checkm2_db_v${db_version}.dmnd

cat <<-END_VERSIONS > versions.yml
"${task.process}":
aria2: \$(echo \$(aria2c --version 2>&1) | grep 'aria2 version' | cut -f3 -d ' ')
END_VERSIONS
"""
}
30 changes: 21 additions & 9 deletions modules/nf-core/checkm2/databasedownload/meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "checkm2_databasedownload"
description: CheckM2 database download
keywords:
Expand All @@ -16,12 +15,10 @@ tools:
doi: "10.1038/s41592-023-01940-w"
licence: ["GPL v3"]
identifier: ""

input:
- db_zenodo_id:
type: integer
description: Zenodo ID of the CheckM2 database to download

output:
database:
- - meta:
Expand All @@ -34,12 +31,27 @@ output:
description: CheckM2 database file
pattern: "checkm2_db_v*.dmnd"
ontologies: []
versions_checkm2_databasedownload:
- - ${task.process}:
type: string
description: The process the versions were collected from
- aria2:
type: string
description: The tool name
- aria2c --version 2>&1 | head -n 1 | cut -f3 -d " ":
type: string
description: The command used to generate 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 process the versions were collected from
- aria2:
type: string
description: The tool name
- 'aria2c --version 2>&1 | head -n 1 | cut -f3 -d " "':
type: string
description: The command used to generate the version of the tool
authors:
- "@dialvarezs"
- "@eit-maxlcummins"
4 changes: 2 additions & 2 deletions modules/nf-core/checkm2/databasedownload/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() },
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() },
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason why process.out.database is not captured?

)
}

Expand All @@ -42,7 +42,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() },
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() },
)
}

Expand Down
36 changes: 24 additions & 12 deletions modules/nf-core/checkm2/databasedownload/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
{
"test_checkm2_databasedownload": {
"content": [
[
"versions.yml:md5,74b6560ab3e6bae88ae53cb8ae3c283e"
]
{
"versions_checkm2_databasedownload": [
[
"CHECKM2_DATABASEDOWNLOAD",
"aria2",
"1.37.0"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
"nf-test": "0.9.3",
"nextflow": "25.10.2"
},
"timestamp": "2025-03-13T21:41:14.428719466"
"timestamp": "2026-01-23T09:04:29.73758792"
},
"test_checkm2_databasedownload - stub": {
"content": [
[
"versions.yml:md5,74b6560ab3e6bae88ae53cb8ae3c283e"
]
{
"versions_checkm2_databasedownload": [
[
"CHECKM2_DATABASEDOWNLOAD",
"aria2",
"1.37.0"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
"nf-test": "0.9.3",
"nextflow": "25.10.2"
},
"timestamp": "2025-03-13T21:41:24.118075242"
"timestamp": "2026-01-23T09:04:35.505821639"
}
}
24 changes: 6 additions & 18 deletions modules/nf-core/checkm2/predict/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ process CHECKM2_PREDICT {
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/0a/0af812c983aeffc99c0fca9ed2c910816b2ddb9a9d0dcad7b87dab0c9c08a16f/data'
: 'community.wave.seqera.io/library/checkm2:1.1.0--60f287bc25d7a10d'}"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/0a/0af812c983aeffc99c0fca9ed2c910816b2ddb9a9d0dcad7b87dab0c9c08a16f/data':
'community.wave.seqera.io/library/checkm2:1.1.0--60f287bc25d7a10d' }"

input:
tuple val(meta), path(fasta, stageAs: "input_bins/*")
tuple val(dbmeta), path(db)

output:
tuple val(meta), path("${prefix}"), emit: checkm2_output
tuple val(meta), path("${prefix}") , emit: checkm2_output
tuple val(meta), path("${prefix}_checkm2_report.tsv"), emit: checkm2_tsv
path ("versions.yml"), emit: versions
tuple val("${task.process}"), val('checkm2'), eval('checkm2 --version'), topic: versions, emit: versions_checkm2_predict

when:
task.ext.when == null || task.ext.when
Expand All @@ -23,33 +23,21 @@ process CHECKM2_PREDICT {
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
export DB=\$(find -L . -name "*.dmnd" -type f)

checkm2 \\
predict \\
--input ${fasta} \\
--output-directory ${prefix} \\
--threads ${task.cpus} \\
--database_path \$DB \\
--database_path ${db} \\
${args}

cp ${prefix}/quality_report.tsv ${prefix}_checkm2_report.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
checkm2: \$(checkm2 --version)
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir ${prefix}/
touch ${prefix}_checkm2_report.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
checkm2: \$(checkm2 --version)
END_VERSIONS
"""
}
29 changes: 22 additions & 7 deletions modules/nf-core/checkm2/predict/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ tools:
doi: "10.1038/s41592-023-01940-w"
licence: ["GPL v3"]
identifier: ""

input:
- - meta:
type: map
Expand All @@ -37,6 +36,7 @@ input:
type: file
description: CheckM2 database
ontologies: []

output:
checkm2_output:
- - meta:
Expand All @@ -60,12 +60,27 @@ output:
pattern: "*.tsv"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
versions_checkm2_predict:
- - ${task.process}:
type: string
description: The name of the process
- checkm2:
type: string
description: The name of the tool
- "checkm2 --version":
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 process the versions were collected from
- checkm2:
type: string
description: The tool name
- "checkm2 --version":
type: string
description: The command used to generate the version of the tool
authors:
- "@dialvarezs"
- "@eit-maxlcummins"
18 changes: 8 additions & 10 deletions modules/nf-core/checkm2/predict/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ nextflow_process {
tag "modules"
tag "checkm2"
tag "checkm2/predict"
tag "untar"
tag "checkm2/databasedownload"
script "modules/nf-core/checkm2/predict/main.nf"
process "CHECKM2_PREDICT"

setup {
run("UNTAR") {
script "../../../untar/main.nf"
run("CHECKM2_DATABASEDOWNLOAD") {
script "../../databasedownload/main.nf"
process {
"""
input[0] = channel
.fromPath("https://zenodo.org/records/14897628/files/checkm2_database.tar.gz", checkIfExists: true)
.map { dbfile -> [ [id: 'checkm2db'], dbfile ] }
input[0] = []
"""
}
}
Expand All @@ -31,15 +29,15 @@ nextflow_process {
process {
"""
input[0] = [ [id: 'test'], [file(params.modules_testdata_base_path + 'genomics/prokaryotes/escherichia_coli/genome/genome.fa', checkIfExists: true)] ]
input[1] = UNTAR.out.untar
input[1] = CHECKM2_DATABASEDOWNLOAD.out.database
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.checkm2_tsv, process.out.versions).match() }
{ assert snapshot(process.out.checkm2_tsv, process.out.findAll { key, val -> key.startsWith('versions') }).match() }
)
}
}
Expand All @@ -55,15 +53,15 @@ nextflow_process {
process {
"""
input[0] = [ [id: 'test'], [file(params.modules_testdata_base_path + 'genomics/prokaryotes/escherichia_coli/genome/genome.fa', checkIfExists: true)] ]
input[1] = UNTAR.out.untar
input[1] = CHECKM2_DATABASEDOWNLOAD.out.database
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.checkm2_tsv, process.out.versions).match() }
{ assert snapshot(process.out.checkm2_tsv, process.out.findAll { key, val -> key.startsWith('versions') }).match() }
)
}
}
Expand Down
36 changes: 24 additions & 12 deletions modules/nf-core/checkm2/predict/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
"test_checkm2_report.tsv:md5,1b6021262d336b21f526d8369f6ddd3f"
]
],
[
"versions.yml:md5,f13e02312d6a08ca746e6de2659d8195"
]
{
"versions_checkm2_predict": [
[
"CHECKM2_PREDICT",
"checkm2",
"1.1.0"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
"nf-test": "0.9.3",
"nextflow": "25.10.2"
},
"timestamp": "2025-03-13T15:23:26.857419645"
"timestamp": "2026-01-23T09:28:00.364406628"
},
"test_checkm2_predict - stub": {
"content": [
Expand All @@ -29,14 +35,20 @@
"test_checkm2_report.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
"versions.yml:md5,f13e02312d6a08ca746e6de2659d8195"
]
{
"versions_checkm2_predict": [
[
"CHECKM2_PREDICT",
"checkm2",
"1.1.0"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
"nf-test": "0.9.3",
"nextflow": "25.10.2"
},
"timestamp": "2025-03-13T15:23:40.153127645"
"timestamp": "2026-01-23T09:28:10.0910672"
}
}
Loading