Mantra.cpp

From Genome Analysis Wiki
Revision as of 15:02, 8 December 2009 by Goncalo (talk | contribs) (New page: '''Mantra.cpp''' provides useful functions handling inheritance vectors. A call to Mantra::Prepare() will first list all the meioses in a pedigree (which constitute an inheritance vect...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Mantra.cpp provides useful functions handling inheritance vectors. A call to Mantra::Prepare() will first list all the meioses in a pedigree (which constitute an inheritance vector) and then list, among those, the key meioses that must be changed to traverse the space of all possible inheritance vectors.

Background

The meiosis that connect each individual to his (or her) parents can take two possible states, each denoting whether the grandmaternal or grandpaternal allele was transmitted. Listing all meiosis in a pedigree (there are possible meiosis) and then iterating over all possible outcomes for each meiosis (there are possible outcomes) completely specifies all the possible allele sharing patterns in a pedigree.

Details

To interpret the contents of an instance of the Mantra class, first assign each individual in the pedigree a unique integer id i. In Merlin, this identifier is always the value stored in Person::traverse. Further, assign each of the alleles carried by that individual unique integer id 2i and 2i + 1.

The descent of alleles through the pedigree is summarized in Mantra::vector and Mantra::state. For example, consider individual i = 5. This individual will carry two alleles and information about these will be stored in entries 2i = 10 and 2i + 1 = 11. For example, if Mantra::vector[10] = 7 and Mantra::vector[11] = 5 that would imply that these two alleles were copied from alleles '5' and '7' in the pedigree (the second allele in individuals 2 and 3 respectively). If Mantra::state[10] = 1 and Mantra::state[11] = 3, that would imply that the individual carries founder alleles 1 and 3.

Listing All Inheritance Vectors

To list all possible inheritance vectors,