Skip to content

Commit d911d93

Browse files
LouisLeNezetLouisLeNezetmashehu
authored
Update test files for Glimpse (#9467)
* Update glimpse * Update chunk * Update concordance * Revert changes * Fix glimpse test * Fix glimpse * Fix glimpse2 tests * Update sbwf * Remove old snapshots * Update glimpse * Update modules/nf-core/glimpse2/concordance/tests/main.nf.test Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com> * Update test --------- Co-authored-by: LouisLeNezet <louislenezet@gmaio.com> Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
1 parent 654daca commit d911d93

File tree

35 files changed

+834
-509
lines changed

35 files changed

+834
-509
lines changed

modules/nf-core/glimpse/chunk/main.nf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ process GLIMPSE_CHUNK {
3737

3838
stub:
3939
def prefix = task.ext.prefix ?: "${meta.id}"
40+
4041
"""
4142
touch ${prefix}.txt
4243

modules/nf-core/glimpse/chunk/tests/main.nf.test

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@ nextflow_process {
33
name "Test Process GLIMPSE_CHUNK"
44
script "../main.nf"
55
process "GLIMPSE_CHUNK"
6+
config "./nextflow.config"
7+
68
tag "glimpse"
79
tag "glimpse/chunk"
810
tag "modules_nfcore"
911
tag "modules"
1012

11-
test("Should run without failures") {
12-
config "modules/nf-core/glimpse/chunk/tests/nextflow.config"
13-
13+
test("homo_sapiens - vcf chr 22") {
1414
when {
15+
params{
16+
glimpse_args = "--window-size 2000000 --buffer-size 200000"
17+
}
1518
process {
1619
"""
1720
input[0] = [
1821
[ id:'input' ], // meta map
19-
file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true),
20-
file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true),
21-
"chr21"
22+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExists:true),
23+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExists:true),
24+
"chr22"
2225
]
2326
"""
2427
}
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"Should run without failures": {
2+
"homo_sapiens - vcf chr 22": {
33
"content": [
44
{
55
"0": [
66
[
77
{
88
"id": "input"
99
},
10-
"input.txt:md5,9e5562b3f94857b8189b59849ce65cfb"
10+
"input.txt:md5,38bc015bc7bb9f4fc0fdb08a698cfc78"
1111
]
1212
],
1313
"1": [
@@ -18,14 +18,18 @@
1818
{
1919
"id": "input"
2020
},
21-
"input.txt:md5,9e5562b3f94857b8189b59849ce65cfb"
21+
"input.txt:md5,38bc015bc7bb9f4fc0fdb08a698cfc78"
2222
]
2323
],
2424
"versions": [
2525
"versions.yml:md5,a523ef8d6391ddeff47bfd30b606d628"
2626
]
2727
}
2828
],
29-
"timestamp": "2023-10-16T15:55:52.457257547"
29+
"meta": {
30+
"nf-test": "0.9.3",
31+
"nextflow": "25.10.0"
32+
},
33+
"timestamp": "2025-11-26T19:06:32.115560314"
3034
}
3135
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
process {
22
withName: GLIMPSE_CHUNK {
3-
ext.args = [
4-
"--window-size 2000000",
5-
"--buffer-size 200000"
6-
].join(' ')
3+
ext.args = { "${params.glimpse_args}" }
74
ext.prefix = { "${meta.id}" }
85
}
96
}

modules/nf-core/glimpse/concordance/main.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ process GLIMPSE_CONCORDANCE {
2020
tuple val(meta), path("*.rsquare.grp.txt.gz"), emit: rsquare_grp
2121
tuple val(meta), path("*.rsquare.spl.txt.gz"), emit: rsquare_spl
2222
path "versions.yml" , emit: versions
23-
2423
when:
2524
task.ext.when == null || task.ext.when
2625

@@ -42,13 +41,14 @@ process GLIMPSE_CONCORDANCE {
4241
$bins_cmd
4342
4443
cat <<-END_VERSIONS > versions.yml
45-
"${task.process}":
46-
glimpse: "\$(GLIMPSE_concordance --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
44+
"${task.process}":
45+
glimpse: "\$(GLIMPSE_concordance --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
4746
END_VERSIONS
4847
"""
4948

