corrected bug, rerun test, vortrag nears completion

This commit is contained in:
Stefan Dresselhaus
2018-06-27 12:51:06 +02:00
parent 4f32bf2cd0
commit 6b93f61d0d
654 changed files with 64616 additions and 20377 deletions

View File

@ -170,7 +170,7 @@
</ul></li>
<li class="fragment">Input can be <code class="sourceCode haskell"><span class="dt">Substrate</span></code> and/or <code class="sourceCode haskell"><span class="dt">Products</span></code></li>
<li class="fragment">Outputs can only be <code class="sourceCode haskell"><span class="dt">Products</span></code></li>
<li class="fragment"><span class="math inline"></span> This makes them to Edges in a graph combining the chemical compounds</li>
<li class="fragment"><span class="math inline">\(\Rightarrow\)</span> This makes them to Edges in a graph combining the chemical compounds</li>
</ul>
</section>
<section id="usage-in-the-current-model-1" class="level2">
@ -191,9 +191,9 @@
<li class="fragment"><strong><code class="sourceCode haskell"><span class="dt">Predator</span></code>s</strong> consist of
<ul>
<li class="fragment">a list of <code class="sourceCode haskell"><span class="dt">Compound</span></code>s that can kill them</li>
<li class="fragment">a fitness impact (<span class="math inline">[0..1]</span>) as the probability of killing the plant</li>
<li class="fragment">a fitness impact (<span class="math inline">\([0..1]\)</span>) as the probability of killing the plant</li>
<li class="fragment">an expected number of attacks per generation</li>
<li class="fragment">a probability (<span class="math inline">[0..1]</span>) of appearing in a single generation</li>
<li class="fragment">a probability (<span class="math inline">\([0..1]\)</span>) of appearing in a single generation</li>
</ul></li>
<li class="fragment"><code class="sourceCode haskell"><span class="dt">Predator</span></code> need not necessary be biologically motivated
<ul>
@ -223,7 +223,7 @@
<p>Additional rules:</p>
<ul>
<li class="fragment">Every “subtree” from the marked <code class="sourceCode haskell"><span class="dt">PPM</span></code> is treated as a separate species (fungi, animals, …)<br />
<span class="math inline"></span> Every predator can only be affected by toxins in the same part of the tree</li>
<span class="math inline">\(\Rightarrow\)</span> Every predator can only be affected by toxins in the same part of the tree</li>
<li class="fragment">Trees can be automatically generated in a decent manner to search for environmens where specific effects may arise</li>
</ul>
</div>
@ -242,55 +242,172 @@
<section id="plants" class="level2">
<h2>Plants</h2>
<p>A plant consists of</p>
<p>A <strong><code class="sourceCode haskell"><span class="dt">Plant</span></code></strong> consists of</p>
<ul>
<li class="fragment">a <strong><code class="sourceCode haskell"><span class="dt">Genome</span></code></strong>, a simple list of genes
<ul>
<li class="fragment">Triple of <code class="sourceCode haskell">(<span class="dt">Enzyme</span>, <span class="dt">Quantity</span>, <span class="dt">Activation</span>)</code></li>
<li class="fragment">without order or locality (i.e. interference of neighboring genes)</li>
<li class="fragment"><code class="sourceCode haskell"><span class="dt">Quantity</span></code> is just an optimization (=Int) to group identical <code class="sourceCode haskell"><span class="dt">Activation</span></code>s</li>
<li class="fragment"><code class="sourceCode haskell"><span class="dt">Activation</span></code> is a float <span class="math inline">\(\in [0..1]\)</span> to regulate the activity of the <code class="sourceCode haskell"><span class="dt">Enzyme</span></code> genetically</li>
</ul></li>
<li class="fragment">an <code class="sourceCode haskell">absorbNutrients</code>-Function to simulate various effects when absorbing nutrients out of the environment, depending on the environment (i.e. <em>can</em> use informations about chemistry, predators, etc.)
<ul>
<li class="fragment">Not used in our simulation, as we only have <code class="sourceCode haskell"><span class="dt">PPM</span></code> as “nutrient” and we take everything given to us.</li>
</ul></li>
</ul>
</section>
<section id="metabolism-simulation" class="level2">
<h2>Metabolism simulation</h2>
<p>Compounds are created foo..</p>
<p>Creation of compounds from the given resources is an iterative process:</p>
<ul>
<li class="fragment">First of all we create a conversion Matrix <span class="math inline">\(\Delta_c\)</span> with corresponding startvector <span class="math inline">\(s_0\)</span>.</li>
<li class="fragment"><p>We now iterate <span class="math inline">\(s_i = (\mathbb{1} + \Delta_c) \cdot s_{i-1}\)</span> for a fixed number of times (currently: <span class="math inline">\(100\)</span>) to simulate the metabolism<sup>[2]</sup>.</p>
<div class="footer">
<p><sup>[2]</sup>: Thats a lie, we calculate <span class="math inline">\((\mathbb{1} + \Delta_c)^{100}\)</span> efficiently via <code>lapack</code>-internals</p>
</div></li>
<li class="fragment">Entries in the matrix come from the <code class="sourceCode haskell"><span class="dt">Genome</span></code>: an <code class="sourceCode haskell"><span class="dt">Enzyme</span></code> which converts <span class="math inline">\(i\)</span> to <span class="math inline">\(j\)</span> with quantity <span class="math inline">\(q\)</span> and activity <span class="math inline">\(a\)</span> yield <span class="math display">\[\begin{eqnarray*}
\Delta_c[i,j] &amp;\mathrel{+}=&amp; q\cdot a,\\
\Delta_c[j,i] &amp;\mathrel{+}=&amp; q\cdot a, \\
\Delta_c[i,i] &amp;\mathrel{-}=&amp; q\cdot a, \\
\Delta_c[j,j] &amp;\mathrel{-}=&amp; q\cdot a
\end{eqnarray*}.\]</span>
<ul>
<li class="fragment">This makes the Enzyme-reaction invertible as both ways get treated equally.</li>
</ul></li>
</ul>
</section>
<section id="metabolism-example" class="level2">
<h2>Metabolism-example</h2>
<ul>
<li class="fragment"><p>Given a simple Metabolism with <span class="math inline">\(1\)</span> nutrient (first row/column) and <span class="math inline">\(2\)</span> Enzymes in sequence, we have given <span class="math inline">\(\Delta_c\)</span> wtih corresponding startvector <span class="math inline">\(s_0\)</span>: <span class="math display">\[\Delta_c = 0.01 \cdot \begin{pmatrix}
-1 &amp; 1 &amp; 0 \\
1 &amp; -2 &amp; 1 \\
0 &amp; 1 &amp; -1 \\
\end{pmatrix}, s_0 = \begin{pmatrix}\text{PPM:} &amp; 3 \\ \text{Compound1:} &amp; 0 \\ \text{Compound2:} &amp; 0\end{pmatrix}.\]</span></p></li>
<li class="fragment"><p>In the simulation this yields us <span class="math display">\[s_{100} \approx \begin{pmatrix}\text{PPM:} &amp; 1 \\ \text{Compound1:} &amp; 1 \\ \text{Compound2:} &amp; 1\end{pmatrix},\]</span> which is the expected outcome for an equilibrium.</p></li>
</ul>
</section>
<section id="assumptions-for-metabolism-simulation" class="level2">
<h2>Assumptions for metabolism simulation</h2>
<ul>
<li class="fragment">All Enzymes are there from the beginning</li>
<li class="fragment">All Enzyme-reactions are reversible without loss</li>
<li class="fragment">static conversion-matrix for fast calculations (unsuited, if i.e. enzymes depend on catalysts)</li>
<li class="fragment">One genetic enzyme corresponds to (infinitely) many real (proportional weaker) enzymes in the plant, which get controlled via the “activation” parameter</li>
</ul>
</section>
<section id="fitness" class="level2">
<h2>Fitness</h2>
<ul>
<li class="fragment">Static costs of enzymes</li>
<li class="fragment">Cost of active enzymes</li>
<li class="fragment">We handle fitness as <span class="math inline">\(\text{survival-probability} \in [0..1]\)</span> and model each detrimental effect as probability which get multiplied together.</li>
<li class="fragment">To calculate the fitness of an individual we take three distinct effects into consideration:
<ul>
<li class="fragment">Static costs of enzymes
<ul>
<li class="fragment">Creating enzymes weakens the primary cycle and thus possibly beneficial traits (growth, attraction of beneficial organisms, …) <span class="math display">\[F_s := \text{static_cost_factor} \cdot \sum_i q_i \cdot a_i \quad | \quad (e_i,q_i, a_i) \in \text{Genome}\]</span></li>
<li class="fragment">limits the amount of dormant enzymes</li>
</ul></li>
<li class="fragment">Cost of active enzymes
<ul>
<li class="fragment">Cost of using up nutrients <span class="math display">\[F_e := \text{active_cost_factor} \cdot \frac{\text{Nutrients used}}{\text{Nutrients available}}\]</span></li>
</ul></li>
<li class="fragment">Deterrence of attackers <span class="math inline">\(F_d\)</span> (next slide)</li>
</ul></li>
</ul>
</section>
<section id="attacker" class="level2">
<h2>Attacker</h2>
<ul>
<li class="fragment">Rate of attack ~&gt; Paper, Formulas</li>
<li class="fragment">Defenses
<li class="fragment">Predators are modeled after <a href="http://doi.org/10.1098/rspb.2007.0456">Svennungsen et al. (2007)</a></li>
<li class="fragment">Each predator has an expected number of attacks <span class="math inline">\(P_a\)</span>, that are poisson-distributed with impact <span class="math inline">\(P_i\)</span>.</li>
<li class="fragment">Plants can defend themselves via
<ul>
<li class="fragment">single plant</li>
<li class="fragment">automimicry</li>
<li class="fragment">toxins that the predator is affected by with impact-probability <span class="math inline">\(D_t(P_i)\)</span></li>
<li class="fragment">herd-immunity via effects like automimicry: <span class="math inline">\(D_{pop} = \mathbb{E}[D_t(P_i)]\)</span></li>
</ul></li>
<li class="fragment"><p>All this yields the formula:</p>
<p><span class="math display">\[F_d := 1 - e^{- (D_{pop} \cdot P_a) (1-D_t(P_i))}\]</span></p></li>
<li class="fragment">The attacker-model is only valid for many reasonable assumptions
<ul>
<li class="fragment">equilibrium population dynamics</li>
<li class="fragment">equal dense population</li>
<li class="fragment">which individual to attack is independently chosen</li>
<li class="fragment">etc. (Details in the paper linked above)</li>
</ul></li>
</ul>
</section>
<section id="haploid-mating" class="level2">
<h2>Haploid mating</h2>
<ul>
<li class="fragment">fixed population-size (100)</li>
<li class="fragment"><span class="math inline">$p(\textrm{reproduction}) = \frac{\textrm{plant-fitness}}{\textrm{total fitness in population}}$</span></li>
<li class="fragment">Gene
<li class="fragment">We hold the population-size fixed at <span class="math inline">\(100\)</span></li>
<li class="fragment">Each plant has a reproduction-probability of <span class="math display">\[p(\textrm{reproduction}) = \frac{\textrm{plant-fitness}}{\textrm{total fitness in population}}\]</span> yielding a fitness-weighted distribution from that <span class="math inline">\(100\)</span> new offspring are drawn</li>
<li class="fragment"><p>in inheritance each gene of the parent goes through different steps (with given default-values)<sup>[3]</sup></p>
<div class="footer">
<p><sup>[3]</sup>: in case of quantity <span class="math inline">\(q &gt; 1\)</span> the process is repeated <span class="math inline">\(q\)</span> times independently.</p>
</div>
<ul>
<li class="fragment">mutation</li>
<li class="fragment">duplication</li>
<li class="fragment">deletion</li>
<li class="fragment">addition</li>
<li class="fragment">activation-noise</li>
<li class="fragment"><strong>mutation</strong>: with <span class="math inline">\(p_{mut} = 0.01\)</span> another random enzyme is produced, but activation kept</li>
<li class="fragment"><strong>duplication</strong>: with <span class="math inline">\(p_{dup} = 0.05\)</span> the gene gets duplicated (quantity <span class="math inline">\(+1\)</span>)</li>
<li class="fragment"><strong>deletion</strong>: with <span class="math inline">\(p_{del} = p_{dup}\)</span> the gene get deleted (or quantity <span class="math inline">\(-1\)</span>)</li>
<li class="fragment"><strong>addition</strong>: with <span class="math inline">\(p_{add} = 0.005\)</span> an additional gene producing a random enzyme with activation <span class="math inline">\(0.5\)</span> gets added as mutation from genes we do not track (i.e. primary cycle)</li>
<li class="fragment"><strong>activation-noise</strong>: activation is changed by <span class="math inline">\(c_{noise} = \pm 0.01\)</span> drawn from a uniform distribution, clamped to <span class="math inline">\([0..1]\)</span></li>
</ul></li>
</ul>
<aside class="notes">
<ul>
<li>Default values <strong>not</strong> motivated in any way!</li>
<li>finding out how these values influence is core!</li>
</ul>
</aside>
</section>
</section>
<section class="slide level1">
<section id="simulations" class="level2">
<h2>Simulations</h2>
<p>Parameters tested</p>
<ul>
<li class="fragment">x</li>
<li class="fragment">y</li>
<li class="fragment">z</li>
<li class="fragment">Overall question: What parameters are necessary for chemodiversity?
<ul>
<li class="fragment">How can we see chemodiversity?</li>
<li class="fragment">We define an Enzyme <span class="math inline">\(E\)</span> as divers, if the average of this Enzyme in the population stays below <span class="math inline">\(0.5\)</span>, so <span class="math inline">\(E_i \in E_{div} \text{iff.} \mathbb{E}[E_i] &lt; 0.5\)</span></li>
<li class="fragment">We can then count the number of diverse Enzymes per plant <span class="math inline">\(E_{d,p_i} = |\left\lbrace E_i | E_i \in E_{div}, E_{i,p_i} &gt; 0.5, \right\rbrace|\)</span></li>
</ul></li>
<li class="fragment">To get an insight into how this behaves we observe several other parameters every generation:
<ul>
<li class="fragment">Fitness <span class="math inline">\(\in [0..1]\)</span></li>
<li class="fragment">Number of different compounds created</li>
<li class="fragment">Amount of compounds created</li>
<li class="fragment">Number of Plants theoretically resistant to predator <span class="math inline">\(i\)</span> (i.e. <strong>can</strong> produce a toxin to defend themselves, albeit not to <span class="math inline">\(100\%\)</span>.</li>
</ul></li>
</ul>
</section>
<section id="simulations-cont." class="level2">
<h2>Simulations (cont.)</h2>
<ul>
<li class="fragment">General setup of the simulation:
<ul>
<li class="fragment">All using the example-environment shown before
<ul>
<li class="fragment">27 different compounds, 1 Nutrient (simulating the primary metabolism)</li>
<li class="fragment">7 of 27 compounds are toxic</li>
<li class="fragment">at least 3 compounds are needed for total immunity</li>
<li class="fragment">4 predators</li>
</ul></li>
<li class="fragment">Duration of 2000 generations</li>
</ul></li>
<li class="fragment">Different setups tested:
<ul>
<li class="fragment">Behavior of predators (<code class="sourceCode haskell"><span class="dt">AlwaysAttack</span></code>, <code class="sourceCode haskell"><span class="dt">AttackRandom</span></code>, <code class="sourceCode haskell"><span class="dt">AttackInterval</span> <span class="dt">Int</span></code>)</li>
<li class="fragment">varying <span class="math inline">\(\text{static_enzyme_cost}\)</span> from <span class="math inline">\(0.0\)</span> to <span class="math inline">\(0.20\)</span> in steps of <span class="math inline">\(0.02\)</span>
<ul>
<li class="fragment">effectively limits the amount of maximal enzymes to <span class="math inline">\(\frac{1}{\text{static_enzyme_cost}}\)</span></li>
</ul></li>
<li class="fragment">varying <span class="math inline">\(\text{nutrient_impact}\)</span> from <span class="math inline">\(0.0\)</span> to <span class="math inline">\(1.0\)</span> in steps of <span class="math inline">\(0.1\)</span>
<ul>
<li class="fragment">makes toxins less/more costly to produce</li>
</ul></li>
</ul></li>
</ul>
</section>
</section>
@ -303,6 +420,48 @@
</section>
<section class="slide level1">
<section id="effect-of-predator-behavior-onto-chemodiversity" class="level2">
<h2>Effect of Predator-Behavior onto chemodiversity</h2>
<figure>
<img data-src="img/attackRate_E_d_mu_vs_C_mu.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-static-enzyme-cost" class="level2">
<h2>Effect of static enzyme cost</h2>
<figure>
<img data-src="img/staticCost_Fitness_vs_num_compounds.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-static-enzyme-cost-cont." class="level2">
<h2>Effect of static enzyme cost (cont.)</h2>
<figure>
<img data-src="img/staticCost_Fitness_vs_e_d_mu.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-static-enzyme-cost-cont.-1" class="level2">
<h2>Effect of static enzyme cost (cont.)</h2>
<figure>
<img data-src="img/staticCost_e_d_mu_vs_num_compounds.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-nutrient-impact" class="level2">
<h2>Effect of nutrient-impact</h2>
<figure>
<img data-src="img/nutrientCost_Fitness_vs_num_compounds.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-nutrient-impact-cont." class="level2">
<h2>Effect of nutrient-impact (cont.)</h2>
<figure>
<img data-src="img/nutrientCost_Fitness_vs_e_d_mu.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
<section id="effect-of-nutrient-impact-cont.-1" class="level2">
<h2>Effect of nutrient-impact (cont.)</h2>
<figure>
<img data-src="img/nutrientCost_e_d_mu_vs_num_compounds.png" alt="Graph" /><figcaption>Graph</figcaption>
</figure>
</section>
</section>