830 - BestAlignment::EvaluateAlignment() (detailed comparison)
From Genome Analysis Wiki
Jump to navigationJump to searchvoid BestAlignment::EvaluateAlignment(String & reference, FastQ & read, unsigned int pos, bool fwd)
{
if (pos < 0 || read.Length() + pos > reference.Length())
return;
if (!isNewPosition(pos))
return;
int iMismatches = 0;
int iSumQ = 0;
for (unsigned int i = 0; i < read.Length(); i++)
if (reference[pos + i] <= 0 || read[i] <= 0 || read[i] != reference[pos + i])
{
iMismatches++;
iSumQ += read.quality[i];
}
if (sumQ > iSumQ)
{
position = pos;
sumQ = iSumQ;
mismatches = iMismatches;
forward = fwd;
}
mapQdenominator += pow(10.0, -0.1 * iSumQ);
}