Skip to content

Commit 2a136c7

Browse files
committed
Use real makegrmpart in removerelatedsubjects tests
1 parent 4dcc560 commit 2a136c7

3 files changed

Lines changed: 65 additions & 66 deletions

File tree

modules/nf-core/gcta/removerelatedsubjects/tests/helpers/dense_grm/main.nf

Lines changed: 0 additions & 33 deletions
This file was deleted.

modules/nf-core/gcta/removerelatedsubjects/tests/main.nf.test

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,53 @@ nextflow_process {
88
tag "modules_nfcore"
99
tag "gcta"
1010
tag "gcta/removerelatedsubjects"
11-
tag "tests/helpers/dense_grm"
11+
tag "gcta/makegrmpart"
1212

1313
setup {
14-
run("GCTA_TEST_DENSE_GRM", alias: "GCTA_TEST_DENSE_GRM_CONTRACT") {
15-
script "../tests/helpers/dense_grm/main.nf"
14+
run("GCTA_MAKEGRMPART", alias: "GCTA_MAKEGRMPART_CONTRACT") {
15+
script "../../makegrmpart/main.nf"
1616
process {
1717
"""
18+
file('tiny_dense.mbfile').text = 'plink_simulated\\n'
19+
1820
input[0] = [
19-
[ id:'tiny_dense' ],
20-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true),
21-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true),
22-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
21+
[ id:'tiny_dense', part_gcta_job:1, nparts_gcta:1 ],
22+
file('tiny_dense.mbfile'),
23+
[
24+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
25+
],
26+
[
27+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true)
28+
],
29+
[
30+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
31+
]
2332
]
33+
input[1] = [[ id:'all_variants' ], []]
2434
"""
2535
}
2636
}
2737

28-
run("GCTA_TEST_DENSE_GRM", alias: "GCTA_TEST_DENSE_GRM_STUB") {
29-
script "../tests/helpers/dense_grm/main.nf"
38+
run("GCTA_MAKEGRMPART", alias: "GCTA_MAKEGRMPART_STUB") {
39+
script "../../makegrmpart/main.nf"
3040
process {
3141
"""
42+
file('stub_dense.mbfile').text = 'plink_simulated\\n'
43+
3244
input[0] = [
33-
[ id:'stub_dense' ],
34-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true),
35-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true),
36-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
45+
[ id:'stub_dense', part_gcta_job:1, nparts_gcta:1 ],
46+
file('stub_dense.mbfile'),
47+
[
48+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
49+
],
50+
[
51+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true)
52+
],
53+
[
54+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
55+
]
3756
]
57+
input[1] = [[ id:'all_variants' ], []]
3858
"""
3959
}
4060
}
@@ -46,7 +66,10 @@ nextflow_process {
4666
when {
4767
process {
4868
"""
49-
input[0] = GCTA_TEST_DENSE_GRM_CONTRACT.out.dense_grm
69+
input[0] = GCTA_MAKEGRMPART_CONTRACT.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
70+
def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
71+
[[ id:prefix ], grm_id, grm_bin, grm_n_bin]
72+
}
5073
"""
5174
}
5275
}
@@ -56,7 +79,7 @@ nextflow_process {
5679
{ assert process.success },
5780
{ assert process.out.grm_files.size() == 1 },
5881
{ assert process.out.keep_file.size() == 1 },
59-
{ assert process.out.grm_files.get(0).get(0).id == "tiny_dense" },
82+
{ assert process.out.grm_files.get(0).get(0).id == "tiny_dense.part_1_1" },
6083
{
6184
def grm_row = process.out.grm_files.get(0)
6285
def expected_prefix = "${grm_row.get(0).id}_unrel05"
@@ -82,7 +105,10 @@ nextflow_process {
82105
when {
83106
process {
84107
"""
85-
input[0] = GCTA_TEST_DENSE_GRM_CONTRACT.out.dense_grm.map { meta, grm_id, grm_bin, grm_n_bin ->
108+
input[0] = GCTA_MAKEGRMPART_CONTRACT.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
109+
def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
110+
[[ id:prefix ], grm_id, grm_bin, grm_n_bin]
111+
}.map { meta, grm_id, grm_bin, grm_n_bin ->
86112
[[ id:'tiny_dense_mismatched' ], grm_id, grm_bin, grm_n_bin]
87113
}
88114
"""
@@ -103,7 +129,10 @@ nextflow_process {
103129
when {
104130
process {
105131
"""
106-
input[0] = GCTA_TEST_DENSE_GRM_CONTRACT.out.dense_grm.map { meta, grm_id, grm_bin, grm_n_bin ->
132+
input[0] = GCTA_MAKEGRMPART_CONTRACT.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
133+
def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
134+
[[ id:prefix ], grm_id, grm_bin, grm_n_bin]
135+
}.map { meta, grm_id, grm_bin, grm_n_bin ->
107136
[[ id:meta.id ], grm_id, grm_bin]
108137
}
109138
"""
@@ -122,15 +151,18 @@ nextflow_process {
122151
when {
123152
process {
124153
"""
125-
input[0] = GCTA_TEST_DENSE_GRM_STUB.out.dense_grm
154+
input[0] = GCTA_MAKEGRMPART_STUB.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
155+
def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
156+
[[ id:prefix ], grm_id, grm_bin, grm_n_bin]
157+
}
126158
"""
127159
}
128160
}
129161

130162
then {
131163
assertAll(
132164
{ assert process.success },
133-
{ assert process.out.grm_files.get(0).get(0).id == "stub_dense" },
165+
{ assert process.out.grm_files.get(0).get(0).id == "stub_dense.part_1_1" },
134166
{
135167
def grm_row = process.out.grm_files.get(0)
136168
def expected_prefix = "${grm_row.get(0).id}_unrel05"

modules/nf-core/gcta/removerelatedsubjects/tests/main.nf.test.snap

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
[
55
[
66
{
7-
"id": "tiny_dense"
7+
"id": "tiny_dense.part_1_1"
88
},
9-
"tiny_dense_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b",
10-
"tiny_dense_unrel05.grm.bin:md5,b1f124463eecbae86840a6651eec372d",
11-
"tiny_dense_unrel05.grm.N.bin:md5,06b73ea8bae8f1e5f5d4de33dbd2c75e"
9+
"tiny_dense.part_1_1_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b",
10+
"tiny_dense.part_1_1_unrel05.grm.bin:md5,b1f124463eecbae86840a6651eec372d",
11+
"tiny_dense.part_1_1_unrel05.grm.N.bin:md5,06b73ea8bae8f1e5f5d4de33dbd2c75e"
1212
]
1313
],
1414
[
1515
[
1616
{
17-
"id": "tiny_dense"
17+
"id": "tiny_dense.part_1_1"
1818
},
19-
"tiny_dense_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
19+
"tiny_dense.part_1_1_unrel05.grm.id:md5,ca8c0bded6951fdd3bf0dddc97b6df6b"
2020
]
2121
],
2222
{
@@ -33,26 +33,26 @@
3333
"nf-test": "0.9.3",
3434
"nextflow": "25.10.4"
3535
},
36-
"timestamp": "2026-03-21T18:41:51.827057425"
36+
"timestamp": "2026-03-21T20:33:54.318908345"
3737
},
3838
"homo_sapiens popgen - remove related individuals from dense GRM - stub": {
3939
"content": [
4040
[
4141
[
4242
{
43-
"id": "stub_dense"
43+
"id": "stub_dense.part_1_1"
4444
},
45-
"stub_dense_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e",
46-
"stub_dense_unrel05.grm.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
47-
"stub_dense_unrel05.grm.N.bin:md5,d41d8cd98f00b204e9800998ecf8427e"
45+
"stub_dense.part_1_1_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e",
46+
"stub_dense.part_1_1_unrel05.grm.bin:md5,d41d8cd98f00b204e9800998ecf8427e",
47+
"stub_dense.part_1_1_unrel05.grm.N.bin:md5,d41d8cd98f00b204e9800998ecf8427e"
4848
]
4949
],
5050
[
5151
[
5252
{
53-
"id": "stub_dense"
53+
"id": "stub_dense.part_1_1"
5454
},
55-
"stub_dense_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
55+
"stub_dense.part_1_1_unrel05.grm.id:md5,d41d8cd98f00b204e9800998ecf8427e"
5656
]
5757
],
5858
{
@@ -69,6 +69,6 @@
6969
"nf-test": "0.9.3",
7070
"nextflow": "25.10.4"
7171
},
72-
"timestamp": "2026-03-21T18:42:16.0502909"
72+
"timestamp": "2026-03-21T20:34:22.18319806"
7373
}
7474
}

0 commit comments

Comments
 (0)