Skip to content
Merged
1 change: 1 addition & 0 deletions modules/nf-core/glimpse/chunk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ process GLIMPSE_CHUNK {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.txt

Expand Down
15 changes: 9 additions & 6 deletions modules/nf-core/glimpse/chunk/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ nextflow_process {
name "Test Process GLIMPSE_CHUNK"
script "../main.nf"
process "GLIMPSE_CHUNK"
config "./nextflow.config"

tag "glimpse"
tag "glimpse/chunk"
tag "modules_nfcore"
tag "modules"

test("Should run without failures") {
config "modules/nf-core/glimpse/chunk/tests/nextflow.config"

test("homo_sapiens - vcf chr 22") {
when {
params{
glimpse_args = "--window-size 2000000 --buffer-size 200000"
}
process {
"""
input[0] = [
[ id:'input' ], // meta map
file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true),
"chr21"
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExists:true),
"chr22"
]
"""
}
Expand Down
12 changes: 8 additions & 4 deletions modules/nf-core/glimpse/chunk/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"Should run without failures": {
"homo_sapiens - vcf chr 22": {
"content": [
{
"0": [
[
{
"id": "input"
},
"input.txt:md5,9e5562b3f94857b8189b59849ce65cfb"
"input.txt:md5,38bc015bc7bb9f4fc0fdb08a698cfc78"
]
],
"1": [
Expand All @@ -18,14 +18,18 @@
{
"id": "input"
},
"input.txt:md5,9e5562b3f94857b8189b59849ce65cfb"
"input.txt:md5,38bc015bc7bb9f4fc0fdb08a698cfc78"
]
],
"versions": [
"versions.yml:md5,a523ef8d6391ddeff47bfd30b606d628"
]
}
],
"timestamp": "2023-10-16T15:55:52.457257547"
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-11-26T19:06:32.115560314"
}
}
5 changes: 1 addition & 4 deletions modules/nf-core/glimpse/chunk/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
process {
withName: GLIMPSE_CHUNK {
ext.args = [
"--window-size 2000000",
"--buffer-size 200000"
].join(' ')
ext.args = { "${params.glimpse_args}" }
ext.prefix = { "${meta.id}" }
}
}
6 changes: 3 additions & 3 deletions modules/nf-core/glimpse/concordance/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ process GLIMPSE_CONCORDANCE {
tuple val(meta), path("*.rsquare.grp.txt.gz"), emit: rsquare_grp
tuple val(meta), path("*.rsquare.spl.txt.gz"), emit: rsquare_spl
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

Expand All @@ -42,13 +41,14 @@ process GLIMPSE_CONCORDANCE {
$bins_cmd

cat <<-END_VERSIONS > versions.yml
"${task.process}":
glimpse: "\$(GLIMPSE_concordance --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
"${task.process}":
glimpse: "\$(GLIMPSE_concordance --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"

"""
echo "" | gzip > ${prefix}.error.cal.txt.gz
echo "" | gzip > ${prefix}.error.grp.txt.gz
Expand Down
76 changes: 15 additions & 61 deletions modules/nf-core/glimpse/concordance/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ nextflow_process {
script "../main.nf"
process "GLIMPSE_CONCORDANCE"

config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "glimpse"
Expand All @@ -12,64 +14,21 @@ nextflow_process {
tag "bcftools/index"

test("test_glimpse_concordance") {
setup {
run("GLIMPSE_PHASE") {
script "../../phase/main.nf"
process {
"""
ch_sample = Channel.of('NA12878 2').collectFile(name: 'sampleinfos.txt')
region = Channel.fromList([
["chr21:16600000-16750000","chr21:16650000-16700000"]
])
input_vcf = Channel.of([
[ id:'input'], // meta map
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
ref_panel = Channel.of([
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true)
])
ch_map = Channel.of([
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])

input[0] = input_vcf
| combine(ch_sample)
| combine(region)
| combine(ref_panel)
| combine(ch_map)
"""
}
}
run("BCFTOOLS_INDEX") {
script "../../../bcftools/index/main.nf"
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variants
"""
}
}
}
when {
process {
"""
allele_freq = Channel.fromList([
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true),
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true)
]).collect()
truth = Channel.fromList([
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true)
]).collect()
estimate = GLIMPSE_PHASE.out.phased_variants
| join (BCFTOOLS_INDEX.out.csi)
input[0] = estimate
| combine (allele_freq)
| combine (truth)
| combine (["chr21"])
input[1] = []
input[2] = []
input[0] = channel.of([
[ id: "NA12878" ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz",checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi",checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz",checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz.csi",checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878_GIAB.chr21_22.vcf.gz",checkIfExists:true),
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878_GIAB.chr21_22.vcf.gz.csi",checkIfExists:true),
"chr21"
])
input[1] = 0.7
input[2] = 3
input[3] = []
"""
}
Expand All @@ -78,12 +37,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.errors_cal,
process.out.errors_spl,
process.out.rsquare_spl,
process.out.versions
).match() }
{ assert snapshot(process.out).match() }
)
}

Expand Down
119 changes: 90 additions & 29 deletions modules/nf-core/glimpse/concordance/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,38 +1,99 @@
{
"test_glimpse_concordance": {
"content": [
[
[
{
"id": "input"
},
"input.error.cal.txt.gz:md5,15c6a120d9fd3ac8c0ff6a6aedc76571"
{
"0": [
[
{
"id": "NA12878"
},
"NA12878.error.cal.txt.gz:md5,b4af39e7acfebd69f2fe5fa496551a32"
]
],
"1": [
[
{
"id": "NA12878"
},
"NA12878.error.grp.txt.gz:md5,069e311f252ff6b6e748a68ce0bcb499"
]
],
"2": [
[
{
"id": "NA12878"
},
"NA12878.error.spl.txt.gz:md5,284843acf1662f2aeafc6fe5c47e629f"
]
],
"3": [
[
{
"id": "NA12878"
},
"NA12878.rsquare.grp.txt.gz:md5,06c70a1e2047710d6752b9d98e45cea0"
]
],
"4": [
[
{
"id": "NA12878"
},
"NA12878.rsquare.spl.txt.gz:md5,30a00f0b1de47fd63414d819b4304ded"
]
],
"5": [
"versions.yml:md5,b6c06f9736c60f9f548c3c082b522025"
],
"errors_cal": [
[
{
"id": "NA12878"
},
"NA12878.error.cal.txt.gz:md5,b4af39e7acfebd69f2fe5fa496551a32"
]
],
"errors_grp": [
[
{
"id": "NA12878"
},
"NA12878.error.grp.txt.gz:md5,069e311f252ff6b6e748a68ce0bcb499"
]
],
"errors_spl": [
[
{
"id": "NA12878"
},
"NA12878.error.spl.txt.gz:md5,284843acf1662f2aeafc6fe5c47e629f"
]
],
"rsquare_grp": [
[
{
"id": "NA12878"
},
"NA12878.rsquare.grp.txt.gz:md5,06c70a1e2047710d6752b9d98e45cea0"
]
],
"rsquare_spl": [
[
{
"id": "NA12878"
},
"NA12878.rsquare.spl.txt.gz:md5,30a00f0b1de47fd63414d819b4304ded"
]
],
"versions": [
"versions.yml:md5,b6c06f9736c60f9f548c3c082b522025"
]
],
[
[
{
"id": "input"
},
"input.error.spl.txt.gz:md5,35cb463e8db41e2180f21941ab0324e0"
]
],
[
[
{
"id": "input"
},
"input.rsquare.spl.txt.gz:md5,55659f466775d828ee1ba723464bb460"
]
],
[
"versions.yml:md5,f79c864118d03a4afa93082c46c0d608"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-15T12:50:35.203335"
"timestamp": "2025-11-27T11:08:34.841155791"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/glimpse/concordance/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: GLIMPSE_CONCORDANCE {
ext.args = "--gt-validation --gt-target"
}
}
6 changes: 3 additions & 3 deletions modules/nf-core/glimpse/ligate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ process GLIMPSE_LIGATE {
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: "vcf.gz"
"""
printf "%s\\n" $input_list | tr -d '[],' > all_files.txt
printf "%s\\n" $input_list | tr -d '[],' | sort -V > all_files.txt

GLIMPSE_ligate \\
$args \\
Expand All @@ -31,8 +31,8 @@ process GLIMPSE_LIGATE {
--output ${prefix}.${suffix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
glimpse: "\$(GLIMPSE_ligate --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
"${task.process}":
glimpse: "\$(GLIMPSE_ligate --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
END_VERSIONS
"""

Expand Down
Loading
Loading