@@ -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"
0 commit comments