Skip to content

Commit

Permalink
Merge pull request #1217 from maxulysse/joint_mutect2_tumor_only_fix
Browse files Browse the repository at this point in the history
FIX: Final fix for joint_mutect2 tumor_only in mutect2 subworkflow
  • Loading branch information
FriederikeHanssen authored Sep 8, 2023
2 parents 75829ff + 6336cf6 commit c59cd0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c59cd0b

Please sign in to comment.