diff --git a/CHANGELOG.md b/CHANGELOG.md index c8baf7b047..86db9aae32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ Rapaselet is a delta formed by the RapaƤtno river between the Bielloriehppe mas - [#1214](https://github.com/nf-core/sarek/pull/1214) - Don't pass in intervals file to ControlFREEC for WGS analysis - [#1215](https://github.com/nf-core/sarek/pull/1215) - Fix `meta.id` for mutect2 tumor_only subworkflows - [#1216](https://github.com/nf-core/sarek/pull/1216) - Better test coverage for variant calling `*_all` subworkflows +- [#1217](https://github.com/nf-core/sarek/pull/1217) - Fix `groupTuple` statement for mutect2 tumor_only subworkflows ### Dependencies diff --git a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf index ccdf370b61..a8415fb4d4 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -113,12 +113,7 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_ALL { if (tools.split(',').contains('mutect2')) { BAM_VARIANT_CALLING_TUMOR_ONLY_MUTECT2( // Adjust meta.map to simplify joining channels - // joint_mutect2 mode needs different meta.map than regular mode - cram.map{ meta, cram, crai -> - joint_mutect2 ? - [ meta + [ id:meta.patient ] - meta.subMap('sample', 'status', 'data_type', 'patient') , cram, crai ] : - [ meta + [ id:meta.sample ] - meta.subMap('sample', 'status', 'data_type'), cram, crai ] - }, + cram.map{ meta, cram, crai -> [ meta + [ id:meta.sample ] - meta.subMap('sample', 'status', 'data_type'), cram, crai ] }, // Remap channel to match module/subworkflow fasta.map{ it -> [ [ id:'fasta' ], it ] }, // Remap channel to match module/subworkflow diff --git a/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf b/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf index 9e2c6d0bc5..9530c75f01 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_mutect2/main.nf @@ -41,12 +41,15 @@ workflow BAM_VARIANT_CALLING_TUMOR_ONLY_MUTECT2 { if (joint_mutect2) { // Perform variant calling using mutect2 module in tumor single mode // Group cram files by patient - patient_crams = input.groupTuple() + input_joint = input + .map{ meta, input, index -> [ meta + [ id:meta.patient ], input, index ] } + .groupTuple() + // Add intervals for scatter-gather scaling - patient_cram_intervals = patient_crams.combine(intervals) + input_joint_intervals = input_joint.combine(intervals) // Move num_intervals to meta map and reorganize channel for MUTECT2 module - .map{ meta, t_cram, t_crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], t_cram, t_crai, intervals ] } - MUTECT2(patient_cram_intervals, fasta, fai, dict, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi) + .map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ num_intervals:num_intervals ], cram, crai, intervals ] } + MUTECT2(input_joint_intervals, fasta, fai, dict, germline_resource, germline_resource_tbi, panel_of_normals, panel_of_normals_tbi) } else { // Perform variant calling using mutect2 module in tumor single mode