@@ -8,30 +8,29 @@ nextflow_process {
88 tag "modules_nfcore"
99 tag "gcta"
1010 tag "gcta/filtergrmwithkeep"
11- tag "gcta/makegrmpart "
11+ tag "gcta/makegrm "
1212 tag "gcta/removerelatedsubjects"
1313
1414 setup {
15- run("GCTA_MAKEGRMPART ", alias: "GCTA_MAKEGRMPART_DENSE ") {
16- script "../../makegrmpart /main.nf"
15+ run("GCTA_MAKEGRM ", alias: "GCTA_MAKEGRM_DENSE ") {
16+ script "../../makegrm /main.nf"
1717 process {
1818 """
19- file('plink_simulated.mbfile ').text = 'plink_simulated\\n'
19+ file('plink_simulated.mpfile ').text = 'plink_simulated plink_simulated.pgen plink_simulated.psam plink_simulated.pvar \\n'
2020
2121 input[0] = [
22- [ id:'plink_simulated_dense', part_gcta_job:1, nparts_gcta:1 ],
23- file('plink_simulated.mbfile '),
22+ [ id:'plink_simulated_dense' ],
23+ file('plink_simulated.mpfile '),
2424 [
25- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed ', checkIfExists: true)
25+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pgen ', checkIfExists: true)
2626 ],
2727 [
28- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim ', checkIfExists: true)
28+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pvar ', checkIfExists: true)
2929 ],
3030 [
31- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam ', checkIfExists: true)
31+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.psam ', checkIfExists: true)
3232 ]
3333 ]
34- input[1] = [[ id:'all_variants' ], []]
3534 """
3635 }
3736 }
@@ -40,10 +39,8 @@ nextflow_process {
4039 script "../../removerelatedsubjects/main.nf"
4140 process {
4241 """
43- dense_grm = GCTA_MAKEGRMPART_DENSE.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
44- def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
45- [[ id:prefix ], grm_id, grm_bin, grm_n_bin]
46- }
42+ dense_grm = GCTA_MAKEGRM_DENSE.out.grm_files
43+ .map { meta, grm_files -> [[ id:meta.id ], grm_files] }
4744
4845 input[0] = dense_grm
4946 """
@@ -57,12 +54,7 @@ nextflow_process {
5754 when {
5855 process {
5956 """
60- dense_grm = GCTA_MAKEGRMPART_DENSE.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
61- def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
62- [[ id:prefix ], grm_id, grm_bin, grm_n_bin]
63- }
64-
65- input[0] = dense_grm
57+ input[0] = GCTA_MAKEGRM_DENSE.out.grm_files.map { meta, grm_files -> [[ id:meta.id ], grm_files] }
6658 input[1] = GCTA_REMOVERELATEDSUBJECTS_KEEP.out.keep_file
6759 """
6860 }
@@ -72,17 +64,20 @@ nextflow_process {
7264 assertAll(
7365 { assert process.success },
7466 { assert process.out.filtered_grm.size() == 1 },
75- { assert process.out.filtered_grm.get(0).get(0).id == "plink_simulated_dense.part_1_1 " },
67+ { assert process.out.filtered_grm.get(0).get(0).id == "plink_simulated_dense" },
7668 {
7769 assert snapshot(
7870 process.out.filtered_grm
7971 ).match("filtered_grm")
8072 },
8173 {
8274 def row = process.out.filtered_grm.get(0)
83- assert file(row.get(1)).exists()
84- assert file(row.get(2)).exists()
85- assert file(row.get(3)).exists()
75+ assert row.get(1).every { file(it).exists() }
76+ assert row.get(1).collect { file(it).name }.sort() == [
77+ "plink_simulated_dense_unrel.grm.N.bin",
78+ "plink_simulated_dense_unrel.grm.bin",
79+ "plink_simulated_dense_unrel.grm.id"
80+ ]
8681 },
8782 { assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match("versions") }
8883 )
@@ -95,13 +90,8 @@ nextflow_process {
9590 when {
9691 process {
9792 """
98- dense_grm = GCTA_MAKEGRMPART_DENSE.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
99- def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
100- [[ id:prefix ], grm_id, grm_bin, grm_n_bin]
101- }
102-
103- input[0] = dense_grm.map { meta, grm_id, grm_bin, grm_n_bin ->
104- [[ id:'contract_dense_mismatch' ], grm_id, grm_bin, grm_n_bin]
93+ input[0] = GCTA_MAKEGRM_DENSE.out.grm_files.map { meta, grm_files ->
94+ [[ id:'contract_dense_mismatch' ], grm_files]
10595 }
10696 input[1] = GCTA_REMOVERELATEDSUBJECTS_KEEP.out.keep_file
10797 """
@@ -123,12 +113,7 @@ nextflow_process {
123113 when {
124114 process {
125115 """
126- dense_grm = GCTA_MAKEGRMPART_DENSE.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
127- def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
128- [[ id:prefix ], grm_id, grm_bin, grm_n_bin]
129- }
130-
131- input[0] = dense_grm
116+ input[0] = GCTA_MAKEGRM_DENSE.out.grm_files.map { meta, grm_files -> [[ id:meta.id ], grm_files] }
132117 input[1] = GCTA_REMOVERELATEDSUBJECTS_KEEP.out.keep_file
133118 """
134119 }
@@ -138,17 +123,20 @@ nextflow_process {
138123 assertAll(
139124 { assert process.success },
140125 { assert process.out.filtered_grm.size() == 1 },
141- { assert process.out.filtered_grm.get(0).get(0).id == "plink_simulated_dense.part_1_1 " },
126+ { assert process.out.filtered_grm.get(0).get(0).id == "plink_simulated_dense" },
142127 {
143128 assert snapshot(
144129 process.out.filtered_grm
145130 ).match("stub_filtered_grm")
146131 },
147132 {
148133 def row = process.out.filtered_grm.get(0)
149- assert file(row.get(1)).exists()
150- assert file(row.get(2)).exists()
151- assert file(row.get(3)).exists()
134+ assert row.get(1).every { file(it).exists() }
135+ assert row.get(1).collect { file(it).name }.sort() == [
136+ "plink_simulated_dense_unrel.grm.N.bin",
137+ "plink_simulated_dense_unrel.grm.bin",
138+ "plink_simulated_dense_unrel.grm.id"
139+ ]
152140 },
153141 { assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match("stub_versions") }
154142 )
0 commit comments