@@ -8,8 +8,9 @@ nextflow_process {
88 tag "modules_nfcore"
99 tag "gcta"
1010 tag "gcta/fastgwa"
11+ tag "gcta/makegrmpart"
12+ tag "gcta/makebksparse"
1113 tag "gawk"
12- tag "tests/helpers/gcta_prepare_sparse"
1314 config "./nextflow.config"
1415
1516 setup {
@@ -83,17 +84,41 @@ nextflow_process {
8384 }
8485 }
8586
86- run("GCTA_TEST_PREPARE_SPARSE ", alias: "GCTA_TEST_PREPARE_SPARSE_DENSE ") {
87- script "../tests/helpers/gcta_prepare_sparse /main.nf"
87+ run("GCTA_MAKEGRMPART ", alias: "GCTA_MAKEGRMPART_DENSE ") {
88+ script "../../makegrmpart /main.nf"
8889 process {
8990 """
91+ file('plink_simulated.mbfile').text = 'plink_simulated\\n'
92+
9093 input[0] = [
91- [ id:'plink_simulated_dense' ],
92- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true),
93- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true),
94- file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
94+ [ id:'plink_simulated_dense', part_gcta_job:1, nparts_gcta:1 ],
95+ file('plink_simulated.mbfile'),
96+ [
97+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true)
98+ ],
99+ [
100+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true)
101+ ],
102+ [
103+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true)
104+ ]
95105 ]
96- input[1] = 0.05
106+ input[1] = [[ id:'all_variants' ], []]
107+ """
108+ }
109+ }
110+
111+ run("GCTA_MAKEBKSPARSE", alias: "GCTA_MAKEBKSPARSE_DENSE") {
112+ script "../../makebksparse/main.nf"
113+ process {
114+ """
115+ dense_grm = GCTA_MAKEGRMPART_DENSE.out.grm_files.map { meta, grm_id, grm_bin, grm_n_bin ->
116+ def prefix = meta.id + '.part_' + meta.nparts_gcta + '_' + meta.part_gcta_job
117+ [[ id:prefix ], grm_id, grm_bin, grm_n_bin]
118+ }
119+
120+ input[0] = dense_grm
121+ input[1] = Channel.value(0.05)
97122 """
98123 }
99124 }
@@ -103,6 +128,10 @@ nextflow_process {
103128 when {
104129 process {
105130 """
131+ sparse_grm = GCTA_MAKEBKSPARSE_DENSE.out.sparse_grm_files.map { meta, sparse_grm_id, sparse_grm_sp ->
132+ [[ id:meta.id + '_sp' ], sparse_grm_id, sparse_grm_sp]
133+ }
134+
106135 quantitative_pheno = GAWK_QUANTITATIVE_PHENO.out.output.map { meta, phenotype_file ->
107136 [[ id:meta.id, is_binary:false ], phenotype_file]
108137 }
@@ -113,7 +142,7 @@ nextflow_process {
113142 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.bim", checkIfExists: true),
114143 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.fam", checkIfExists: true)
115144 ]
116- input[1] = GCTA_TEST_PREPARE_SPARSE_DENSE.out. sparse_grm
145+ input[1] = sparse_grm
117146 input[2] = quantitative_pheno
118147 input[3] = GAWK_QUANTITATIVE_COVARIATES.out.output
119148 input[4] = GAWK_CATEGORICAL_COVARIATES.out.output
@@ -147,6 +176,10 @@ nextflow_process {
147176 when {
148177 process {
149178 """
179+ sparse_grm = GCTA_MAKEBKSPARSE_DENSE.out.sparse_grm_files.map { meta, sparse_grm_id, sparse_grm_sp ->
180+ [[ id:meta.id + '_sp' ], sparse_grm_id, sparse_grm_sp]
181+ }
182+
150183 multi_pheno = GAWK_MULTI_PHENO.out.output.map { meta, phenotype_file ->
151184 [[ id:'QuantitativeTraitMpheno2', is_binary:false ], phenotype_file]
152185 }
@@ -157,7 +190,7 @@ nextflow_process {
157190 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.bim", checkIfExists: true),
158191 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.fam", checkIfExists: true)
159192 ]
160- input[1] = GCTA_TEST_PREPARE_SPARSE_DENSE.out. sparse_grm
193+ input[1] = sparse_grm
161194 input[2] = multi_pheno
162195 input[3] = GAWK_QUANTITATIVE_COVARIATES.out.output
163196 input[4] = GAWK_CATEGORICAL_COVARIATES.out.output
@@ -239,6 +272,10 @@ nextflow_process {
239272 when {
240273 process {
241274 """
275+ sparse_grm = GCTA_MAKEBKSPARSE_DENSE.out.sparse_grm_files.map { meta, sparse_grm_id, sparse_grm_sp ->
276+ [[ id:meta.id + '_sp' ], sparse_grm_id, sparse_grm_sp]
277+ }
278+
242279 quantitative_pheno = GAWK_QUANTITATIVE_PHENO.out.output.map { meta, phenotype_file ->
243280 [[ id:meta.id, is_binary:false ], phenotype_file]
244281 }
@@ -249,7 +286,7 @@ nextflow_process {
249286 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.pvar", checkIfExists: true),
250287 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.psam", checkIfExists: true)
251288 ]
252- input[1] = GCTA_TEST_PREPARE_SPARSE_DENSE.out. sparse_grm
289+ input[1] = sparse_grm
253290 input[2] = quantitative_pheno
254291 input[3] = [[ id:'covariates_quant' ], []]
255292 input[4] = [[ id:'covariates_cat' ], []]
@@ -281,11 +318,15 @@ nextflow_process {
281318 when {
282319 process {
283320 """
321+ sparse_grm = GCTA_MAKEBKSPARSE_DENSE.out.sparse_grm_files.map { meta, sparse_grm_id, sparse_grm_sp ->
322+ [[ id:meta.id + '_sp' ], sparse_grm_id, sparse_grm_sp]
323+ }
324+
284325 quantitative_pheno = GAWK_QUANTITATIVE_PHENO.out.output.map { meta, phenotype_file ->
285326 [[ id:meta.id, is_binary:false ], phenotype_file]
286327 }
287328
288- sparse_grm_bad_prefix = GCTA_TEST_PREPARE_SPARSE_DENSE.out. sparse_grm.map { meta, sparse_grm_id, sparse_grm_sp ->
329+ sparse_grm_bad_prefix = sparse_grm.map { meta, sparse_grm_id, sparse_grm_sp ->
289330 [[ id:'incorrect_sparse_prefix' ], sparse_grm_id, sparse_grm_sp]
290331 }
291332
@@ -320,6 +361,10 @@ nextflow_process {
320361 when {
321362 process {
322363 """
364+ sparse_grm = GCTA_MAKEBKSPARSE_DENSE.out.sparse_grm_files.map { meta, sparse_grm_id, sparse_grm_sp ->
365+ [[ id:meta.id + '_sp' ], sparse_grm_id, sparse_grm_sp]
366+ }
367+
323368 quantitative_pheno = GAWK_QUANTITATIVE_PHENO.out.output.map { meta, phenotype_file ->
324369 [[ id:meta.id, is_binary:false ], phenotype_file]
325370 }
@@ -330,7 +375,7 @@ nextflow_process {
330375 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.pvar", checkIfExists: true),
331376 file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/plink_simulated.psam", checkIfExists: true)
332377 ]
333- input[1] = GCTA_TEST_PREPARE_SPARSE_DENSE.out. sparse_grm
378+ input[1] = sparse_grm
334379 input[2] = quantitative_pheno
335380 input[3] = [[ id:'covariates_quant' ], []]
336381 input[4] = [[ id:'covariates_cat' ], []]
0 commit comments