Adaptive Evolution of Cell Adhesion in Microbes

Go back

1 Commands

1.1 Fig. 3 & 5

Using DICTpy.

cd dictpy
python run.py -v -a OpticsAnalysis -o figure35 -p M=15 "data/datafile.csv"

1.2 Fig. 6 Group size density experienced by individuals

For a fixed \(\hat{z}\).

import numpy as np
import matplotlib.pylab as pl
import scipy.misc as sp

name = "density.png"
T=1000
z = 0.666
x = np.linspace(0,T,T)
y = [(sp.comb(T,k) * z**k * (1-z)**(T-k)) for k in x]
y[1] = 1-z

pl.plot(x,y)
f = pl.gcf()
f.set_size_inches((4,2))
ax = pl.gca()
ax.annotate(r'$1-\hat{z}$', xy=(0,1-z),xycoords="data", textcoords="offset points", xytext=(+40,0),
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))
#ax.annotate(r'$\hat{z}T$', xy=(z*T,0),xycoords="data", textcoords="offset points", xytext=(-5,-20),
#arrowprops=dict(arrowstyle="-", connectionstyle="arc3,rad=.2"))

ax.axis([-5,T,0,1-z+0.1])
ax.spines['right'].set_color("none")
ax.spines['top'].set_color("none")
ax.xaxis.set_ticks([z*T])
ax.set_xticklabels([r'$\hat{z}T$'])
ax.yaxis.set_ticks([])
ax.xaxis.set_ticks_position('bottom')
ax.xaxis.set_label_coords(.45, -0.025)
ax.set_xlabel("Group size")
ax.set_ylabel("Density")
pl.savefig(name)
return(name)

1.3 Fig. 7

Using Pimad.

cd pimad/
python main.py fig7.data -g=3000 -p N=100000,mu=0,ip=0.01,pa=0.4,ps=0.41 -m= "ToyContinuous"

1.4 Fig. 8

1.4.1 a.

cd pimad/adaptived
python pairwiseiplot.py pip_fig8a -p 0.1 -b 20 -T 100 
python pairwiseiplot.py piptable_fig8a load

1.4.2 b.

cd pimad
python -i pairwise.py
>>> main("pip_fig8b",p=100,ip=0.1,g=10,N=100000,save=False):

1.5 Fig. 9

cd pimad/adaptived
python pairwiseiplot.py -f s_nlcost -p 0.01 piptable_fig9
python pairwiseiplot.py piptable_fig9 load

1.6 Fig. 10

cd pimad/adaptived
python fitness_fct.py -i
>>> altruismCondition(0.01)

1.7 Fig. 11 Group benefits as a function of group size.

For a fixed \(\overline{z}\)

import numpy as np
import matplotlib.pyplot as pl
from matplotlib import rc

x = np.linspace(0,1,1000)
y = [1 if i<=0.6 else 0 for i in x]
pl.plot(x,y)

f = pl.gcf()
f.set_size_inches((4,2))

ax = pl.gca()

ax.annotate(r'$b\overline{z}$', xy=(0.6,1),xycoords="data", textcoords="offset points", xytext=(+20,+0),
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))

ax.axis([0,1,0,2])

pl.xticks([0.6,1],[r'$\alpha T$',r'$T$'])
ax.yaxis.set_ticks([])

ax.set_xlabel("n")
ax.set_ylabel("Group benefits")

ax.spines['right'].set_color("none")
ax.spines['top'].set_color("none")
ax.xaxis.set_ticks_position('bottom')
ax.xaxis.set_label_coords(.5, -0.025)

name = "img/threshold_benefits.png"
pl.savefig(name)
return(name)

1.8 Fig. 12

cd pimad/adaptived
python pairwiseiplot.py -f s_sizeThreshold -p 0.01 piptable_fig12
python pairwiseiplot.py piptable_fig12 load

1.9 Fig. 13 Non linear payoff cost of the social trait for different values of \(\chi\)

(red : \(\chi=2\), blue \(\chi=4\) and green \(\chi=8\)).

import numpy as np
import matplotlib.pyplot as pl
from matplotlib import rc
import math

def cost_function(c,nl,z):
        """ Return the individual cost of a z-social individual"""
        if z == 1:
            z = 1-0.00001
        return c * z * math.exp(1/((1-z)**(1/float(nl))))


x = np.linspace(0,1,1000)
y2 = [cost_function(1,4,i) for i in x]
y1 = [cost_function(1,2,i) for i in x]
y3 = [cost_function(1,8,i) for i in x]
pl.plot(x,y1,color="r")
pl.plot(x,y2,color="b")
pl.plot(x,y3,color="g")

f = pl.gcf()
f.set_size_inches((4,2))

ax = pl.gca()


ax.axis([0,1.05,0,30])

ax.yaxis.set_ticks([])
pl.xticks([0,1])


ax.set_xlabel(r'$z$')
ax.set_ylabel("Cost")

ax.spines['right'].set_color("none")
ax.spines['top'].set_color("none")
ax.xaxis.set_ticks_position('bottom')
ax.xaxis.set_label_coords(.5, -0.025)



name = "img/nl_cost.png"
pl.savefig(name)
return(name)

1.10 Fig. 14

cd pimad/adaptived
python pairwiseiplot.py -f s_nlcost -p 0.01 piptable_fig14
python pairwiseiplot.py piptable_fig14 load

Date: 2013-09-13 Fri

Author: Guilhem Doulcier

Org version 7.9.3f with Emacs version 24

Validate XHTML 1.0