From c23115cbaf4ae193a98b4a98fb06594bb39cc018 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Thu, 13 Aug 2026 15:42:43 +0000 Subject: [PATCH 1/6] Swap rgi to topics --- modules/nf-core/rgi/bwt/environment.yml | 2 +- modules/nf-core/rgi/bwt/main.nf | 4 +- modules/nf-core/rgi/bwt/meta.yml | 4 +- .../rgi/cardannotation/environment.yml | 3 +- modules/nf-core/rgi/cardannotation/main.nf | 22 +-- modules/nf-core/rgi/cardannotation/meta.yml | 64 +++++-- .../rgi/cardannotation/tests/main.nf.test | 8 +- .../cardannotation/tests/main.nf.test.snap | 144 ++++++++-------- modules/nf-core/rgi/main/environment.yml | 3 +- modules/nf-core/rgi/main/main.nf | 25 +-- modules/nf-core/rgi/main/meta.yml | 73 +++++--- modules/nf-core/rgi/main/tests/main.nf.test | 15 +- .../nf-core/rgi/main/tests/main.nf.test.snap | 156 +++++++++--------- 13 files changed, 271 insertions(+), 252 deletions(-) diff --git a/modules/nf-core/rgi/bwt/environment.yml b/modules/nf-core/rgi/bwt/environment.yml index 5e32a8273ac0..58b301d50929 100644 --- a/modules/nf-core/rgi/bwt/environment.yml +++ b/modules/nf-core/rgi/bwt/environment.yml @@ -4,5 +4,5 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::rgi=6.0.8 - bioconda::kma=1.6.11 + - bioconda::rgi=6.0.8 diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index c93b60121b6b..24e617eade57 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -4,8 +4,8 @@ process RGI_BWT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container -? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3f/3f452c8e124ee58ab6b26442d15401c57d471cb753f53921570dc484df4e7620/data' -: 'community.wave.seqera.io/library/rgi_kma:e905ecb8305e2609' }" + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3f/3f452c8e124ee58ab6b26442d15401c57d471cb753f53921570dc484df4e7620/data' + : 'community.wave.seqera.io/library/rgi_kma:e905ecb8305e2609' }" input: tuple val(meta), path(reads, arity: '1..2') diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 240e417cc812..96145a1baffa 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -25,7 +25,7 @@ input: description: Single-end or paired-end nucleotide sequences in FASTQ or FASTA format pattern: "*.{fastq,fastq.gz,fq,fq.gz,fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.gz}" ontologies: - - edam: http://edamontology.org/format_1930 + - edam: http://edamontology.org/format_1930 # FASTQ - card: type: directory description: Directory containing the CARD database. This is expected to be the unarchived but otherwise unaltered download folder (see RGI documentation for download instructions). @@ -46,7 +46,7 @@ output: description: JSON formatted file with RGI results pattern: "*.{json}" ontologies: - - edam: http://edamontology.org/format_3464 + - edam: http://edamontology.org/format_3464 # JSON tsv: - - meta: type: map diff --git a/modules/nf-core/rgi/cardannotation/environment.yml b/modules/nf-core/rgi/cardannotation/environment.yml index b6b2d3438158..58b301d50929 100644 --- a/modules/nf-core/rgi/cardannotation/environment.yml +++ b/modules/nf-core/rgi/cardannotation/environment.yml @@ -4,4 +4,5 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::rgi=6.0.5 + - bioconda::kma=1.6.11 + - bioconda::rgi=6.0.8 diff --git a/modules/nf-core/rgi/cardannotation/main.nf b/modules/nf-core/rgi/cardannotation/main.nf index 776f3c25d597..8616f7bb1566 100644 --- a/modules/nf-core/rgi/cardannotation/main.nf +++ b/modules/nf-core/rgi/cardannotation/main.nf @@ -2,9 +2,9 @@ process RGI_CARDANNOTATION { label 'process_medium' conda "${moduleDir}/environment.yml" - container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container - ? 'https://depot.galaxyproject.org/singularity/rgi:6.0.5--pyh05cac1d_0' - : 'quay.io/biocontainers/rgi:6.0.5--pyh05cac1d_0'}" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3f/3f452c8e124ee58ab6b26442d15401c57d471cb753f53921570dc484df4e7620/data' + : 'community.wave.seqera.io/library/rgi_kma:e905ecb8305e2609' }" input: path card @@ -13,7 +13,9 @@ process RGI_CARDANNOTATION { path ("card_database_processed"), emit: db env 'RGI_VERSION', emit: tool_version env 'DB_VERSION', emit: db_version - path "versions.yml", emit: versions + tuple val("${task.process}"), val('rgi'), eval("rgi main --version"), emit: versions_rgi, topic: versions + tuple val("${task.process}"), val('rgi-database'), eval("echo \$DB_VERSION"), emit: versions_db , topic: versions + tuple val("${task.process}"), val('kma'), eval("kma -v"), emit: versions_kma, topic: versions when: task.ext.when == null || task.ext.when @@ -33,12 +35,6 @@ process RGI_CARDANNOTATION { cp ${card}/* card_database_processed RGI_VERSION=\$(rgi main --version) - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - rgi: \$(echo \$RGI_VERSION) - rgi-database: \$(echo \$DB_VERSION) - END_VERSIONS """ stub: @@ -51,11 +47,5 @@ process RGI_CARDANNOTATION { RGI_VERSION=\$(rgi main --version) DB_VERSION=stub_version - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - rgi: \$(echo \$RGI_VERSION) - rgi-database: \$(echo \$DB_VERSION) - END_VERSIONS """ } diff --git a/modules/nf-core/rgi/cardannotation/meta.yml b/modules/nf-core/rgi/cardannotation/meta.yml index 6810661cd325..743f779083bc 100644 --- a/modules/nf-core/rgi/cardannotation/meta.yml +++ b/modules/nf-core/rgi/cardannotation/meta.yml @@ -1,19 +1,18 @@ name: rgi_cardannotation -description: Preprocess the CARD database for RGI to predict antibiotic resistance - from protein or nucleotide data +description: Preprocess the CARD database for RGI to predict antibiotic resistance from protein or nucleotide data keywords: - bacteria - fasta - antibiotic resistance tools: - rgi: - description: This module preprocesses the downloaded Comprehensive Antibiotic - Resistance Database (CARD) which can then be used as input for RGI. + description: This module preprocesses the downloaded Comprehensive Antibiotic Resistance Database (CARD) which can then be used as input for RGI. homepage: https://card.mcmaster.ca documentation: https://github.com/arpcard/rgi tool_dev_url: https://github.com/arpcard/rgi doi: "10.1093/nar/gkz935" - licence: ["https://card.mcmaster.ca/about"] + licence: + - "https://card.mcmaster.ca/about" identifier: "" input: - card: @@ -29,20 +28,55 @@ output: tool_version: - RGI_VERSION: type: string - description: The version of the tool in string format (useful for downstream - tools such as hAMRronization) + description: The version of the tool in string format (useful for downstream tools such as hAMRronization) db_version: - DB_VERSION: type: string - description: The version of the used database in string format (useful for downstream - tools such as hAMRronization) + description: The version of the used database in string format (useful for downstream tools such as hAMRronization) + versions_rgi: + - - ${task.process}: + type: string + description: The name of the process + - rgi: + type: string + description: The name of the tool + - rgi main --version: + type: eval + description: The expression to obtain the version of the tool + + versions_db: + - - ${task.process}: + type: string + description: The name of the process + - rgi-database: + type: string + description: The name of the tool + - echo \$DB_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 name of the process + - rgi: + type: string + description: The name of the tool + - rgi main --version: + type: eval + description: The expression to obtain the version of the tool + + - - ${task.process}: + type: string + description: The name of the process + - rgi-database: + type: string + description: The name of the tool + - echo \$DB_VERSION: + type: eval + description: The expression to obtain the version of the tool + authors: - "@rpetit3" - "@jfy133" diff --git a/modules/nf-core/rgi/cardannotation/tests/main.nf.test b/modules/nf-core/rgi/cardannotation/tests/main.nf.test index fa51142aa751..5345863df7cb 100644 --- a/modules/nf-core/rgi/cardannotation/tests/main.nf.test +++ b/modules/nf-core/rgi/cardannotation/tests/main.nf.test @@ -37,9 +37,9 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } @@ -57,9 +57,9 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap b/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap index 2d1391b0f32b..45a72b624b20 100644 --- a/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap @@ -2,119 +2,107 @@ "rgi/cardannotation - stub": { "content": [ { - "0": [ + "db": [ [ "card.fasta:md5,d41d8cd98f00b204e9800998ecf8427e", "card_all.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "1": [ - "6.0.5" - ], - "2": [ + "db_version": [ "stub_version" ], - "3": [ - "versions.yml:md5,c42c7e6566b41df0310a5a4c1fd8f949" + "tool_version": [ + "6.0.8" ], - "db": [ + "versions_db": [ [ - "card.fasta:md5,d41d8cd98f00b204e9800998ecf8427e", - "card_all.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + "RGI_CARDANNOTATION", + "rgi-database", + "stub_version" ] ], - "db_version": [ - "stub_version" - ], - "tool_version": [ - "6.0.5" + "versions_kma": [ + [ + "RGI_CARDANNOTATION", + "kma", + "KMA-1.6.11" + ] ], - "versions": [ - "versions.yml:md5,c42c7e6566b41df0310a5a4c1fd8f949" + "versions_rgi": [ + [ + "RGI_CARDANNOTATION", + "rgi", + "6.0.8" + ] ] } ], + "timestamp": "2026-08-13T15:04:34.08881093", "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" - }, - "timestamp": "2025-09-03T10:10:40.229702375" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } }, "rgi/cardannotation": { "content": [ { - "0": [ + "db": [ [ "CARD-Download-README.txt:md5,b57364cc1a5fab0541e13a01fabe5dea", - "PMID.tsv:md5,e3ce79c4b5dcf0a9e3117ed683f96e54", - "aro_categories.tsv:md5,6f9c4b0410b9e2b3cf5867a2a3f1db07", - "aro_categories_index.tsv:md5,d5fbc673c0de6601b07c8016b3909f8e", - "aro_index.tsv:md5,0f183c7869876fa32c8f86aade0df7b5", - "card.json:md5,72156d00155f69e637664bfb5d3b5395", - "card_database_v4.0.1.fasta:md5,5ead0b239c312ebb068a3b5aa9676b2d", - "card_database_v4.0.1_all.fasta:md5,f389ce15fac30e9ab394ca8a49f6451f", - "nucleotide_fasta_protein_homolog_model.fasta:md5,696d1aa4f04bd08fc4bdeea33ab9db43", + "PMID.tsv:md5,6aac0b0e6fc3ee1e1e53cf9251522af3", + "aro_categories.tsv:md5,1a45f02fdc6a8b0b64b84ca7cda8dff3", + "aro_categories_index.tsv:md5,9a65b210f7c446d7a4e6dc8aa97fd51c", + "aro_index.tsv:md5,57163f33db066882971eb4e4df4a062b", + "card.json:md5,b73e9f02206e13f02af3809a1ebdf5b5", + "card_database_v4.0.2.fasta:md5,500f594b42c6ac97fdbe17a2f788ffd8", + "card_database_v4.0.2_all.fasta:md5,aa8bb51771f095348d37c72b59b181e9", + "nucleotide_fasta_protein_homolog_model.fasta:md5,e2645d3cfee5bda65d9b7e0956df6463", "nucleotide_fasta_protein_knockout_model.fasta:md5,d8224ce019ad69a041d83ccf7877b4e0", - "nucleotide_fasta_protein_overexpression_model.fasta:md5,80a1e7957c79d311446e06c6dd49db8e", - "nucleotide_fasta_protein_variant_model.fasta:md5,7450e559045c9d1d8f13c73054c64f4c", - "nucleotide_fasta_rRNA_gene_variant_model.fasta:md5,bd53f46d630f652c9f6b7584c2126e1f", - "protein_fasta_protein_homolog_model.fasta:md5,36ea300133fd7c5a45de2fee4c5050bf", + "nucleotide_fasta_protein_overexpression_model.fasta:md5,7d81c25204b97213d7cc7aaf16aba0ba", + "nucleotide_fasta_protein_variant_model.fasta:md5,7d2df2efed96e790c4c0d429025a0361", + "nucleotide_fasta_rRNA_gene_variant_model.fasta:md5,1321456b509ffa30f3ba69fe631b643a", + "protein_fasta_protein_homolog_model.fasta:md5,ba91b130bd7dd8a5eba31e600f7782cc", "protein_fasta_protein_knockout_model.fasta:md5,f16667df70d1a5f910d3ae45f5250c3d", - "protein_fasta_protein_overexpression_model.fasta:md5,723e8762be5c96aed8c379a6499cecee", - "protein_fasta_protein_variant_model.fasta:md5,8c02d8fc84c9a90953f8534355244019", - "shortname_antibiotics.tsv:md5,9a4ba742fd8a3a49c7f50744001a4129", - "shortname_pathogens.tsv:md5,5211712be4f4c3306cbe4052cafae1d7", - "snps.txt:md5,529d4fdb74c8940c0930ec1a7a6d4980" + "protein_fasta_protein_overexpression_model.fasta:md5,711e3e9acc87a3c1379e0ddbf6652c92", + "protein_fasta_protein_variant_model.fasta:md5,88e30f42525980a63667336a24945900", + "shortname_antibiotics.tsv:md5,eab9bb0394aef8c7d04e0453532d2581", + "shortname_pathogens.tsv:md5,76cd65af74163663f6fa8dc92ab30e6b", + "snps.txt:md5,1f4148e4a8c66f88c99652197bc73023" ] ], - "1": [ - "6.0.5" - ], - "2": [ - "4.0.1" + "db_version": [ + "4.0.2" ], - "3": [ - "versions.yml:md5,bbd7b05923d280ece1cc3c426aa98ea9" + "tool_version": [ + "6.0.8" ], - "db": [ + "versions_db": [ [ - "CARD-Download-README.txt:md5,b57364cc1a5fab0541e13a01fabe5dea", - "PMID.tsv:md5,e3ce79c4b5dcf0a9e3117ed683f96e54", - "aro_categories.tsv:md5,6f9c4b0410b9e2b3cf5867a2a3f1db07", - "aro_categories_index.tsv:md5,d5fbc673c0de6601b07c8016b3909f8e", - "aro_index.tsv:md5,0f183c7869876fa32c8f86aade0df7b5", - "card.json:md5,72156d00155f69e637664bfb5d3b5395", - "card_database_v4.0.1.fasta:md5,5ead0b239c312ebb068a3b5aa9676b2d", - "card_database_v4.0.1_all.fasta:md5,f389ce15fac30e9ab394ca8a49f6451f", - "nucleotide_fasta_protein_homolog_model.fasta:md5,696d1aa4f04bd08fc4bdeea33ab9db43", - "nucleotide_fasta_protein_knockout_model.fasta:md5,d8224ce019ad69a041d83ccf7877b4e0", - "nucleotide_fasta_protein_overexpression_model.fasta:md5,80a1e7957c79d311446e06c6dd49db8e", - "nucleotide_fasta_protein_variant_model.fasta:md5,7450e559045c9d1d8f13c73054c64f4c", - "nucleotide_fasta_rRNA_gene_variant_model.fasta:md5,bd53f46d630f652c9f6b7584c2126e1f", - "protein_fasta_protein_homolog_model.fasta:md5,36ea300133fd7c5a45de2fee4c5050bf", - "protein_fasta_protein_knockout_model.fasta:md5,f16667df70d1a5f910d3ae45f5250c3d", - "protein_fasta_protein_overexpression_model.fasta:md5,723e8762be5c96aed8c379a6499cecee", - "protein_fasta_protein_variant_model.fasta:md5,8c02d8fc84c9a90953f8534355244019", - "shortname_antibiotics.tsv:md5,9a4ba742fd8a3a49c7f50744001a4129", - "shortname_pathogens.tsv:md5,5211712be4f4c3306cbe4052cafae1d7", - "snps.txt:md5,529d4fdb74c8940c0930ec1a7a6d4980" + "RGI_CARDANNOTATION", + "rgi-database", + "4.0.2" ] ], - "db_version": [ - "4.0.1" - ], - "tool_version": [ - "6.0.5" + "versions_kma": [ + [ + "RGI_CARDANNOTATION", + "kma", + "KMA-1.6.11" + ] ], - "versions": [ - "versions.yml:md5,bbd7b05923d280ece1cc3c426aa98ea9" + "versions_rgi": [ + [ + "RGI_CARDANNOTATION", + "rgi", + "6.0.8" + ] ] } ], + "timestamp": "2026-08-13T15:04:11.420831746", "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" - }, - "timestamp": "2025-09-03T10:10:17.719519729" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } } } \ No newline at end of file diff --git a/modules/nf-core/rgi/main/environment.yml b/modules/nf-core/rgi/main/environment.yml index b6b2d3438158..196910e8e0f9 100644 --- a/modules/nf-core/rgi/main/environment.yml +++ b/modules/nf-core/rgi/main/environment.yml @@ -4,4 +4,5 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::rgi=6.0.5 + - bioconda::kma=1.6.11 + - bioconda::rgi=6.0.8 \ No newline at end of file diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 649e9fc35391..213cb10f28e9 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -3,9 +3,9 @@ process RGI_MAIN { label 'process_medium' conda "${moduleDir}/environment.yml" - container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container - ? 'https://depot.galaxyproject.org/singularity/rgi:6.0.5--pyh05cac1d_0' - : 'quay.io/biocontainers/rgi:6.0.5--pyh05cac1d_0'}" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3f/3f452c8e124ee58ab6b26442d15401c57d471cb753f53921570dc484df4e7620/data' + : 'community.wave.seqera.io/library/rgi_kma:e905ecb8305e2609' }" input: tuple val(meta), path(fasta) @@ -18,7 +18,9 @@ process RGI_MAIN { tuple val(meta), path("temp/"), emit: tmp env 'RGI_VERSION', emit: tool_version env 'DB_VERSION', emit: db_version - path "versions.yml", emit: versions + tuple val("${task.process}"), val('rgi'), eval("rgi main --version"), emit: versions_rgi, topic: versions + tuple val("${task.process}"), val('rgi-database'), eval("echo \$DB_VERSION"), emit: versions_db , topic: versions + tuple val("${task.process}"), val('kma'), eval("kma -v"), emit: versions_kma, topic: versions when: task.ext.when == null || task.ext.when @@ -43,6 +45,7 @@ process RGI_MAIN { } """ + export MPLCONFIGDIR=\$PWD DB_VERSION=\$(ls ${card}/card_database_*_all.fasta | sed "s/${card}\\/card_database_v\\([0-9].*[0-9]\\).*/\\1/") rgi \\ @@ -57,7 +60,7 @@ process RGI_MAIN { rgi \\ main \\ ${args2} \\ - --num_threads ${task.cpus} \\ + --threads ${task.cpus} \\ --output_file ${prefix} \\ --input_sequence ${fasta} @@ -65,12 +68,6 @@ process RGI_MAIN { for FILE in *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes *{variant,rrna,protein,predictedGenes,overexpression,homolog}.json; do [[ -e \$FILE ]] && mv \$FILE temp/; done RGI_VERSION=\$(rgi main --version) - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - rgi: \$(echo \$RGI_VERSION) - rgi-database: \$(echo \$DB_VERSION) - END_VERSIONS """ stub: @@ -81,11 +78,5 @@ process RGI_MAIN { RGI_VERSION=\$(rgi main --version) DB_VERSION=stub_version - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - rgi: \$(echo \$RGI_VERSION) - rgi-database: \$(echo \$DB_VERSION) - END_VERSIONS """ } diff --git a/modules/nf-core/rgi/main/meta.yml b/modules/nf-core/rgi/main/meta.yml index f8b102f63d32..19469671ccbf 100644 --- a/modules/nf-core/rgi/main/meta.yml +++ b/modules/nf-core/rgi/main/meta.yml @@ -6,17 +6,13 @@ keywords: - antibiotic resistance tools: - rgi: - description: This tool provides a preliminary annotation of your DNA sequence(s) - based upon the data available in The Comprehensive Antibiotic Resistance Database - (CARD). Hits to genes tagged with Antibiotic Resistance ontology terms will - be highlighted. As CARD expands to include more pathogens, genomes, plasmids, - and ontology terms this tool will grow increasingly powerful in providing first-pass - detection of antibiotic resistance associated genes. See license at CARD website + description: This tool provides a preliminary annotation of your DNA sequence(s) based upon the data available in The Comprehensive Antibiotic Resistance Database (CARD). Hits to genes tagged with Antibiotic Resistance ontology terms will be highlighted. As CARD expands to include more pathogens, genomes, plasmids, and ontology terms this tool will grow increasingly powerful in providing first-pass detection of antibiotic resistance associated genes. See license at CARD website homepage: https://card.mcmaster.ca documentation: https://github.com/arpcard/rgi tool_dev_url: https://github.com/arpcard/rgi doi: "10.1093/nar/gkz935" - licence: ["https://card.mcmaster.ca/about"] + licence: + - "https://card.mcmaster.ca/about" identifier: "" input: - - meta: @@ -31,15 +27,11 @@ input: ontologies: [] - card: type: directory - description: Directory containing the CARD database. This is expected to be the - unarchived but otherwise unaltered download folder (see RGI documentation for - download instructions). + description: Directory containing the CARD database. This is expected to be the unarchived but otherwise unaltered download folder (see RGI documentation for download instructions). pattern: "*/" - wildcard: type: directory - description: Directory containing the WildCARD database (optional). This is expected - to be the unarchived but otherwise unaltered download folder (see RGI documentation - for download instructions). + description: Directory containing the WildCARD database (optional). This is expected to be the unarchived but otherwise unaltered download folder (see RGI documentation for download instructions). pattern: "*/" output: json: @@ -78,20 +70,55 @@ output: tool_version: - RGI_VERSION: type: string - description: The version of the tool in string format (useful for downstream - tools such as hAMRronization) + description: The version of the tool in string format (useful for downstream tools such as hAMRronization) db_version: - DB_VERSION: type: string - description: The version of the used database in string format (useful for downstream - tools such as hAMRronization) + description: The version of the used database in string format (useful for downstream tools such as hAMRronization) + versions_rgi: + - - ${task.process}: + type: string + description: The name of the process + - rgi: + type: string + description: The name of the tool + - rgi main --version: + type: eval + description: The expression to obtain the version of the tool + + versions_db: + - - ${task.process}: + type: string + description: The name of the process + - rgi-database: + type: string + description: The name of the tool + - echo \$DB_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 name of the process + - rgi: + type: string + description: The name of the tool + - rgi main --version: + type: eval + description: The expression to obtain the version of the tool + + - - ${task.process}: + type: string + description: The name of the process + - rgi-database: + type: string + description: The name of the tool + - echo \$DB_VERSION: + type: eval + description: The expression to obtain the version of the tool + authors: - "@rpetit3" - "@jfy133" diff --git a/modules/nf-core/rgi/main/tests/main.nf.test b/modules/nf-core/rgi/main/tests/main.nf.test index fc4a5616f941..a87af12b509a 100644 --- a/modules/nf-core/rgi/main/tests/main.nf.test +++ b/modules/nf-core/rgi/main/tests/main.nf.test @@ -53,16 +53,9 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot( - process.out.versions, - process.out.tsv, - process.out.json, - file(process.out.tmp.get(0).get(1)).list().sort(), - process.out.tool_version, - process.out.db_version, - ).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["tmp"])).match() } ) } } @@ -85,9 +78,9 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/rgi/main/tests/main.nf.test.snap b/modules/nf-core/rgi/main/tests/main.nf.test.snap index 52d455e7ffc4..963154b879d4 100644 --- a/modules/nf-core/rgi/main/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/main/tests/main.nf.test.snap @@ -2,7 +2,10 @@ "rgi/main - haemophilus_influenzae - genome_fna_gz - stub": { "content": [ { - "0": [ + "db_version": [ + "stub_version" + ], + "json": [ [ { "id": "test", @@ -11,37 +14,63 @@ "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "1": [ + "tmp": [ [ { "id": "test", "single_end": false }, - "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + + ] ] ], - "2": [ + "tool_version": [ + "6.0.8" + ], + "tsv": [ [ { "id": "test", "single_end": false }, - [ - - ] + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "3": [ - "6.0.5" - ], - "4": [ - "stub_version" + "versions_db": [ + [ + "RGI_MAIN", + "rgi-database", + "stub_version" + ] ], - "5": [ - "versions.yml:md5,b0808f9aef5a00d6542969c6dbd1c891" + "versions_kma": [ + [ + "RGI_MAIN", + "kma", + "KMA-1.6.11" + ] ], + "versions_rgi": [ + [ + "RGI_MAIN", + "rgi", + "6.0.8" + ] + ] + } + ], + "timestamp": "2026-08-13T15:05:49.354172528", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "rgi/main - haemophilus_influenzae - genome_fna_gz": { + "content": [ + { "db_version": [ - "stub_version" + "4.0.2" ], "json": [ [ @@ -49,7 +78,10 @@ "id": "test", "single_end": false }, - "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" + [ + "fontlist-v3.11.0.json:md5,55cd29f6917eb1663d6b85965ed15b00", + "test.json:md5,74b89120ae465892ef013014e44a8ab4" + ] ] ], "tmp": [ @@ -58,13 +90,11 @@ "id": "test", "single_end": false }, - [ - - ] + "temp" ] ], "tool_version": [ - "6.0.5" + "6.0.8" ], "tsv": [ [ @@ -72,72 +102,36 @@ "id": "test", "single_end": false }, - "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.txt:md5,9dd0afe6946da9c6608e775f954813a1" ] ], - "versions": [ - "versions.yml:md5,b0808f9aef5a00d6542969c6dbd1c891" + "versions_db": [ + [ + "RGI_MAIN", + "rgi-database", + "4.0.2" + ] + ], + "versions_kma": [ + [ + "RGI_MAIN", + "kma", + "KMA-1.6.11" + ] + ], + "versions_rgi": [ + [ + "RGI_MAIN", + "rgi", + "6.0.8" + ] ] } ], + "timestamp": "2026-08-13T15:30:28.80714945", "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" - }, - "timestamp": "2025-09-03T10:03:18.046807023" - }, - "rgi/main - haemophilus_influenzae - genome_fna_gz": { - "content": [ - [ - "versions.yml:md5,1c882aa66647fa7275d0c9fd6d2dda5f" - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.txt:md5,9d7754551163e020beed52a8bc14ce83" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.json:md5,6c403fb8e2f24b7c88be27ba5a30ca70" - ] - ], - [ - "genome.fna.gz.temp.uncompressed.fsa", - "genome.fna.gz.temp.uncompressed.fsa.temp.blastRes.rrna.xml", - "genome.fna.gz.temp.uncompressed.fsa.temp.contig.fsa", - "genome.fna.gz.temp.uncompressed.fsa.temp.contig.fsa.blastRes.xml", - "genome.fna.gz.temp.uncompressed.fsa.temp.contigToORF.fsa", - "genome.fna.gz.temp.uncompressed.fsa.temp.db.nhr", - "genome.fna.gz.temp.uncompressed.fsa.temp.db.nin", - "genome.fna.gz.temp.uncompressed.fsa.temp.db.nsq", - "genome.fna.gz.temp.uncompressed.fsa.temp.draft", - "genome.fna.gz.temp.uncompressed.fsa.temp.homolog.json", - "genome.fna.gz.temp.uncompressed.fsa.temp.overexpression.json", - "genome.fna.gz.temp.uncompressed.fsa.temp.potentialGenes", - "genome.fna.gz.temp.uncompressed.fsa.temp.predictedGenes.json", - "genome.fna.gz.temp.uncompressed.fsa.temp.predictedGenes.protein.json", - "genome.fna.gz.temp.uncompressed.fsa.temp.rrna.json", - "genome.fna.gz.temp.uncompressed.fsa.temp.variant.json" - ], - [ - "6.0.5" - ], - [ - "4.0.1" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" - }, - "timestamp": "2025-09-03T10:03:00.004608398" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } } } \ No newline at end of file From f5b81fec024da1f71b5dd0efaa7f379a90f8d8b9 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Thu, 13 Aug 2026 15:49:36 +0000 Subject: [PATCH 2/6] Fix kma version --- modules/nf-core/rgi/bwt/main.nf | 2 +- modules/nf-core/rgi/bwt/tests/main.nf.test.snap | 14 +++++++------- modules/nf-core/rgi/cardannotation/main.nf | 2 +- .../rgi/cardannotation/tests/main.nf.test.snap | 8 ++++---- modules/nf-core/rgi/main/main.nf | 2 +- modules/nf-core/rgi/main/tests/main.nf.test.snap | 10 +++++----- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 24e617eade57..b92b6679f4f4 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -18,7 +18,7 @@ process RGI_BWT { tuple val(meta), path("temp/"), emit: tmp tuple val("${task.process}"), val('rgi'), eval("rgi main --version"), emit: versions_rgi, topic: versions tuple val("${task.process}"), val('rgi-database'), eval("echo \$DB_VERSION"), emit: versions_db , topic: versions - tuple val("${task.process}"), val('kma'), eval("kma -v"), emit: versions_kma, topic: versions + tuple val("${task.process}"), val('kma'), eval("kma -v | sed 's/KMA-//'"), emit: versions_kma, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap index 46e8eab1a04a..2adfb3ce9fb1 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -49,7 +49,7 @@ [ "RGI_BWT", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "json": [ @@ -92,7 +92,7 @@ [ "RGI_BWT", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -104,10 +104,10 @@ ] } ], - "timestamp": "2026-07-08T14:46:07.17825", + "timestamp": "2026-08-13T15:45:34.756647206", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "26.04.6" } }, "rgi/bwt - minigut - test_fastq_gz": { @@ -137,7 +137,7 @@ [ "RGI_BWT", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -149,10 +149,10 @@ ] } ], - "timestamp": "2026-07-08T16:46:41.850311", + "timestamp": "2026-08-13T15:45:06.31701317", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/modules/nf-core/rgi/cardannotation/main.nf b/modules/nf-core/rgi/cardannotation/main.nf index 8616f7bb1566..3e694e9d02b8 100644 --- a/modules/nf-core/rgi/cardannotation/main.nf +++ b/modules/nf-core/rgi/cardannotation/main.nf @@ -15,7 +15,7 @@ process RGI_CARDANNOTATION { env 'DB_VERSION', emit: db_version tuple val("${task.process}"), val('rgi'), eval("rgi main --version"), emit: versions_rgi, topic: versions tuple val("${task.process}"), val('rgi-database'), eval("echo \$DB_VERSION"), emit: versions_db , topic: versions - tuple val("${task.process}"), val('kma'), eval("kma -v"), emit: versions_kma, topic: versions + tuple val("${task.process}"), val('kma'), eval("kma -v | sed 's/KMA-//'"), emit: versions_kma, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap b/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap index 45a72b624b20..11821a713137 100644 --- a/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/cardannotation/tests/main.nf.test.snap @@ -25,7 +25,7 @@ [ "RGI_CARDANNOTATION", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -37,7 +37,7 @@ ] } ], - "timestamp": "2026-08-13T15:04:34.08881093", + "timestamp": "2026-08-13T15:46:27.816621723", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" @@ -87,7 +87,7 @@ [ "RGI_CARDANNOTATION", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -99,7 +99,7 @@ ] } ], - "timestamp": "2026-08-13T15:04:11.420831746", + "timestamp": "2026-08-13T15:46:04.142183916", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 213cb10f28e9..9c22bd9effc0 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -20,7 +20,7 @@ process RGI_MAIN { env 'DB_VERSION', emit: db_version tuple val("${task.process}"), val('rgi'), eval("rgi main --version"), emit: versions_rgi, topic: versions tuple val("${task.process}"), val('rgi-database'), eval("echo \$DB_VERSION"), emit: versions_db , topic: versions - tuple val("${task.process}"), val('kma'), eval("kma -v"), emit: versions_kma, topic: versions + tuple val("${task.process}"), val('kma'), eval("kma -v | sed 's/KMA-//'"), emit: versions_kma, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/rgi/main/tests/main.nf.test.snap b/modules/nf-core/rgi/main/tests/main.nf.test.snap index 963154b879d4..954eef63b288 100644 --- a/modules/nf-core/rgi/main/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/main/tests/main.nf.test.snap @@ -48,7 +48,7 @@ [ "RGI_MAIN", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -60,7 +60,7 @@ ] } ], - "timestamp": "2026-08-13T15:05:49.354172528", + "timestamp": "2026-08-13T15:48:17.425352268", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" @@ -79,7 +79,7 @@ "single_end": false }, [ - "fontlist-v3.11.0.json:md5,55cd29f6917eb1663d6b85965ed15b00", + "fontlist-v3.11.0.json:md5,6c2e0f86553662d3f48619da57f468a6", "test.json:md5,74b89120ae465892ef013014e44a8ab4" ] ] @@ -116,7 +116,7 @@ [ "RGI_MAIN", "kma", - "KMA-1.6.11" + "1.6.11" ] ], "versions_rgi": [ @@ -128,7 +128,7 @@ ] } ], - "timestamp": "2026-08-13T15:30:28.80714945", + "timestamp": "2026-08-13T15:47:41.766771281", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" From f1a41b352f7b4b1e8d156da999a12c4e027336c5 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Fri, 14 Aug 2026 06:27:48 +0000 Subject: [PATCH 3/6] Update hamronization and remove the fonts.json --- .../hamronization/rgi/tests/main.nf.test.snap | 6 +++--- modules/nf-core/rgi/bwt/meta.yml | 6 ++++-- modules/nf-core/rgi/cardannotation/meta.yml | 21 +++++++++++++++++++ modules/nf-core/rgi/main/environment.yml | 2 +- modules/nf-core/rgi/main/main.nf | 11 +++++----- modules/nf-core/rgi/main/meta.yml | 21 +++++++++++++++++++ .../nf-core/rgi/main/tests/main.nf.test.snap | 7 ++----- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/modules/nf-core/hamronization/rgi/tests/main.nf.test.snap b/modules/nf-core/hamronization/rgi/tests/main.nf.test.snap index c07493220fb9..42eb4d096bf5 100644 --- a/modules/nf-core/hamronization/rgi/tests/main.nf.test.snap +++ b/modules/nf-core/hamronization/rgi/tests/main.nf.test.snap @@ -39,7 +39,7 @@ { "id": "test" }, - "test.tsv:md5,fda542e7a38cb5c36d3c2912aebeae16" + "test.tsv:md5,e127fbecbee7544279945ca130e5533d" ] ], "versions_hamronization": [ @@ -51,10 +51,10 @@ ] } ], - "timestamp": "2026-05-12T17:36:23.428320453", + "timestamp": "2026-08-14T06:12:49.865072999", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.0" + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 96145a1baffa..f18ccd226f84 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -95,9 +95,10 @@ output: - kma: type: string description: The name of the tool - - kma -v: + - kma -v | sed 's/KMA-//': type: eval description: The expression to obtain the version of the tool + topics: versions: - - ${task.process}: @@ -124,9 +125,10 @@ topics: - kma: type: string description: The name of the tool - - kma -v: + - kma -v | sed 's/KMA-//': type: eval description: The expression to obtain the version of the tool + authors: - "@vinisalazar" maintainers: diff --git a/modules/nf-core/rgi/cardannotation/meta.yml b/modules/nf-core/rgi/cardannotation/meta.yml index 743f779083bc..3c1ffbe3e70e 100644 --- a/modules/nf-core/rgi/cardannotation/meta.yml +++ b/modules/nf-core/rgi/cardannotation/meta.yml @@ -55,6 +55,17 @@ output: type: eval description: The expression to obtain the version of the tool + versions_kma: + - - ${task.process}: + type: string + description: The name of the process + - kma: + type: string + description: The name of the tool + - kma -v | sed 's/KMA-//': + type: eval + description: The expression to obtain the version of the tool + topics: versions: - - ${task.process}: @@ -77,6 +88,16 @@ topics: type: eval description: The expression to obtain the version of the tool + - - ${task.process}: + type: string + description: The name of the process + - kma: + type: string + description: The name of the tool + - kma -v | sed 's/KMA-//': + type: eval + description: The expression to obtain the version of the tool + authors: - "@rpetit3" - "@jfy133" diff --git a/modules/nf-core/rgi/main/environment.yml b/modules/nf-core/rgi/main/environment.yml index 196910e8e0f9..58b301d50929 100644 --- a/modules/nf-core/rgi/main/environment.yml +++ b/modules/nf-core/rgi/main/environment.yml @@ -5,4 +5,4 @@ channels: - bioconda dependencies: - bioconda::kma=1.6.11 - - bioconda::rgi=6.0.8 \ No newline at end of file + - bioconda::rgi=6.0.8 diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 9c22bd9effc0..a11398832cbd 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -13,8 +13,8 @@ process RGI_MAIN { path wildcard output: - tuple val(meta), path("*.json"), emit: json - tuple val(meta), path("*.txt"), emit: tsv + tuple val(meta), path("${prefix}.json"), emit: json + tuple val(meta), path("${prefix}.txt"), emit: tsv tuple val(meta), path("temp/"), emit: tmp env 'RGI_VERSION', emit: tool_version env 'DB_VERSION', emit: db_version @@ -30,7 +30,7 @@ process RGI_MAIN { // This customizes the command: rgi load def args2 = task.ext.args2 ?: '' // This customizes the command: rgi main - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" def load_wildcard = "" if (wildcard) { @@ -71,10 +71,11 @@ process RGI_MAIN { """ stub: + prefix = task.ext.prefix ?: "${meta.id}" """ mkdir -p temp - touch test.json - touch test.txt + touch ${prefix}.json + touch ${prefix}.txt RGI_VERSION=\$(rgi main --version) DB_VERSION=stub_version diff --git a/modules/nf-core/rgi/main/meta.yml b/modules/nf-core/rgi/main/meta.yml index 19469671ccbf..dcbea5ea2c24 100644 --- a/modules/nf-core/rgi/main/meta.yml +++ b/modules/nf-core/rgi/main/meta.yml @@ -97,6 +97,17 @@ output: type: eval description: The expression to obtain the version of the tool + versions_kma: + - - ${task.process}: + type: string + description: The name of the process + - kma: + type: string + description: The name of the tool + - kma -v | sed 's/KMA-//': + type: eval + description: The expression to obtain the version of the tool + topics: versions: - - ${task.process}: @@ -119,6 +130,16 @@ topics: type: eval description: The expression to obtain the version of the tool + - - ${task.process}: + type: string + description: The name of the process + - kma: + type: string + description: The name of the tool + - kma -v | sed 's/KMA-//': + type: eval + description: The expression to obtain the version of the tool + authors: - "@rpetit3" - "@jfy133" diff --git a/modules/nf-core/rgi/main/tests/main.nf.test.snap b/modules/nf-core/rgi/main/tests/main.nf.test.snap index 954eef63b288..b1ca7da5a942 100644 --- a/modules/nf-core/rgi/main/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/main/tests/main.nf.test.snap @@ -78,10 +78,7 @@ "id": "test", "single_end": false }, - [ - "fontlist-v3.11.0.json:md5,6c2e0f86553662d3f48619da57f468a6", - "test.json:md5,74b89120ae465892ef013014e44a8ab4" - ] + "test.json:md5,74b89120ae465892ef013014e44a8ab4" ] ], "tmp": [ @@ -128,7 +125,7 @@ ] } ], - "timestamp": "2026-08-13T15:47:41.766771281", + "timestamp": "2026-08-14T06:26:18.644709278", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" From 00f8d52f71652f0b1cc327059cbd5bbbc55ad2c6 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Fri, 14 Aug 2026 07:16:48 +0000 Subject: [PATCH 4/6] Fix linting --- modules/nf-core/rgi/main/meta.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/rgi/main/meta.yml b/modules/nf-core/rgi/main/meta.yml index dcbea5ea2c24..98b48f54396c 100644 --- a/modules/nf-core/rgi/main/meta.yml +++ b/modules/nf-core/rgi/main/meta.yml @@ -40,10 +40,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.json": + - "${prefix}.json": type: file description: JSON formatted file with RGI results - pattern: "*.{json}" + pattern: "${prefix}.{json}" ontologies: - edam: http://edamontology.org/format_3464 # JSON tsv: @@ -52,10 +52,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.txt": + - "${prefix}.txt": type: file description: Tab-delimited file with RGI results - pattern: "*.{txt}" + pattern: "${prefix}.txt" ontologies: [] tmp: - - meta: From 84d8fcebd7b3f616fef96be371a870718ecdcbdc Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Mon, 17 Aug 2026 08:24:20 +0000 Subject: [PATCH 5/6] Use sanitizeOutput for rgi/bwt --- modules/nf-core/rgi/bwt/tests/main.nf.test | 35 ++--- .../nf-core/rgi/bwt/tests/main.nf.test.snap | 120 ++++++++---------- 2 files changed, 68 insertions(+), 87 deletions(-) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index a2a2dde605dd..3f4a88fc1c8b 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -40,7 +40,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test', single_end:false ], [ file(params.modules_testdata_base_path + '../../mag/test_data/test_minigut_R1.fastq.gz', checkIfExists: true), file(params.modules_testdata_base_path + '../../mag/test_data/test_minigut_R2.fastq.gz', checkIfExists: true), @@ -53,24 +53,17 @@ nextflow_process { } then { - assertAll( - { assert process.success }, - { - def outDir = file(process.out.tsv[0][1][0]).parentFile - - def mappingFile = outDir.listFiles().find { - it.name.endsWith(".gene_mapping_data.txt") - } - - assert mappingFile != null : "No .gene_mapping_data.txt file found in ${outDir}" - - def sortedLines = mappingFile.readLines().sort() - - assert snapshot([output: sortedLines], - process.out.findAll { key, val -> key.startsWith('versions') } - ).match() + def outDir = file(process.out.tsv[0][1][0]).parentFile + def mappingFile = outDir.listFiles().find { + it.name.endsWith(".gene_mapping_data.txt") + } - }, + assert process.success + assertAll( + { assert snapshot( + sanitizeOutput(process.out, unstableKeys: ["tsv"]), + mappingFile.readLines().sort() + ).match() }, ) } } @@ -83,7 +76,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test', single_end:false ], [ file(params.modules_testdata_base_path + '../../mag/test_data/test_minigut_R1.fastq.gz', checkIfExists: true), file(params.modules_testdata_base_path + '../../mag/test_data/test_minigut_R2.fastq.gz', checkIfExists: true), @@ -96,9 +89,9 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap index 2adfb3ce9fb1..726ec87c5e94 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -2,56 +2,6 @@ "rgi/bwt - minigut - test_fastq_gz - stub": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - [ - - ] - ] - ], - "3": [ - [ - "RGI_BWT", - "rgi", - "6.0.8" - ] - ], - "4": [ - [ - "RGI_BWT", - "rgi-database", - "stub_version" - ] - ], - "5": [ - [ - "RGI_BWT", - "kma", - "1.6.11" - ] - ], "json": [ [ { @@ -104,7 +54,7 @@ ] } ], - "timestamp": "2026-08-13T15:45:34.756647206", + "timestamp": "2026-08-17T08:23:55.264483205", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" @@ -113,19 +63,46 @@ "rgi/bwt - minigut - test_fastq_gz": { "content": [ { - "output": [ - "ARO Term\tARO Accession\tReference Model Type\tReference DB\tAlleles with Mapped Reads\tReference Allele(s) Identity to CARD Reference Protein (%)\tResistomes & Variants: Observed in Genome(s)\tResistomes & Variants: Observed in Plasmid(s)\tResistomes & Variants: Observed Pathogen(s)\tCompletely Mapped Reads\tMapped Reads with Flanking Sequence\tAll Mapped Reads\tAverage Percent Coverage\tAverage Length Coverage (bp)\tAverage MAPQ (Completely Mapped Reads)\tNumber of Mapped Baits\tNumber of Mapped Baits with Reads\tAverage Number of reads per Bait\tNumber of reads per Bait Coefficient of Variation (%)\tNumber of reads mapping to baits and mapping to complete gene\tNumber of reads mapping to baits and mapping to complete gene (%)\tMate Pair Linkage (# reads)\tReference Length\tAMR Gene Family\tDrug Class\tResistance Mechanism", - "Escherichia coli acrA\t3004043\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t51.00\t0.00\t51.00\t100.00\t1194.00\t188.71\t0\t0\t0\t0\tN/A\tN/A\t\t1194\tresistance-nodulation-cell division (RND) antibiotic efflux pump\tfluoroquinolone antibiotic; cephalosporin; glycylcycline; penicillin beta-lactam; tetracycline antibiotic; rifamycin antibiotic; phenicol antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", - "Escherichia coli emrE\t3004039\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t23.00\t0.00\t23.00\t100.00\t333.00\t175.96\t0\t0\t0\t0\tN/A\tN/A\t\t333\tsmall multidrug resistance (SMR) antibiotic efflux pump\tmacrolide antibiotic\tantibiotic efflux", - "LptD\t3005059\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tKlebsiella pneumoniae\t38.00\t0.00\t38.00\t44.57\t1047.00\t131.34\t0\t0\t0\t0\tN/A\tN/A\t\t2349\tATP-binding cassette (ABC) antibiotic efflux pump\tcarbapenem; peptide antibiotic; aminocoumarin antibiotic; rifamycin antibiotic\tantibiotic efflux", - "acrB\t3000216\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t133.00\t0.00\t133.00\t100.00\t3150.00\t191.36\t0\t0\t0\t0\tN/A\tN/A\t\t3150\tresistance-nodulation-cell division (RND) antibiotic efflux pump\tfluoroquinolone antibiotic; cephalosporin; glycylcycline; penicillin beta-lactam; tetracycline antibiotic; rifamycin antibiotic; phenicol antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", - "kdpE\t3003841\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t45.00\t0.00\t45.00\t100.00\t678.00\t175.80\t0\t0\t0\t0\tN/A\tN/A\t\t678\tkdpDE\taminoglycoside antibiotic\tantibiotic efflux", - "leuO\t3003843\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t55.00\t0.00\t55.00\t100.00\t945.00\t173.55\t0\t0\t0\t0\tN/A\tN/A\t\t945\tmajor facilitator superfamily (MFS) antibiotic efflux pump\tnucleoside antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", - "rmtH\t3003198\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tKlebsiella pneumoniae\t4.00\t0.00\t4.00\t6.59\t50.00\t79.00\t0\t0\t0\t0\tN/A\tN/A\t\t759\t16S rRNA methyltransferase (G1405)\taminoglycoside antibiotic\tantibiotic target alteration", - "tet(Q)\t3000191\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tBacteroides fragilis\t138.00\t0.00\t138.00\t100.00\t1974.00\t179.62\t0\t0\t0\t0\tN/A\tN/A\t\t1974\ttetracycline-resistant ribosomal protection protein\ttetracycline antibiotic\tantibiotic target protection" - ] - }, - { + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.allele_mapping_data.json:md5,81b06efc8024b99ecd87599a7e1eec74" + ] + ], + "tmp": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.temp.sam.temp.fsa:md5,bd47f4f8e6eefb9f9e70deb5cd42e7f9" + ] + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.allele_mapping_data.txt", + "test.artifacts_mapping_stats.txt", + "test.coverage.temp.txt", + "test.coverage_all_positions.summary.temp.txt", + "test.coverage_all_positions.temp.txt", + "test.gene_mapping_data.txt", + "test.overall_mapping_stats.txt", + "test.reference_mapping_stats.txt", + "test.seqs.temp.txt", + "test.temp.txt" + ] + ] + ], "versions_db": [ [ "RGI_BWT", @@ -147,9 +124,20 @@ "6.0.8" ] ] - } + }, + [ + "ARO Term\tARO Accession\tReference Model Type\tReference DB\tAlleles with Mapped Reads\tReference Allele(s) Identity to CARD Reference Protein (%)\tResistomes & Variants: Observed in Genome(s)\tResistomes & Variants: Observed in Plasmid(s)\tResistomes & Variants: Observed Pathogen(s)\tCompletely Mapped Reads\tMapped Reads with Flanking Sequence\tAll Mapped Reads\tAverage Percent Coverage\tAverage Length Coverage (bp)\tAverage MAPQ (Completely Mapped Reads)\tNumber of Mapped Baits\tNumber of Mapped Baits with Reads\tAverage Number of reads per Bait\tNumber of reads per Bait Coefficient of Variation (%)\tNumber of reads mapping to baits and mapping to complete gene\tNumber of reads mapping to baits and mapping to complete gene (%)\tMate Pair Linkage (# reads)\tReference Length\tAMR Gene Family\tDrug Class\tResistance Mechanism", + "Escherichia coli acrA\t3004043\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t51.00\t0.00\t51.00\t100.00\t1194.00\t188.71\t0\t0\t0\t0\tN/A\tN/A\t\t1194\tresistance-nodulation-cell division (RND) antibiotic efflux pump\tfluoroquinolone antibiotic; cephalosporin; glycylcycline; penicillin beta-lactam; tetracycline antibiotic; rifamycin antibiotic; phenicol antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", + "Escherichia coli emrE\t3004039\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t23.00\t0.00\t23.00\t100.00\t333.00\t175.96\t0\t0\t0\t0\tN/A\tN/A\t\t333\tsmall multidrug resistance (SMR) antibiotic efflux pump\tmacrolide antibiotic\tantibiotic efflux", + "LptD\t3005059\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tKlebsiella pneumoniae\t38.00\t0.00\t38.00\t44.57\t1047.00\t131.34\t0\t0\t0\t0\tN/A\tN/A\t\t2349\tATP-binding cassette (ABC) antibiotic efflux pump\tcarbapenem; peptide antibiotic; aminocoumarin antibiotic; rifamycin antibiotic\tantibiotic efflux", + "acrB\t3000216\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t133.00\t0.00\t133.00\t100.00\t3150.00\t191.36\t0\t0\t0\t0\tN/A\tN/A\t\t3150\tresistance-nodulation-cell division (RND) antibiotic efflux pump\tfluoroquinolone antibiotic; cephalosporin; glycylcycline; penicillin beta-lactam; tetracycline antibiotic; rifamycin antibiotic; phenicol antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", + "kdpE\t3003841\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t45.00\t0.00\t45.00\t100.00\t678.00\t175.80\t0\t0\t0\t0\tN/A\tN/A\t\t678\tkdpDE\taminoglycoside antibiotic\tantibiotic efflux", + "leuO\t3003843\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tEscherichia coli\t55.00\t0.00\t55.00\t100.00\t945.00\t173.55\t0\t0\t0\t0\tN/A\tN/A\t\t945\tmajor facilitator superfamily (MFS) antibiotic efflux pump\tnucleoside antibiotic; disinfecting agents and antiseptics\tantibiotic efflux", + "rmtH\t3003198\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tKlebsiella pneumoniae\t4.00\t0.00\t4.00\t6.59\t50.00\t79.00\t0\t0\t0\t0\tN/A\tN/A\t\t759\t16S rRNA methyltransferase (G1405)\taminoglycoside antibiotic\tantibiotic target alteration", + "tet(Q)\t3000191\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tBacteroides fragilis\t138.00\t0.00\t138.00\t100.00\t1974.00\t179.62\t0\t0\t0\t0\tN/A\tN/A\t\t1974\ttetracycline-resistant ribosomal protection protein\ttetracycline antibiotic\tantibiotic target protection" + ] ], - "timestamp": "2026-08-13T15:45:06.31701317", + "timestamp": "2026-08-17T08:23:28.080752378", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" From 4ce442d4603d48ef272d54cf57207ac78da90bb1 Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Mon, 17 Aug 2026 14:28:30 +0000 Subject: [PATCH 6/6] Fix unstable file --- modules/nf-core/rgi/bwt/tests/main.nf.test | 2 +- modules/nf-core/rgi/bwt/tests/main.nf.test.snap | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index 3f4a88fc1c8b..a31672c34533 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -61,7 +61,7 @@ nextflow_process { assert process.success assertAll( { assert snapshot( - sanitizeOutput(process.out, unstableKeys: ["tsv"]), + sanitizeOutput(process.out, unstableKeys: ["tsv", "json"]), mappingFile.readLines().sort() ).match() }, ) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap index 726ec87c5e94..01c0c639e456 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -69,7 +69,7 @@ "id": "test", "single_end": false }, - "test.allele_mapping_data.json:md5,81b06efc8024b99ecd87599a7e1eec74" + "test.allele_mapping_data.json" ] ], "tmp": [ @@ -137,7 +137,7 @@ "tet(Q)\t3000191\tprotein homolog model\tCARD\t1\t100.0\tno data\tno data\tBacteroides fragilis\t138.00\t0.00\t138.00\t100.00\t1974.00\t179.62\t0\t0\t0\t0\tN/A\tN/A\t\t1974\ttetracycline-resistant ribosomal protection protein\ttetracycline antibiotic\tantibiotic target protection" ] ], - "timestamp": "2026-08-17T08:23:28.080752378", + "timestamp": "2026-08-17T12:30:32.794546461", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6"