From 1e7b0ff28774582f9bdb81310d0b5474dc18d207 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Fri, 8 Sep 2023 12:03:13 +0200 Subject: [PATCH 1/3] fix meta map for joint_mutect2 for tumor only subworkflow --- .../local/bam_variant_calling_tumor_only_all/main.nf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 45cca72c4a..a8415fb4d4 100644 --- a/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf +++ b/subworkflows/local/bam_variant_calling_tumor_only_all/main.nf @@ -1,5 +1,5 @@ // -// TUMOR VARIANT CALLING +// TUMOR ONLY VARIANT CALLING // Should be only run on patients without normal sample // @@ -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 From 84fa45b85c10b2990de164bdb0091e4c1d9f0b65 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Fri, 8 Sep 2023 12:04:13 +0200 Subject: [PATCH 2/3] fix groupTuple handling for joint_mutect2 subworkflow tumor_only with joint_mutect2 --- .../bam_variant_calling_tumor_only_mutect2/main.nf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 From 70b866b213936f4860aea49cbb061838b838ad08 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Fri, 8 Sep 2023 12:05:04 +0200 Subject: [PATCH 3/3] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59210b254b..61364d8f45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ Rapaselet is a delta formed by the RapaƤtno river between the Bielloriehppe mas - [#1205](https://github.com/nf-core/sarek/pull/1205) - Less tests triggered - [#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 +- [#1217](https://github.com/nf-core/sarek/pull/1217) - Fix `groupTuple` statement for mutect2 tumor_only subworkflows ### Dependencies