Skip to content

Commit d3f4018

Browse files
authored
Merge pull request #189 from LouisLeNezet/id_string
Set meta map id to string
2 parents 5563e31 + 6552b91 commit d3f4018

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- [#179](https://github.com/nf-core/phaseimpute/pull/179) - Fix VCF usage in `GLIMPSE2`.
2626
- [#183](https://github.com/nf-core/phaseimpute/pull/183) - Remove wrongfully added files in `BAM_EXTRACT_REGION_SAMTOOLS`.
2727
- [#185](https://github.com/nf-core/phaseimpute/pull/185) - Fix CSV generation and check that all mentioned path files exist.
28+
- [#189](https://github.com/nf-core/phaseimpute/pull/189) - Set meta map id as string to avoid error when using numbers in csv files.
2829

2930
## v1.0.0 - Black Labrador [2024-12-09]
3031

subworkflows/local/utils_nfcore_phaseimpute_pipeline/main.nf

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ workflow PIPELINE_INITIALISATION {
109109
.map { samplesheet ->
110110
validateInputSamplesheet(samplesheet)
111111
}
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
113116
} else {
114117
ch_input = Channel.of([[], [], []])
115118
}
@@ -131,7 +134,7 @@ workflow PIPELINE_INITIALISATION {
131134
.fromList(samplesheetToList(params.input_truth, "${projectDir}/assets/schema_input.json"))
132135
.map {
133136
meta, file, index ->
134-
[ meta, file, index ]
137+
[ meta + [id:meta.id.toString()], file, index ]
135138
}
136139
// Check if all extension are identical
137140
getFilesSameExt(ch_input_truth)
@@ -151,7 +154,10 @@ workflow PIPELINE_INITIALISATION {
151154
println "Panel file provided as input is a samplesheet"
152155
ch_panel = Channel.fromList(samplesheetToList(
153156
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+
}
155161
} else {
156162
// #TODO Wait for `oneOf()` to be supported in the nextflow_schema.json
157163
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 {
220226
// Create posfile channel
221227
//
222228
if (params.posfile) {
223-
ch_posfile = Channel // ["panel", "chr", "vcf", "index", "hap", "legend"]
229+
ch_posfile = Channel // ["meta", "chr", "vcf", "index", "hap", "legend"]
224230
.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+
}
225234
} else {
226235
ch_posfile = Channel.of([[],[],[],[],[]])
227236
}
@@ -240,6 +249,9 @@ workflow PIPELINE_INITIALISATION {
240249
if (params.chunks) {
241250
ch_chunks = Channel
242251
.fromList(samplesheetToList(params.chunks, "${projectDir}/assets/schema_chunks.json"))
252+
.map { meta, chr, chunks ->
253+
[ meta + [id:meta.id.toString()], chr, chunks ]
254+
}
243255
} else {
244256
ch_chunks = Channel.of([[],[]])
245257
}

0 commit comments

Comments
 (0)