@@ -109,7 +109,10 @@ workflow PIPELINE_INITIALISATION {
109
109
.map { samplesheet ->
110
110
validateInputSamplesheet(samplesheet)
111
111
}
112
- .map { meta, file, index -> [meta + [batch : 0 ], file, index] } // Set batch to 0 by default
112
+ .map { meta, file, index ->
113
+ def new_meta = meta + [id :meta. id. toString()]
114
+ [ new_meta + [batch : 0 ], file, index ]
115
+ } // Set batch to 0 by default
113
116
} else {
114
117
ch_input = Channel . of([[], [], []])
115
118
}
@@ -131,7 +134,7 @@ workflow PIPELINE_INITIALISATION {
131
134
.fromList(samplesheetToList(params. input_truth, " ${ projectDir} /assets/schema_input.json" ))
132
135
.map {
133
136
meta, file, index ->
134
- [ meta, file, index ]
137
+ [ meta + [ id :meta . id . toString()] , file, index ]
135
138
}
136
139
// Check if all extension are identical
137
140
getFilesSameExt(ch_input_truth)
@@ -151,7 +154,10 @@ workflow PIPELINE_INITIALISATION {
151
154
println " Panel file provided as input is a samplesheet"
152
155
ch_panel = Channel . fromList(samplesheetToList(
153
156
params. panel, " ${ projectDir} /assets/schema_input_panel.json"
154
- ))
157
+ )). map {
158
+ meta, chr, file, index ->
159
+ [ meta + [id :meta. id. toString()], chr, file, index ]
160
+ }
155
161
} else {
156
162
// #TODO Wait for `oneOf()` to be supported in the nextflow_schema.json
157
163
error " Panel file provided is of another format than CSV (not yet supported). Please separate your panel by chromosome and use the samplesheet format."
@@ -220,8 +226,11 @@ workflow PIPELINE_INITIALISATION {
220
226
// Create posfile channel
221
227
//
222
228
if (params. posfile) {
223
- ch_posfile = Channel // ["panel ", "chr", "vcf", "index", "hap", "legend"]
229
+ ch_posfile = Channel // ["meta ", "chr", "vcf", "index", "hap", "legend"]
224
230
.fromList(samplesheetToList(params. posfile, " ${ projectDir} /assets/schema_posfile.json" ))
231
+ .map { meta, chr, vcf, index, hap, legend ->
232
+ [ meta + [id :meta. id. toString()], chr, vcf, index, hap, legend ]
233
+ }
225
234
} else {
226
235
ch_posfile = Channel . of([[],[],[],[],[]])
227
236
}
@@ -240,6 +249,9 @@ workflow PIPELINE_INITIALISATION {
240
249
if (params. chunks) {
241
250
ch_chunks = Channel
242
251
.fromList(samplesheetToList(params. chunks, " ${ projectDir} /assets/schema_chunks.json" ))
252
+ .map { meta, chr, chunks ->
253
+ [ meta + [id :meta. id. toString()], chr, chunks ]
254
+ }
243
255
} else {
244
256
ch_chunks = Channel . of([[],[]])
245
257
}
0 commit comments