Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Final fix for joint_mutect2 tumor_only in mutect2 subworkflow #1217

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// TUMOR VARIANT CALLING
// TUMOR ONLY VARIANT CALLING
// Should be only run on patients without normal sample
//

Expand Down 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 ] },
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
// 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