@@ -5,6 +5,7 @@ nextflow.enable.dsl = 2
55params. ifm_transform = [" square" , " cube" , " none" ][0 ]
66params. ifm_ntrails = 1000
77params. test = false
8+ params. num_reps = 1
89params. resdir = " res"
910def resdir = params. resdir
1011
@@ -274,10 +275,25 @@ workflow WF_SP {
274275 println (" \n\n ------------- Single Population Sets-------------" )
275276 sp_sets. each{k, v -> println (" ${ k} \t\t ${ v} " )}
276277
278+ def expanded_sets = [:]
279+
280+ if (params. num_reps == 1 ) {
281+ expanded_sets = sp_sets
282+ } else {
283+ (0 .. < (params. num_reps)). each {rep ->
284+ sp_sets. each{k, v->
285+ def k1 = " ${ k} _rep${ rep} "
286+ def v1 = v + [genome_set_id : v. genome_set_id + 10 * rep]
287+ expanded_sets[k1] = v1
288+ }
289+ }
290+ }
291+
292+
277293
278294 // SIMULATE chromosomes
279295 chr_chrno = channel. from(1 .. 14 )
280- ch_sp_params = channel. from(sp_sets . collect{k , v -> [k, v]})
296+ ch_sp_params = channel. from(expanded_sets . collect{k , v -> [k, v]})
281297
282298 if (params. test) {
283299 ch_sp_params = ch_sp_params. first(). map{
@@ -334,11 +350,26 @@ workflow WF_MP {
334350 println (" \n\n ------------- Multiple Population Sets-------------" )
335351 mp_sets. each{k, v -> println (" ${ k} \t\t ${ v} " )}
336352
353+ def expanded_sets = [:]
337354
355+ if (params. num_reps == 1 )
356+ {
357+ expanded_sets = mp_sets
358+ }
359+ else {
360+ (0 .. < (params. num_reps)). each {rep ->
361+ mp_sets. each{k, v->
362+ def k1 = " ${ k} _rep${ rep} "
363+ def v1 = v + [genome_set_id : v. genome_set_id + 10 * rep]
364+ expanded_sets[k1] = v1
365+ }
366+ }
367+
368+ }
338369
339370 // SIMULATE chromosomes
340371 chr_chrno = channel. from(1 .. 14 )
341- ch_mp_params = channel. from(mp_sets . collect{k , v -> [k, v]})
372+ ch_mp_params = channel. from(expanded_sets . collect{k , v -> [k, v]})
342373
343374 if (params. test) {
344375 ch_mp_params = ch_mp_params. first(). map{
0 commit comments