From aef770552ef305616e22566d398685690a19a070 Mon Sep 17 00:00:00 2001 From: Ehsan ESTAJI <71376358+ehsanestaji@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:56:48 +0200 Subject: [PATCH 1/5] add fastaguard module --- modules/nf-core/fastaguard/environment.yml | 5 + modules/nf-core/fastaguard/main.nf | 44 +++++++ modules/nf-core/fastaguard/meta.yml | 108 ++++++++++++++++++ modules/nf-core/fastaguard/tests/data/fail.fa | 6 + .../nf-core/fastaguard/tests/data/invalid.fa | 3 + modules/nf-core/fastaguard/tests/data/pass.fa | 2 + modules/nf-core/fastaguard/tests/data/warn.fa | 4 + modules/nf-core/fastaguard/tests/main.nf.test | 95 +++++++++++++++ 8 files changed, 267 insertions(+) create mode 100644 modules/nf-core/fastaguard/environment.yml create mode 100644 modules/nf-core/fastaguard/main.nf create mode 100644 modules/nf-core/fastaguard/meta.yml create mode 100644 modules/nf-core/fastaguard/tests/data/fail.fa create mode 100644 modules/nf-core/fastaguard/tests/data/invalid.fa create mode 100644 modules/nf-core/fastaguard/tests/data/pass.fa create mode 100644 modules/nf-core/fastaguard/tests/data/warn.fa create mode 100644 modules/nf-core/fastaguard/tests/main.nf.test diff --git a/modules/nf-core/fastaguard/environment.yml b/modules/nf-core/fastaguard/environment.yml new file mode 100644 index 000000000000..6786c8e608df --- /dev/null +++ b/modules/nf-core/fastaguard/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::fastaguard=0.5.0 diff --git a/modules/nf-core/fastaguard/main.nf b/modules/nf-core/fastaguard/main.nf new file mode 100644 index 000000000000..1c21b5c9b8dd --- /dev/null +++ b/modules/nf-core/fastaguard/main.nf @@ -0,0 +1,44 @@ +process FASTAGUARD { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fastaguard:0.5.0--hfa8f182_0': + 'quay.io/biocontainers/fastaguard:0.5.0--hfa8f182_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.fastaguard.html"), emit: html + tuple val(meta), path("*.fastaguard.json"), emit: json + tuple val(meta), path("*.fastaguard.tsv"), emit: tsv + tuple val(meta), path("*.fastaguard_mqc.json"), emit: mqc + tuple val(meta), path("*.fastaguard.exit_code"), emit: exit_code + tuple val("${task.process}"), val('fastaguard'), eval('fastaguard --version | cut -d " " -f 2'), emit: versions_fastaguard, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: meta.id + def args = task.ext.args ?: '--profile assembly --gate pipeline' + """ + set +e + fastaguard ${fasta} \ + ${args} \ + --out ${prefix}.fastaguard.html \ + --json ${prefix}.fastaguard.json \ + --tsv ${prefix}.fastaguard.tsv \ + --multiqc ${prefix}.fastaguard_mqc.json + status=\$? + set -e + + printf "%s\\n" "\${status}" > ${prefix}.fastaguard.exit_code + + if [ "\${status}" -eq 3 ]; then + exit "\${status}" + fi + """ +} diff --git a/modules/nf-core/fastaguard/meta.yml b/modules/nf-core/fastaguard/meta.yml new file mode 100644 index 000000000000..734cc8c27e40 --- /dev/null +++ b/modules/nf-core/fastaguard/meta.yml @@ -0,0 +1,108 @@ +name: "fastaguard" +description: FASTA preflight QC for assembly pipelines +keywords: + - fasta + - assembly + - qc +tools: + - "fastaguard": + description: FASTA preflight QC for assembly pipelines + homepage: "https://github.com/ehsanestaji/FastaGuard" + documentation: "https://github.com/ehsanestaji/FastaGuard" + tool_dev_url: "https://github.com/ehsanestaji/FastaGuard" + licence: + - "MIT" + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - fasta: + type: file + description: Assembly FASTA file + pattern: "*.{fa,fasta,fa.gz,fasta.gz}" + ontologies: [] +output: + html: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - "*.fastaguard.html": + type: file + description: FastaGuard HTML report + pattern: "*.fastaguard.html" + ontologies: [] + json: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - "*.fastaguard.json": + type: file + description: FastaGuard JSON report + pattern: "*.fastaguard.json" + ontologies: + - edam: http://edamontology.org/format_3464 + tsv: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - "*.fastaguard.tsv": + type: file + description: FastaGuard TSV summary + pattern: "*.fastaguard.tsv" + ontologies: + - edam: http://edamontology.org/format_3475 + mqc: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - "*.fastaguard_mqc.json": + type: file + description: MultiQC custom-content JSON + pattern: "*.fastaguard_mqc.json" + ontologies: + - edam: http://edamontology.org/format_3464 + exit_code: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample' ] + - "*.fastaguard.exit_code": + type: file + description: FastaGuard CLI exit code for collect-then-gate workflows + pattern: "*.fastaguard.exit_code" + ontologies: [] + versions_fastaguard: + - - ${task.process}: + type: string + description: The process the versions were collected from + - fastaguard: + type: string + description: The tool name + - fastaguard --version | cut -d " " -f 2: + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - fastaguard: + type: string + description: The tool name + - fastaguard --version | cut -d " " -f 2: + type: eval + description: The expression to obtain the version of the tool +authors: + - "FastaGuard contributors" diff --git a/modules/nf-core/fastaguard/tests/data/fail.fa b/modules/nf-core/fastaguard/tests/data/fail.fa new file mode 100644 index 000000000000..cea2c6b7fec8 --- /dev/null +++ b/modules/nf-core/fastaguard/tests/data/fail.fa @@ -0,0 +1,6 @@ +>dup +ACGTACGT +>dup +ACGTACGT +>bad +ACGTXYZ diff --git a/modules/nf-core/fastaguard/tests/data/invalid.fa b/modules/nf-core/fastaguard/tests/data/invalid.fa new file mode 100644 index 000000000000..717a70dc4655 --- /dev/null +++ b/modules/nf-core/fastaguard/tests/data/invalid.fa @@ -0,0 +1,3 @@ +>empty_record +>next_record +ACGT diff --git a/modules/nf-core/fastaguard/tests/data/pass.fa b/modules/nf-core/fastaguard/tests/data/pass.fa new file mode 100644 index 000000000000..3d90f7cbe195 --- /dev/null +++ b/modules/nf-core/fastaguard/tests/data/pass.fa @@ -0,0 +1,2 @@ +>clean +ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT diff --git a/modules/nf-core/fastaguard/tests/data/warn.fa b/modules/nf-core/fastaguard/tests/data/warn.fa new file mode 100644 index 000000000000..564261615f3e --- /dev/null +++ b/modules/nf-core/fastaguard/tests/data/warn.fa @@ -0,0 +1,4 @@ +>long +ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT +>tiny +ACGT diff --git a/modules/nf-core/fastaguard/tests/main.nf.test b/modules/nf-core/fastaguard/tests/main.nf.test new file mode 100644 index 000000000000..abc00aae9790 --- /dev/null +++ b/modules/nf-core/fastaguard/tests/main.nf.test @@ -0,0 +1,95 @@ +nextflow_process { + + name "Test FASTAGUARD" + script "../main.nf" + process "FASTAGUARD" + + tag "modules" + tag "modules_nfcore" + tag "fastaguard" + tag "fastaguard_single" + + test("pass FASTA emits all reports") { + when { + process { + """ + input[0] = [ + [ id:'pass' ], + file("${moduleDir}/tests/data/pass.fa", checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert file(process.out.html[0][1]).name.endsWith(".fastaguard.html") + assert file(process.out.json[0][1]).name.endsWith(".fastaguard.json") + assert file(process.out.tsv[0][1]).name.endsWith(".fastaguard.tsv") + assert file(process.out.mqc[0][1]).name.endsWith(".fastaguard_mqc.json") + assert file(process.out.exit_code[0][1]).name.endsWith(".fastaguard.exit_code") + assert file(process.out.exit_code[0][1]).text.trim() == "0" + assert process.out.versions_fastaguard + } + } + + test("warn FASTA preserves reports") { + when { + process { + """ + input[0] = [ + [ id:'warn' ], + file("${moduleDir}/tests/data/warn.fa", checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert process.out.json + assert process.out.mqc + assert file(process.out.exit_code[0][1]).text.trim() == "1" + } + } + + test("fail FASTA preserves reports for gate review") { + when { + process { + """ + input[0] = [ + [ id:'fail' ], + file("${moduleDir}/tests/data/fail.fa", checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert process.out.json + assert process.out.mqc + assert file(process.out.exit_code[0][1]).text.trim() == "2" + } + } + + test("invalid FASTA is represented in the evidence path") { + when { + process { + """ + input[0] = [ + [ id:'invalid' ], + file("${moduleDir}/tests/data/invalid.fa", checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert process.out.json + assert process.out.mqc + assert file(process.out.exit_code[0][1]).text.trim() == "2" + } + } +} From a82020772466e84dd1ad7f31845996d7d1ceb2dc Mon Sep 17 00:00:00 2001 From: Ehsan ESTAJI <71376358+ehsanestaji@users.noreply.github.com> Date: Sun, 5 Jul 2026 21:55:39 +0200 Subject: [PATCH 2/5] test: inline fastaguard fixtures --- modules/nf-core/fastaguard/tests/data/fail.fa | 6 - .../nf-core/fastaguard/tests/data/invalid.fa | 3 - modules/nf-core/fastaguard/tests/data/pass.fa | 2 - modules/nf-core/fastaguard/tests/data/warn.fa | 4 - modules/nf-core/fastaguard/tests/main.nf.test | 79 ++++-- .../fastaguard/tests/main.nf.test.snap | 234 ++++++++++++++++++ 6 files changed, 289 insertions(+), 39 deletions(-) delete mode 100644 modules/nf-core/fastaguard/tests/data/fail.fa delete mode 100644 modules/nf-core/fastaguard/tests/data/invalid.fa delete mode 100644 modules/nf-core/fastaguard/tests/data/pass.fa delete mode 100644 modules/nf-core/fastaguard/tests/data/warn.fa create mode 100644 modules/nf-core/fastaguard/tests/main.nf.test.snap diff --git a/modules/nf-core/fastaguard/tests/data/fail.fa b/modules/nf-core/fastaguard/tests/data/fail.fa deleted file mode 100644 index cea2c6b7fec8..000000000000 --- a/modules/nf-core/fastaguard/tests/data/fail.fa +++ /dev/null @@ -1,6 +0,0 @@ ->dup -ACGTACGT ->dup -ACGTACGT ->bad -ACGTXYZ diff --git a/modules/nf-core/fastaguard/tests/data/invalid.fa b/modules/nf-core/fastaguard/tests/data/invalid.fa deleted file mode 100644 index 717a70dc4655..000000000000 --- a/modules/nf-core/fastaguard/tests/data/invalid.fa +++ /dev/null @@ -1,3 +0,0 @@ ->empty_record ->next_record -ACGT diff --git a/modules/nf-core/fastaguard/tests/data/pass.fa b/modules/nf-core/fastaguard/tests/data/pass.fa deleted file mode 100644 index 3d90f7cbe195..000000000000 --- a/modules/nf-core/fastaguard/tests/data/pass.fa +++ /dev/null @@ -1,2 +0,0 @@ ->clean -ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT diff --git a/modules/nf-core/fastaguard/tests/data/warn.fa b/modules/nf-core/fastaguard/tests/data/warn.fa deleted file mode 100644 index 564261615f3e..000000000000 --- a/modules/nf-core/fastaguard/tests/data/warn.fa +++ /dev/null @@ -1,4 +0,0 @@ ->long -ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT ->tiny -ACGT diff --git a/modules/nf-core/fastaguard/tests/main.nf.test b/modules/nf-core/fastaguard/tests/main.nf.test index abc00aae9790..0586408cb965 100644 --- a/modules/nf-core/fastaguard/tests/main.nf.test +++ b/modules/nf-core/fastaguard/tests/main.nf.test @@ -13,23 +13,26 @@ nextflow_process { when { process { """ + def fasta = file(workDir.resolve("pass.fa").toString()) + fasta.text = [ + ">clean", + "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT" + ].join("\\n") + "\\n" + input[0] = [ [ id:'pass' ], - file("${moduleDir}/tests/data/pass.fa", checkIfExists: true) + fasta ] """ } } then { - assert process.success - assert file(process.out.html[0][1]).name.endsWith(".fastaguard.html") - assert file(process.out.json[0][1]).name.endsWith(".fastaguard.json") - assert file(process.out.tsv[0][1]).name.endsWith(".fastaguard.tsv") - assert file(process.out.mqc[0][1]).name.endsWith(".fastaguard_mqc.json") - assert file(process.out.exit_code[0][1]).name.endsWith(".fastaguard.exit_code") - assert file(process.out.exit_code[0][1]).text.trim() == "0" - assert process.out.versions_fastaguard + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, + { assert file(process.out.exit_code[0][1]).text.trim() == "0" } + ) } } @@ -37,19 +40,28 @@ nextflow_process { when { process { """ + def fasta = file(workDir.resolve("warn.fa").toString()) + fasta.text = [ + ">long", + "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT", + ">tiny", + "ACGT" + ].join("\\n") + "\\n" + input[0] = [ [ id:'warn' ], - file("${moduleDir}/tests/data/warn.fa", checkIfExists: true) + fasta ] """ } } then { - assert process.success - assert process.out.json - assert process.out.mqc - assert file(process.out.exit_code[0][1]).text.trim() == "1" + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, + { assert file(process.out.exit_code[0][1]).text.trim() == "1" } + ) } } @@ -57,19 +69,30 @@ nextflow_process { when { process { """ + def fasta = file(workDir.resolve("fail.fa").toString()) + fasta.text = [ + ">dup", + "ACGTACGT", + ">dup", + "ACGTACGT", + ">bad", + "ACGTXYZ" + ].join("\\n") + "\\n" + input[0] = [ [ id:'fail' ], - file("${moduleDir}/tests/data/fail.fa", checkIfExists: true) + fasta ] """ } } then { - assert process.success - assert process.out.json - assert process.out.mqc - assert file(process.out.exit_code[0][1]).text.trim() == "2" + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, + { assert file(process.out.exit_code[0][1]).text.trim() == "2" } + ) } } @@ -77,19 +100,27 @@ nextflow_process { when { process { """ + def fasta = file(workDir.resolve("invalid.fa").toString()) + fasta.text = [ + ">empty_record", + ">next_record", + "ACGT" + ].join("\\n") + "\\n" + input[0] = [ [ id:'invalid' ], - file("${moduleDir}/tests/data/invalid.fa", checkIfExists: true) + fasta ] """ } } then { - assert process.success - assert process.out.json - assert process.out.mqc - assert file(process.out.exit_code[0][1]).text.trim() == "2" + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, + { assert file(process.out.exit_code[0][1]).text.trim() == "2" } + ) } } } diff --git a/modules/nf-core/fastaguard/tests/main.nf.test.snap b/modules/nf-core/fastaguard/tests/main.nf.test.snap new file mode 100644 index 000000000000..61e82ef702ce --- /dev/null +++ b/modules/nf-core/fastaguard/tests/main.nf.test.snap @@ -0,0 +1,234 @@ +{ + "invalid FASTA is represented in the evidence path": { + "content": [ + { + "exit_code": [ + [ + { + "id": "invalid" + }, + "invalid.fastaguard.exit_code:md5,26ab0db90d72e28ad0ba1e22ee510510" + ] + ], + "html": [ + [ + { + "id": "invalid" + }, + "invalid.fastaguard.html" + ] + ], + "json": [ + [ + { + "id": "invalid" + }, + "invalid.fastaguard.json" + ] + ], + "mqc": [ + [ + { + "id": "invalid" + }, + "invalid.fastaguard_mqc.json" + ] + ], + "tsv": [ + [ + { + "id": "invalid" + }, + "invalid.fastaguard.tsv" + ] + ], + "versions_fastaguard": [ + [ + "FASTAGUARD", + "fastaguard", + "0.5.0" + ] + ] + } + ], + "timestamp": "2026-07-05T21:53:00.621129", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + }, + "fail FASTA preserves reports for gate review": { + "content": [ + { + "exit_code": [ + [ + { + "id": "fail" + }, + "fail.fastaguard.exit_code:md5,26ab0db90d72e28ad0ba1e22ee510510" + ] + ], + "html": [ + [ + { + "id": "fail" + }, + "fail.fastaguard.html" + ] + ], + "json": [ + [ + { + "id": "fail" + }, + "fail.fastaguard.json" + ] + ], + "mqc": [ + [ + { + "id": "fail" + }, + "fail.fastaguard_mqc.json" + ] + ], + "tsv": [ + [ + { + "id": "fail" + }, + "fail.fastaguard.tsv" + ] + ], + "versions_fastaguard": [ + [ + "FASTAGUARD", + "fastaguard", + "0.5.0" + ] + ] + } + ], + "timestamp": "2026-07-05T21:52:53.226297", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + }, + "warn FASTA preserves reports": { + "content": [ + { + "exit_code": [ + [ + { + "id": "warn" + }, + "warn.fastaguard.exit_code:md5,b026324c6904b2a9cb4b88d6d61c81d1" + ] + ], + "html": [ + [ + { + "id": "warn" + }, + "warn.fastaguard.html" + ] + ], + "json": [ + [ + { + "id": "warn" + }, + "warn.fastaguard.json" + ] + ], + "mqc": [ + [ + { + "id": "warn" + }, + "warn.fastaguard_mqc.json" + ] + ], + "tsv": [ + [ + { + "id": "warn" + }, + "warn.fastaguard.tsv" + ] + ], + "versions_fastaguard": [ + [ + "FASTAGUARD", + "fastaguard", + "0.5.0" + ] + ] + } + ], + "timestamp": "2026-07-05T21:52:45.428014", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + }, + "pass FASTA emits all reports": { + "content": [ + { + "exit_code": [ + [ + { + "id": "pass" + }, + "pass.fastaguard.exit_code:md5,897316929176464ebc9ad085f31e7284" + ] + ], + "html": [ + [ + { + "id": "pass" + }, + "pass.fastaguard.html" + ] + ], + "json": [ + [ + { + "id": "pass" + }, + "pass.fastaguard.json" + ] + ], + "mqc": [ + [ + { + "id": "pass" + }, + "pass.fastaguard_mqc.json" + ] + ], + "tsv": [ + [ + { + "id": "pass" + }, + "pass.fastaguard.tsv" + ] + ], + "versions_fastaguard": [ + [ + "FASTAGUARD", + "fastaguard", + "0.5.0" + ] + ] + } + ], + "timestamp": "2026-07-05T21:52:37.489392", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + } +} \ No newline at end of file From 548f431661b80bbed7d34597956456af28b45992 Mon Sep 17 00:00:00 2001 From: Ehsan ESTAJI <71376358+ehsanestaji@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:02:56 +0200 Subject: [PATCH 3/5] test: shorten fastaguard fixtures --- modules/nf-core/fastaguard/tests/main.nf.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/fastaguard/tests/main.nf.test b/modules/nf-core/fastaguard/tests/main.nf.test index 0586408cb965..7fb168046005 100644 --- a/modules/nf-core/fastaguard/tests/main.nf.test +++ b/modules/nf-core/fastaguard/tests/main.nf.test @@ -16,7 +16,7 @@ nextflow_process { def fasta = file(workDir.resolve("pass.fa").toString()) fasta.text = [ ">clean", - "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT" + ("ACGT" * 60) ].join("\\n") + "\\n" input[0] = [ @@ -43,7 +43,7 @@ nextflow_process { def fasta = file(workDir.resolve("warn.fa").toString()) fasta.text = [ ">long", - "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT", + ("ACGT" * 60), ">tiny", "ACGT" ].join("\\n") + "\\n" From 88f93dc12b1003c8718948b60f0e0cc42c7d27ab Mon Sep 17 00:00:00 2001 From: Ehsan ESTAJI <71376358+ehsanestaji@users.noreply.github.com> Date: Mon, 6 Jul 2026 20:09:50 +0200 Subject: [PATCH 4/5] fix: align fastaguard module conventions --- modules/nf-core/fastaguard/main.nf | 12 +++++------- modules/nf-core/fastaguard/meta.yml | 2 +- modules/nf-core/fastaguard/tests/main.nf.test | 1 + modules/nf-core/fastaguard/tests/nextflow.config | 5 +++++ 4 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 modules/nf-core/fastaguard/tests/nextflow.config diff --git a/modules/nf-core/fastaguard/main.nf b/modules/nf-core/fastaguard/main.nf index 1c21b5c9b8dd..d61c870f6de1 100644 --- a/modules/nf-core/fastaguard/main.nf +++ b/modules/nf-core/fastaguard/main.nf @@ -22,22 +22,20 @@ process FASTAGUARD { task.ext.when == null || task.ext.when script: - def prefix = task.ext.prefix ?: meta.id - def args = task.ext.args ?: '--profile assembly --gate pipeline' + def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' """ - set +e + status=0 fastaguard ${fasta} \ ${args} \ --out ${prefix}.fastaguard.html \ --json ${prefix}.fastaguard.json \ --tsv ${prefix}.fastaguard.tsv \ - --multiqc ${prefix}.fastaguard_mqc.json - status=\$? - set -e + --multiqc ${prefix}.fastaguard_mqc.json || status=\$? printf "%s\\n" "\${status}" > ${prefix}.fastaguard.exit_code - if [ "\${status}" -eq 3 ]; then + if [ "\${status}" -ge 3 ]; then exit "\${status}" fi """ diff --git a/modules/nf-core/fastaguard/meta.yml b/modules/nf-core/fastaguard/meta.yml index 734cc8c27e40..d7707ca28ee0 100644 --- a/modules/nf-core/fastaguard/meta.yml +++ b/modules/nf-core/fastaguard/meta.yml @@ -105,4 +105,4 @@ topics: type: eval description: The expression to obtain the version of the tool authors: - - "FastaGuard contributors" + - "@ehsanestaji" diff --git a/modules/nf-core/fastaguard/tests/main.nf.test b/modules/nf-core/fastaguard/tests/main.nf.test index 7fb168046005..fd42239db3f5 100644 --- a/modules/nf-core/fastaguard/tests/main.nf.test +++ b/modules/nf-core/fastaguard/tests/main.nf.test @@ -3,6 +3,7 @@ nextflow_process { name "Test FASTAGUARD" script "../main.nf" process "FASTAGUARD" + config "./nextflow.config" tag "modules" tag "modules_nfcore" diff --git a/modules/nf-core/fastaguard/tests/nextflow.config b/modules/nf-core/fastaguard/tests/nextflow.config new file mode 100644 index 000000000000..245733682dcc --- /dev/null +++ b/modules/nf-core/fastaguard/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'FASTAGUARD' { + ext.args = '--profile assembly --gate pipeline' + } +} From 11cca40a52f43197c3c0791b997a26c0630c282d Mon Sep 17 00:00:00 2001 From: Ehsan ESTAJI <71376358+ehsanestaji@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:54:15 +0200 Subject: [PATCH 5/5] fix: update fastaguard module for 0.6.0 --- modules/nf-core/fastaguard/environment.yml | 2 +- modules/nf-core/fastaguard/main.nf | 14 +---- modules/nf-core/fastaguard/meta.yml | 11 ---- modules/nf-core/fastaguard/tests/main.nf.test | 12 ++-- .../fastaguard/tests/main.nf.test.snap | 56 ++++--------------- 5 files changed, 20 insertions(+), 75 deletions(-) diff --git a/modules/nf-core/fastaguard/environment.yml b/modules/nf-core/fastaguard/environment.yml index 6786c8e608df..0448a46b6d29 100644 --- a/modules/nf-core/fastaguard/environment.yml +++ b/modules/nf-core/fastaguard/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::fastaguard=0.5.0 + - bioconda::fastaguard=0.6.0 diff --git a/modules/nf-core/fastaguard/main.nf b/modules/nf-core/fastaguard/main.nf index d61c870f6de1..27e1d4b8eb45 100644 --- a/modules/nf-core/fastaguard/main.nf +++ b/modules/nf-core/fastaguard/main.nf @@ -4,8 +4,8 @@ process FASTAGUARD { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/fastaguard:0.5.0--hfa8f182_0': - 'quay.io/biocontainers/fastaguard:0.5.0--hfa8f182_0' }" + 'https://depot.galaxyproject.org/singularity/fastaguard:0.6.0--hfa8f182_0': + 'quay.io/biocontainers/fastaguard:0.6.0--hfa8f182_0' }" input: tuple val(meta), path(fasta) @@ -15,7 +15,6 @@ process FASTAGUARD { tuple val(meta), path("*.fastaguard.json"), emit: json tuple val(meta), path("*.fastaguard.tsv"), emit: tsv tuple val(meta), path("*.fastaguard_mqc.json"), emit: mqc - tuple val(meta), path("*.fastaguard.exit_code"), emit: exit_code tuple val("${task.process}"), val('fastaguard'), eval('fastaguard --version | cut -d " " -f 2'), emit: versions_fastaguard, topic: versions when: @@ -25,18 +24,11 @@ process FASTAGUARD { def prefix = task.ext.prefix ?: "${meta.id}" def args = task.ext.args ?: '' """ - status=0 fastaguard ${fasta} \ ${args} \ --out ${prefix}.fastaguard.html \ --json ${prefix}.fastaguard.json \ --tsv ${prefix}.fastaguard.tsv \ - --multiqc ${prefix}.fastaguard_mqc.json || status=\$? - - printf "%s\\n" "\${status}" > ${prefix}.fastaguard.exit_code - - if [ "\${status}" -ge 3 ]; then - exit "\${status}" - fi + --multiqc ${prefix}.fastaguard_mqc.json """ } diff --git a/modules/nf-core/fastaguard/meta.yml b/modules/nf-core/fastaguard/meta.yml index d7707ca28ee0..f54895873ff9 100644 --- a/modules/nf-core/fastaguard/meta.yml +++ b/modules/nf-core/fastaguard/meta.yml @@ -72,17 +72,6 @@ output: pattern: "*.fastaguard_mqc.json" ontologies: - edam: http://edamontology.org/format_3464 - exit_code: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'sample' ] - - "*.fastaguard.exit_code": - type: file - description: FastaGuard CLI exit code for collect-then-gate workflows - pattern: "*.fastaguard.exit_code" - ontologies: [] versions_fastaguard: - - ${task.process}: type: string diff --git a/modules/nf-core/fastaguard/tests/main.nf.test b/modules/nf-core/fastaguard/tests/main.nf.test index fd42239db3f5..24304bd0d08d 100644 --- a/modules/nf-core/fastaguard/tests/main.nf.test +++ b/modules/nf-core/fastaguard/tests/main.nf.test @@ -31,8 +31,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, - { assert file(process.out.exit_code[0][1]).text.trim() == "0" } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } ) } } @@ -60,8 +59,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, - { assert file(process.out.exit_code[0][1]).text.trim() == "1" } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } ) } } @@ -91,8 +89,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, - { assert file(process.out.exit_code[0][1]).text.trim() == "2" } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } ) } } @@ -119,8 +116,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() }, - { assert file(process.out.exit_code[0][1]).text.trim() == "2" } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } ) } } diff --git a/modules/nf-core/fastaguard/tests/main.nf.test.snap b/modules/nf-core/fastaguard/tests/main.nf.test.snap index 61e82ef702ce..d702507ca36a 100644 --- a/modules/nf-core/fastaguard/tests/main.nf.test.snap +++ b/modules/nf-core/fastaguard/tests/main.nf.test.snap @@ -2,14 +2,6 @@ "invalid FASTA is represented in the evidence path": { "content": [ { - "exit_code": [ - [ - { - "id": "invalid" - }, - "invalid.fastaguard.exit_code:md5,26ab0db90d72e28ad0ba1e22ee510510" - ] - ], "html": [ [ { @@ -46,28 +38,20 @@ [ "FASTAGUARD", "fastaguard", - "0.5.0" + "0.6.0" ] ] } ], - "timestamp": "2026-07-05T21:53:00.621129", + "timestamp": "2026-07-23T12:35:19.837744", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "25.04.6" } }, "fail FASTA preserves reports for gate review": { "content": [ { - "exit_code": [ - [ - { - "id": "fail" - }, - "fail.fastaguard.exit_code:md5,26ab0db90d72e28ad0ba1e22ee510510" - ] - ], "html": [ [ { @@ -104,28 +88,20 @@ [ "FASTAGUARD", "fastaguard", - "0.5.0" + "0.6.0" ] ] } ], - "timestamp": "2026-07-05T21:52:53.226297", + "timestamp": "2026-07-23T12:34:59.917502", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "25.04.6" } }, "warn FASTA preserves reports": { "content": [ { - "exit_code": [ - [ - { - "id": "warn" - }, - "warn.fastaguard.exit_code:md5,b026324c6904b2a9cb4b88d6d61c81d1" - ] - ], "html": [ [ { @@ -162,28 +138,20 @@ [ "FASTAGUARD", "fastaguard", - "0.5.0" + "0.6.0" ] ] } ], - "timestamp": "2026-07-05T21:52:45.428014", + "timestamp": "2026-07-23T12:34:47.135258", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "25.04.6" } }, "pass FASTA emits all reports": { "content": [ { - "exit_code": [ - [ - { - "id": "pass" - }, - "pass.fastaguard.exit_code:md5,897316929176464ebc9ad085f31e7284" - ] - ], "html": [ [ { @@ -220,15 +188,15 @@ [ "FASTAGUARD", "fastaguard", - "0.5.0" + "0.6.0" ] ] } ], - "timestamp": "2026-07-05T21:52:37.489392", + "timestamp": "2026-07-23T12:34:36.226584", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.4" + "nextflow": "25.04.6" } } } \ No newline at end of file