Skip to content

Commit

Permalink
[bugfix] metrics are now updated and logged in the overlapping bases (#…
Browse files Browse the repository at this point in the history
…825)

* [bugfix] overlapping consensus caller should examine only
bases that map in both the read and ref

Fixes issue #821.
  • Loading branch information
nh13 authored Apr 16, 2022
1 parent bb82ed6 commit 29168ad
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,16 @@ object OverlappingBasesConsensusCaller {
disagreementStrategy = disagreementStrategy
)
val templateIterator = Bams.templateIterator(in=in).flatMap { template =>
caller.call(template)
val stats: CorrectionStats = caller.call(template)

// update metrics
val basesCorrected = stats.r1CorrectedBases + stats.r2CorrectedBases
if (basesMetric.overlapping > 0) templateMetric.overlapping += 1
if (basesCorrected > 0) templateMetric.corrected += 1
templateMetric.total += 1
basesMetric.total += template.primaryReads.map(_.length).sum
basesMetric.overlapping = stats.overlappingBases
basesMetric.corrected = basesCorrected
template.allReads
}
new SelfClosingIterator(templateIterator, closer = () => {
Expand Down

0 comments on commit 29168ad

Please sign in to comment.