Skip to content

Commit

Permalink
Added mapq as part of the scoring of duplicate reads.
Browse files Browse the repository at this point in the history
Added filtering of unmapped reads and reads with unmapped mates in the consensus calling iterator.
  • Loading branch information
tfenne committed Oct 25, 2023
1 parent 126009b commit a637753
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class ConsensusCallingIterator[ConsensusRead <: SimpleRead](sourceIterator: Iter
private var collectedStats: Boolean = false

protected val iter: Iterator[SamRecord] = {
val filteredIterator = sourceIterator.filterNot(r => r.secondary || r.supplementary)
val filteredIterator = sourceIterator.filterNot { r =>
r.secondary || r.supplementary || r.unmapped || (r.paired && r.mateUnmapped)
}

// Wrap our input iterator in a progress logging iterator if we have a progress logger
val progressIterator = progress match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ class GroupReadsByUmi
private def setDuplicateFlags(group: Seq[Template]): Unit = {
val nonDuplicateTemplate = group.maxBy { template =>
template.primaryReads.sumBy { r =>
DuplicateScoringStrategy.computeDuplicateScore(r.asSam, ScoringStrategy.SUM_OF_BASE_QUALITIES)
r.mapq + DuplicateScoringStrategy.computeDuplicateScore(r.asSam, ScoringStrategy.SUM_OF_BASE_QUALITIES)
}
}

Expand Down

0 comments on commit a637753

Please sign in to comment.