In [1]:
%matplotlib inline
import numpy as np;

np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;

pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = False
import seaborn as sns
import pylab as plt;
import matplotlib as mpl
import os, sys;sys.path.insert(1,'/home/arya/workspace/bio')
import Utils.Util as utl
import Utils.Plots as pplt
import Scripts.MultiLociSelection.Util as mutl
prop=[0.89, 0.1, 0.01, 0.]
N=10000;L=1000;gen=500
r=1e-7
sa=0.05;sb=0.09;sab=0.1;saabb=0.15


simuPOP Version 1.1.7 : Copyright (c) 2004-2016 Bo Peng
Revision 5000 (Jan 21 2016) for Python 2.7.11 (64bit, 1thread)
Random Number Generator is set to mt19937 with random seed 0xf923c4e567973891.
This is the standard short allele version with 256 maximum allelic states.
For more information, please visit http://simupop.sourceforge.net,
or email simupop-list@lists.sourceforge.net (subscription required).

In [16]:
sa=0.05;sb=0.05;r=0;prop=[0.98, 0.01, 0.01, 0.]
reload(mutl);mutl.simulate(N,L,r,gen,sa,sb,sab,saabb,prop)
plt.suptitle('No Recombination (no 11 hap) and sa=sb,  a0=b0. Absolute Equilibrium!',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.98, 0.01, 0.01, 0.0]

In [18]:
sa=0.05;sb=0.05;r=0;prop=[0.69, 0.3, 0.01, 0.];reload(mutl)
mutl.simulate(N,L,r,gen,sa,sb,sab,saabb,prop)
plt.suptitle('No Recombination (no 11 hap) and sa=sb,  a0>b0. Imbalance Equilibrium.',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.69, 0.3, 0.01, 0.0]

In [12]:
sa=0.08;sb=0.05;r=0
prop=[0.8, 0.1, 0.1, 0.]
reload(mutl)
mutl.simulate(N,L,r,gen,sa,sb,sab,saabb,prop)
plt.suptitle('No Recombination (no 11 hap) and sa$>$sb,  a0=b0.  Equilibrium.',fontsize=18);


N=10000 ,s=0.08 , Ns=800.0 prop=[0.8, 0.1, 0.1, 0.0]

In [5]:
sa=0.12;sb=0.05;r=0
prop=[0.8, 0.1, 0.1, 0.]
reload(mutl)
mutl.simulate(N,L,r,gen,sa,sb,sab,saabb,prop)
plt.suptitle('No Recombination (no 11 hap) and sa$>>$sb,  a0=b0.  a dominates.',fontsize=18);


N=10000 ,s=0.12 , Ns=1200.0 prop=[0.8, 0.1, 0.1, 0.0]

In [6]:
sa=0.05;sb=0.05;sab=0.1
saabb=sab
gen=1000
r=1e-6
prop=[0.98, 0.01, 0.01, 0.]
reload(mutl)
mutl.simulate(N,L,r,gen,sa,sb,sab,saabb,prop)
plt.suptitle('Recombination (11 hap will appear) and sa=sb$<<$sab,  a0=b0. Absolute Equilibrium!',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.98, 0.01, 0.01, 0.0]

In [22]:
sa=0.05;sb=0.05;sab=0.1
saabb=sab
r=1e-7
prop=[0.98, 0.01, 0.01, 0.]
reload(mutl)
mutl.simulate(N,L,r,1200,sa,sb,sab,saabb,prop)
plt.suptitle('Low Recombination (11 hap will appear after eq.) and sa=sb$<$sab,  a0=b0. Sweep-Equilibrium-Sweep!',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.98, 0.01, 0.01, 0.0]

In [23]:
sa=0.05;sb=0.05;sab=0.1
saabb=sab
r=1e-6
prop=[0.8, 0.1, 0.1, 0.]
reload(mutl)
mutl.simulate(N,L,r,1200,sa,sb,sab,saabb,prop)
plt.suptitle('High Recombination (11 hap will appear before eq.) and sa=sb<sab,  a0=b0. Fast Sweep!',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.8, 0.1, 0.1, 0.0]

In [9]:
sa=0.05;sb=0.05;sab=0.1
saabb=sab
r=1e-7
prop=[0.5, 0.25, 0.25, 0.]
reload(mutl)
ha,hb,hab=0,0,0
mutl.simulate(N,L,r,800,sa,sb,sab,saabb,prop,ha,hb,hab)
plt.suptitle('Recessive Allele Medioum Recombination (11 hap will appear at eq.) and sa=sb<sab,  a0=b0.',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.5, 0.25, 0.25, 0.0]

In [10]:
sa=0.05;sb=0.05;sab=0.1
saabb=0.15
r=1e-7
prop=[0.5, 0.25, 0.25, 0.]
reload(mutl)
ha,hb,hab=0,0,0
mutl.simulate(N,L,r,800,sa,sb,sab,saabb,prop,ha,hb,hab)
plt.suptitle('Recessive Allele Medioum Recombination (11 hap will appear at eq.) and sa=sb<sab<saabb,  a0=b0.',fontsize=18);


N=10000 ,s=0.05 , Ns=500.0 prop=[0.5, 0.25, 0.25, 0.0]

In [ ]: