Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions modules/nf-core/graphtyper/genotype/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""

}
48 changes: 32 additions & 16 deletions modules/nf-core/graphtyper/genotype/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 <chr>:<start>-<stop>. 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 <chr>:<start>-<stop>. This or
`--region` (in ext.args) must be specified.
pattern: "*"
ontologies: []
output:
Expand All @@ -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:
Expand Down
38 changes: 20 additions & 18 deletions modules/nf-core/graphtyper/genotype/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ nextflow_process {

name "Test Process GRAPHTYPER_GENOTYPE"
script "../main.nf"
config './nextflow.config'
process "GRAPHTYPER_GENOTYPE"

tag "modules"
Expand All @@ -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)]
Expand All @@ -32,54 +36,53 @@ 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),
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_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)]
input[3] = channel.of([])
input[3] = []
"""
}
}

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)]
Expand All @@ -94,7 +97,6 @@ nextflow_process {
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

}
68 changes: 49 additions & 19 deletions modules/nf-core/graphtyper/genotype/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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"
}
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/graphtyper/genotype/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process {
withName: GRAPHTYPER_GENOTYPE {
ext.args = '--region MT192765.1'
ext.args = params.module_args
}
}
14 changes: 2 additions & 12 deletions modules/nf-core/graphtyper/vcfconcatenate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
"""
}
Loading
Loading