Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Run bamQC on the recalibrated BAMs #720

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### `Removed`
- [#715](https://github.com/SciLifeLab/Sarek/pull/715) - Remove `defReferencesFiles` function from `buildReferences.nf`

### `Fixed`
- [#720](https://github.com/SciLifeLab/Sarek/pull/720) - bamQC is now run on the recalibrated bams, and not after MarkDuplicates

## [2.2.2] - 2018-12-19

### `Added`
Expand Down
15 changes: 4 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,6 @@ if (params.verbose) recalibrationTable = recalibrationTable.view {
Files : [${it[3].fileName}, ${it[4].fileName}, ${it[5].fileName}]"
}

(bamForBamQC, bamForSamToolsStats, recalTables, recalibrationTableForHC, recalibrationTable) = recalibrationTable.into(5)

// Remove recalTable from Channels to match inputs for Process to avoid:
// WARN: Input tuple does not match input set cardinality declared by process...
bamForBamQC = bamForBamQC.map { it[0..4] }
bamForSamToolsStats = bamForSamToolsStats.map{ it[0..4] }

recalTables = recalTables.map { [it[0]] + it[2..-1] } // remove status

process RecalibrateBam {
tag {idPatient + "-" + idSample}

Expand All @@ -406,8 +397,6 @@ process RecalibrateBam {
set idPatient, status, idSample, file("${idSample}.recal.bam"), file("${idSample}.recal.bai") into recalibratedBam, recalibratedBamForStats
set idPatient, status, idSample, val("${idSample}.recal.bam"), val("${idSample}.recal.bai") into recalibratedBamTSV

// GATK4 HaplotypeCaller can not do BQSR on the fly, so we have to create a
// recalibrated BAM explicitly.
when: !params.onlyQC

script:
Expand Down Expand Up @@ -436,6 +425,10 @@ if (params.verbose) recalibratedBam = recalibratedBam.view {
Files : [${it[3].fileName}, ${it[4].fileName}]"
}

// Remove recalTable from Channels to match inputs for Process to avoid:
// WARN: Input tuple does not match input set cardinality declared by process...
(bamForBamQC, bamForSamToolsStats) = recalibratedBamForStats.map{ it[0..4] }.into(2)

process RunSamtoolsStats {
tag {idPatient + "-" + idSample}

Expand Down