From 75f95ec19656cd274db05f71e7942a40d15d64a7 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 11:24:45 +1100 Subject: [PATCH 01/18] rgi/bwt: add draft - Use template from rgi/main --- modules/nf-core/rgi/bwt/environment.yml | 7 ++ modules/nf-core/rgi/bwt/main.nf | 89 +++++++++++++++++++ modules/nf-core/rgi/bwt/meta.yml | 99 ++++++++++++++++++++++ modules/nf-core/rgi/bwt/tests/main.nf.test | 94 ++++++++++++++++++++ 4 files changed, 289 insertions(+) create mode 100644 modules/nf-core/rgi/bwt/environment.yml create mode 100644 modules/nf-core/rgi/bwt/main.nf create mode 100644 modules/nf-core/rgi/bwt/meta.yml create mode 100644 modules/nf-core/rgi/bwt/tests/main.nf.test diff --git a/modules/nf-core/rgi/bwt/environment.yml b/modules/nf-core/rgi/bwt/environment.yml new file mode 100644 index 000000000000..b6b2d3438158 --- /dev/null +++ b/modules/nf-core/rgi/bwt/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::rgi=6.0.5 diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf new file mode 100644 index 000000000000..70b5bd6c3eae --- /dev/null +++ b/modules/nf-core/rgi/bwt/main.nf @@ -0,0 +1,89 @@ +process RGI_BWT { + tag "${meta.id}" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/rgi:6.0.5--pyh05cac1d_0' + : 'biocontainers/rgi:6.0.5--pyh05cac1d_0'}" + + input: + tuple val(meta), path(fasta) + path card + path wildcard + + output: + tuple val(meta), path("*.json"), emit: json + tuple val(meta), path("*.txt"), emit: tsv + tuple val(meta), path("temp/"), emit: tmp + env RGI_VERSION, emit: tool_version + env DB_VERSION, emit: db_version + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + // This customizes the command: rgi bwt + def prefix = task.ext.prefix ?: "${meta.id}" + def load_wildcard = "" + + if (wildcard) { + load_wildcard = """ \\ + --wildcard_annotation ${wildcard}/wildcard_database_v\$DB_VERSION.fasta \\ + --wildcard_annotation_all_models ${wildcard}/wildcard_database_v\$DB_VERSION\\_all.fasta \\ + --wildcard_index ${wildcard}/wildcard/index-for-model-sequences.txt \\ + --amr_kmers ${wildcard}/wildcard/all_amr_61mers.txt \\ + --kmer_database ${wildcard}/wildcard/61_kmer_db.json \\ + --kmer_size 61 + """ + } + + """ + DB_VERSION=\$(ls ${card}/card_database_*_all.fasta | sed "s/${card}\\/card_database_v\\([0-9].*[0-9]\\).*/\\1/") + + rgi \\ + load \\ + ${args} \\ + --card_json ${card}/card.json \\ + --debug --local \\ + --card_annotation ${card}/card_database_v\$DB_VERSION.fasta \\ + --card_annotation_all_models ${card}/card_database_v\$DB_VERSION\\_all.fasta \\ + ${load_wildcard} + + rgi \\ + bwt \\ + ${args} \\ + --threads ${task.cpus} \\ + --output_file ${prefix} \\ + --input_sequence ${fasta} + + mkdir temp/ + 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: + """ + mkdir -p temp + touch test.json + touch test.txt + + 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/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml new file mode 100644 index 000000000000..ff5436c13398 --- /dev/null +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -0,0 +1,99 @@ +name: rgi_bwt +description: Predict antibiotic resistance from protein or nucleotide data +keywords: + - bacteria + - fasta + - 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 + 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"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Nucleotide or protein sequences in FASTA format + pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.gz}" + 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). + 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). + pattern: "*/" +output: + json: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.json": + type: file + description: JSON formatted file with RGI results + pattern: "*.{json}" + ontologies: + - edam: http://edamontology.org/format_3464 # JSON + tsv: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Tab-delimited file with RGI results + pattern: "*.{txt}" + ontologies: [] + tmp: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - temp/: + type: directory + description: Directory containing various intermediate files + pattern: "temp/" + tool_version: + - RGI_VERSION: + type: string + 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) + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML +authors: + - "@vinisalazar" +maintainers: + - "@nickp60" + - "@vinisalazar" diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test new file mode 100644 index 000000000000..7138e09841ee --- /dev/null +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -0,0 +1,94 @@ +nextflow_process { + + name "Test Process RGI_BWT" + script "../main.nf" + process "RGI_BWT" + + tag "modules" + tag "modules_nfcore" + tag "rgi" + tag "rgi/bwt" + tag "rgi/cardannotation" + tag "untar" + + setup { + run("UNTAR") { + script "modules/nf-core/untar/main.nf" + process { + """ + file('https://card.mcmaster.ca/latest/data', checkIfExists: true).copyTo('card-data.tar.bz2') + + input[0] = [ + [ ], + file("card-data.tar.bz2") + ] + """ + } + } + + run("RGI_CARDANNOTATION") { + script "modules/nf-core/rgi/cardannotation" + process { + """ + input[0] = UNTAR.out.untar.map{ it[1] } + """ + } + } + } + + + test("rgi/bwt - haemophilus_influenzae - genome_fna_gz") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true) + ] + input[1] = RGI_CARDANNOTATION.out.db + input[2] = [] + """ + } + } + + then { + 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() } + ) + } + } + + test("rgi/bwt - haemophilus_influenzae - genome_fna_gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true) + ] + input[1] = RGI_CARDANNOTATION.out.db + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} From 42bf5c7e7140637a3ac69417100500dd4358357b Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 11:54:03 +1100 Subject: [PATCH 02/18] rgi/bwt: editing input channel - Use fastq pair instead of single fasta file --- modules/nf-core/rgi/bwt/main.nf | 8 ++++++-- modules/nf-core/rgi/bwt/tests/main.nf.test | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 70b5bd6c3eae..9d31ea47acae 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -8,7 +8,7 @@ process RGI_BWT { : 'biocontainers/rgi:6.0.5--pyh05cac1d_0'}" input: - tuple val(meta), path(fasta) + tuple val(meta), path(reads) path card path wildcard @@ -27,6 +27,8 @@ process RGI_BWT { def args = task.ext.args ?: '' // This customizes the command: rgi bwt def prefix = task.ext.prefix ?: "${meta.id}" + def read_one = reads instanceof List ? reads[0] : reads + def read_two = reads instanceof List && reads.size() > 1 ? reads[1] : null def load_wildcard = "" if (wildcard) { @@ -57,7 +59,9 @@ process RGI_BWT { ${args} \\ --threads ${task.cpus} \\ --output_file ${prefix} \\ - --input_sequence ${fasta} + --read_one ${read_one} \\ + ${ read_two ? "--read_two ${read_two}" : "" } + mkdir temp/ for FILE in *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes *{variant,rrna,protein,predictedGenes,overexpression,homolog}.json; do [[ -e \$FILE ]] && mv \$FILE temp/; done diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index 7138e09841ee..075df33db1bb 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -37,14 +37,15 @@ nextflow_process { } - test("rgi/bwt - haemophilus_influenzae - genome_fna_gz") { + test("rgi/bwt - homo_sapiens - test_fastq_gz") { when { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), ] input[1] = RGI_CARDANNOTATION.out.db input[2] = [] @@ -67,7 +68,7 @@ nextflow_process { } } - test("rgi/bwt - haemophilus_influenzae - genome_fna_gz - stub") { + test("rgi/bwt - homo_sapiens - test_fastq_gz - stub") { options "-stub" @@ -76,7 +77,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), ] input[1] = RGI_CARDANNOTATION.out.db input[2] = [] From 77ec4ba074c587491c07a5c0285152e16013b5be Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:33:42 +1100 Subject: [PATCH 03/18] rgi/bwt: edit meta.yaml - add fastq extensions to 'pattern' --- modules/nf-core/rgi/bwt/meta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index ff5436c13398..8bffe3e1e10d 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -26,8 +26,8 @@ input: e.g. [ id:'test', single_end:false ] - fasta: type: file - description: Nucleotide or protein sequences in FASTA format - pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.gz}" + description: 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: [] - card: type: directory From fe0039c4d21eb29542701746e1275bba32724e87 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 13:40:46 +1100 Subject: [PATCH 04/18] rgi/bwt: update meta.yaml - Trying to pass linter --- modules/nf-core/rgi/bwt/meta.yml | 35 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 8bffe3e1e10d..43210e91d392 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -6,12 +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 @@ -24,22 +25,22 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - fasta: + - reads: type: file description: 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: [] - 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,13 +79,13 @@ 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: - versions.yml: type: file From 6252f12d48570aae7c0e6983889049707136c4ec Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 13:54:17 +1100 Subject: [PATCH 05/18] rgi/bwt: add test snapshot --- .../nf-core/rgi/bwt/tests/main.nf.test.snap | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 modules/nf-core/rgi/bwt/tests/main.nf.test.snap diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap new file mode 100644 index 000000000000..1dbec1d9b0fe --- /dev/null +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -0,0 +1,89 @@ +{ + "rgi/bwt - homo_sapiens - 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": [ + "6.0.5" + ], + "4": [ + "stub_version" + ], + "5": [ + "versions.yml:md5,47cb67c7969fe73d5f59c5fee0cda9c6" + ], + "db_version": [ + "stub_version" + ], + "json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tmp": [ + [ + { + "id": "test", + "single_end": false + }, + [ + + ] + ] + ], + "tool_version": [ + "6.0.5" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,47cb67c7969fe73d5f59c5fee0cda9c6" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-12-18T13:42:37.634355" + } +} \ No newline at end of file From 738ffc34637d281a3498b4f6eb4b8445512ede42 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 15:35:00 +1100 Subject: [PATCH 06/18] rgi/bwt: add '--local' flag - build KMA/BWT index in workdir instead of program executable dir - update test snapshot --- modules/nf-core/rgi/bwt/main.nf | 10 +++- .../nf-core/rgi/bwt/tests/main.nf.test.snap | 52 ++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 9d31ea47acae..f77ed7700ae6 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -25,6 +25,12 @@ process RGI_BWT { script: def args = task.ext.args ?: '' + def use_local = task.ext.local == null ? true : task.ext.local as boolean + // Add this to nextflow.config if not using local: + // withName: RGI_BWT { + // ext.local = false + // } + def local_flag = use_local ? '--local' : '' // This customizes the command: rgi bwt def prefix = task.ext.prefix ?: "${meta.id}" def read_one = reads instanceof List ? reads[0] : reads @@ -48,8 +54,9 @@ process RGI_BWT { rgi \\ load \\ ${args} \\ + ${local_flag} \\ --card_json ${card}/card.json \\ - --debug --local \\ + --debug \\ --card_annotation ${card}/card_database_v\$DB_VERSION.fasta \\ --card_annotation_all_models ${card}/card_database_v\$DB_VERSION\\_all.fasta \\ ${load_wildcard} @@ -57,6 +64,7 @@ process RGI_BWT { rgi \\ bwt \\ ${args} \\ + ${local_flag} \\ --threads ${task.cpus} \\ --output_file ${prefix} \\ --read_one ${read_one} \\ 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 1dbec1d9b0fe..351a9047ab24 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -84,6 +84,56 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T13:42:37.634355" + "timestamp": "2025-12-18T15:30:09.343629" + }, + "rgi/bwt - homo_sapiens - test_fastq_gz": { + "content": [ + [ + "versions.yml:md5,b58eb6cbad22c5eb956ad02a190a4e42" + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.allele_mapping_data.txt:md5,b4026da308ca791aad88f0ed0792e752", + "test.artifacts_mapping_stats.txt:md5,dc3ec8afe253950acb86b3ecd9dabba4", + "test.coverage.temp.txt:md5,660631842fc316d1b1081c3d8109c817", + "test.coverage_all_positions.summary.temp.txt:md5,05c4ab1a8e600535beef1c4745fa6fba", + "test.coverage_all_positions.temp.txt:md5,7d8071acc4745847d612d2ceb0964291", + "test.gene_mapping_data.txt:md5,fc75b9923a2a4e4ff534f9d1d7dfae56", + "test.overall_mapping_stats.txt:md5,16b52dbfd9d3f8e0d5c87e153a0b5276", + "test.reference_mapping_stats.txt:md5,8c7c19c11274ec1bf7ee51f4b1e8a0be", + "test.seqs.temp.txt:md5,94a9ffa4649f9919454cf2e3606f35e2", + "test.temp.txt:md5,6f1d013552a1b03a490bb33c909c5e74" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.allele_mapping_data.json:md5,13fef6bc037c98b6a8642f2ad7ee345f" + ] + ], + [ + "test.temp.sam.temp.fsa" + ], + [ + "6.0.5" + ], + [ + "4.0.1" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-12-18T15:29:41.02051" } } \ No newline at end of file From 47300b443bc50d73a595e165f7917a0057701390 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 15:43:48 +1100 Subject: [PATCH 07/18] rgi/bwt: update snapshot --- modules/nf-core/rgi/bwt/tests/main.nf.test.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 351a9047ab24..867886f9dd4e 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -106,7 +106,7 @@ "test.gene_mapping_data.txt:md5,fc75b9923a2a4e4ff534f9d1d7dfae56", "test.overall_mapping_stats.txt:md5,16b52dbfd9d3f8e0d5c87e153a0b5276", "test.reference_mapping_stats.txt:md5,8c7c19c11274ec1bf7ee51f4b1e8a0be", - "test.seqs.temp.txt:md5,94a9ffa4649f9919454cf2e3606f35e2", + "test.seqs.temp.txt:md5,819f4fe54d72e635f388b1cfa0ac9058", "test.temp.txt:md5,6f1d013552a1b03a490bb33c909c5e74" ] ] From c95108caef85343a23ec15581ede8dca29301824 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 15:50:59 +1100 Subject: [PATCH 08/18] rgi/bwt: fix tests - Don't check temp/ directory on snapshot, is different every time - Update snapshot --- modules/nf-core/rgi/bwt/tests/main.nf.test | 1 - modules/nf-core/rgi/bwt/tests/main.nf.test.snap | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index 075df33db1bb..d189e8de1154 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -60,7 +60,6 @@ nextflow_process { 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() } 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 867886f9dd4e..753f6d8582fe 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -84,7 +84,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T15:30:09.343629" + "timestamp": "2025-12-18T15:50:19.844883" }, "rgi/bwt - homo_sapiens - test_fastq_gz": { "content": [ @@ -106,7 +106,7 @@ "test.gene_mapping_data.txt:md5,fc75b9923a2a4e4ff534f9d1d7dfae56", "test.overall_mapping_stats.txt:md5,16b52dbfd9d3f8e0d5c87e153a0b5276", "test.reference_mapping_stats.txt:md5,8c7c19c11274ec1bf7ee51f4b1e8a0be", - "test.seqs.temp.txt:md5,819f4fe54d72e635f388b1cfa0ac9058", + "test.seqs.temp.txt:md5,b70ab46abd10edbca8710abffe457553", "test.temp.txt:md5,6f1d013552a1b03a490bb33c909c5e74" ] ] @@ -120,9 +120,6 @@ "test.allele_mapping_data.json:md5,13fef6bc037c98b6a8642f2ad7ee345f" ] ], - [ - "test.temp.sam.temp.fsa" - ], [ "6.0.5" ], @@ -134,6 +131,6 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T15:29:41.02051" + "timestamp": "2025-12-18T15:49:45.276248" } } \ No newline at end of file From e90b13c4294e652a97168c66c42552d63789eec5 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:27:29 +1100 Subject: [PATCH 09/18] rgi/bwt: continue to fix tests - provide input.reads as list - don't check tsv snapshot (it's different every time) --- modules/nf-core/rgi/bwt/tests/main.nf.test | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index d189e8de1154..2db4226175a1 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -36,7 +36,6 @@ nextflow_process { } } - test("rgi/bwt - homo_sapiens - test_fastq_gz") { when { @@ -44,8 +43,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + [ + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + ] ] input[1] = RGI_CARDANNOTATION.out.db input[2] = [] @@ -58,8 +59,8 @@ nextflow_process { { 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() } @@ -76,8 +77,10 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + [ + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), + ] ] input[1] = RGI_CARDANNOTATION.out.db input[2] = [] From 8db057402a5d8a99597788a8fe7b0d76ed69bce8 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:48:16 +1100 Subject: [PATCH 10/18] rgi/bwt: remove json from snapshots - json files are in random order so snapshot differs every time (I think) --- modules/nf-core/rgi/bwt/tests/main.nf.test | 1 - .../nf-core/rgi/bwt/tests/main.nf.test.snap | 32 ++----------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index 2db4226175a1..dc33b4c5d178 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -59,7 +59,6 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions, - process.out.json, file(process.out.tmp.get(0).get(1)).list().sort(), process.out.tool_version, process.out.db_version, 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 753f6d8582fe..45280276f858 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -84,7 +84,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T15:50:19.844883" + "timestamp": "2025-12-18T16:46:01.907563" }, "rgi/bwt - homo_sapiens - test_fastq_gz": { "content": [ @@ -92,33 +92,7 @@ "versions.yml:md5,b58eb6cbad22c5eb956ad02a190a4e42" ], [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test.allele_mapping_data.txt:md5,b4026da308ca791aad88f0ed0792e752", - "test.artifacts_mapping_stats.txt:md5,dc3ec8afe253950acb86b3ecd9dabba4", - "test.coverage.temp.txt:md5,660631842fc316d1b1081c3d8109c817", - "test.coverage_all_positions.summary.temp.txt:md5,05c4ab1a8e600535beef1c4745fa6fba", - "test.coverage_all_positions.temp.txt:md5,7d8071acc4745847d612d2ceb0964291", - "test.gene_mapping_data.txt:md5,fc75b9923a2a4e4ff534f9d1d7dfae56", - "test.overall_mapping_stats.txt:md5,16b52dbfd9d3f8e0d5c87e153a0b5276", - "test.reference_mapping_stats.txt:md5,8c7c19c11274ec1bf7ee51f4b1e8a0be", - "test.seqs.temp.txt:md5,b70ab46abd10edbca8710abffe457553", - "test.temp.txt:md5,6f1d013552a1b03a490bb33c909c5e74" - ] - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.allele_mapping_data.json:md5,13fef6bc037c98b6a8642f2ad7ee345f" - ] + "test.temp.sam.temp.fsa" ], [ "6.0.5" @@ -131,6 +105,6 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T15:49:45.276248" + "timestamp": "2025-12-18T16:45:23.269447" } } \ No newline at end of file From cd2faf4ef2d1a60efd064ae53c96f7f4f3227579 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 30 Dec 2025 14:35:46 +1000 Subject: [PATCH 11/18] rgi/bwt: remove task.ext value - Use '--local' flag as default --- modules/nf-core/rgi/bwt/main.nf | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index f77ed7700ae6..028c9f5ee1e4 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -25,13 +25,6 @@ process RGI_BWT { script: def args = task.ext.args ?: '' - def use_local = task.ext.local == null ? true : task.ext.local as boolean - // Add this to nextflow.config if not using local: - // withName: RGI_BWT { - // ext.local = false - // } - def local_flag = use_local ? '--local' : '' - // This customizes the command: rgi bwt def prefix = task.ext.prefix ?: "${meta.id}" def read_one = reads instanceof List ? reads[0] : reads def read_two = reads instanceof List && reads.size() > 1 ? reads[1] : null @@ -54,7 +47,7 @@ process RGI_BWT { rgi \\ load \\ ${args} \\ - ${local_flag} \\ + --local \\ --card_json ${card}/card.json \\ --debug \\ --card_annotation ${card}/card_database_v\$DB_VERSION.fasta \\ @@ -64,7 +57,7 @@ process RGI_BWT { rgi \\ bwt \\ ${args} \\ - ${local_flag} \\ + --local \\ --threads ${task.cpus} \\ --output_file ${prefix} \\ --read_one ${read_one} \\ From c1673365bfdc4bcb8ef88ed0ec4a0d438b6ce1a4 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:29:22 +1100 Subject: [PATCH 12/18] rgi/bwt: move version to topics output - Code review from #9585 --- modules/nf-core/rgi/bwt/main.nf | 19 +------ .../nf-core/rgi/bwt/tests/main.nf.test.snap | 52 ++++++++++--------- 2 files changed, 30 insertions(+), 41 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 028c9f5ee1e4..890a2d7bb664 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -16,9 +16,8 @@ process RGI_BWT { tuple val(meta), path("*.json"), emit: json tuple val(meta), path("*.txt"), emit: tsv 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 when: task.ext.when == null || task.ext.when @@ -67,13 +66,6 @@ process RGI_BWT { mkdir temp/ 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: @@ -82,13 +74,6 @@ process RGI_BWT { touch test.json touch test.txt - 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/bwt/tests/main.nf.test.snap b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap index 45280276f858..7a792cd8b5f9 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -32,16 +32,18 @@ ] ], "3": [ - "6.0.5" + [ + "RGI_BWT", + "rgi", + "6.0.5" + ] ], "4": [ - "stub_version" - ], - "5": [ - "versions.yml:md5,47cb67c7969fe73d5f59c5fee0cda9c6" - ], - "db_version": [ - "stub_version" + [ + "RGI_BWT", + "rgi-database", + "stub_version" + ] ], "json": [ [ @@ -63,9 +65,6 @@ ] ] ], - "tool_version": [ - "6.0.5" - ], "tsv": [ [ { @@ -75,8 +74,19 @@ "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,47cb67c7969fe73d5f59c5fee0cda9c6" + "versions_db": [ + [ + "RGI_BWT", + "rgi-database", + "stub_version" + ] + ], + "versions_rgi": [ + [ + "RGI_BWT", + "rgi", + "6.0.5" + ] ] } ], @@ -84,27 +94,21 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T16:46:01.907563" + "timestamp": "2026-01-15T12:26:59.982426" }, "rgi/bwt - homo_sapiens - test_fastq_gz": { "content": [ - [ - "versions.yml:md5,b58eb6cbad22c5eb956ad02a190a4e42" - ], + null, [ "test.temp.sam.temp.fsa" ], - [ - "6.0.5" - ], - [ - "4.0.1" - ] + null, + null ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-12-18T16:45:23.269447" + "timestamp": "2026-01-15T12:26:25.450504" } } \ No newline at end of file From 6efbbe375d95c6073e4fc004e7392a79a6457332 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:29:47 +1100 Subject: [PATCH 13/18] rgi/bwt: update meta.yml - Create topics field in meta.yml --- modules/nf-core/rgi/bwt/meta.yml | 51 +++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 43210e91d392..7fdb3394d795 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -29,7 +29,8 @@ input: type: file description: 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: [] + ontologies: + - edam: http://edamontology.org/format_1930 # FASTQ - card: type: directory description: Directory containing the CARD database. This is expected to be @@ -76,23 +77,39 @@ output: type: directory description: Directory containing various intermediate files pattern: "temp/" - tool_version: - - RGI_VERSION: - type: string - 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) + versions_rgi: + - - ${task.process}: + type: string + description: The process the versions were collected from + - rgi: + type: string + description: The tool name + - rgi main --version: + type: string + description: The version string returned by the command + versions_db: + - - ${task.process}: + type: string + description: The process the versions were collected from + - rgi-database: + type: string + description: The tool name + - echo $DB_VERSION: + type: string + description: The CARD database version string + +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 + - rgi: + type: string + description: The tool name + - rgi main --version: + type: string + description: The command used to generate the version of the tool + authors: - "@vinisalazar" maintainers: From b1f3cae5077174f00deb1c7a979df6e019039aff Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Mon, 19 Jan 2026 10:34:21 +1100 Subject: [PATCH 14/18] Apply suggestions from code review Co-authored-by: Jim Downie <19718667+prototaxites@users.noreply.github.com> Co-authored-by: James A. Fellows Yates --- modules/nf-core/rgi/bwt/main.nf | 9 ++++++--- modules/nf-core/rgi/bwt/meta.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 890a2d7bb664..ee99b299c071 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -8,7 +8,7 @@ process RGI_BWT { : 'biocontainers/rgi:6.0.5--pyh05cac1d_0'}" input: - tuple val(meta), path(reads) + tuple val(meta), path(reads, arity: '1..2') path card path wildcard @@ -23,10 +23,13 @@ process RGI_BWT { task.ext.when == null || task.ext.when script: + // This customizes the command: rgi load def args = task.ext.args ?: '' + // This customizes the command: rgi main + def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def read_one = reads instanceof List ? reads[0] : reads - def read_two = reads instanceof List && reads.size() > 1 ? reads[1] : null + def read_one = reads[0] + def read_two = reads.size() > 1 ? reads[1] : null def load_wildcard = "" if (wildcard) { diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 7fdb3394d795..7838e8d69dc7 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -27,7 +27,7 @@ input: e.g. [ id:'test', single_end:false ] - reads: type: file - description: Nucleotide sequences in FASTQ or FASTA format + 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 # FASTQ From 890342982c70d35552ce508fbe923e7688b43e46 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:07:50 +1100 Subject: [PATCH 15/18] rgi/bwt: fix tests and linting - capture topics appropriately in meta.yml --- modules/nf-core/rgi/bwt/main.nf | 4 +-- modules/nf-core/rgi/bwt/meta.yml | 13 ++++++++-- modules/nf-core/rgi/bwt/tests/main.nf.test | 4 +-- .../nf-core/rgi/bwt/tests/main.nf.test.snap | 25 ++++++++++++++----- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index ee99b299c071..4fc467e73b64 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -16,8 +16,8 @@ process RGI_BWT { tuple val(meta), path("*.json"), emit: json tuple val(meta), path("*.txt"), emit: tsv 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('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 when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index 7838e8d69dc7..c6b2a639711b 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -94,7 +94,7 @@ output: - rgi-database: type: string description: The tool name - - echo $DB_VERSION: + - echo \$DB_VERSION: type: string description: The CARD database version string @@ -108,7 +108,16 @@ topics: description: The tool name - rgi main --version: type: string - description: The command used to generate the version of the tool + description: Command used to collect the version + - - ${task.process}: + type: string + description: The process the versions were collected from + - rgi-database: + type: string + description: The tool name + - echo $DB_VERSION: + type: string + description: Command used to collect the version authors: - "@vinisalazar" diff --git a/modules/nf-core/rgi/bwt/tests/main.nf.test b/modules/nf-core/rgi/bwt/tests/main.nf.test index dc33b4c5d178..40074303c71a 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test @@ -58,10 +58,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.versions, + process.out.findAll { key, val -> key.startsWith("versions") }, file(process.out.tmp.get(0).get(1)).list().sort(), - process.out.tool_version, - process.out.db_version, ).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 7a792cd8b5f9..91124f320ec6 100644 --- a/modules/nf-core/rgi/bwt/tests/main.nf.test.snap +++ b/modules/nf-core/rgi/bwt/tests/main.nf.test.snap @@ -94,21 +94,34 @@ "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2026-01-15T12:26:59.982426" + "timestamp": "2026-01-20T14:01:51.787935" }, "rgi/bwt - homo_sapiens - test_fastq_gz": { "content": [ - null, + { + "versions_db": [ + [ + "RGI_BWT", + "rgi-database", + "4.0.1" + ] + ], + "versions_rgi": [ + [ + "RGI_BWT", + "rgi", + "6.0.5" + ] + ] + }, [ "test.temp.sam.temp.fsa" - ], - null, - null + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2026-01-15T12:26:25.450504" + "timestamp": "2026-01-20T14:01:20.471757" } } \ No newline at end of file From a63bb29e894e7c7322f44c78fae88628e40062a8 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:23:01 +1100 Subject: [PATCH 16/18] rgi/bwt: formatting --- modules/nf-core/rgi/bwt/main.nf | 2 +- modules/nf-core/rgi/bwt/meta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 4fc467e73b64..154af42a01e0 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -16,7 +16,7 @@ process RGI_BWT { tuple val(meta), path("*.json"), emit: json tuple val(meta), path("*.txt"), emit: tsv 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') , 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 when: diff --git a/modules/nf-core/rgi/bwt/meta.yml b/modules/nf-core/rgi/bwt/meta.yml index c6b2a639711b..a29a5c3f838f 100644 --- a/modules/nf-core/rgi/bwt/meta.yml +++ b/modules/nf-core/rgi/bwt/meta.yml @@ -115,7 +115,7 @@ topics: - rgi-database: type: string description: The tool name - - echo $DB_VERSION: + - echo \$DB_VERSION: type: string description: Command used to collect the version From 6647bb8e32057785a0909786cadeae854e0ee6cc Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:31:02 +1100 Subject: [PATCH 17/18] rgi/bwt: formatting --- modules/nf-core/rgi/bwt/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 154af42a01e0..7f0c8492aaf8 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -16,8 +16,8 @@ process RGI_BWT { tuple val(meta), path("*.json"), emit: json tuple val(meta), path("*.txt"), emit: tsv 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('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 when: task.ext.when == null || task.ext.when From 60c83c31e9d598471db35c3c853395c860028043 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:35:03 +1100 Subject: [PATCH 18/18] rgi/bwt: formatting --- modules/nf-core/rgi/bwt/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/rgi/bwt/main.nf b/modules/nf-core/rgi/bwt/main.nf index 7f0c8492aaf8..a69f3a089736 100644 --- a/modules/nf-core/rgi/bwt/main.nf +++ b/modules/nf-core/rgi/bwt/main.nf @@ -16,8 +16,8 @@ process RGI_BWT { tuple val(meta), path("*.json"), emit: json tuple val(meta), path("*.txt"), emit: tsv 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('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 when: task.ext.when == null || task.ext.when