@@ -5,6 +5,7 @@ nextflow.enable.dsl = 2
5
5
params. ifm_transform = [" square" , " cube" , " none" ][0 ]
6
6
params. ifm_ntrails = 1000
7
7
params. test = false
8
+ params. num_reps = 1
8
9
params. resdir = " res"
9
10
def resdir = params. resdir
10
11
@@ -274,10 +275,25 @@ workflow WF_SP {
274
275
println (" \n\n ------------- Single Population Sets-------------" )
275
276
sp_sets. each{k, v -> println (" ${ k} \t\t ${ v} " )}
276
277
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
+
277
293
278
294
// SIMULATE chromosomes
279
295
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]})
281
297
282
298
if (params. test) {
283
299
ch_sp_params = ch_sp_params. first(). map{
@@ -334,11 +350,26 @@ workflow WF_MP {
334
350
println (" \n\n ------------- Multiple Population Sets-------------" )
335
351
mp_sets. each{k, v -> println (" ${ k} \t\t ${ v} " )}
336
352
353
+ def expanded_sets = [:]
337
354
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
+ }
338
369
339
370
// SIMULATE chromosomes
340
371
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]})
342
373
343
374
if (params. test) {
344
375
ch_mp_params = ch_mp_params. first(). map{
0 commit comments