In [1]:
import sys
sys.path.append('../src')
from popgen import *
%matplotlib inline

Simple (and test for migration rate)


In [2]:
m = Island(gens=200)
m.mig = [0, 0.01, 0.05]
m.pop_size = 50
m.num_pops = 5
m.num_msats = 50
BasicView(m, [fst(), ExpHe()], ['mean'], with_model=True)
m.run()


Number of populations

(Not very fair)


In [3]:
m = Island(gens=200)
m.mig = 0.02
m.pop_size = 200
m.num_pops = [2, 5, 10, 20]
m.num_msats = 50
#asicView(m, [fst(), FST(), ExpHe()], ['mean'], with_model=True)
BasicView(m, [fst(), ExpHe()], ['mean'], with_model=True)
m.run()


Comparing TWO variables (migration and population size)


In [4]:
m = Island(gens=100)
m.mig = [0, 0.01, 0.05]
m.pop_size = [50, 100, 200]
m.num_pops = 5
m.num_msats = 50
m.sample_size = 50
BasicViewTwo(m, FST())
m.run()


Compare stats in the meta population vs individual demes (no and some migration)


In [5]:
m = Island(gens=1000)
m.mig = [0, 0.01]
m.pop_size = 50
m.num_pops = 5
m.num_msats = 5
MetaVsDemeView(m, ExpHe(), ExpHe(do_structured=True))
MetaVsDemeView(m, NumAlleles(), NumAlleles(do_structured=True))
m.run()



In [6]:
m = Island(gens=100)
m.mig = 0
m.pop_size = [20, 50]
m.num_pops = [2, 5, 20]
m.num_msats = 50
BasicViewTwo(m, FST())
m.run()


LDNe


In [7]:
m = Island(gens=20)
m.mig = 0
m.pop_size = [20, 50]
m.num_pops = [2, 10]
m.num_msats = 50
BasicViewTwo(m, FST())
MetaVsDemeView(m, LDNe(), LDNe(do_structured=True), max_y=m.pop_size[-1] * 3)
m.run()



In [ ]:
m = Island(gens=50)
m.mig = 0.01
m.pop_size = 100
m.num_pops = [5, 10]
m.num_msats = 20
m.sample_size = 50
BasicView(m, [FST(), ExpHe()])
MetaVsDemeView(m, LDNe(), LDNe(do_structured=True), max_y=m.pop_size * 3)
m.run()



In [ ]:
m = Island(gens=50)
m.mig = [0, 0.01, 0.1]
m.pop_size = 100
m.num_pops = 5
m.num_msats = 50
m.sample_size = 50
BasicView(m, [FST()])
MetaVsDemeView(m, ExpHe(), ExpHe(do_structured=True))
MetaVsDemeView(m, LDNe(), LDNe(do_structured=True), max_y=m.pop_size * 3)
m.run()

In [ ]: