Suppose I have 2 reads, and I align them as a part of a joining program or an assembly:
AATGCGTTTGA
GCGTTAGATGCTGA
________^
Then I output one combined read:
AATGCGTTTGATGCTGA
How do I combine the associated (phred scaled) quality scores in the overlapped region?
If the two bases match, and say one is q20 and the other q20 is then the likelihood of correctness is probably higher than q20.
It's clear that if the two bases don't match, and say one is q20 and the other q20 is then the likelihood of correctness is 50% (phred quality score of 3).
If the two bases don't match, and one is q40 and the other q3, and I choose the q40 base, then the correctness likelihood is probably still really near around q40. That q3 base shouldn't pull down the q40 that much.
Is there a "correct" formula for:
- combining quality scores when bases match in an overlapped region
- combining quality scores when don't match in an overlapped region
Note: When the bases match, it's a much easier problem. With an assumption of independence, you can simple add the q scores. But that this assumption is fundamentally flawed. For Illumina I use
max(a,b)+min(4,min(a,b))
... when they match. It's the mismatches that are harder.For mismatches....
min(a,b,max(abs(a-b),3))
? That seems a close approximation. At least it seems to make sense to me when they are the same (3), and when they are far apart.