Changes

From Genome Analysis Wiki
Jump to navigationJump to search
Created page with "<source lang="cpp"> double MarkovModel::CountErrors(float * vector, char ** haplotypes, int position, char observed, double e, double freq) { if (observed == 0) re..."
<source lang="cpp">
double 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);
}
</source>

Navigation menu