@@ -10,15 +10,15 @@ nextflow_process {
1010 tag "gcta/makegrmpart"
1111
1212 test("homo_sapiens popgen - plink2") {
13- config "./nextflow.config"
14-
1513 when {
1614 process {
1715 """
1816 file('gcta_grm.mpfile').text = 'plink_simulated plink_simulated.pgen plink_simulated.psam plink_simulated.pvar\\n'
1917
2018 input[0] = [
21- [ id:'gcta_grm', part_gcta_job:1, nparts_gcta:2 ],
19+ [ id:'gcta_grm' ],
20+ 2,
21+ 1,
2222 file('gcta_grm.mpfile'),
2323 [
2424 file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pgen', checkIfExists: true)
@@ -40,6 +40,10 @@ nextflow_process {
4040 { assert process.success },
4141 { assert process.out.grm_files.size() == 1 },
4242 { assert process.out.grm_files.get(0).get(0).id == 'gcta_grm' },
43+ { assert process.out.grm_files.get(0).get(0).keySet() == ['id'] as Set },
44+ { assert process.out.grm_files.get(0).get(1).size() == 3 },
45+ { assert process.out.grm_files.get(0).get(2) == 2 },
46+ { assert process.out.grm_files.get(0).get(3) == 1 },
4347 {
4448 assert snapshot(
4549 process.out.grm_files,
@@ -51,15 +55,15 @@ nextflow_process {
5155 }
5256
5357 test("homo_sapiens popgen - plink1") {
54- config "./nextflow.config"
55-
5658 when {
5759 process {
5860 """
5961 file('gcta_grm.mbfile').text = 'plink_simulated\\n'
6062
6163 input[0] = [
62- [ id:'gcta_grm_bed', part_gcta_job:1, nparts_gcta:2 ],
64+ [ id:'gcta_grm_bed' ],
65+ 2,
66+ 1,
6367 file('gcta_grm.mbfile'),
6468 [
6569 file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
@@ -81,6 +85,10 @@ nextflow_process {
8185 { assert process.success },
8286 { assert process.out.grm_files.size() == 1 },
8387 { assert process.out.grm_files.get(0).get(0).id == 'gcta_grm_bed' },
88+ { assert process.out.grm_files.get(0).get(0).keySet() == ['id'] as Set },
89+ { assert process.out.grm_files.get(0).get(1).size() == 3 },
90+ { assert process.out.grm_files.get(0).get(2) == 2 },
91+ { assert process.out.grm_files.get(0).get(3) == 1 },
8492 {
8593 assert snapshot(
8694 process.out.grm_files,
@@ -92,8 +100,6 @@ nextflow_process {
92100 }
93101
94102 test("homo_sapiens popgen - plink1 - extract snp group") {
95- config "./nextflow.config"
96-
97103 when {
98104 process {
99105 """
@@ -107,7 +113,9 @@ nextflow_process {
107113 file('snp_group_extract.txt').text = extractSnps
108114
109115 input[0] = [
110- [ id:'gcta_grm_bed_extract', part_gcta_job:1, nparts_gcta:2 ],
116+ [ id:'gcta_grm_bed_extract' ],
117+ 2,
118+ 1,
111119 file('gcta_grm_extract.mbfile'),
112120 [
113121 file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
@@ -119,7 +127,7 @@ nextflow_process {
119127 file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
120128 ]
121129 ]
122- input[1] = [[ id:'snp_group_extract', snp_group:1 ], file('snp_group_extract.txt')]
130+ input[1] = [[ id:'snp_group_extract' ], file('snp_group_extract.txt')]
123131 """
124132 }
125133 }
@@ -129,6 +137,10 @@ nextflow_process {
129137 { assert process.success },
130138 { assert process.out.grm_files.size() == 1 },
131139 { assert process.out.grm_files.get(0).get(0).id == 'gcta_grm_bed_extract' },
140+ { assert process.out.grm_files.get(0).get(0).keySet() == ['id'] as Set },
141+ { assert process.out.grm_files.get(0).get(1).size() == 3 },
142+ { assert process.out.grm_files.get(0).get(2) == 2 },
143+ { assert process.out.grm_files.get(0).get(3) == 1 },
132144 {
133145 assert snapshot(
134146 process.out.grm_files,
@@ -139,17 +151,69 @@ nextflow_process {
139151 }
140152 }
141153
154+ test("homo_sapiens popgen - plink1 - default partition values") {
155+ when {
156+ process {
157+ """
158+ file('gcta_grm_default.mbfile').text = 'plink_simulated\\n'
159+
160+ input[0] = [
161+ [ id:'gcta_grm_bed_default' ],
162+ null,
163+ null,
164+ file('gcta_grm_default.mbfile'),
165+ [
166+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
167+ ],
168+ [
169+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true)
170+ ],
171+ [
172+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
173+ ]
174+ ]
175+ input[1] = [[ id:'snp_group0' ], []]
176+ """
177+ }
178+ }
179+
180+ then {
181+ assertAll(
182+ { assert process.success },
183+ { assert process.out.grm_files.size() == 1 },
184+ { assert process.out.grm_files.get(0).get(0).id == 'gcta_grm_bed_default' },
185+ { assert process.out.grm_files.get(0).get(0).keySet() == ['id'] as Set },
186+ { assert process.out.grm_files.get(0).get(1).size() == 3 },
187+ {
188+ assert process.out.grm_files.get(0).get(1).collect { it.toString().tokenize('/').last() }.toSet() == [
189+ 'gcta_grm_bed_default.part_1_1.grm.id',
190+ 'gcta_grm_bed_default.part_1_1.grm.bin',
191+ 'gcta_grm_bed_default.part_1_1.grm.N.bin'
192+ ] as Set
193+ },
194+ { assert process.out.grm_files.get(0).get(2) == null },
195+ { assert process.out.grm_files.get(0).get(3) == null },
196+ {
197+ assert snapshot(
198+ process.out.findAll { key, val -> key.startsWith('versions') }
199+ ).match()
200+ }
201+ )
202+ }
203+ }
204+
142205 test("homo_sapiens popgen - plink1 - stub") {
143206 options "-stub"
144- config "./nextflow.config"
145207
146208 when {
147209 process {
148210 """
149211 file('gcta_grm.mbfile').text = 'plink_simulated\\n'
150212
151213 input[0] = [
152- [ id:'gcta_grm_bed', part_gcta_job:1, nparts_gcta:2 ],
214+ [ id:'gcta_grm_bed' ],
215+ 2,
216+ 1,
153217 file('gcta_grm.mbfile'),
154218 [
155219 file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
0 commit comments