830 - MarkovModel::CountErrors()
From Genome Analysis Wiki
Jump to navigationJump to searchdouble MarkovModel::CountErrors(float * vector, char ** haplotypes, int position, char observed, double e, double freq)
{
if (observed == 0)
return e;
double match = 0;
double mismatch = 0;
for (int i = 0; i < states; i++)
if (haplotypes[i][position] == observed)
match += vector[i];
else
mismatch += vector[i];
mismatch = (match + mismatch) * e * freq;
match *= 1.0 - e;
return mismatch / (mismatch + match);
}