From Genome Analysis Wiki
Jump to navigationJump to search
215 bytes added
, 14:29, 2 October 2013
Line 1: |
Line 1: |
| + | <source lang="cpp"> |
| + | |
| void Haplotyper::ImputeGenotypes(float * matrix1, float * matrix2, int marker) | | void Haplotyper::ImputeGenotypes(float * matrix1, float * matrix2, int marker) |
| { | | { |
Line 14: |
Line 16: |
| posterior[haplotypes[i][marker] * 2][marker] += *matrix1 * *matrix2; | | posterior[haplotypes[i][marker] * 2][marker] += *matrix1 * *matrix2; |
| } | | } |
| + | |
| + | double sum = posterior[0][marker] = posterior[1][marker] = posterior[2][marker]; |
| + | |
| + | posterior[0][marker] /= sum; |
| + | posterior[1][marker] /= sum; |
| + | posterior[2][marker] /= sum; |
| } | | } |
| + | |
| + | </source> |