<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://genome.sph.umich.edu/w/index.php?action=history&amp;feed=atom&amp;title=Mantra.cpp</id>
	<title>Mantra.cpp - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://genome.sph.umich.edu/w/index.php?action=history&amp;feed=atom&amp;title=Mantra.cpp"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mantra.cpp&amp;action=history"/>
	<updated>2026-11-01T07:44:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mantra.cpp&amp;diff=162&amp;oldid=prev</id>
		<title>Goncalo at 19:09, 8 December 2009</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mantra.cpp&amp;diff=162&amp;oldid=prev"/>
		<updated>2009-12-08T19:09:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:09, 8 December 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Listing All Inheritance Vectors ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Listing All Inheritance Vectors ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To list all possible inheritance vectors,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The first &#039;&#039;2f&#039;&#039; entries in Mantra::vector[] correspond to the founder alleles in the pedigree. The remaining entries correspond to meiosis that, ultimately, connect each individual (directly or indirectly). &lt;/ins&gt;To list all possible inheritance vectors, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;one could iterate through entries in Mantra::vector with index greater than &#039;&#039;2f + 1&#039;&#039; and consider each of two possible states for each of these. In practice, many of these inheritance vectors would be equivalent because they would imply exactly the same pattern of allele sharing between individuals in the pedigree.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;As an example, consider a pedigree with two siblings and two parents. The initial contents of Mantra::vector and Mantra::state might be:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      Mantra::vector[] = { 0, 1, 2, 3, 0, 2, 0, 2 }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      Mantra::state[]  = { 0, 1, 2, 3, 0, 2, 0, 2 }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Goncalo</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mantra.cpp&amp;diff=161&amp;oldid=prev</id>
		<title>Goncalo: New page: &#039;&#039;&#039;Mantra.cpp&#039;&#039;&#039; 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...</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mantra.cpp&amp;diff=161&amp;oldid=prev"/>
		<updated>2009-12-08T19:02:47Z</updated>

		<summary type="html">&lt;p&gt;New page: &amp;#039;&amp;#039;&amp;#039;Mantra.cpp&amp;#039;&amp;#039;&amp;#039; provides useful functions handling &lt;a href=&quot;/w/index.php?title=Inheritance_vectors&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Inheritance vectors (page does not exist)&quot;&gt;inheritance vectors&lt;/a&gt;. A call to Mantra::Prepare() will first list all the meioses in a pedigree (which constitute an inheritance vect...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Mantra.cpp&amp;#039;&amp;#039;&amp;#039; 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.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;math&amp;gt;2n&amp;lt;/math&amp;gt; possible meiosis) and then iterating over all possible outcomes for each meiosis (there are &amp;lt;math&amp;gt;2^(2n)&amp;lt;/math&amp;gt; possible outcomes) completely specifies all the possible allele sharing patterns in a pedigree.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
To interpret the contents of an instance of the Mantra class, first assign each individual in the pedigree a unique integer id &amp;#039;&amp;#039;i&amp;#039;&amp;#039;. 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 &amp;#039;&amp;#039;2i&amp;#039;&amp;#039; and &amp;#039;&amp;#039;2i + 1&amp;#039;&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
The descent of alleles through the pedigree is summarized in Mantra::vector and Mantra::state. For example, consider individual &amp;#039;&amp;#039;i = 5&amp;#039;&amp;#039;. This individual will carry two alleles and information about these will be stored in entries &amp;#039;&amp;#039;2i = 10&amp;#039;&amp;#039; and &amp;#039;&amp;#039;2i + 1 = 11&amp;#039;&amp;#039;. For example, if Mantra::vector[10] = 7 and Mantra::vector[11] = 5 that would imply that these two alleles were copied from alleles &amp;#039;5&amp;#039; and &amp;#039;7&amp;#039; 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. &lt;br /&gt;
&lt;br /&gt;
== Listing All Inheritance Vectors ==&lt;br /&gt;
&lt;br /&gt;
To list all possible inheritance vectors,&lt;/div&gt;</summary>
		<author><name>Goncalo</name></author>
	</entry>
</feed>