Skip to content

Commit

Permalink
fix initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
famosab committed Nov 19, 2024
1 parent 132e190 commit b56df87
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions subworkflows/local/utils_nfcore_vcftomaf_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,22 @@ workflow PIPELINE_INITIALISATION {
//
// Create channel from input file provided through params.input
//

Channel
ch_samplesheet = Channel
.fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json"))
.map {
meta, fastq_1, fastq_2 ->
if (!fastq_2) {
return [ meta.id, meta + [ single_end:true ], [ fastq_1 ] ]
} else {
return [ meta.id, meta + [ single_end:false ], [ fastq_1, fastq_2 ] ]
}
}
.groupTuple()
.map { samplesheet ->
validateInputSamplesheet(samplesheet)
.map{ meta, normal_id, tumor_id, vcf_normal_id, vcf_tumor_id, vcf, index ->

meta.index = index ? true : false

if (normal_id) {
meta.normal_id = normal_id
meta.vcf_normal_id = vcf_normal_id
}
if (tumor_id) {
meta.tumor_id = tumor_id
meta.vcf_tumor_id = vcf_tumor_id
}
return [meta, vcf, index] // it[0], it[1], it[2]
}
.map {
meta, fastqs ->
return [ meta, fastqs.flatten() ]
}
.set { ch_samplesheet }

emit:
samplesheet = ch_samplesheet
versions = ch_versions
Expand Down

0 comments on commit b56df87

Please sign in to comment.