diff --git a/modules/nf-core/graphtyper/genotype/main.nf b/modules/nf-core/graphtyper/genotype/main.nf index a5e3d0c841f..86718f92c37 100644 --- a/modules/nf-core/graphtyper/genotype/main.nf +++ b/modules/nf-core/graphtyper/genotype/main.nf @@ -16,7 +16,7 @@ process GRAPHTYPER_GENOTYPE { output: tuple val(meta), path("results/*/*.vcf.gz") , emit: vcf tuple val(meta), path("results/*/*.vcf.gz.tbi"), emit: tbi - path "versions.yml", emit: versions + tuple val("${task.process}"), val('graphtyper'), eval("graphtyper --help | tail -1 | sed 's/.* //'"), emit: versions_graphtyper, topic: versions when: task.ext.when == null || task.ext.when @@ -32,30 +32,20 @@ process GRAPHTYPER_GENOTYPE { printf "$bam_path_text" > bam_list.txt graphtyper \\ genotype \\ - $ref \\ - $args \\ + ${ref} \\ + ${args} \\ --sams bam_list.txt \\ - --threads $task.cpus \\ - $region_text - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - graphtyper: \$(graphtyper --help | tail -n 1 | sed 's/^ //') - END_VERSIONS + --threads ${task.cpus} \\ + ${region_text} """ stub: """ mkdir -p results/test - echo | gzip > results/test/region1.vcf.gz - echo | gzip > results/test/region2.vcf.gz + echo "" | gzip > results/test/region1.vcf.gz + echo "" | gzip > results/test/region2.vcf.gz touch results/test/region1.vcf.gz.tbi touch results/test/region2.vcf.gz.tbi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - graphtyper: \$(graphtyper --help | tail -n 1 | sed 's/^ //') - END_VERSIONS """ } diff --git a/modules/nf-core/graphtyper/genotype/meta.yml b/modules/nf-core/graphtyper/genotype/meta.yml index f0bb03801a0..2002c967ad0 100644 --- a/modules/nf-core/graphtyper/genotype/meta.yml +++ b/modules/nf-core/graphtyper/genotype/meta.yml @@ -8,13 +8,15 @@ keywords: - pangenome tools: - "graphtyper": - description: A graph-based variant caller capable of genotyping population-scale - short read data sets while incorporating previously discovered variants. + description: A graph-based variant caller capable of genotyping + population-scale short read data sets while incorporating previously + discovered variants. homepage: "https://github.com/DecodeGenetics/graphtyper" documentation: "https://github.com/DecodeGenetics/graphtyper/wiki/User-guide" tool_dev_url: "https://github.com/DecodeGenetics/graphtyper" doi: "10.1038/ng.3964" - licence: ["MIT"] + licence: + - "MIT" identifier: biotools:Graphtyper input: - - meta: @@ -29,8 +31,8 @@ input: ontologies: [] - bai: type: file - description: BAM index file. This is automatically found base on BAM input file - name + description: BAM index file. This is automatically found base on BAM input + file name pattern: "*.{bai}" ontologies: [] - - meta2: @@ -50,15 +52,15 @@ input: e.g. [ id:'genome' ] - ref_fai: type: file - description: Reference index file. This is automatically found based on reference - input file name. + description: Reference index file. This is automatically found based on + reference input file name. pattern: "*.{.fai}" ontologies: [] - region_file: type: file - description: File with a list of chromosome/locations in reference genome to genotype. - One region per line in the format :-. This or `--region` (in - ext.args) must be specified. + description: File with a list of chromosome/locations in reference genome to + genotype. One region per line in the format :-. This or + `--region` (in ext.args) must be specified. pattern: "*" ontologies: [] output: @@ -84,13 +86,27 @@ output: description: VCF index file pattern: "*.{vcf.gz.tbi}" ontologies: [] + versions_graphtyper: + - - ${task.process}: + type: string + description: The name of the process + - graphtyper: + type: string + description: The name of the tool + - graphtyper --help | tail -1 | sed 's/.* //': + 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 + - graphtyper: + type: string + description: The name of the tool + - graphtyper --help | tail -1 | sed 's/.* //': + type: eval + description: The expression to obtain the version of the tool authors: - "@zachary-foster" maintainers: diff --git a/modules/nf-core/graphtyper/genotype/tests/main.nf.test b/modules/nf-core/graphtyper/genotype/tests/main.nf.test index 056127e3a62..e1e4f9fccdf 100644 --- a/modules/nf-core/graphtyper/genotype/tests/main.nf.test +++ b/modules/nf-core/graphtyper/genotype/tests/main.nf.test @@ -2,6 +2,7 @@ nextflow_process { name "Test Process GRAPHTYPER_GENOTYPE" script "../main.nf" + config './nextflow.config' process "GRAPHTYPER_GENOTYPE" tag "modules" @@ -12,12 +13,15 @@ nextflow_process { test("single - region_file") { when { + params { + module_args = "" + } process { """ input[0] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) ] + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) ] input[1] = [ [ id: 'ref' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[2] = [ [ id: 'ref_index' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)] @@ -32,20 +36,21 @@ nextflow_process { { assert snapshot( process.out.vcf.collect{ meta, vcf -> [ meta, path(vcf[0]).vcf.variantsMD5 ] }, // Second VCF is empty process.out.tbi, - process.out.versions + process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) } - } test("multiple - region_args") { - config './nextflow.config' when { + params { + module_args = "--region MT192765.1" + } process { """ input[0] = [ - [ id: 'test' ], // meta map + [ id: 'test' ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam", checkIfExists: true) ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), @@ -53,7 +58,7 @@ nextflow_process { ] input[1] = [ [ id: 'ref' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[2] = [ [ id: 'ref_index' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)] - input[3] = channel.of([]) + input[3] = [] """ } } @@ -61,25 +66,23 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.tbi[0][1]).name, - file(process.out.vcf[0][1]).name, // no variants and header unstable - process.out.versions - ).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["vcf", "tbi"])).match() } ) } - } test("single - region_file - stub") { options '-stub' when { + params { + module_args = "" + } process { """ input[0] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) ] + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) ] input[1] = [ [ id: 'ref' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] input[2] = [ [ id: 'ref_index' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)] @@ -94,7 +97,6 @@ nextflow_process { { assert snapshot(sanitizeOutput(process.out)).match() } ) } - } } diff --git a/modules/nf-core/graphtyper/genotype/tests/main.nf.test.snap b/modules/nf-core/graphtyper/genotype/tests/main.nf.test.snap index 12a04eb04cf..f3ea1a7c05e 100644 --- a/modules/nf-core/graphtyper/genotype/tests/main.nf.test.snap +++ b/modules/nf-core/graphtyper/genotype/tests/main.nf.test.snap @@ -1,16 +1,36 @@ { "multiple - region_args": { "content": [ - "000000001-000029829.vcf.gz.tbi", - "000000001-000029829.vcf.gz", - [ - "versions.yml:md5,131488e7eb93b8c761765afcbc51a719" - ] + { + "tbi": [ + [ + { + "id": "test" + }, + "000000001-000029829.vcf.gz.tbi" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "000000001-000029829.vcf.gz" + ] + ], + "versions_graphtyper": [ + [ + "GRAPHTYPER_GENOTYPE", + "graphtyper", + "2.7.2" + ] + ] + } ], - "timestamp": "2026-02-14T13:12:02.090140452", + "timestamp": "2026-05-11T22:30:39.050124678", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.03.2" } }, "single - region_file": { @@ -34,14 +54,20 @@ ] ] ], - [ - "versions.yml:md5,131488e7eb93b8c761765afcbc51a719" - ] + { + "versions_graphtyper": [ + [ + "GRAPHTYPER_GENOTYPE", + "graphtyper", + "2.7.2" + ] + ] + } ], - "timestamp": "2026-02-16T16:05:22.263192697", + "timestamp": "2026-05-11T22:30:23.400437096", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.03.2" } }, "single - region_file - stub": { @@ -69,15 +95,19 @@ ] ] ], - "versions": [ - "versions.yml:md5,131488e7eb93b8c761765afcbc51a719" + "versions_graphtyper": [ + [ + "GRAPHTYPER_GENOTYPE", + "graphtyper", + "2.7.2" + ] ] } ], - "timestamp": "2026-02-14T12:28:22.719581642", + "timestamp": "2026-05-11T22:30:46.904602299", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.03.2" } } } \ No newline at end of file diff --git a/modules/nf-core/graphtyper/genotype/tests/nextflow.config b/modules/nf-core/graphtyper/genotype/tests/nextflow.config index 09d8a3d5728..669846d6ab4 100644 --- a/modules/nf-core/graphtyper/genotype/tests/nextflow.config +++ b/modules/nf-core/graphtyper/genotype/tests/nextflow.config @@ -1,5 +1,5 @@ process { withName: GRAPHTYPER_GENOTYPE { - ext.args = '--region MT192765.1' + ext.args = params.module_args } } diff --git a/modules/nf-core/graphtyper/vcfconcatenate/main.nf b/modules/nf-core/graphtyper/vcfconcatenate/main.nf index 4d2dd823ea8..d3f066b43fd 100644 --- a/modules/nf-core/graphtyper/vcfconcatenate/main.nf +++ b/modules/nf-core/graphtyper/vcfconcatenate/main.nf @@ -13,7 +13,7 @@ process GRAPHTYPER_VCFCONCATENATE { output: tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf tuple val(meta), path("${prefix}.vcf.gz.tbi"), emit: tbi - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('graphtyper'), eval("graphtyper --help | tail -1 | sed 's/.* //'"), emit: versions_graphtyper, topic: versions when: task.ext.when == null || task.ext.when @@ -41,11 +41,6 @@ process GRAPHTYPER_VCFCONCATENATE { # Delete batch VCFs rm ${prefix}_subset_*.vcf.gz - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - graphtyper: \$(graphtyper --help | tail -n 1 | sed 's/^ //') - END_VERSIONS """ stub: @@ -54,12 +49,7 @@ process GRAPHTYPER_VCFCONCATENATE { error "Input and output names are the same, set prefix in module configuration to disambiguate!" } """ - echo | gzip > ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - graphtyper: \$(graphtyper --help | tail -n 1 | sed 's/^ //') - END_VERSIONS """ } diff --git a/modules/nf-core/graphtyper/vcfconcatenate/meta.yml b/modules/nf-core/graphtyper/vcfconcatenate/meta.yml index f73542e60ec..3a9328bf477 100644 --- a/modules/nf-core/graphtyper/vcfconcatenate/meta.yml +++ b/modules/nf-core/graphtyper/vcfconcatenate/meta.yml @@ -7,13 +7,15 @@ keywords: - vcf tools: - "graphtyper": - description: A graph-based variant caller capable of genotyping population-scale - short read data sets while incorporating previously discovered variants. + description: A graph-based variant caller capable of genotyping + population-scale short read data sets while incorporating previously + discovered variants. homepage: "https://github.com/DecodeGenetics/graphtyper" documentation: "https://github.com/DecodeGenetics/graphtyper/wiki/User-guide" tool_dev_url: "https://github.com/DecodeGenetics/graphtyper" doi: "10.1038/ng.3964" - licence: ["MIT"] + licence: + - "MIT" identifier: biotools:Graphtyper input: - - meta: @@ -49,13 +51,27 @@ output: description: Concatenated VCF file index pattern: "*.{tbi}" ontologies: [] + versions_graphtyper: + - - ${task.process}: + type: string + description: The name of the process + - graphtyper: + type: string + description: The name of the tool + - graphtyper --help | tail -1 | sed 's/.* //': + 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 + - graphtyper: + type: string + description: The name of the tool + - graphtyper --help | tail -1 | sed 's/.* //': + type: eval + description: The expression to obtain the version of the tool authors: - "@zachary-foster" maintainers: diff --git a/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test b/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test index 9426b27b0f3..8bb01e3c783 100644 --- a/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test +++ b/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test @@ -4,7 +4,6 @@ nextflow_process { name "Test Process GRAPHTYPER_VCFCONCATENATE" script "../main.nf" process "GRAPHTYPER_VCFCONCATENATE" - config "./nextflow.config" tag "modules" tag "modules_nfcore" @@ -17,13 +16,12 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test_all' ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) ] ] - """ } } @@ -34,9 +32,8 @@ nextflow_process { { assert snapshot( path(process.out.vcf[0][1]).vcf.variantsMD5, file(process.out.tbi[0][1]).name, - process.out.versions - ).match() - } + process.out.findAll { key, val -> key.startsWith('versions') } + ).match()} ) } } @@ -48,13 +45,12 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test_all' ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) ] ] - """ } } @@ -62,7 +58,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } diff --git a/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test.snap b/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test.snap index 16dc2cce15b..a7ece276282 100644 --- a/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test.snap +++ b/modules/nf-core/graphtyper/vcfconcatenate/tests/main.nf.test.snap @@ -2,68 +2,55 @@ "test-graphtyper-vcfconcatenate-stub": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "prefix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "prefix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - "versions.yml:md5,98cf72d3f556b54f0cb2c11c6d3b46b9" - ], "tbi": [ [ { - "id": "test", - "single_end": false + "id": "test_all" }, - "prefix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_all.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "vcf": [ [ { - "id": "test", - "single_end": false + "id": "test_all" }, - "prefix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_all.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], - "versions": [ - "versions.yml:md5,98cf72d3f556b54f0cb2c11c6d3b46b9" + "versions_graphtyper": [ + [ + "GRAPHTYPER_VCFCONCATENATE", + "graphtyper", + "2.7.7" + ] ] } ], + "timestamp": "2026-05-11T22:31:01.584613437", "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" - }, - "timestamp": "2025-03-14T14:07:03.164929021" + "nf-test": "0.9.5", + "nextflow": "26.03.2" + } }, "test-graphtyper-vcfconcatenate": { "content": [ "93f741cc7a648675dfc13f0a42a39788", - "prefix.vcf.gz.tbi", - [ - "versions.yml:md5,98cf72d3f556b54f0cb2c11c6d3b46b9" - ] + "test_all.vcf.gz.tbi", + { + "versions_graphtyper": [ + [ + "GRAPHTYPER_VCFCONCATENATE", + "graphtyper", + "2.7.7" + ] + ] + } ], + "timestamp": "2026-05-11T22:30:54.301437614", "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" - }, - "timestamp": "2025-03-14T13:58:20.53915175" + "nf-test": "0.9.5", + "nextflow": "26.03.2" + } } } \ No newline at end of file diff --git a/modules/nf-core/graphtyper/vcfconcatenate/tests/nextflow.config b/modules/nf-core/graphtyper/vcfconcatenate/tests/nextflow.config deleted file mode 100644 index 8f512938d24..00000000000 --- a/modules/nf-core/graphtyper/vcfconcatenate/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: GRAPHTYPER_VCFCONCATENATE { - ext.prefix = "prefix" - } -}