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 ...")
(No difference)

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); }