5049
stub:
5150
def prefix = task.ext.prefix ?: "${meta.id}"
51+
5252
"""
5353
echo "" | gzip > ${prefix}.error.cal.txt.gz
5454
echo "" | gzip > ${prefix}.error.grp.txt.gz

modules/nf-core/glimpse/concordance/tests/main.nf.test

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ nextflow_process {
44
script "../main.nf"
55
process "GLIMPSE_CONCORDANCE"
66

7+
config "./nextflow.config"
8+
79
tag "modules"
810
tag "modules_nfcore"
911
tag "glimpse"
@@ -12,64 +14,21 @@ nextflow_process {
1214
tag "bcftools/index"
1315

1416
test("test_glimpse_concordance") {
15-
setup {
16-
run("GLIMPSE_PHASE") {
17-
script "../../phase/main.nf"
18-
process {
19-
"""
20-
ch_sample = Channel.of('NA12878 2').collectFile(name: 'sampleinfos.txt')
21-
region = Channel.fromList([
22-
["chr21:16600000-16750000","chr21:16650000-16700000"]
23-
])
24-
input_vcf = Channel.of([
25-
[ id:'input'], // meta map
26-
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
27-
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
28-
])
29-
ref_panel = Channel.of([
30-
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
31-
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true)
32-
])
33-
ch_map = Channel.of([
34-
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
35-
])
36-
37-
input[0] = input_vcf
38-
| combine(ch_sample)
39-
| combine(region)
40-
| combine(ref_panel)
41-
| combine(ch_map)
42-
"""
43-
}
44-
}
45-
run("BCFTOOLS_INDEX") {
46-
script "../../../bcftools/index/main.nf"
47-
process {
48-
"""
49-
input[0] = GLIMPSE_PHASE.out.phased_variants
50-
"""
51-
}
52-
}
53-
}
5417
when {
5518
process {
5619
"""
57-
allele_freq = Channel.fromList([
58-
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true),
59-
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true)
60-
]).collect()
61-
truth = Channel.fromList([
62-
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true),
63-
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true)
64-
]).collect()
65-
estimate = GLIMPSE_PHASE.out.phased_variants
66-
| join (BCFTOOLS_INDEX.out.csi)
67-
input[0] = estimate
68-
| combine (allele_freq)
69-
| combine (truth)
70-
| combine (["chr21"])
71-
input[1] = []
72-
input[2] = []
20+
input[0] = channel.of([
21+
[ id: "NA12878" ],
22+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz",checkIfExists:true),
23+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi",checkIfExists:true),
24+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz",checkIfExists:true),
25+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz.csi",checkIfExists:true),
26+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878_GIAB.chr21_22.vcf.gz",checkIfExists:true),
27+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878_GIAB.chr21_22.vcf.gz.csi",checkIfExists:true),
28+
"chr21"
29+
])
30+
input[1] = 0.7
31+
input[2] = 3
7332
input[3] = []
7433
"""
7534
}
@@ -78,12 +37,7 @@ nextflow_process {
7837
then {
7938
assertAll(
8039
{ assert process.success },
81-
{ assert snapshot(
82-
process.out.errors_cal,
83-
process.out.errors_spl,
84-
process.out.rsquare_spl,
85-
process.out.versions
86-
).match() }
40+
{ assert snapshot(process.out).match() }
8741
)
8842
}
8943

Lines changed: 90 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,99 @@
11
{
22
"test_glimpse_concordance": {
33
"content": [
4-
[
5-
[
6-
{
7-
"id": "input"
8-
},
9-
"input.error.cal.txt.gz:md5,15c6a120d9fd3ac8c0ff6a6aedc76571"
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "NA12878"
9+
},
10+
"NA12878.error.cal.txt.gz:md5,b4af39e7acfebd69f2fe5fa496551a32"
11+
]
12+
],
13+
"1": [
14+
[
15+
{
16+
"id": "NA12878"
17+
},
18+
"NA12878.error.grp.txt.gz:md5,069e311f252ff6b6e748a68ce0bcb499"
19+
]
20+
],
21+
"2": [
22+
[
23+
{
24+
"id": "NA12878"
25+
},
26+
"NA12878.error.spl.txt.gz:md5,284843acf1662f2aeafc6fe5c47e629f"
27+
]
28+
],
29+
"3": [
30+
[
31+
{
32+
"id": "NA12878"
33+
},
34+
"NA12878.rsquare.grp.txt.gz:md5,06c70a1e2047710d6752b9d98e45cea0"
35+
]
36+
],
37+
"4": [
38+
[
39+
{
40+
"id": "NA12878"
41+
},
42+
"NA12878.rsquare.spl.txt.gz:md5,30a00f0b1de47fd63414d819b4304ded"
43+
]
44+
],
45+
"5": [
46+
"versions.yml:md5,b6c06f9736c60f9f548c3c082b522025"
47+
],
48+
"errors_cal": [
49+
[
50+
{
51+
"id": "NA12878"
52+
},
53+
"NA12878.error.cal.txt.gz:md5,b4af39e7acfebd69f2fe5fa496551a32"
54+
]
55+
],
56+
"errors_grp": [
57+
[
58+
{
59+
"id": "NA12878"
60+
},
61+
"NA12878.error.grp.txt.gz:md5,069e311f252ff6b6e748a68ce0bcb499"
62+
]
63+
],
64+
"errors_spl": [
65+
[
66+
{
67+
"id": "NA12878"
68+
},
69+
"NA12878.error.spl.txt.gz:md5,284843acf1662f2aeafc6fe5c47e629f"
70+
]
71+
],
72+
"rsquare_grp": [
73+
[
74+
{
75+
"id": "NA12878"
76+
},
77+
"NA12878.rsquare.grp.txt.gz:md5,06c70a1e2047710d6752b9d98e45cea0"
78+
]
79+
],
80+
"rsquare_spl": [
81+
[
82+
{
83+
"id": "NA12878"
84+
},
85+
"NA12878.rsquare.spl.txt.gz:md5,30a00f0b1de47fd63414d819b4304ded"
86+
]
87+
],
88+
"versions": [
89+
"versions.yml:md5,b6c06f9736c60f9f548c3c082b522025"
1090
]
11-
],
12-
[
13-
[
14-
{
15-
"id": "input"
16-
},
17-
"input.error.spl.txt.gz:md5,35cb463e8db41e2180f21941ab0324e0"
18-
]
19-
],
20-
[
21-
[
22-
{
23-
"id": "input"
24-
},
25-
"input.rsquare.spl.txt.gz:md5,55659f466775d828ee1ba723464bb460"
26-
]
27-
],
28-
[
29-
"versions.yml:md5,f79c864118d03a4afa93082c46c0d608"
30-
]
91+
}
3192
],
3293
"meta": {
33-
"nf-test": "0.9.2",
34-
"nextflow": "25.04.6"
94+
"nf-test": "0.9.3",
95+
"nextflow": "25.10.0"
3596
},
36-
"timestamp": "2025-09-15T12:50:35.203335"
97+
"timestamp": "2025-11-27T11:08:34.841155791"
3798
}
3899
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
process {
2+
withName: GLIMPSE_CONCORDANCE {
3+
ext.args = "--gt-validation --gt-target"
4+
}
5+
}

modules/nf-core/glimpse/ligate/main.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ process GLIMPSE_LIGATE {
2222
def prefix = task.ext.prefix ?: "${meta.id}"
2323
def suffix = task.ext.suffix ?: "vcf.gz"
2424
"""
25-
printf "%s\\n" $input_list | tr -d '[],' > all_files.txt
25+
printf "%s\\n" $input_list | tr -d '[],' | sort -V > all_files.txt
2626
2727
GLIMPSE_ligate \\
2828
$args \\
@@ -31,8 +31,8 @@ process GLIMPSE_LIGATE {
3131
--output ${prefix}.${suffix}
3232
3333
cat <<-END_VERSIONS > versions.yml
34-
"${task.process}":
35-
glimpse: "\$(GLIMPSE_ligate --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
34+
"${task.process}":
35+
glimpse: "\$(GLIMPSE_ligate --help | sed -nr '/Version/p' | grep -o -E '([0-9]+.){1,2}[0-9]')"
3636
END_VERSIONS
3737
"""
3838

0 commit comments

Comments
 (0)