Difference between revisions of "830 - BestAlignment::EvaluateAlignment() (detailed comparison)"
From Genome Analysis Wiki
Jump to navigationJump to search (Created page with "void BestAlignment::EvaluateAlignment(String & reference, FastQ & read, unsigned int pos, bool fwd) { if (pos < 0 || read.Length() + pos > reference.Length()) return; if ...") |
|||
Line 1: | Line 1: | ||
+ | <source lang="cpp"> | ||
+ | |||
void BestAlignment::EvaluateAlignment(String & reference, FastQ & read, unsigned int pos, bool fwd) | void BestAlignment::EvaluateAlignment(String & reference, FastQ & read, unsigned int pos, bool fwd) | ||
{ | { | ||
Line 27: | Line 29: | ||
mapQdenominator += pow(10.0, -0.1 * iSumQ); | mapQdenominator += pow(10.0, -0.1 * iSumQ); | ||
} | } | ||
+ | |||
+ | </source> |
Latest revision as of 13:47, 28 October 2013
void 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);
}