830 - Haplotyper::ImputeGenotypes()

From Genome Analysis Wiki
Revision as of 14:19, 2 October 2013 by Goncalo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
void Haplotyper::ImputeGenotypes()
   {
   RewindMemoryPool();

   // Process the last position
   RetrieveMemoryBlock(markers - 1);
   ImputeGenotypes(leftMatrices[markers - 1], markers - 1);

   SetupPrior(rightMatrices[0]);
   ConditionOnData(rightMatrices[0], 0, current_genotypes[0]);

   float *temp;
   float *from = rightMatrices[0];
   float *to = rightMatrices[1];

   for (int i = markers - 2; i >= 0; i--)
      {
      // Move things along
      Transpose(from, to, thetas[i]);

      RetrieveMemoryBlock(i);

      ImputeGenotypes(leftMatrices[i], to, i);
      ConditionOnData(to, i, genotypes[states / 2][i]);

      temp = from;
      from = to;
      to = temp;
      }
   }